File: /home/nyiet8349bzl/www/icbm2026.sbsc.in/wp-content/plugins/templately/assets/js/templately.js
(()=>{var e,t,n,r,o={2505(e,t,n){e.exports=n(8015)},5592(e,t,n){"use strict";var r=n(9516),o=n(7522),i=n(3948),a=n(9106),l=n(9615),s=n(2012),c=n(4202),u=n(7763),d=n(4896),p=n(1928);e.exports=function(e){return new Promise(function(t,n){var f,h=e.data,m=e.headers,g=e.responseType;function v(){e.cancelToken&&e.cancelToken.unsubscribe(f),e.signal&&e.signal.removeEventListener("abort",f)}r.isFormData(h)&&delete m["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(b+":"+w)}var E=l(e.baseURL,e.url);function k(){if(y){var r="getAllResponseHeaders"in y?s(y.getAllResponseHeaders()):null,i={data:g&&"text"!==g&&"json"!==g?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};o(function(e){t(e),v()},function(e){n(e),v()},i),y=null}}if(y.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(k)},y.onabort=function(){y&&(n(u("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(u("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var O=(e.withCredentials||c(E))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;O&&(m[e.xsrfHeaderName]=O)}"setRequestHeader"in y&&r.forEach(m,function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete m[t]:y.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),g&&"json"!==g&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(f=function(e){y&&(n(!e||e&&e.type?new p("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(f),e.signal&&(e.signal.aborted?f():e.signal.addEventListener("abort",f))),h||(h=null),y.send(h)})}},8015(e,t,n){"use strict";var r=n(9516),o=n(9012),i=n(5155),a=n(5343),l=function e(t){var n=new i(t),l=o(i.prototype.request,n);return r.extend(l,i.prototype,n),r.extend(l,n),l.create=function(n){return e(a(t,n))},l}(n(7412));l.Axios=i,l.Cancel=n(1928),l.CancelToken=n(3191),l.isCancel=n(3864),l.VERSION=n(9641).version,l.all=function(e){return Promise.all(e)},l.spread=n(7980),l.isAxiosError=n(5019),e.exports=l,e.exports.default=l},1928(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},3191(e,t,n){"use strict";var r=n(1928);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;this.promise.then(function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}}),this.promise.then=function(e){var t,r=new Promise(function(e){n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e){n.reason||(n.reason=new r(e),t(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o(function(t){e=t}),cancel:e}},e.exports=o},3864(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},5155(e,t,n){"use strict";var r=n(9516),o=n(9106),i=n(3471),a=n(4490),l=n(5343),s=n(4841),c=s.validators;function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=l(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&s.assertOptions(n,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))});var i,u=[];if(this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)}),!o){var d=[a,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(u),i=Promise.resolve(t);d.length;)i=i.then(d.shift(),d.shift());return i}for(var p=t;r.length;){var f=r.shift(),h=r.shift();try{p=f(p)}catch(e){h(e);break}}try{i=a(p)}catch(e){return Promise.reject(e)}for(;u.length;)i=i.then(u.shift(),u.shift());return i},u.prototype.getUri=function(e){return e=l(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],function(e){u.prototype[e]=function(t,n){return this.request(l(n||{},{method:e,url:t,data:(n||{}).data}))}}),r.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,n,r){return this.request(l(r||{},{method:e,url:t,data:n}))}}),e.exports=u},3471(e,t,n){"use strict";var r=n(9516);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=o},9615(e,t,n){"use strict";var r=n(9137),o=n(4680);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},7763(e,t,n){"use strict";var r=n(5449);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},4490(e,t,n){"use strict";var r=n(9516),o=n(2881),i=n(3864),a=n(7412),l=n(1928);function s(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new l("canceled")}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||a.adapter)(e).then(function(t){return s(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(s(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},5449(e){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},5343(e,t,n){"use strict";var r=n(9516);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function a(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function l(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function s(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var c={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s};return r.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=c[e]||i,o=t(e);r.isUndefined(o)&&t!==s||(n[e]=o)}),n}},7522(e,t,n){"use strict";var r=n(7763);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},2881(e,t,n){"use strict";var r=n(9516),o=n(7412);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,function(n){e=n.call(i,e,t)}),e}},7412(e,t,n){"use strict";var r=n(9516),o=n(7018),i=n(5449),a=n(4896),l={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5592)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){u.headers[e]={}}),r.forEach(["post","put","patch"],function(e){u.headers[e]=r.merge(l)}),e.exports=u},4896(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},9641(e){e.exports={version:"0.26.1"}},9012(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},9106(e,t,n){"use strict";var r=n(9516);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))}))}),i=a.join("&")}if(i){var l=e.indexOf("#");-1!==l&&(e=e.slice(0,l)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},4680(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},3948(e,t,n){"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(o)&&l.push("path="+o),r.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},9137(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5019(e,t,n){"use strict";var r=n(9516);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},4202(e,t,n){"use strict";var r=n(9516);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},7018(e,t,n){"use strict";var r=n(9516);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},2012(e,t,n){"use strict";var r=n(9516),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}}),a):a}},7980(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4841(e,t,n){"use strict";var r=n(9641).version,o={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=t[i];if(a){var l=e[i],s=void 0===l||a(l,i,e);if(!0!==s)throw new TypeError("option "+i+" must be "+s)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},9516(e,t,n){"use strict";var r=n(9012),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function a(e){return void 0===e}function l(e){return"[object ArrayBuffer]"===o.call(e)}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!a(e)&&null!==e.constructor&&!a(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===o.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:c,isUndefined:a,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return s(e)&&u(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===o.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:d,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t}),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},4765(){},3144(e,t,n){"use strict";var r=n(6743),o=n(1002),i=n(76),a=n(7119);e.exports=a||r.call(i,o)},1002(e){"use strict";e.exports=Function.prototype.apply},76(e){"use strict";e.exports=Function.prototype.call},3126(e,t,n){"use strict";var r=n(6743),o=n(9675),i=n(76),a=n(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(r,i,e)}},7119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},6556(e,t,n){"use strict";var r=n(453),o=n(3126),i=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o([n]):n}},8907(e,t){"use strict";t.Y=function(e,t){return function(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),i=t[1],a=t[2],l=t[3]||"",s={};return s.inverse=!!i&&"not"===i.toLowerCase(),s.type=a?a.toLowerCase():"all",l=l.match(/\([^\)]+\)/g)||[],s.expressions=l.map(function(e){var t=e.match(r),n=t[1].toLowerCase().match(o);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}(e).some(function(e){var n=e.inverse,r="all"===e.type||t.type===e.type;if(r&&n||!r&&!n)return!1;var o=e.expressions.every(function(e){var n=e.feature,r=e.modifier,o=e.value,i=t[n];if(!i)return!1;switch(n){case"orientation":case"scan":return i.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=c(o),i=c(i);break;case"resolution":o=s(o),i=s(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=l(o),i=l(i);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,i=parseInt(i,10)||0}switch(r){case"min":return i>=o;case"max":return i<=o;default:return i===o}});return o&&!n||!o&&n})};var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,r=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,i=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function l(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function s(e){var t=parseFloat(e);switch(String(e).match(a)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function c(e){var t=parseFloat(e);switch(String(e).match(i)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},5413(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},1141(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(5413),a=n(6957);o(n(6957),t);var l={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=l),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:l,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,r=new a.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===i.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new a.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=s,t.default=s},6957(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var a=n(5413),l=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),k(this,e)},e}();t.Node=l;var s=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return o(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(l);t.DataNode=s;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Text,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(s);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Comment,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(s);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=a.ElementType.Directive,r}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(s);t.ProcessingInstruction=d;var p=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return o(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(l);t.NodeWithChildren=p;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.CDATA,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=f;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=a.ElementType.Root,t}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=h;var m=function(e){function t(t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o="script"===t?a.ElementType.Script:"style"===t?a.ElementType.Style:a.ElementType.Tag);var i=e.call(this,r)||this;return i.name=t,i.attribs=n,i.type=o,i}return o(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}})},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,a.isTag)(e)}function v(e){return e.type===a.ElementType.CDATA}function y(e){return e.type===a.ElementType.Text}function b(e){return e.type===a.ElementType.Comment}function w(e){return e.type===a.ElementType.Directive}function E(e){return e.type===a.ElementType.Root}function k(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(g(e)){var r=t?O(e.children):[],o=new m(e.name,i({},e.attribs),r);r.forEach(function(e){return e.parent=o}),null!=e.namespace&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=i({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=i({},e["x-attribsPrefix"])),n=o}else if(v(e)){r=t?O(e.children):[];var a=new f(r);r.forEach(function(e){return e.parent=a}),n=a}else if(E(e)){r=t?O(e.children):[];var l=new h(r);r.forEach(function(e){return e.parent=l}),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),n=l}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var s=new d(e.name,e.data);null!=e["x-name"]&&(s["x-name"]=e["x-name"],s["x-publicId"]=e["x-publicId"],s["x-systemId"]=e["x-systemId"]),n=s}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function O(e){for(var t=e.map(function(e){return k(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=m,t.isTag=g,t.isCDATA=v,t.isText=y,t.isComment=b,t.isDirective=w,t.isDocument=E,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=k},7176(e,t,n){"use strict";var r,o=n(3126),i=n(8176);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),l=Object,s=l.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof s&&function(e){return s(null==e?e:l(e))}},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237(e){"use strict";e.exports=EvalError},9383(e){"use strict";e.exports=Error},9290(e){"use strict";e.exports=RangeError},9538(e){"use strict";e.exports=ReferenceError},8068(e){"use strict";e.exports=SyntaxError},9675(e){"use strict";e.exports=TypeError},5345(e){"use strict";e.exports=URIError},9612(e){"use strict";e.exports=Object},411(e,t,n){var r;!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},9353(e){"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),l=n(0,o.length-a.length),s=[],c=0;c<l;c++)s[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(s)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},6743(e,t,n){"use strict";var r=n(9353);e.exports=Function.prototype.bind||r},453(e,t,n){"use strict";var r,o=n(9612),i=n(9383),a=n(1237),l=n(9290),s=n(9538),c=n(8068),u=n(9675),d=n(5345),p=n(1514),f=n(8968),h=n(6188),m=n(8002),g=n(5880),v=n(414),y=n(3093),b=Function,w=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},E=n(8176),k=n(655),O=function(){throw new u},S=E?function(){try{return O}catch(e){try{return E(arguments,"callee").get}catch(e){return O}}}():O,x=n(4039)(),_=n(3628),C=n(1064),D=n(8648),P=n(1002),A=n(76),T={},F="undefined"!=typeof Uint8Array&&_?_(Uint8Array):r,M={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":x&&_?_([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":x&&_?_(_([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&x&&_?_((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":l,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&x&&_?_((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":x&&_?_(""[Symbol.iterator]()):r,"%Symbol%":x?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":S,"%TypedArray%":F,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":P,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":y,"%Reflect.getPrototypeOf%":D};if(_)try{null.error}catch(e){var I=_(_(e));M["%Error.prototype%"]=I}var N=function e(t){var n;if("%AsyncFunction%"===t)n=w("async function () {}");else if("%GeneratorFunction%"===t)n=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=w("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&_&&(n=_(o.prototype))}return M[t]=n,n},j={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=n(6743),R=n(9957),B=L.call(A,Array.prototype.concat),z=L.call(P,Array.prototype.splice),W=L.call(A,String.prototype.replace),U=L.call(A,String.prototype.slice),V=L.call(A,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(e,t){var n,r=e;if(R(j,r)&&(r="%"+(n=j[r])[0]+"%"),R(M,r)){var o=M[r];if(o===T&&(o=N(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=U(e,0,1),n=U(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return W(e,H,function(e,t,n,o){r[r.length]=n?W(o,G,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=q("%"+r+"%",t),i=o.name,a=o.value,l=!1,s=o.alias;s&&(r=s[0],z(n,B([0,1],s)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],h=U(f,0,1),m=U(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===m||"'"===m||"`"===m)&&h!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&p||(l=!0),R(M,i="%"+(r+="."+f)+"%"))a=M[i];else if(null!=a){if(!(f in a)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(E&&d+1>=n.length){var g=E(a,f);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[f]}else p=R(a,f),a=a[f];p&&!l&&(M[i]=a)}}return a}},1064(e,t,n){"use strict";var r=n(9612);e.exports=r.getPrototypeOf||null},8648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628(e,t,n){"use strict";var r=n(8648),o=n(1064),i=n(7176);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},8176(e,t,n){"use strict";var r=n(6549);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},4039(e,t,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(1333);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},1333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9957(e,t,n){"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(6743);e.exports=i.call(r,o)},4146(e,t,n){"use strict";var r=n(3404),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?a:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var l=s(t),m=s(n),g=0;g<a.length;++g){var v=a[g];if(!(i[v]||r&&r[v]||m&&m[v]||l&&l[v])){var y=p(n,v);try{c(t,v,y)}catch(e){}}}}return t}},3072(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case l:case a:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case s:return e;default:return t}}case o:return t}}}function k(e){return E(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return k(e)||E(e)===u},t.isConcurrentMode=k,t.isContextConsumer=function(e){return E(e)===c},t.isContextProvider=function(e){return E(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===p},t.isFragment=function(e){return E(e)===i},t.isLazy=function(e){return E(e)===g},t.isMemo=function(e){return E(e)===m},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===l},t.isStrictMode=function(e){return E(e)===a},t.isSuspense=function(e){return E(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===l||e===a||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=E},3404(e,t,n){"use strict";e.exports=n(3072)},5270(e,t){t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]},5496(e){var t="html",n="head",r="body",o=/<([a-zA-Z]+[0-9]?)/,i=/<head[^]*>/i,a=/<body[^]*>/i,l=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},s=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},c="object"==typeof window&&window.DOMParser;if("function"==typeof c){var u=new c;l=s=function(e,t){return t&&(e="<"+t+">"+e+"</"+t+">"),u.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(e,t){return t?(d.documentElement.querySelector(t).innerHTML=e,d):(d.documentElement.innerHTML=e,d)}}var p,f="object"==typeof document?document.createElement("template"):{};f.content&&(p=function(e){return f.innerHTML=e,f.content.childNodes}),e.exports=function(e){var c,u,d,f,h=e.match(o);switch(h&&h[1]&&(c=h[1].toLowerCase()),c){case t:return u=s(e),i.test(e)||(d=u.querySelector(n))&&d.parentNode.removeChild(d),a.test(e)||(d=u.querySelector(r))&&d.parentNode.removeChild(d),u.querySelectorAll(t);case n:case r:return f=(u=l(e)).querySelectorAll(c),a.test(e)&&i.test(e)?f[0].parentNode.childNodes:f;default:return p?p(e):(d=l(e,r).querySelector(r)).childNodes}}},2471(e,t,n){var r=n(5496),o=n(7731).formatDOM,i=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(""===e)return[];var t,n=e.match(i);return n&&n[1]&&(t=n[1]),o(r(e),null,t)}},7731(e,t,n){for(var r,o=n(1141),i=n(5270).CASE_SENSITIVE_TAG_NAMES,a=o.Comment,l=o.Element,s=o.ProcessingInstruction,c=o.Text,u={},d=0,p=i.length;d<p;d++)r=i[d],u[r.toLowerCase()]=r;function f(e){for(var t,n={},r=0,o=e.length;r<o;r++)n[(t=e[r]).name]=t.value;return n}function h(e){return function(e){return u[e]}(e=e.toLowerCase())||e}t.formatAttributes=f,t.formatDOM=function e(t,n,r){n=n||null;for(var o,i=[],u=0,d=t.length;u<d;u++){var p,m=t[u];switch(m.nodeType){case 1:o=h(m.nodeName),(p=new l(o,f(m.attributes))).children=e("template"===o?m.content.childNodes:m.childNodes,p);break;case 3:p=new c(m.nodeValue);break;case 8:p=new a(m.nodeValue);break;default:continue}var g=i[u-1]||null;g&&(g.next=p),p.parent=n,p.prev=g,p.next=null,i.push(p)}return r&&((p=new s(r.substring(0,r.indexOf(" ")).toLowerCase(),r)).next=i[0]||null,p.parent=n,i.unshift(p),i[1]&&(i[1].prev=i[0])),i}},6614(e,t,n){var r=n(1141),o=n(2471),i=n(840),a=n(308);o="function"==typeof o.default?o.default:o;var l={lowerCaseAttributeNames:!1};function s(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");return""===e?[]:a(o(e,(t=t||{}).htmlparser2||l),t)}s.domToReact=a,s.htmlToDOM=o,s.attributesToProps=i,s.Comment=r.Comment,s.Element=r.Element,s.ProcessingInstruction=r.ProcessingInstruction,s.Text=r.Text,e.exports=s,s.default=s},840(e,t,n){var r=n(4210),o=n(4958),i=["checked","value"],a=["input","select","textarea"],l={reset:!0,submit:!0};function s(e){return r.possibleStandardNames[e]}e.exports=function(e,t){var n,c,u,d,p,f={},h=(e=e||{}).type&&l[e.type];for(n in e)if(u=e[n],r.isCustomAttribute(n))f[n]=u;else if(d=s(c=n.toLowerCase()))switch(p=r.getPropertyInfo(d),-1===i.indexOf(d)||-1===a.indexOf(t)||h||(d=s("default"+c)),f[d]=u,p&&p.type){case r.BOOLEAN:f[d]=!0;break;case r.OVERLOADED_BOOLEAN:""===u&&(f[d]=!0)}else o.PRESERVE_CUSTOM_ATTRIBUTES&&(f[n]=u);return o.setStyleProp(e.style,f),f}},308(e,t,n){var r=n(1609),o=n(840),i=n(4958),a=i.setStyleProp,l=i.canTextBeChildOfNode;function s(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&i.isCustomComponent(e.name,e.attribs)}e.exports=function e(t,n){for(var i,c,u,d,p,f=(n=n||{}).library||r,h=f.cloneElement,m=f.createElement,g=f.isValidElement,v=[],y="function"==typeof n.replace,b=n.trim,w=0,E=t.length;w<E;w++)if(i=t[w],y&&g(u=n.replace(i)))E>1&&(u=h(u,{key:u.key||w})),v.push(u);else if("text"!==i.type){switch(d=i.attribs,s(i)?a(d.style,d):d&&(d=o(d,i.name)),p=null,i.type){case"script":case"style":i.children[0]&&(d.dangerouslySetInnerHTML={__html:i.children[0].data});break;case"tag":"textarea"===i.name&&i.children[0]?d.defaultValue=i.children[0].data:i.children&&i.children.length&&(p=e(i.children,n));break;default:continue}E>1&&(d.key=w),v.push(m(i.name,d,p))}else{if((c=!i.data.trim().length)&&i.parent&&!l(i.parent))continue;if(b&&c)continue;v.push(i.data)}return 1===v.length?v[0]:v}},4958(e,t,n){var r=n(1609),o=n(5229).default,i={reactCompat:!0},a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);e.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,invertObject:function(e,t){if(!e||"object"!=typeof e)throw new TypeError("First argument must be an object");var n,r,o="function"==typeof t,i={},a={};for(n in e)r=e[n],o&&(i=t(n,r))&&2===i.length?a[i[0]]=i[1]:"string"==typeof r&&(a[r]=n);return a},isCustomComponent:function(e,t){if(-1===e.indexOf("-"))return t&&"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}},setStyleProp:function(e,t){if(null!=e)try{t.style=o(e,i)}catch(e){t.style={}}},canTextBeChildOfNode:function(e){return!l.has(e.name)},elementsWithNoTextChildren:l}},9788(e){var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,p=1;function f(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=s.source}m.prototype.content=e;var g=[];function v(t){var n=new Error(s.source+":"+d+":"+p+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=p,n.source=e,!s.silent)throw n;g.push(n)}function y(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function b(){y(r)}function w(e){var t;for(e=e||[];t=E();)!1!==t&&e.push(t);return e}function E(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return v("End of comment missing");var r=e.slice(2,n-2);return p+=2,f(r),e=e.slice(n),p+=2,t({type:"comment",comment:r})}}function k(){var e=h(),n=y(o);if(n){if(E(),!y(i))return v("property missing ':'");var r=y(a),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return y(l),s}}return b(),function(){var e,t=[];for(w(t);e=k();)!1!==e&&(t.push(e),w(t));return t}()}},7918(e,t,n){"use strict";var r=n(8907).Y,o="undefined"!=typeof window?window.matchMedia:null;function i(e,t,n){var i,a=this;function l(e){a.matches=e.matches,a.media=e.media}o&&!n&&(i=o.call(window,e)),i?(this.matches=i.matches,this.media=i.media,i.addListener(l)):(this.matches=r(e,t),this.media=e),this.addListener=function(e){i&&i.addListener(e)},this.removeListener=function(e){i&&i.removeListener(e)},this.dispose=function(){i&&i.removeListener(l)}}e.exports=function(e,t,n){return new i(e,t,n)}},1514(e){"use strict";e.exports=Math.abs},8968(e){"use strict";e.exports=Math.floor},4459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},8002(e){"use strict";e.exports=Math.min},5880(e){"use strict";e.exports=Math.pow},414(e){"use strict";e.exports=Math.round},3093(e,t,n){"use strict";var r=n(4459);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},8859(e,t,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,l="function"==typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&l?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=l&&s&&"function"==typeof s.get?s.get:null,u=l&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,E=String.prototype.toLowerCase,k=RegExp.prototype.test,O=Array.prototype.concat,S=Array.prototype.join,x=Array.prototype.slice,_=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,D=Object.getOwnPropertySymbols,P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,A="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-_(-e):_(e);if(r!==e){var o=String(r),i=y.call(t,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var N=n(2634),j=N.custom,L=G(j)?j:null,R={__proto__:null,double:'"',single:"'"},B={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(e,t,n){var r=n.quoteStyle||t,o=R[r];return o+e+o}function W(e){return b.call(String(e),/"/g,""")}function U(e){return!T||!("object"==typeof e&&(T in e||void 0!==e[T]))}function V(e){return"[object Array]"===$(e)&&U(e)}function H(e){return"[object RegExp]"===$(e)&&U(e)}function G(e){if(A)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,r,o){var l=n||{};if(Q(l,"quoteStyle")&&!Q(R,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!Q(l,"customInspect")||l.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return X(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return m?I(t,w):w}if("bigint"==typeof t){var k=String(t)+"n";return m?I(t,k):k}var _=void 0===l.depth?5:l.depth;if(void 0===r&&(r=0),r>=_&&_>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var D,j=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(l,r);if(void 0===o)o=[];else if(Y(o,t)>=0)return"[Circular]";function B(t,n,i){if(n&&(o=x.call(o)).push(n),i){var a={depth:l.depth};return Q(l,"quoteStyle")&&(a.quoteStyle=l.quoteStyle),e(t,a,r+1,o)}return e(t,l,r+1,o)}if("function"==typeof t&&!H(t)){var q=function(e){if(e.name)return e.name;var t=v.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),K=ne(t,B);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(K.length>0?" { "+S.call(K,", ")+" }":"")}if(G(t)){var re=A?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(t);return"object"!=typeof t||A?re:Z(re)}if((D=t)&&"object"==typeof D&&("undefined"!=typeof HTMLElement&&D instanceof HTMLElement||"string"==typeof D.nodeName&&"function"==typeof D.getAttribute)){for(var oe="<"+E.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)oe+=" "+ie[ae].name+"="+z(W(ie[ae].value),"double",l);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+"</"+E.call(String(t.nodeName))+">"}if(V(t)){if(0===t.length)return"[]";var le=ne(t,B);return j&&!function(e){for(var t=0;t<e.length;t++)if(Y(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,j)+"]":"[ "+S.call(le,", ")+" ]"}if(function(e){return"[object Error]"===$(e)&&U(e)}(t)){var se=ne(t,B);return"cause"in Error.prototype||!("cause"in t)||F.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(se,", ")+" }":"{ ["+String(t)+"] "+S.call(O.call("[cause]: "+B(t.cause),se),", ")+" }"}if("object"==typeof t&&s){if(L&&"function"==typeof t[L]&&N)return N(t,{depth:_-r});if("symbol"!==s&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ce=[];return a&&a.call(t,function(e,n){ce.push(B(n,t,!0)+" => "+B(e,t))}),ee("Map",i.call(t),ce,j)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ue=[];return u&&u.call(t,function(e){ue.push(B(e,t))}),ee("Set",c.call(t),ue,j)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return J("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return J("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return J("WeakRef");if(function(e){return"[object Number]"===$(e)&&U(e)}(t))return Z(B(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return Z(B(C.call(t)));if(function(e){return"[object Boolean]"===$(e)&&U(e)}(t))return Z(h.call(t));if(function(e){return"[object String]"===$(e)&&U(e)}(t))return Z(B(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof globalThis&&t===globalThis)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===$(e)&&U(e)}(t)&&!H(t)){var de=ne(t,B),pe=M?M(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",he=!pe&&T&&Object(t)===t&&T in t?y.call($(t),8,-1):fe?"Object":"",me=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||fe?"["+S.call(O.call([],he||[],fe||[]),": ")+"] ":"");return 0===de.length?me+"{}":j?me+"{"+te(de,j)+"}":me+"{ "+S.call(de,", ")+" }"}return String(t)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function Q(e,t){return q.call(e,t)}function $(e){return m.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function X(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return X(y.call(e,0,t.maxStringLength),t)+r}var o=B[t.quoteStyle||"single"];return o.lastIndex=0,z(b.call(b.call(e,o,"\\$1"),/[\x00-\x1f]/g,K),"single",t)}function K(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function ee(e,t,n,r){return e+" ("+t+") {"+(r?te(n,r):S.call(n,", "))+"}"}function te(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function ne(e,t){var n=V(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=Q(e,o)?t(e[o],e):""}var i,a="function"==typeof D?D(e):[];if(A){i={};for(var l=0;l<a.length;l++)i["$"+a[l]]=a[l]}for(var s in e)Q(e,s)&&(n&&String(Number(s))===s&&s<e.length||A&&i["$"+s]instanceof Symbol||(k.call(/[^\w$]/,s)?r.push(t(s,e)+": "+t(e[s],e)):r.push(s+": "+t(e[s],e))));if("function"==typeof D)for(var c=0;c<a.length;c++)F.call(e,a[c])&&r.push("["+t(a[c])+"]: "+t(e[a[c]],e));return r}},2694(e,t,n){"use strict";var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7146(e){"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},5373(e,t,n){"use strict";var r=n(8636),o=n(2642),i=n(7146);e.exports={formats:i,parse:o,stringify:r}},2642(e,t,n){"use strict";var r=n(7720),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},l=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,n,i){if(e){var a=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&o.call(Object.prototype,n)&&!t.allowPrototypes)return;return[n]}var r=/(\[[^[\]]*])/g,i=/(\[[^[\]]*])/.exec(n),a=i?n.slice(0,i.index):n,l=[];if(a){if(!t.plainObjects&&o.call(Object.prototype,a)&&!t.allowPrototypes)return;l[l.length]=a}for(var s=0;null!==(i=r.exec(n))&&s<t.depth;){s+=1;var c=i[1].slice(1,-1);if(!t.plainObjects&&o.call(Object.prototype,c)&&!t.allowPrototypes)return;l[l.length]=i[1]}if(i){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");l[l.length]="["+n.slice(i.index)+"]"}return l}(e,n);if(a)return function(e,t,n,o){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var a=e.slice(0,-1).join("");i=Array.isArray(t)&&t[a]?t[a].length:0}for(var l=o?t:s(t,n,i),c=e.length-1;c>=0;--c){var u,d=e[c];if("[]"===d&&n.parseArrays)u=r.isOverflow(l)?l:n.allowEmptyArrays&&(""===l||n.strictNullHandling&&null===l)?[]:r.combine([],l,n.arrayLimit,n.plainObjects);else{u=n.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,f=n.decodeDotInKeys?p.replace(/%2E/g,"."):p,h=parseInt(f,10),m=!isNaN(h)&&d!==f&&String(h)===f&&h>=0&&n.parseArrays;if(n.parseArrays||""!==f)if(m&&h<n.arrayLimit)(u=[])[h]=l;else{if(m&&n.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(1===n.arrayLimit?"":"s")+" allowed in an array.");m?(u[h]=l,r.markOverflow(u,h)):"__proto__"!==f&&(u[f]=l)}else u={0:l}}l=u}return l}(a,t,n,i)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?a.charset:e.charset,n=void 0===e.duplicates?a.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||a.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:a.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:a.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return n.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var n={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,d=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&d.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var p,f=-1,h=t.charset;if(t.charsetSentinel)for(p=0;p<d.length;++p)0===d[p].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[p]?h="utf-8":"utf8=%26%2310003%3B"===d[p]&&(h="iso-8859-1"),f=p,p=d.length);for(p=0;p<d.length;++p)if(p!==f){var m,g,v=d[p],y=v.indexOf("]="),b=-1===y?v.indexOf("="):y+1;if(-1===b?(m=t.decoder(v,a.decoder,h,"key"),g=t.strictNullHandling?null:""):null!==(m=t.decoder(v.slice(0,b),a.decoder,h,"key"))&&(g=r.maybeMap(s(v.slice(b+1),t,i(n[m])?n[m].length:0),function(e){return t.decoder(e,a.decoder,h,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===h&&(g=l(String(g))),v.indexOf("[]=")>-1&&(g=i(g)?[g]:g),t.comma&&i(g)&&g.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");g=r.combine([],g,t.arrayLimit,t.plainObjects)}if(null!==m){var w=o.call(n,m);w&&("combine"===t.duplicates||v.indexOf("[]=")>-1)?n[m]=r.combine(n[m],g,t.arrayLimit,t.plainObjects):w&&"last"!==t.duplicates||(n[m]=g)}}return n}(e,n):e,d=n.plainObjects?{__proto__:null}:{},p=Object.keys(u),f=0;f<p.length;++f){var h=p[f],m=c(h,u[h],n,"string"==typeof e);d=r.merge(d,m,n)}return!0===n.allowSparse?d:r.compact(d)}},8636(e,t,n){"use strict";var r=n(920),o=n(7720),i=n(7146),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,p=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},h={},m=function e(t,n,i,a,l,c,d,p,m,g,v,y,b,w,E,k,O,S){for(var x,_=t,C=S,D=0,P=!1;void 0!==(C=C.get(h))&&!P;){var A=C.get(t);if(D+=1,void 0!==A){if(A===D)throw new RangeError("Cyclic object value");P=!0}void 0===C.get(h)&&(D=0)}if("function"==typeof g?_=g(n,_):_ instanceof Date?_=b(_):"comma"===i&&s(_)&&(_=o.maybeMap(_,function(e){return e instanceof Date?b(e):e})),null===_){if(c)return m&&!k?m(n,f.encoder,O,"key",w):n;_=""}if("string"==typeof(x=_)||"number"==typeof x||"boolean"==typeof x||"symbol"==typeof x||"bigint"==typeof x||o.isBuffer(_))return m?[E(k?n:m(n,f.encoder,O,"key",w))+"="+E(m(_,f.encoder,O,"value",w))]:[E(n)+"="+E(String(_))];var T,F=[];if(void 0===_)return F;if("comma"===i&&s(_))k&&m&&(_=o.maybeMap(_,m)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if(s(g))T=g;else{var M=Object.keys(_);T=v?M.sort(v):M}var I=p?String(n).replace(/\./g,"%2E"):String(n),N=a&&s(_)&&1===_.length?I+"[]":I;if(l&&s(_)&&0===_.length)return N+"[]";for(var j=0;j<T.length;++j){var L=T[j],R="object"==typeof L&&L&&void 0!==L.value?L.value:_[L];if(!d||null!==R){var B=y&&p?String(L).replace(/\./g,"%2E"):String(L),z=s(_)?"function"==typeof i?i(N,B):N:N+(y?"."+B:"["+B+"]");S.set(t,D);var W=r();W.set(h,S),u(F,e(R,z,i,a,l,c,d,p,"comma"===i&&k&&s(_)?null:m,g,v,y,b,w,E,k,O,W))}}return F};e.exports=function(e,t){var n,o=e,c=function(e){if(!e)return f;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r,o=i.formatters[n],c=f.filter;if(("function"==typeof e.filter||s(e.filter))&&(c=e.filter),r=e.arrayFormat in l?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":f.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||f.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:f.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):s(c.filter)&&(n=c.filter);var d=[];if("object"!=typeof o||null===o)return"";var p=l[c.arrayFormat],h="comma"===p&&c.commaRoundTrip;n||(n=Object.keys(o)),c.sort&&n.sort(c.sort);for(var g=r(),v=0;v<n.length;++v){var y=n[v],b=o[y];c.skipNulls&&null===b||u(d,m(b,y,p,h,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=d.join(c.delimiter),E=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),w.length>0?E+w:""}},7720(e,t,n){"use strict";var r=n(7146),o=n(920),i=Object.prototype.hasOwnProperty,a=Array.isArray,l=o(),s=function(e,t){return l.set(e,t),e},c=function(e){return l.has(e)},u=function(e){return l.get(e)},d=function(e,t){l.set(e,t)},p=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),f=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},h=1024;e.exports={arrayToObject:f,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t,n,r){if(c(e)){var o=u(e)+1;return e[o]=t,d(e,o),e}var i=[].concat(e,t);return i.length>n?s(f(i,{plainObjects:r}),i.length-1):i},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],l=Object.keys(i),s=0;s<l.length;++s){var c=l[s],u=i[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t[t.length]={obj:i,prop:c},n[n.length]=u)}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&(r[r.length]=n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===n)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var l="",s=0;s<a.length;s+=h){for(var c=a.length>=h?a.slice(s,s+h):a,u=[],d=0;d<c.length;++d){var f=c.charCodeAt(d);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===r.RFC1738&&(40===f||41===f)?u[u.length]=c.charAt(d):f<128?u[u.length]=p[f]:f<2048?u[u.length]=p[192|f>>6]+p[128|63&f]:f<55296||f>=57344?u[u.length]=p[224|f>>12]+p[128|f>>6&63]+p[128|63&f]:(d+=1,f=65536+((1023&f)<<10|1023&c.charCodeAt(d)),u[u.length]=p[240|f>>18]+p[128|f>>12&63]+p[128|f>>6&63]+p[128|63&f])}l+=u.join("")}return l},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isOverflow:c,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:s,maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r<e.length;r+=1)n[n.length]=t(e[r]);return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n&&"function"!=typeof n){if(a(t)){var o=t.length;if(r&&"number"==typeof r.arrayLimit&&o>r.arrayLimit)return s(f(t.concat(n),r),o);t[o]=n}else{if(!t||"object"!=typeof t)return[t,n];if(c(t)){var l=u(t)+1;t[l]=n,d(t,l)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0)}}return t}if(!t||"object"!=typeof t){if(c(n)){for(var p=Object.keys(n),h=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},m=0;m<p.length;m++)h[parseInt(p[m],10)+1]=n[p[m]];return s(h,u(n)+1)}var g=[t].concat(n);return r&&"number"==typeof r.arrayLimit&&g.length>r.arrayLimit?s(f(g,r),g.length-1):g}var v=t;return a(t)&&!a(n)&&(v=f(t,r)),a(t)&&a(n)?(n.forEach(function(n,o){if(i.call(t,o)){var a=t[o];a&&"object"==typeof a&&n&&"object"==typeof n?t[o]=e(a,n,r):t[t.length]=n}else t[o]=n}),t):Object.keys(n).reduce(function(t,o){var a=n[o];if(i.call(t,o)?t[o]=e(t[o],a,r):t[o]=a,c(n)&&!c(t)&&s(t,u(n)),c(t)){var l=parseInt(o,10);String(l)===o&&l>=0&&l>u(t)&&d(t,l)}return t},v)}}},1921(e,t,n){(()=>{var t={296:(e,t,n)=>{var r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")(),d=Object.prototype.toString,p=Math.max,f=Math.min,h=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=i.test(e);return n||a.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function b(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=i}function w(){var e=h();if(b(e))return E(e);l=setTimeout(w,function(e){var n=t-(e-s);return d?f(n,i-(e-c)):n}(e))}function E(e){return l=void 0,v&&r?y(e):(r=o=void 0,a)}function k(){var e=h(),n=b(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(w,t),u?y(e):a}(s);if(d)return l=setTimeout(w,t),y(s)}return void 0===l&&(l=setTimeout(w,t)),a}return t=g(t)||0,m(n)&&(u=!!n.leading,i=(d="maxWait"in n)?p(g(n.maxWait)||0,t):i,v="trailing"in n?!!n.trailing:v),k.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},k.flush=function(){return void 0===l?a:E(h())},k}},96:(e,t,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,h=Math.min,m=function(){return d.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return g(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,a,l,s,c,u=0,d=!1,p=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,u=t,l=e.apply(r,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-u>=a}function E(){var e=m();if(w(e))return k(e);s=setTimeout(E,function(e){var n=t-(e-c);return p?h(n,a-(e-u)):n}(e))}function k(e){return s=void 0,y&&o?b(e):(o=i=void 0,l)}function O(){var e=m(),n=w(e);if(o=arguments,i=this,c=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(E,t),d?b(e):l}(c);if(p)return s=setTimeout(E,t),b(c)}return void 0===s&&(s=setTimeout(E,t)),l}return t=v(t)||0,g(n)&&(d=!!n.leading,a=(p="maxWait"in n)?f(v(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=i=s=void 0},O.flush=function(){return void 0===s?l:k(m())},O}(e,t,{leading:o,maxWait:t,trailing:i})}},703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";o.r(i),o.d(i,{LazyLoadComponent:()=>H,LazyLoadImage:()=>te,trackWindowScroll:()=>M});const e=n(1609);var t=o.n(e),r=o(697);function a(){return"undefined"!=typeof window&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!==l(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===l(t)?t:String(t)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}var h=function(e){e.forEach(function(e){e.isIntersecting&&e.target.onVisible()})},m={},g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(g,e);var n,r,o,i,d=(o=g,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=f(o);if(i){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function g(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(t=d.call(this,e)).supportsObserver=!e.scrollPosition&&e.useIntersectionObserver&&a(),t.supportsObserver){var n=e.threshold;t.observer=function(e){return m[e]=m[e]||new IntersectionObserver(h,{rootMargin:e+"px"}),m[e]}(n)}return t}return n=g,r=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollPosition,t=this.placeholder.getBoundingClientRect(),n=this.placeholder.style,r=parseInt(n.getPropertyValue("margin-left"),10)||0,o=parseInt(n.getPropertyValue("margin-top"),10)||0;return{bottom:e.y+t.bottom+o,left:e.x+t.left+r,right:e.x+t.right+r,top:e.y+t.top+o}}},{key:"isPlaceholderInViewport",value:function(){if("undefined"==typeof window||!this.placeholder)return!1;var e=this.props,t=e.scrollPosition,n=e.threshold,r=this.getPlaceholderBoundingBox(t),o=t.y+window.innerHeight,i=t.x,a=t.x+window.innerWidth,l=t.y;return Boolean(l-n<=r.bottom&&o+n>=r.top&&i-n<=r.right&&a+n>=r.left)}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var e=this,n=this.props,r=n.className,o=n.height,i=n.placeholder,a=n.style,l=n.width;if(i&&"function"!=typeof i.type)return t().cloneElement(i,{ref:function(t){return e.placeholder=t}});var u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({display:"inline-block"},a);return void 0!==l&&(u.width=l),void 0!==o&&(u.height=o),t().createElement("span",{className:r,ref:function(t){return e.placeholder=t},style:u},i)}}],r&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),g}(t().Component);g.propTypes={onVisible:r.PropTypes.func.isRequired,className:r.PropTypes.string,height:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]),placeholder:r.PropTypes.element,threshold:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool,scrollPosition:r.PropTypes.shape({x:r.PropTypes.number.isRequired,y:r.PropTypes.number.isRequired}),width:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string])},g.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const v=g;var y=o(296),b=o.n(y),w=o(96),E=o.n(w),k=function(e){var t=getComputedStyle(e,null);return t.getPropertyValue("overflow")+t.getPropertyValue("overflow-y")+t.getPropertyValue("overflow-x")};const O=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t instanceof HTMLElement;){if(/(scroll|auto)/.test(k(t)))return t;t=t.parentNode}return window};function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}var x=["delayMethod","delayTime"];function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(this,arguments)}function C(e,t){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},C(e,t)}function D(e,t){if(t&&("object"===S(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var T=function(){return"undefined"==typeof window?0:window.scrollX||window.pageXOffset},F=function(){return"undefined"==typeof window?0:window.scrollY||window.pageYOffset};const M=function(e){var n=function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C(e,t)}(c,n);var r,o,i,l,s=(i=c,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=A(i);if(l){var n=A(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return D(this,e)});function c(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=s.call(this,e)).useIntersectionObserver=e.useIntersectionObserver&&a(),n.useIntersectionObserver)return D(n);var r=n.onChangeScroll.bind(P(n));return"debounce"===e.delayMethod?n.delayedScroll=b()(r,e.delayTime):"throttle"===e.delayMethod&&(n.delayedScroll=E()(r,e.delayTime)),n.state={scrollPosition:{x:T(),y:F()}},n.baseComponentRef=t().createRef(),n}return r=c,(o=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){"undefined"==typeof window||this.useIntersectionObserver||O(this.baseComponentRef.current)!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement=O(this.baseComponentRef.current),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:T(),y:F()}})}},{key:"render",value:function(){var n=this.props,r=(n.delayMethod,n.delayTime,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,x)),o=this.useIntersectionObserver?null:this.state.scrollPosition;return t().createElement(e,_({forwardRef:this.baseComponentRef,scrollPosition:o},r))}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==S(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==S(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===S(o)?o:String(o)),r)}var o}(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),c}(t().Component);return n.propTypes={delayMethod:r.PropTypes.oneOf(["debounce","throttle"]),delayTime:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool},n.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},n};function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(e,t)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=j(o);if(i){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===I(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a.call(this,e)}return n=l,(r=[{key:"render",value:function(){return t().createElement(v,this.props)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==I(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===I(o)?o:String(o)),r)}var o}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),l}(t().Component);const R=M(L);function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function z(e,t){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},z(e,t)}function W(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},U(e)}var V=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}(s,e);var n,r,o,i,l=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=U(o);if(i){var n=U(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return W(e)}(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=l.call(this,e);var n=e.afterLoad,r=e.beforeLoad,o=e.scrollPosition,i=e.visibleByDefault;return t.state={visible:i},i&&(r(),n()),t.onVisible=t.onVisible.bind(W(t)),t.isScrollTracked=Boolean(o&&Number.isFinite(o.x)&&o.x>=0&&Number.isFinite(o.y)&&o.y>=0),t}return n=s,(r=[{key:"componentDidUpdate",value:function(e,t){t.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var e=this.props,n=e.className,r=e.delayMethod,o=e.delayTime,i=e.height,l=e.placeholder,s=e.scrollPosition,c=e.style,u=e.threshold,d=e.useIntersectionObserver,p=e.width;return this.isScrollTracked||d&&a()?t().createElement(v,{className:n,height:i,onVisible:this.onVisible,placeholder:l,scrollPosition:s,style:c,threshold:u,useIntersectionObserver:d,width:p}):t().createElement(R,{className:n,delayMethod:r,delayTime:o,height:i,onVisible:this.onVisible,placeholder:l,style:c,threshold:u,width:p})}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=function(e){if("object"!==B(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===B(o)?o:String(o)),r)}var o}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);V.propTypes={afterLoad:r.PropTypes.func,beforeLoad:r.PropTypes.func,useIntersectionObserver:r.PropTypes.bool,visibleByDefault:r.PropTypes.bool},V.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const H=V;function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}var q=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach(function(t){Y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Y(e,t,n){return(t=K(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(this,arguments)}function K(e){var t=function(e){if("object"!==G(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===G(t)?t:String(t)}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Z(e,t)}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}var ee=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}(l,e);var n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=J(o);if(i){var n=J(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===G(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).state={loaded:!1},t}return n=l,(r=[{key:"onImageLoad",value:function(){var e=this;return this.state.loaded?null:function(t){e.props.onLoad(t),e.props.afterLoad(),e.setState({loaded:!0})}}},{key:"getImg",value:function(){var e=this.props,n=(e.afterLoad,e.beforeLoad,e.delayMethod,e.delayTime,e.effect,e.placeholder,e.placeholderSrc,e.scrollPosition,e.threshold,e.useIntersectionObserver,e.visibleByDefault,e.wrapperClassName,e.wrapperProps,function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,q));return t().createElement("img",X({},n,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var e=this.props,n=e.beforeLoad,r=e.className,o=e.delayMethod,i=e.delayTime,a=e.height,l=e.placeholder,s=e.scrollPosition,c=e.style,u=e.threshold,d=e.useIntersectionObserver,p=e.visibleByDefault,f=e.width;return t().createElement(H,{beforeLoad:n,className:r,delayMethod:o,delayTime:i,height:a,placeholder:l,scrollPosition:s,style:c,threshold:u,useIntersectionObserver:d,visibleByDefault:p,width:f},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(e){var n=this.props,r=n.effect,o=n.height,i=n.placeholderSrc,a=n.width,l=n.wrapperClassName,s=n.wrapperProps,c=this.state.loaded,u=c?" lazy-load-image-loaded":"",d=c||!i?{}:{backgroundImage:"url(".concat(i,")"),backgroundSize:"100% 100%"};return t().createElement("span",X({className:l+" lazy-load-image-background "+r+u,style:$($({},d),{},{color:"transparent",display:"inline-block",height:o,width:a})},s),e)}},{key:"render",value:function(){var e=this.props,t=e.effect,n=e.placeholderSrc,r=e.visibleByDefault,o=e.wrapperClassName,i=e.wrapperProps,a=this.getLazyLoadImage();return(t||n)&&!r||o||i?this.getWrappedLazyLoadImage(a):a}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,K(r.key),r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),l}(t().Component);ee.propTypes={onLoad:r.PropTypes.func,afterLoad:r.PropTypes.func,beforeLoad:r.PropTypes.func,delayMethod:r.PropTypes.string,delayTime:r.PropTypes.number,effect:r.PropTypes.string,placeholderSrc:r.PropTypes.string,threshold:r.PropTypes.number,useIntersectionObserver:r.PropTypes.bool,visibleByDefault:r.PropTypes.bool,wrapperClassName:r.PropTypes.string,wrapperProps:r.PropTypes.object},ee.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const te=ee})(),e.exports=i})()},1345(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var s=e.displayName||e.name,c="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,r)}}return e}n.r(t),n.d(t,{polyfill:()=>a}),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},1720(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bodyOpenClassName=t.portalClassName=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1609),a=h(i),l=h(n(5795)),s=h(n(5556)),c=h(n(9090)),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(6462)),d=n(834),p=h(d),f=n(1345);function h(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=t.portalClassName="ReactModalPortal",v=t.bodyOpenClassName="ReactModal__Body--open",y=d.canUseDOM&&void 0!==l.default.createPortal,b=function(e){return document.createElement(e)},w=function(){return y?l.default.createPortal:l.default.unstable_renderSubtreeIntoContainer};function E(e){return e()}var k=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,s=Array(i),u=0;u<i;u++)s[u]=arguments[u];return n=o=m(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(s))),o.removePortal=function(){!y&&l.default.unmountComponentAtNode(o.node);var e=E(o.props.parentSelector);e&&e.contains(o.node)?e.removeChild(o.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},o.portalRef=function(e){o.portal=e},o.renderPortal=function(e){var n=w()(o,a.default.createElement(c.default,r({defaultStyles:t.defaultStyles},e)),o.node);o.portalRef(n)},m(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){d.canUseDOM&&(y||(this.node=b("div")),this.node.className=this.props.portalClassName,E(this.props.parentSelector).appendChild(this.node),!y&&this.renderPortal(this.props))}},{key:"getSnapshotBeforeUpdate",value:function(e){return{prevParent:E(e.parentSelector),nextParent:E(this.props.parentSelector)}}},{key:"componentDidUpdate",value:function(e,t,n){if(d.canUseDOM){var r=this.props,o=r.isOpen,i=r.portalClassName;e.portalClassName!==i&&(this.node.className=i);var a=n.prevParent,l=n.nextParent;l!==a&&(a.removeChild(this.node),l.appendChild(this.node)),(e.isOpen||o)&&!y&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(d.canUseDOM&&this.node&&this.portal){var e=this.portal.state,t=Date.now(),n=e.isOpen&&this.props.closeTimeoutMS&&(e.closesAt||t+this.props.closeTimeoutMS);n?(e.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,n-t)):this.removePortal()}}},{key:"render",value:function(){return d.canUseDOM&&y?(!this.node&&y&&(this.node=b("div")),w()(a.default.createElement(c.default,r({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)):null}}],[{key:"setAppElement",value:function(e){u.setElement(e)}}]),t}(i.Component);k.propTypes={isOpen:s.default.bool.isRequired,style:s.default.shape({content:s.default.object,overlay:s.default.object}),portalClassName:s.default.string,bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,className:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),overlayClassName:s.default.oneOfType([s.default.string,s.default.shape({base:s.default.string.isRequired,afterOpen:s.default.string.isRequired,beforeClose:s.default.string.isRequired})]),appElement:s.default.oneOfType([s.default.instanceOf(p.default),s.default.instanceOf(d.SafeHTMLCollection),s.default.instanceOf(d.SafeNodeList),s.default.arrayOf(s.default.instanceOf(p.default))]),onAfterOpen:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,ariaHideApp:s.default.bool,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,parentSelector:s.default.func,aria:s.default.object,data:s.default.object,role:s.default.string,contentLabel:s.default.string,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func},k.defaultProps={isOpen:!1,portalClassName:g,bodyOpenClassName:v,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,t){return a.default.createElement("div",e,t)},contentElement:function(e,t){return a.default.createElement("div",e,t)}},k.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,f.polyfill)(k),t.default=k},9090(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1609),l=g(n(5556)),s=m(n(7791)),c=g(n(7067)),u=m(n(6462)),d=m(n(4838)),p=n(834),f=g(p),h=g(n(9628));function m(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function g(e){return e&&e.__esModule?e:{default:e}}n(7727);var v={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},y=0,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.setOverlayRef=function(e){n.overlay=e,n.props.overlayRef&&n.props.overlayRef(e)},n.setContentRef=function(e){n.content=e,n.props.contentRef&&n.props.contentRef(e)},n.afterClose=function(){var e=n.props,t=e.appElement,r=e.ariaHideApp,o=e.htmlOpenClassName,i=e.bodyOpenClassName,a=e.parentSelector,l=a&&a().ownerDocument||document;i&&d.remove(l.body,i),o&&d.remove(l.getElementsByTagName("html")[0],o),r&&y>0&&0==(y-=1)&&u.show(t),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(s.returnFocus(n.props.preventScroll),s.teardownScopedFocus()):s.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),h.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(s.setupScopedFocus(n.node),s.markForFocusLater()),n.setState({isOpen:!0},function(){n.openAnimationFrame=requestAnimationFrame(function(){n.setState({afterOpen:!0}),n.props.isOpen&&n.props.onAfterOpen&&n.props.onAfterOpen({overlayEl:n.overlay,contentEl:n.content})})}))},n.close=function(){n.props.closeTimeoutMS>0?n.closeWithTimeout():n.closeWithoutTimeout()},n.focusContent=function(){return n.content&&!n.contentHasFocus()&&n.content.focus({preventScroll:!0})},n.closeWithTimeout=function(){var e=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:e},function(){n.closeTimer=setTimeout(n.closeWithoutTimeout,n.state.closesAt-Date.now())})},n.closeWithoutTimeout=function(){n.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},n.afterClose)},n.handleKeyDown=function(e){(function(e){return"Tab"===e.code||9===e.keyCode})(e)&&(0,c.default)(n.content,e),n.props.shouldCloseOnEsc&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&(e.stopPropagation(),n.requestClose(e))},n.handleOverlayOnClick=function(e){null===n.shouldClose&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(e):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(e){n.props.shouldCloseOnOverlayClick||e.target!=n.overlay||e.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(e){return n.ownerHandlesClose()&&n.props.onRequestClose(e)},n.ownerHandlesClose=function(){return n.props.onRequestClose},n.shouldBeClosed=function(){return!n.state.isOpen&&!n.state.beforeClose},n.contentHasFocus=function(){return document.activeElement===n.content||n.content.contains(document.activeElement)},n.buildClassName=function(e,t){var r="object"===(void 0===t?"undefined":o(t))?t:{base:v[e],afterOpen:v[e]+"--after-open",beforeClose:v[e]+"--before-close"},i=r.base;return n.state.afterOpen&&(i=i+" "+r.afterOpen),n.state.beforeClose&&(i=i+" "+r.beforeClose),"string"==typeof t&&t?i+" "+t:i},n.attributesFromObject=function(e,t){return Object.keys(t).reduce(function(n,r){return n[e+"-"+r]=t[r],n},{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,t){this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!t.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,t=e.appElement,n=e.ariaHideApp,r=e.htmlOpenClassName,o=e.bodyOpenClassName,i=e.parentSelector,a=i&&i().ownerDocument||document;o&&d.add(a.body,o),r&&d.add(a.getElementsByTagName("html")[0],r),n&&(y+=1,u.hide(t)),h.default.register(this)}},{key:"render",value:function(){var e=this.props,t=e.id,n=e.className,o=e.overlayClassName,i=e.defaultStyles,a=e.children,l=n?{}:i.content,s=o?{}:i.overlay;if(this.shouldBeClosed())return null;var c={ref:this.setOverlayRef,className:this.buildClassName("overlay",o),style:r({},s,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},u=r({id:t,ref:this.setContentRef,style:r({},l,this.props.style.content),className:this.buildClassName("content",n),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",r({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),d=this.props.contentElement(u,a);return this.props.overlayElement(c,d)}}]),t}(a.Component);b.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},b.propTypes={isOpen:l.default.bool.isRequired,defaultStyles:l.default.shape({content:l.default.object,overlay:l.default.object}),style:l.default.shape({content:l.default.object,overlay:l.default.object}),className:l.default.oneOfType([l.default.string,l.default.object]),overlayClassName:l.default.oneOfType([l.default.string,l.default.object]),parentSelector:l.default.func,bodyOpenClassName:l.default.string,htmlOpenClassName:l.default.string,ariaHideApp:l.default.bool,appElement:l.default.oneOfType([l.default.instanceOf(f.default),l.default.instanceOf(p.SafeHTMLCollection),l.default.instanceOf(p.SafeNodeList),l.default.arrayOf(l.default.instanceOf(f.default))]),onAfterOpen:l.default.func,onAfterClose:l.default.func,onRequestClose:l.default.func,closeTimeoutMS:l.default.number,shouldFocusAfterRender:l.default.bool,shouldCloseOnOverlayClick:l.default.bool,shouldReturnFocusAfterClose:l.default.bool,preventScroll:l.default.bool,role:l.default.string,contentLabel:l.default.string,aria:l.default.object,data:l.default.object,children:l.default.node,shouldCloseOnEsc:l.default.bool,overlayRef:l.default.func,contentRef:l.default.func,id:l.default.string,overlayElement:l.default.func,contentElement:l.default.func,testId:l.default.string},t.default=b,e.exports=t.default},6462(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){a&&(a.removeAttribute?a.removeAttribute("aria-hidden"):null!=a.length?a.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(a).forEach(function(e){return e.removeAttribute("aria-hidden")})),a=null},t.log=function(){},t.assertNodeList=l,t.setElement=function(e){var t=e;if("string"==typeof t&&i.canUseDOM){var n=document.querySelectorAll(t);l(n,t),t=n}return a=t||a},t.validateElement=s,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=s(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.setAttribute("aria-hidden","true")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=s(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.removeAttribute("aria-hidden")}catch(e){n=!0,r=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){a=null};var r,o=(r=n(9771))&&r.__esModule?r:{default:r},i=n(834),a=null;function l(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function s(e){var t=e||a;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,o.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},7727(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){for(var e=[i,a],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}i=a=null,l=[]},t.log=function(){console.log("bodyTrap ----------"),console.log(l.length);for(var e=[i,a],t=0;t<e.length;t++){var n=e[t]||{};console.log(n.nodeName,n.className,n.id)}console.log("edn bodyTrap ----------")};var r,o=(r=n(9628))&&r.__esModule?r:{default:r},i=void 0,a=void 0,l=[];function s(){0!==l.length&&l[l.length-1].focusContent()}o.default.subscribe(function(e,t){i||a||((i=document.createElement("div")).setAttribute("data-react-modal-body-trap",""),i.style.position="absolute",i.style.opacity="0",i.setAttribute("tabindex","0"),i.addEventListener("focus",s),(a=i.cloneNode()).addEventListener("focus",s)),(l=t).length>0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==a&&document.body.appendChild(a)):(i.parentElement&&i.parentElement.removeChild(i),a.parentElement&&a.parentElement.removeChild(a))})},4838(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){var e=document.getElementsByTagName("html")[0];for(var t in n)o(e,n[t]);var i=document.body;for(var a in r)o(i,r[a]);n={},r={}},t.log=function(){};var n={},r={};function o(e,t){e.classList.remove(t)}t.add=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach(function(e){!function(e,t){e[t]||(e[t]=0),e[t]+=1}(i,e),o.add(e)});var o,i},t.remove=function(e,t){return o=e.classList,i="html"==e.nodeName.toLowerCase()?n:r,void t.split(" ").forEach(function(e){!function(e,t){e[t]&&(e[t]-=1)}(i,e),0===i[e]&&o.remove(e)});var o,i}},7791(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){i=[]},t.log=function(){},t.handleBlur=s,t.handleFocus=c,t.markForFocusLater=function(){i.push(document.activeElement)},t.returnFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=null;try{return void(0!==i.length&&(t=i.pop()).focus({preventScroll:e}))}catch(e){console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}},t.popWithoutFocus=function(){i.length>0&&i.pop()},t.setupScopedFocus=function(e){a=e,window.addEventListener?(window.addEventListener("blur",s,!1),document.addEventListener("focus",c,!0)):(window.attachEvent("onBlur",s),document.attachEvent("onFocus",c))},t.teardownScopedFocus=function(){a=null,window.addEventListener?(window.removeEventListener("blur",s),document.removeEventListener("focus",c)):(window.detachEvent("onBlur",s),document.detachEvent("onFocus",c))};var r,o=(r=n(2411))&&r.__esModule?r:{default:r},i=[],a=null,l=!1;function s(){l=!0}function c(){if(l){if(l=!1,!a)return;setTimeout(function(){a.contains(document.activeElement)||((0,o.default)(a)[0]||a).focus()},0)}}},9628(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(r.openInstances.length),r.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")},t.resetState=function(){r=new n};var n=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach(function(n){return n(e,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},r=new n;t.default=r},834(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canUseDOM=t.SafeNodeList=t.SafeHTMLCollection=void 0;var r,o=((r=n(411))&&r.__esModule?r:{default:r}).default,i=o.canUseDOM?window.HTMLElement:{};t.SafeHTMLCollection=o.canUseDOM?window.HTMLCollection:{},t.SafeNodeList=o.canUseDOM?window.NodeList:{},t.canUseDOM=o.canUseDOM,t.default=i},7067(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);if(n.length){var r=void 0,a=t.shiftKey,l=n[0],s=n[n.length-1],c=i();if(e===c){if(!a)return;r=s}if(s!==c||a||(r=l),l===c&&a&&(r=s),r)return t.preventDefault(),void r.focus();var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);if(null!=u&&"Chrome"!=u[1]&&null==/\biPod\b|\biPad\b/g.exec(navigator.userAgent)){var d=n.indexOf(c);if(d>-1&&(d+=a?-1:1),void 0===(r=n[d]))return t.preventDefault(),void(r=a?s:l).focus();t.preventDefault(),r.focus()}}else t.preventDefault()};var r,o=(r=n(2411))&&r.__esModule?r:{default:r};function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return e.activeElement.shadowRoot?i(e.activeElement.shadowRoot):e.activeElement}e.exports=t.default},2411(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){return[].slice.call(t.querySelectorAll("*"),0).reduce(function(t,n){return t.concat(n.shadowRoot?e(n.shadowRoot):[n])},[]).filter(o)};var n=/^(input|select|textarea|button|object|iframe)$/;function r(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var n=window.getComputedStyle(e),r=n.getPropertyValue("display");return t?"contents"!==r&&function(e,t){return"visible"!==t.getPropertyValue("overflow")||e.scrollWidth<=0&&e.scrollHeight<=0}(e,n):"none"===r}catch(e){return console.warn("Failed to inspect element style"),!1}}function o(e){var t=e.getAttribute("tabindex");null===t&&(t=void 0);var o=isNaN(t);return(o||t>=0)&&function(e,t){var o=e.nodeName.toLowerCase();return(n.test(o)&&!e.disabled||"a"===o&&e.href||t)&&function(e){for(var t=e,n=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(n&&t===n&&(t=n.host.parentNode),r(t))return!1;t=t.parentNode}return!0}(e)}(e,!o)}e.exports=t.default},312(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(1720))&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},4145(e,t,n){e.exports=n(5961)},8371(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609);t.LeftArrow=function(e){var t=e.customLeftArrow,n=e.getState,o=e.previous,i=e.disabled,a=e.rtl;if(t)return r.cloneElement(t,{onClick:function(){return o()},carouselState:n(),disabled:i,rtl:a});var l=a?"rtl":"";return r.createElement("button",{"aria-label":"Go to previous slide",className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--left "+l,onClick:function(){return o()},type:"button",disabled:i})},t.RightArrow=function(e){var t=e.customRightArrow,n=e.getState,o=e.next,i=e.disabled,a=e.rtl;if(t)return r.cloneElement(t,{onClick:function(){return o()},carouselState:n(),disabled:i,rtl:a});var l=a?"rtl":"";return r.createElement("button",{"aria-label":"Go to next slide",className:"react-multiple-carousel__arrow react-multiple-carousel__arrow--right "+l,onClick:function(){return o()},type:"button",disabled:i})}},6163(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1609),a=n(7035),l=n(2424),s=n(4169),c=n(8371),u=n(1519),d=n(6802),p=400,f="transform 400ms ease-in-out",h=function(e){function t(t){var n=e.call(this,t)||this;return n.containerRef=i.createRef(),n.listRef=i.createRef(),n.state={itemWidth:0,slidesToShow:0,currentSlide:0,totalItems:i.Children.count(t.children),deviceType:"",domLoaded:!1,transform:0,containerWidth:0},n.onResize=n.onResize.bind(n),n.handleDown=n.handleDown.bind(n),n.handleMove=n.handleMove.bind(n),n.handleOut=n.handleOut.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n.handleEnter=n.handleEnter.bind(n),n.setIsInThrottle=n.setIsInThrottle.bind(n),n.next=a.throttle(n.next.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.previous=a.throttle(n.previous.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.goToSlide=a.throttle(n.goToSlide.bind(n),t.transitionDuration||p,n.setIsInThrottle),n.onMove=!1,n.initialX=0,n.lastX=0,n.isAnimationAllowed=!1,n.direction="",n.initialY=0,n.isInThrottle=!1,n.transformPlaceHolder=0,n}return o(t,e),t.prototype.resetTotalItems=function(){var e=this,t=i.Children.count(this.props.children),n=a.notEnoughChildren(this.state)?0:Math.max(0,Math.min(this.state.currentSlide,t));this.setState({totalItems:t,currentSlide:n},function(){e.setContainerAndItemWidth(e.state.slidesToShow,!0)})},t.prototype.setIsInThrottle=function(e){void 0===e&&(e=!1),this.isInThrottle=e},t.prototype.setTransformDirectly=function(e,t){var n=this.props.additionalTransfrom;this.transformPlaceHolder=e;var r=d.getTransform(this.state,this.props,this.transformPlaceHolder);this.listRef&&this.listRef.current&&(this.setAnimationDirectly(t),this.listRef.current.style.transform="translate3d("+(r+n)+"px,0,0)")},t.prototype.setAnimationDirectly=function(e){this.listRef&&this.listRef.current&&(this.listRef.current.style.transition=e?this.props.customTransition||f:"none")},t.prototype.componentDidMount=function(){this.setState({domLoaded:!0}),this.setItemsToShow(),window.addEventListener("resize",this.onResize),this.onResize(!0),this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),this.props.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},t.prototype.setClones=function(e,t,n,r){var o=this;void 0===r&&(r=!1),this.isAnimationAllowed=!1;var l=i.Children.toArray(this.props.children),s=a.getInitialSlideInInfiniteMode(e||this.state.slidesToShow,l),c=a.getClones(this.state.slidesToShow,l),u=l.length<this.state.slidesToShow?0:this.state.currentSlide;this.setState({totalItems:c.length,currentSlide:n&&!r?u:s},function(){o.correctItemsPosition(t||o.state.itemWidth)})},t.prototype.setItemsToShow=function(e,t){var n=this,r=this.props.responsive;Object.keys(r).forEach(function(o){var i=r[o],a=i.breakpoint,l=i.items,s=a.max,c=a.min,u=[window.innerWidth];window.screen&&window.screen.width&&u.push(window.screen.width);var d=Math.min.apply(Math,u);c<=d&&d<=s&&(n.setState({slidesToShow:l,deviceType:o}),n.setContainerAndItemWidth(l,e,t))})},t.prototype.setContainerAndItemWidth=function(e,t,n){var r=this;if(this.containerRef&&this.containerRef.current){var o=this.containerRef.current.offsetWidth,i=a.getItemClientSideWidth(this.props,e,o);this.setState({containerWidth:o,itemWidth:i},function(){r.props.infinite&&r.setClones(e,i,t,n)}),t&&this.correctItemsPosition(i)}},t.prototype.correctItemsPosition=function(e,t,n){t&&(this.isAnimationAllowed=!0),!t&&this.isAnimationAllowed&&(this.isAnimationAllowed=!1);var r=this.state.totalItems<this.state.slidesToShow?0:-e*this.state.currentSlide;n&&this.setTransformDirectly(r,!0),this.setState({transform:r})},t.prototype.onResize=function(e){var t;t=!(!this.props.infinite||"boolean"==typeof e&&e),this.setItemsToShow(t)},t.prototype.componentDidUpdate=function(e,n){var r=this,o=e.keyBoardControl,i=e.autoPlay,l=e.children,s=n.containerWidth,c=n.domLoaded,u=n.currentSlide;if(this.containerRef&&this.containerRef.current&&this.containerRef.current.offsetWidth!==s&&(this.itemsToShowTimeout&&clearTimeout(this.itemsToShowTimeout),this.itemsToShowTimeout=setTimeout(function(){r.setItemsToShow(!0)},this.props.transitionDuration||p)),o&&!this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),!o&&this.props.keyBoardControl&&window.addEventListener("keyup",this.onKeyUp),i&&!this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),i||!this.props.autoPlay||this.autoPlay||(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed)),l.length!==this.props.children.length?t.clonesTimeout=setTimeout(function(){r.props.infinite?r.setClones(r.state.slidesToShow,r.state.itemWidth,!0,!0):r.resetTotalItems()},this.props.transitionDuration||p):this.props.infinite&&this.state.currentSlide!==u&&this.correctClonesPosition({domLoaded:c}),this.transformPlaceHolder!==this.state.transform&&(this.transformPlaceHolder=this.state.transform),this.props.autoPlay&&this.props.rewind&&!this.props.infinite&&a.isInRightEnd(this.state)){var d=this.props.transitionDuration||p;t.isInThrottleTimeout=setTimeout(function(){r.setIsInThrottle(!1),r.resetAutoplayInterval(),r.goToSlide(0,void 0,!!r.props.rewindWithAnimation)},d+this.props.autoPlaySpeed)}},t.prototype.correctClonesPosition=function(e){var n=this,r=e.domLoaded,o=i.Children.toArray(this.props.children),l=a.checkClonesPosition(this.state,o,this.props),s=l.isReachingTheEnd,c=l.isReachingTheStart,u=l.nextSlide,d=l.nextPosition;this.state.domLoaded&&r&&(s||c)&&(this.isAnimationAllowed=!1,t.transformTimeout=setTimeout(function(){n.setState({transform:d,currentSlide:u})},this.props.transitionDuration||p))},t.prototype.next=function(e){var n=this;void 0===e&&(e=0);var r=this.props,o=r.afterChange,i=r.beforeChange;if(!a.notEnoughChildren(this.state)){var l=a.populateNextSlides(this.state,this.props,e),s=l.nextSlides,c=l.nextPosition,u=this.state.currentSlide;void 0!==s&&void 0!==c&&("function"==typeof i&&i(s,this.getState()),this.isAnimationAllowed=!0,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({transform:c,currentSlide:s},function(){"function"==typeof o&&(t.afterChangeTimeout=setTimeout(function(){o(u,n.getState())},n.props.transitionDuration||p))}))}},t.prototype.previous=function(e){var n=this;void 0===e&&(e=0);var r=this.props,o=r.afterChange,i=r.beforeChange;if(!a.notEnoughChildren(this.state)){var l=a.populatePreviousSlides(this.state,this.props,e),s=l.nextSlides,c=l.nextPosition;if(void 0!==s&&void 0!==c){var u=this.state.currentSlide;"function"==typeof i&&i(s,this.getState()),this.isAnimationAllowed=!0,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({transform:c,currentSlide:s},function(){"function"==typeof o&&(t.afterChangeTimeout2=setTimeout(function(){o(u,n.getState())},n.props.transitionDuration||p))})}}},t.prototype.resetAutoplayInterval=function(){this.props.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed))},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.onResize),this.props.keyBoardControl&&window.removeEventListener("keyup",this.onKeyUp),this.props.autoPlay&&this.autoPlay&&(clearInterval(this.autoPlay),this.autoPlay=void 0),this.itemsToShowTimeout&&clearTimeout(this.itemsToShowTimeout),t.clonesTimeout&&clearTimeout(t.clonesTimeout),t.isInThrottleTimeout&&clearTimeout(t.isInThrottleTimeout),t.transformTimeout&&clearTimeout(t.transformTimeout),t.afterChangeTimeout&&clearTimeout(t.afterChangeTimeout),t.afterChangeTimeout2&&clearTimeout(t.afterChangeTimeout2),t.afterChangeTimeout3&&clearTimeout(t.afterChangeTimeout3)},t.prototype.resetMoveStatus=function(){this.onMove=!1,this.initialX=0,this.lastX=0,this.direction="",this.initialY=0},t.prototype.getCords=function(e){var t=e.clientX,n=e.clientY;return{clientX:d.parsePosition(this.props,t),clientY:d.parsePosition(this.props,n)}},t.prototype.handleDown=function(e){if(!(!l.isMouseMoveEvent(e)&&!this.props.swipeable||l.isMouseMoveEvent(e)&&!this.props.draggable||this.isInThrottle)){var t=this.getCords(l.isMouseMoveEvent(e)?e:e.touches[0]),n=t.clientX,r=t.clientY;this.onMove=!0,this.initialX=n,this.initialY=r,this.lastX=n,this.isAnimationAllowed=!1}},t.prototype.handleMove=function(e){if(!(!l.isMouseMoveEvent(e)&&!this.props.swipeable||l.isMouseMoveEvent(e)&&!this.props.draggable||a.notEnoughChildren(this.state))){var t=this.getCords(l.isMouseMoveEvent(e)?e:e.touches[0]),n=t.clientX,r=t.clientY,o=this.initialX-n,i=this.initialY-r;if(this.onMove){if(!(Math.abs(o)>Math.abs(i)))return;var s=a.populateSlidesOnMouseTouchMove(this.state,this.props,this.initialX,this.lastX,n,this.transformPlaceHolder),c=s.direction,u=s.nextPosition,d=s.canContinue;c&&(this.direction=c,d&&void 0!==u&&this.setTransformDirectly(u)),this.lastX=n}}},t.prototype.handleOut=function(e){this.props.autoPlay&&!this.autoPlay&&(this.autoPlay=setInterval(this.next,this.props.autoPlaySpeed));var t="touchend"===e.type&&!this.props.swipeable,n=("mouseleave"===e.type||"mouseup"===e.type)&&!this.props.draggable;if(!t&&!n&&this.onMove){if(this.setAnimationDirectly(!0),"right"===this.direction)if(this.initialX-this.lastX>=this.props.minimumTouchDrag){var r=Math.round((this.initialX-this.lastX)/this.state.itemWidth);this.next(r)}else this.correctItemsPosition(this.state.itemWidth,!0,!0);"left"===this.direction&&(this.lastX-this.initialX>this.props.minimumTouchDrag?(r=Math.round((this.lastX-this.initialX)/this.state.itemWidth),this.previous(r)):this.correctItemsPosition(this.state.itemWidth,!0,!0)),this.resetMoveStatus()}},t.prototype.isInViewport=function(e){var t=e.getBoundingClientRect(),n=t.top,r=void 0===n?0:n,o=t.left,i=void 0===o?0:o,a=t.bottom,l=void 0===a?0:a,s=t.right,c=void 0===s?0:s;return 0<=r&&0<=i&&l<=(window.innerHeight||document.documentElement.clientHeight)&&c<=(window.innerWidth||document.documentElement.clientWidth)},t.prototype.isChildOfCarousel=function(e){return!!(e instanceof Element&&this.listRef&&this.listRef.current)&&this.listRef.current.contains(e)},t.prototype.onKeyUp=function(e){var t=e.target;switch(e.keyCode){case 37:if(this.isChildOfCarousel(t))return this.previous();break;case 39:if(this.isChildOfCarousel(t))return this.next();break;case 9:if(this.isChildOfCarousel(t)&&t instanceof HTMLInputElement&&this.isInViewport(t))return this.next()}},t.prototype.handleEnter=function(e){l.isMouseMoveEvent(e)&&this.autoPlay&&this.props.autoPlay&&this.props.pauseOnHover&&(clearInterval(this.autoPlay),this.autoPlay=void 0)},t.prototype.goToSlide=function(e,n,r){var o=this;if(void 0===r&&(r=!0),!this.isInThrottle){var i=this.state.itemWidth,a=this.props,l=a.afterChange,s=a.beforeChange,c=this.state.currentSlide;"function"!=typeof s||n&&("object"!=typeof n||n.skipBeforeChange)||s(e,this.getState()),this.isAnimationAllowed=r,this.props.shouldResetAutoplay&&this.resetAutoplayInterval(),this.setState({currentSlide:e,transform:-i*e},function(){o.props.infinite&&o.correctClonesPosition({domLoaded:!0}),"function"!=typeof l||n&&("object"!=typeof n||n.skipAfterChange)||(t.afterChangeTimeout3=setTimeout(function(){l(c,o.getState())},o.props.transitionDuration||p))})}},t.prototype.getState=function(){return this.state},t.prototype.renderLeftArrow=function(e){var t=this,n=this.props,r=n.customLeftArrow,o=n.rtl;return i.createElement(c.LeftArrow,{customLeftArrow:r,getState:function(){return t.getState()},previous:this.previous,disabled:e,rtl:o})},t.prototype.renderRightArrow=function(e){var t=this,n=this.props,r=n.customRightArrow,o=n.rtl;return i.createElement(c.RightArrow,{customRightArrow:r,getState:function(){return t.getState()},next:this.next,disabled:e,rtl:o})},t.prototype.renderButtonGroups=function(){var e=this,t=this.props.customButtonGroup;return t?i.cloneElement(t,{previous:function(){return e.previous()},next:function(){return e.next()},goToSlide:function(t,n){return e.goToSlide(t,n)},carouselState:this.getState()}):null},t.prototype.renderDotsList=function(){var e=this;return i.createElement(s.default,{state:this.state,props:this.props,goToSlide:this.goToSlide,getState:function(){return e.getState()}})},t.prototype.renderCarouselItems=function(){var e=[];if(this.props.infinite){var t=i.Children.toArray(this.props.children);e=a.getClones(this.state.slidesToShow,t)}return i.createElement(u.default,{clones:e,goToSlide:this.goToSlide,state:this.state,notEnoughChildren:a.notEnoughChildren(this.state),props:this.props})},t.prototype.render=function(){var e=this.props,t=e.deviceType,n=e.arrows,r=e.renderArrowsWhenDisabled,o=e.removeArrowOnDeviceType,l=e.infinite,s=e.containerClass,c=e.sliderClass,u=e.customTransition,p=e.additionalTransfrom,h=e.renderDotsOutside,m=e.renderButtonGroupOutside,g=e.className,v=e.rtl,y=a.getInitialState(this.state,this.props),b=y.shouldRenderOnSSR,w=y.shouldRenderAtAll,E=a.isInLeftEnd(this.state),k=a.isInRightEnd(this.state),O=n&&!(o&&(t&&-1<o.indexOf(t)||this.state.deviceType&&-1<o.indexOf(this.state.deviceType)))&&!a.notEnoughChildren(this.state)&&w,S=!l&&E,x=!l&&k,_=d.getTransform(this.state,this.props);return i.createElement(i.Fragment,null,i.createElement("div",{className:"react-multi-carousel-list "+s+" "+g,dir:v?"rtl":"ltr",ref:this.containerRef},i.createElement("ul",{ref:this.listRef,className:"react-multi-carousel-track "+c,style:{transition:this.isAnimationAllowed?u||f:"none",overflow:b?"hidden":"unset",transform:"translate3d("+(_+p)+"px,0,0)"},onMouseMove:this.handleMove,onMouseDown:this.handleDown,onMouseUp:this.handleOut,onMouseEnter:this.handleEnter,onMouseLeave:this.handleOut,onTouchStart:this.handleDown,onTouchMove:this.handleMove,onTouchEnd:this.handleOut},this.renderCarouselItems()),O&&(!S||r)&&this.renderLeftArrow(S),O&&(!x||r)&&this.renderRightArrow(x),w&&!m&&this.renderButtonGroups(),w&&!h&&this.renderDotsList()),w&&h&&this.renderDotsList(),w&&m&&this.renderButtonGroups())},t.defaultProps={slidesToSlide:1,infinite:!1,draggable:!0,swipeable:!0,arrows:!0,renderArrowsWhenDisabled:!1,containerClass:"",sliderClass:"",itemClass:"",keyBoardControl:!0,autoPlaySpeed:3e3,showDots:!1,renderDotsOutside:!1,renderButtonGroupOutside:!1,minimumTouchDrag:80,className:"",dotListClass:"",focusOnSelect:!1,centerMode:!1,additionalTransfrom:0,pauseOnHover:!0,shouldResetAutoplay:!0,rewind:!1,rtl:!1,rewindWithAnimation:!1},t}(i.Component);t.default=h},1519(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(7035);t.default=function(e){var t=e.props,n=e.state,i=e.goToSlide,a=e.clones,l=e.notEnoughChildren,s=n.itemWidth,c=t.children,u=t.infinite,d=t.itemClass,p=t.itemAriaLabel,f=t.partialVisbile,h=t.partialVisible,m=o.getInitialState(n,t),g=m.flexBisis,v=m.shouldRenderOnSSR,y=m.domFullyLoaded,b=m.partialVisibilityGutter;return m.shouldRenderAtAll?(f&&console.warn('WARNING: Please correct props name: "partialVisible" as old typo will be removed in future versions!'),r.createElement(r.Fragment,null,(u?a:r.Children.toArray(c)).map(function(e,a){return r.createElement("li",{key:a,"data-index":a,onClick:function(){t.focusOnSelect&&i(a)},"aria-hidden":o.getIfSlideIsVisbile(a,n)?"false":"true","aria-label":p||(e.props.ariaLabel?e.props.ariaLabel:null),style:{flex:v?"1 0 "+g+"%":"auto",position:"relative",width:y?((f||h)&&b&&!l?s-b:s)+"px":"auto"},className:"react-multi-carousel-item "+(o.getIfSlideIsVisbile(a,n)?"react-multi-carousel-item--active":"")+" "+d},e)}))):null}},4169(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(9189),i=n(1811),a=n(6802);t.default=function(e){var t=e.props,n=e.state,l=e.goToSlide,s=e.getState,c=t.showDots,u=t.customDot,d=t.dotListClass,p=t.infinite,f=t.children;if(!c||a.notEnoughChildren(n))return null;var h,m=n.currentSlide,g=n.slidesToShow,v=a.getSlidesToSlide(n,t),y=r.Children.toArray(f);h=p?Math.ceil(y.length/v):Math.ceil((y.length-g)/v)+1;var b=i.getLookupTableForNextSlides(h,n,t,y),w=o.getOriginalIndexLookupTableByClones(g,y),E=w[m];return r.createElement("ul",{className:"react-multi-carousel-dot-list "+d},Array(h).fill(0).map(function(e,t){var n,o;if(p){o=b[t];var i=w[o];n=E===i||i<=E&&E<i+v}else{var a=y.length-g,c=t*v;n=(o=a<c?a:c)===m||o<m&&m<o+v&&m<y.length-g}return u?r.cloneElement(u,{index:t,active:n,key:t,onClick:function(){return l(o)},carouselState:s()}):r.createElement("li",{"data-index":t,key:t,className:"react-multi-carousel-dot "+(n?"react-multi-carousel-dot--active":"")},r.createElement("button",{"aria-label":"Go to slide "+(t+1),onClick:function(){return l(o)}}))}))}},5961(e,t,n){"use strict";var r=n(6163);t.default=r.default},2424(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(1609);t.isMouseMoveEvent=function(e){return"clientY"in e};var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(i.Component);t.default=a},9189(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOriginalCounterPart=function(e,t,n){var r=t.slidesToShow,o=t.currentSlide;return n.length>2*r?e+2*r:o>=n.length?n.length+e:e},t.getOriginalIndexLookupTableByClones=function(e,t){if(t.length>2*e){for(var n={},r=t.length-2*e,o=t.length-r,i=r,a=0;a<o;a++)n[a]=i,i++;var l=t.length+o,s=l+t.slice(0,2*e).length,c=0;for(a=l;a<=s;a++)n[a]=c,c++;var u=l,d=0;for(a=o;a<u;a++)n[a]=d,d++;return n}n={};var p=3*t.length,f=0;for(a=0;a<p;a++)n[a]=f,++f===t.length&&(f=0);return n},t.getClones=function(e,t){return t.length<e?t:t.length>2*e?t.slice(t.length-2*e,t.length).concat(t,t.slice(0,2*e)):t.concat(t,t)},t.getInitialSlideInInfiniteMode=function(e,t){return t.length>2*e?2*e:t.length},t.checkClonesPosition=function(e,t,n){var r,o=e.currentSlide,i=e.slidesToShow,a=e.itemWidth,l=e.totalItems,s=0,c=0,u=0===o,d=t.length-(t.length-2*i);return t.length<i?(c=s=0,u=r=!1):t.length>2*i?((r=o>=d+t.length)&&(c=-a*(s=o-t.length)),u&&(c=-a*(s=d+(t.length-2*i)))):((r=o>=2*t.length)&&(c=-a*(s=o-t.length)),u&&(c=n.showDots?-a*(s=t.length):-a*(s=l/3))),{isReachingTheEnd:r,isReachingTheStart:u,nextSlide:s,nextPosition:c}}},6802(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4867);function o(e){var t=e.slidesToShow;return e.totalItems<t}function i(e,t,n){var r=n||e.transform;return!t.infinite&&0===e.currentSlide||o(e)?r:r+e.itemWidth/2}function a(e){var t=e.currentSlide,n=e.totalItems;return!(t+e.slidesToShow<n)}function l(e,t,n,r){void 0===t&&(t=0);var i=e.currentSlide,l=e.slidesToShow,s=a(e),c=!n.infinite&&s,u=r||e.transform;if(o(e))return u;var d=u+i*t;return c?d+(e.containerWidth-(e.itemWidth-t)*l):d}function s(e,t){return e.rtl?-1*t:t}t.notEnoughChildren=o,t.getInitialState=function(e,t){var n,o=e.domLoaded,i=e.slidesToShow,a=e.containerWidth,l=e.itemWidth,s=t.deviceType,c=t.responsive,u=t.ssr,d=t.partialVisbile,p=t.partialVisible,f=Boolean(o&&i&&a&&l);u&&s&&!f&&(n=r.getWidthFromDeviceType(s,c));var h=Boolean(u&&s&&!f&&n);return{shouldRenderOnSSR:h,flexBisis:n,domFullyLoaded:f,partialVisibilityGutter:r.getPartialVisibilityGutter(c,d||p,s,e.deviceType),shouldRenderAtAll:h||f}},t.getIfSlideIsVisbile=function(e,t){var n=t.currentSlide,r=t.slidesToShow;return n<=e&&e<n+r},t.getTransformForCenterMode=i,t.isInLeftEnd=function(e){return!(0<e.currentSlide)},t.isInRightEnd=a,t.getTransformForPartialVsibile=l,t.parsePosition=s,t.getTransform=function(e,t,n){var o=t.partialVisbile,a=t.partialVisible,c=t.responsive,u=t.deviceType,d=t.centerMode,p=n||e.transform,f=r.getPartialVisibilityGutter(c,o||a,u,e.deviceType);return s(t,a||o?l(e,f,t,n):d?i(e,t,n):p)},t.getSlidesToSlide=function(e,t){var n=e.domLoaded,r=e.slidesToShow,o=e.containerWidth,i=e.itemWidth,a=t.deviceType,l=t.responsive,s=t.slidesToSlide||1,c=Boolean(n&&r&&o&&i);return t.ssr&&t.deviceType&&!c&&Object.keys(l).forEach(function(e){var t=l[e].slidesToSlide;a===e&&t&&(s=t)}),c&&Object.keys(l).forEach(function(e){var t=l[e],n=t.breakpoint,r=t.slidesToSlide,o=n.max,i=n.min;r&&window.innerWidth>=i&&window.innerWidth<=o&&(s=r)}),s}},1811(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9189),o=n(6802);t.getLookupTableForNextSlides=function(e,t,n,i){var a={},l=o.getSlidesToSlide(t,n);return Array(e).fill(0).forEach(function(e,n){var o=r.getOriginalCounterPart(n,t,i);if(0===n)a[0]=o;else{var s=a[n-1]+l;a[n]=s}}),a}},4867(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPartialVisibilityGutter=function(e,t,n,r){var o=0,i=r||n;return t&&i&&(o=e[i].partialVisibilityGutter||e[i].paritialVisibilityGutter),o},t.getWidthFromDeviceType=function(e,t){var n;return t[e]&&(n=(100/t[e].items).toFixed(1)),n},t.getItemClientSideWidth=function(e,t,n){return Math.round(n/(t+(e.centerMode?1:0)))}},7035(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9189);t.getOriginalCounterPart=r.getOriginalCounterPart,t.getClones=r.getClones,t.checkClonesPosition=r.checkClonesPosition,t.getInitialSlideInInfiniteMode=r.getInitialSlideInInfiniteMode;var o=n(4867);t.getWidthFromDeviceType=o.getWidthFromDeviceType,t.getPartialVisibilityGutter=o.getPartialVisibilityGutter,t.getItemClientSideWidth=o.getItemClientSideWidth;var i=n(6802);t.getInitialState=i.getInitialState,t.getIfSlideIsVisbile=i.getIfSlideIsVisbile,t.getTransformForCenterMode=i.getTransformForCenterMode,t.getTransformForPartialVsibile=i.getTransformForPartialVsibile,t.isInLeftEnd=i.isInLeftEnd,t.isInRightEnd=i.isInRightEnd,t.notEnoughChildren=i.notEnoughChildren,t.getSlidesToSlide=i.getSlidesToSlide;var a=n(2259);t.throttle=a.default;var l=n(4713);t.throwError=l.default;var s=n(6650);t.populateNextSlides=s.populateNextSlides;var c=n(6862);t.populatePreviousSlides=c.populatePreviousSlides;var u=n(251);t.populateSlidesOnMouseTouchMove=u.populateSlidesOnMouseTouchMove},251(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.populateSlidesOnMouseTouchMove=function(e,t,n,r,o,i){var a,l,s=e.itemWidth,c=e.slidesToShow,u=e.totalItems,d=e.currentSlide,p=t.infinite,f=!1,h=Math.round((n-r)/s),m=Math.round((r-n)/s),g=n<o;if(o<n&&h<=c){a="right";var v=Math.abs(-s*(u-c)),y=i-(r-o),b=d===u-c;(Math.abs(y)<=v||b&&p)&&(l=y,f=!0)}return g&&m<=c&&(a="left",((y=i+(o-r))<=0||0===d&&p)&&(f=!0,l=y)),{direction:a,nextPosition:l,canContinue:f}}},6650(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6802);t.populateNextSlides=function(e,t,n){void 0===n&&(n=0);var o,i,a=e.slidesToShow,l=e.currentSlide,s=e.itemWidth,c=e.totalItems,u=r.getSlidesToSlide(e,t),d=l+1+n+a+(0<n?0:u);return i=d<=c?-s*(o=l+n+(0<n?0:u)):c<d&&l!==c-a?-s*(o=c-a):o=void 0,{nextSlides:o,nextPosition:i}}},6862(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609),o=n(6802),i=n(6802);t.populatePreviousSlides=function(e,t,n){void 0===n&&(n=0);var a,l,s=e.currentSlide,c=e.itemWidth,u=e.slidesToShow,d=t.children,p=t.showDots,f=t.infinite,h=o.getSlidesToSlide(e,t),m=s-n-(0<n?0:h),g=(r.Children.toArray(d).length-u)%h;return l=0<=m?(a=m,p&&!f&&0<g&&i.isInRightEnd(e)&&(a=s-g),-c*a):a=m<0&&0!==s?0:void 0,{nextSlides:a,nextPosition:l}}},2259(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r;return function(){var o=arguments;r||(e.apply(this,o),r=!0,"function"==typeof n&&n(!0),setTimeout(function(){r=!1,"function"==typeof n&&n(!1)},t))}}},4713(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t.partialVisbile,r=t.partialVisible,o=t.centerMode,i=t.ssr,a=t.responsive;if((n||r)&&o)throw new Error("center mode can not be used at the same time with partialVisible");if(!a)throw i?new Error("ssr mode need to be used in conjunction with responsive prop"):new Error("Responsive prop is needed for deciding the amount of items to show on the screen");if(a&&"object"!=typeof a)throw new Error("responsive prop must be an object")}},4210(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}Object.defineProperty(t,"__esModule",{value:!0});var i={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(e){i[e]=new o(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t,n,a=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(t,n)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=a[0],s=a[1];i[l]=new o(l,1,!1,s,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){i[e]=new o(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){i[e]=new o(e,2,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(e){i[e]=new o(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){i[e]=new o(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){i[e]=new o(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){i[e]=new o(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){i[e]=new o(e,5,!1,e.toLowerCase(),null,!1,!1)});var a=/[\-\:]([a-z])/g,l=function(e){return e[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(a,l);i[t]=new o(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){i[e]=new o(e,1,!1,e.toLowerCase(),null,!1,!1)}),i.xlinkHref=new o("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){i[e]=new o(e,1,!1,e.toLowerCase(),null,!0,!0)});var s=n(6811),c=s.CAMELCASE,u=s.SAME,d=s.possibleStandardNames,p=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),f=Object.keys(d).reduce(function(e,t){var n=d[t];return n===u?e[t]=t:n===c?e[t.toLowerCase()]=t:e[t]=n,e},{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return i.hasOwnProperty(e)?i[e]:null},t.isCustomAttribute=p,t.possibleStandardNames=f},6811(e,t){t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},465(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return a(t,e),t},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0});var c=l(n(1609)),u=n(1813),d=n(8105),p=["ArrowRight","ArrowUp","k","PageUp"],f=["ArrowLeft","ArrowDown","j","PageDown"],h=function(e){function t(t){var n=e.call(this,t)||this;if(n.trackRef=c.createRef(),n.thumbRefs=[],n.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(n.props.values.length).fill(0).map(function(e,t){return t}),isChanged:!1,markOffsets:[]},n.getOffsets=function(){var e=n.props,t=e.direction,r=e.values,o=e.min,i=e.max,a=n.trackRef.current;if(!a)return console.warn("No track element found."),[];var l=a.getBoundingClientRect(),s=(0,u.getPaddingAndBorder)(a);return n.getThumbs().map(function(e,n){var a={x:0,y:0},c=e.getBoundingClientRect(),p=(0,u.getMargin)(e);switch(t){case d.Direction.Right:return a.x=-1*(p.left+s.left),a.y=-1*((c.height-l.height)/2+s.top),a.x+=l.width*(0,u.relativeValue)(r[n],o,i)-c.width/2,a;case d.Direction.Left:return a.x=-1*(p.right+s.right),a.y=-1*((c.height-l.height)/2+s.top),a.x+=l.width-l.width*(0,u.relativeValue)(r[n],o,i)-c.width/2,a;case d.Direction.Up:return a.x=-1*((c.width-l.width)/2+p.left+s.left),a.y=-s.left,a.y+=l.height-l.height*(0,u.relativeValue)(r[n],o,i)-c.height/2,a;case d.Direction.Down:return a.x=-1*((c.width-l.width)/2+p.left+s.left),a.y=-s.left,a.y+=l.height*(0,u.relativeValue)(r[n],o,i)-c.height/2,a;default:return(0,u.assertUnreachable)(t)}})},n.getThumbs=function(){return n.trackRef&&n.trackRef.current?Array.from(n.trackRef.current.children).filter(function(e){return e.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},n.getTargetIndex=function(e){return n.getThumbs().findIndex(function(t){return t===e.target||t.contains(e.target)})},n.addTouchEvents=function(e){document.addEventListener("touchmove",n.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",n.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",n.schdOnEnd,{passive:!1})},n.addMouseEvents=function(e){document.addEventListener("mousemove",n.schdOnMouseMove),document.addEventListener("mouseup",n.schdOnEnd)},n.onMouseDownTrack=function(e){var t;if(0===e.button&&!(0,u.isIOS)())if(e.persist(),e.preventDefault(),n.addMouseEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some(function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)}))return;n.setState({draggedTrackPos:[e.clientX,e.clientY]},function(){return n.onMove(e.clientX,e.clientY)})}else{var r=(0,u.getClosestThumbIndex)(n.thumbRefs.map(function(e){return e.current}),e.clientX,e.clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},function(){return n.onMove(e.clientX,e.clientY)})}},n.onResize=function(){(0,u.translateThumbs)(n.getThumbs(),n.getOffsets(),n.props.rtl),n.calculateMarkOffsets()},n.onTouchStartTrack=function(e){var t;if(e.persist(),n.addTouchEvents(e.nativeEvent),n.props.values.length>1&&n.props.draggableTrack){if(n.thumbRefs.some(function(t){var n;return null===(n=t.current)||void 0===n?void 0:n.contains(e.target)}))return;n.setState({draggedTrackPos:[e.touches[0].clientX,e.touches[0].clientY]},function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)})}else{var r=(0,u.getClosestThumbIndex)(n.thumbRefs.map(function(e){return e.current}),e.touches[0].clientX,e.touches[0].clientY,n.props.direction);null===(t=n.thumbRefs[r].current)||void 0===t||t.focus(),n.setState({draggedThumbIndex:r},function(){return n.onMove(e.touches[0].clientX,e.touches[0].clientY)})}},n.onMouseOrTouchStart=function(e){if(!n.props.disabled){var t=(0,u.isTouchEvent)(e);if(t||0===e.button){var r=n.getTargetIndex(e);-1!==r&&(t?n.addTouchEvents(e):n.addMouseEvents(e),n.setState({draggedThumbIndex:r,thumbZIndexes:n.state.thumbZIndexes.map(function(e,t){return t===r?Math.max.apply(Math,n.state.thumbZIndexes):e<=n.state.thumbZIndexes[r]?e:e-1})}))}}},n.onMouseMove=function(e){e.preventDefault(),n.onMove(e.clientX,e.clientY)},n.onTouchMove=function(e){e.preventDefault(),n.onMove(e.touches[0].clientX,e.touches[0].clientY)},n.onKeyDown=function(e){var t=n.props,r=t.values,o=t.onChange,i=t.step,a=t.rtl,l=t.direction,s=n.state.isChanged,c=n.getTargetIndex(e.nativeEvent),h=a||l===d.Direction.Left||l===d.Direction.Down?-1:1;-1!==c&&(p.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:c,isChanged:!0}),o((0,u.replaceAt)(r,c,n.normalizeValue(r[c]+h*("PageUp"===e.key?10*i:i),c)))):f.includes(e.key)?(e.preventDefault(),n.setState({draggedThumbIndex:c,isChanged:!0}),o((0,u.replaceAt)(r,c,n.normalizeValue(r[c]-h*("PageDown"===e.key?10*i:i),c)))):"Tab"===e.key?n.setState({draggedThumbIndex:-1},function(){s&&n.fireOnFinalChange()}):s&&n.fireOnFinalChange())},n.onKeyUp=function(e){var t=n.state.isChanged;n.setState({draggedThumbIndex:-1},function(){t&&n.fireOnFinalChange()})},n.onMove=function(e,t){var r=n.state,o=r.draggedThumbIndex,i=r.draggedTrackPos,a=n.props,l=a.direction,s=a.min,c=a.max,p=a.onChange,f=a.values,h=a.step,m=a.rtl;if(-1===o&&-1===i[0]&&-1===i[1])return null;var g=n.trackRef.current;if(!g)return null;var v=g.getBoundingClientRect(),y=(0,u.isVertical)(l)?v.height:v.width;if(-1!==i[0]&&-1!==i[1]){var b=e-i[0],w=t-i[1],E=0;switch(l){case d.Direction.Right:case d.Direction.Left:E=b/y*(c-s);break;case d.Direction.Down:case d.Direction.Up:E=w/y*(c-s);break;default:(0,u.assertUnreachable)(l)}if(m&&(E*=-1),Math.abs(E)>=h/2){for(var k=0;k<n.thumbRefs.length;k++){if(f[k]===c&&1===Math.sign(E)||f[k]===s&&-1===Math.sign(E))return;var O=f[k]+E;O>c?E=c-f[k]:O<s&&(E=s-f[k])}var S=f.slice(0);for(k=0;k<n.thumbRefs.length;k++)S=(0,u.replaceAt)(S,k,n.normalizeValue(f[k]+E,k));n.setState({draggedTrackPos:[e,t]}),p(S)}}else{var x=0;switch(l){case d.Direction.Right:x=(e-v.left)/y*(c-s)+s;break;case d.Direction.Left:x=(y-(e-v.left))/y*(c-s)+s;break;case d.Direction.Down:x=(t-v.top)/y*(c-s)+s;break;case d.Direction.Up:x=(y-(t-v.top))/y*(c-s)+s;break;default:(0,u.assertUnreachable)(l)}m&&(x=c+s-x),Math.abs(f[o]-x)>=h/2&&p((0,u.replaceAt)(f,o,n.normalizeValue(x,o)))}},n.normalizeValue=function(e,t){var r=n.props,o=r.min,i=r.max,a=r.step,l=r.allowOverlap,s=r.values;return(0,u.normalizeValue)(e,t,o,i,a,l,s)},n.onEnd=function(e){if(e.preventDefault(),document.removeEventListener("mousemove",n.schdOnMouseMove),document.removeEventListener("touchmove",n.schdOnTouchMove),document.removeEventListener("mouseup",n.schdOnEnd),document.removeEventListener("touchend",n.schdOnEnd),document.removeEventListener("touchcancel",n.schdOnEnd),-1===n.state.draggedThumbIndex&&-1===n.state.draggedTrackPos[0]&&-1===n.state.draggedTrackPos[1])return null;n.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){n.fireOnFinalChange()})},n.fireOnFinalChange=function(){n.setState({isChanged:!1});var e=n.props,t=e.onFinalChange,r=e.values;t&&t(r)},n.updateMarkRefs=function(e){if(!e.renderMark)return n.numOfMarks=void 0,void(n.markRefs=void 0);n.numOfMarks=(e.max-e.min)/n.props.step,n.markRefs=[];for(var t=0;t<n.numOfMarks+1;t++)n.markRefs[t]=c.createRef()},n.calculateMarkOffsets=function(){if(n.props.renderMark&&n.trackRef&&n.numOfMarks&&n.markRefs&&null!==n.trackRef.current){for(var e=window.getComputedStyle(n.trackRef.current),t=parseInt(e.width,10),r=parseInt(e.height,10),o=parseInt(e.paddingLeft,10),i=parseInt(e.paddingTop,10),a=[],l=0;l<n.numOfMarks+1;l++){var s=9999,c=9999;if(n.markRefs[l].current){var u=n.markRefs[l].current.getBoundingClientRect();s=u.height,c=u.width}n.props.direction===d.Direction.Left||n.props.direction===d.Direction.Right?a.push([Math.round(t/n.numOfMarks*l+o-c/2),-Math.round((s-r)/2)]):a.push([Math.round(r/n.numOfMarks*l+i-s/2),-Math.round((c-t)/2)])}n.setState({markOffsets:a})}},0===t.step)throw new Error('"step" property should be a positive number');return n.schdOnMouseMove=(0,u.schd)(n.onMouseMove),n.schdOnTouchMove=(0,u.schd)(n.onTouchMove),n.schdOnEnd=(0,u.schd)(n.onEnd),n.thumbRefs=t.values.map(function(){return c.createRef()}),n.updateMarkRefs(t),n}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.values,r=t.min,o=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",e.onResize)},unobserve:function(){return window.removeEventListener("resize",e.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,u.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(t){return(0,u.checkBoundaries)(t,e.props.min,e.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),n.forEach(function(e){(0,u.isStepDivisible)(r,e,o)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},t.prototype.componentDidUpdate=function(e,t){var n=this.props,r=n.max,o=n.min,i=n.step,a=n.values,l=n.rtl;e.max===r&&e.min===o&&e.step===i||this.updateMarkRefs(this.props),(0,u.translateThumbs)(this.getThumbs(),this.getOffsets(),l),e.max===r&&e.min===o&&e.step===i&&t.markOffsets.length===this.state.markOffsets.length||(this.calculateMarkOffsets(),a.forEach(function(e){(0,u.isStepDivisible)(o,e,i)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},t.prototype.componentWillUnmount=function(){document.removeEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},t.prototype.render=function(){var e=this,t=this.props,n=t.label,r=t.labelledBy,o=t.renderTrack,i=t.renderThumb,a=t.renderMark,l=void 0===a?function(){return null}:a,c=t.values,p=t.min,f=t.max,h=t.allowOverlap,m=t.disabled,g=this.state,v=g.draggedThumbIndex,y=g.thumbZIndexes,b=g.markOffsets;return o({props:{style:{transform:"scale(1)",cursor:v>-1?"grabbing":this.props.draggableTrack?(0,u.isVertical)(this.props.direction)?"ns-resize":"ew-resize":1!==c.length||m?"inherit":"pointer"},onMouseDown:m?u.voidFn:this.onMouseDownTrack,onTouchStart:m?u.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:m,children:s(s([],b.map(function(t,n,r){return l({props:{style:e.props.direction===d.Direction.Left||e.props.direction===d.Direction.Right?{position:"absolute",left:"".concat(t[0],"px"),marginTop:"".concat(t[1],"px")}:{position:"absolute",top:"".concat(t[0],"px"),marginLeft:"".concat(t[1],"px")},key:"mark".concat(n),ref:e.markRefs[n]},index:n})}),!0),c.map(function(t,o){var a=e.state.draggedThumbIndex===o;return i({index:o,value:t,isDragged:a,props:{style:{position:"absolute",zIndex:y[o],cursor:m?"inherit":a?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:o,tabIndex:m?void 0:0,"aria-valuemax":h?f:c[o+1]||f,"aria-valuemin":h?p:c[o-1]||p,"aria-valuenow":t,draggable:!1,ref:e.thumbRefs[o],"aria-label":n,"aria-labelledby":r,role:"slider",onKeyDown:m?u.voidFn:e.onKeyDown,onKeyUp:m?u.voidFn:e.onKeyUp}})}),!0)})},t.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:d.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},t}(c.Component);t.default=h},124(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkValuesAgainstBoundaries=t.relativeValue=t.useThumbOverlap=t.Direction=t.getTrackBackground=t.Range=void 0;var o=r(n(465));t.Range=o.default;var i=n(1813);Object.defineProperty(t,"getTrackBackground",{enumerable:!0,get:function(){return i.getTrackBackground}}),Object.defineProperty(t,"useThumbOverlap",{enumerable:!0,get:function(){return i.useThumbOverlap}}),Object.defineProperty(t,"relativeValue",{enumerable:!0,get:function(){return i.relativeValue}}),Object.defineProperty(t,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return i.checkValuesAgainstBoundaries}});var a=n(8105);Object.defineProperty(t,"Direction",{enumerable:!0,get:function(){return a.Direction}})},8105(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Direction=void 0,function(e){e.Right="to right",e.Left="to left",e.Down="to bottom",e.Up="to top"}(n||(t.Direction=n={}))},1813(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.isIOS=t.useThumbOverlap=t.assertUnreachable=t.voidFn=t.getTrackBackground=t.replaceAt=t.schd=t.translate=t.getClosestThumbIndex=t.translateThumbs=t.getPaddingAndBorder=t.getMargin=t.checkInitialOverlap=t.checkValuesAgainstBoundaries=t.checkBoundaries=t.isVertical=t.relativeValue=t.normalizeValue=t.isStepDivisible=t.isTouchEvent=t.getStepDecimals=void 0;var o=n(1609),i=n(8105);function a(e){return e===i.Direction.Up||e===i.Direction.Down}function l(e,t,n){e.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}t.getStepDecimals=function(e){var t=e.toString().split(".")[1];return t?t.length:0},t.isTouchEvent=function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length},t.isStepDivisible=function(e,t,n){var r=Number(((t-e)/n).toFixed(8));return parseInt(r.toString(),10)===r},t.normalizeValue=function(e,n,r,o,i,a,l){var s=1e11;if(e=Math.round(e*s)/s,!a){var c=l[n-1],u=l[n+1];if(c&&c>e)return c;if(u&&u<e)return u}if(e>o)return o;if(e<r)return r;var d=Math.floor(e*s-r*s)%Math.floor(i*s),p=Math.floor(e*s-Math.abs(d)),f=0===d?e:p/s,h=Math.abs(d/s)<i/2?f:f+i,m=(0,t.getStepDecimals)(i);return parseFloat(h.toFixed(m))},t.relativeValue=function(e,t,n){return(e-t)/(n-t)},t.isVertical=a,t.checkBoundaries=function(e,t,n){if(t>=n)throw new RangeError("min (".concat(t,") is equal/bigger than max (").concat(n,")"));if(e<t)throw new RangeError("value (".concat(e,") is smaller than min (").concat(t,")"));if(e>n)throw new RangeError("value (".concat(e,") is bigger than max (").concat(n,")"))},t.checkValuesAgainstBoundaries=function(e,t,n){return e<t?t:e>n?n:e},t.checkInitialOverlap=function(e){if(!(e.length<2||e.slice(1).every(function(t,n){return e[n]<=t})))throw new RangeError("values={[".concat(e,"]} needs to be sorted when allowOverlap={false}"))},t.getMargin=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["margin-top"],10),bottom:parseInt(t["margin-bottom"],10),left:parseInt(t["margin-left"],10),right:parseInt(t["margin-right"],10)}},t.getPaddingAndBorder=function(e){var t=window.getComputedStyle(e);return{top:parseInt(t["padding-top"],10)+parseInt(t["border-top-width"],10),bottom:parseInt(t["padding-bottom"],10)+parseInt(t["border-bottom-width"],10),left:parseInt(t["padding-left"],10)+parseInt(t["border-left-width"],10),right:parseInt(t["padding-right"],10)+parseInt(t["border-right-width"],10)}},t.translateThumbs=function(e,t,n){var r=n?-1:1;e.forEach(function(e,n){return l(e,r*t[n].x,t[n].y)})},t.getClosestThumbIndex=function(e,t,n,r){for(var o=0,i=c(e[0],t,n,r),a=1;a<e.length;a++){var l=c(e[a],t,n,r);l<i&&(i=l,o=a)}return o},t.translate=l,t.schd=function(e){var t=[],n=null;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];t=r,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))}},t.replaceAt=function(e,t,n){var r=e.slice(0);return r[t]=n,r},t.getTrackBackground=function(e){var t=e.values,n=e.colors,r=e.min,o=e.max,a=e.direction,l=void 0===a?i.Direction.Right:a,s=e.rtl,c=void 0!==s&&s;c&&l===i.Direction.Right?l=i.Direction.Left:c&&i.Direction.Left&&(l=i.Direction.Right);var u=t.slice(0).sort(function(e,t){return e-t}).map(function(e){return(e-r)/(o-r)*100}).reduce(function(e,t,r){return"".concat(e,", ").concat(n[r]," ").concat(t,"%, ").concat(n[r+1]," ").concat(t,"%")},"");return"linear-gradient(".concat(l,", ").concat(n[0]," 0%").concat(u,", ").concat(n[n.length-1]," 100%)")},t.voidFn=function(){},t.assertUnreachable=function(e){throw new Error("Didn't expect to get here")};var s=function(e,t,n,o,i){return void 0===i&&(i=function(e){return e}),Math.ceil(r([e],Array.from(e.children),!0).reduce(function(e,r){var a=Math.ceil(r.getBoundingClientRect().width);if(r.innerText&&r.innerText.includes(n)&&0===r.childElementCount){var l=r.cloneNode(!0);l.innerHTML=i(t.toFixed(o)),l.style.visibility="hidden",document.body.appendChild(l),a=Math.ceil(l.getBoundingClientRect().width),document.body.removeChild(l)}return a>e?a:e},e.getBoundingClientRect().width))};function c(e,t,n,r){var o=e.getBoundingClientRect(),i=o.left,l=o.top,s=o.width,c=o.height;return a(r)?Math.abs(n-(l+c/2)):Math.abs(t-(i+s/2))}t.useThumbOverlap=function(e,n,i,a,l,c){void 0===a&&(a=.1),void 0===l&&(l=" - "),void 0===c&&(c=function(e){return e});var u=(0,t.getStepDecimals)(a),d=(0,o.useState)({}),p=d[0],f=d[1],h=(0,o.useState)(c(n[i].toFixed(u))),m=h[0],g=h[1];return(0,o.useEffect)(function(){if(e){var t=e.getThumbs();if(t.length<1)return;var o={},a=e.getOffsets(),d=function(e,t,n,o,i,a,l){void 0===l&&(l=function(e){return e});var c=[],u=function(e){var d=s(n[e],o[e],i,a,l),p=t[e].x;t.forEach(function(t,f){var h=t.x,m=s(n[f],o[f],i,a,l);e!==f&&(p>=h&&p<=h+m||p+d>=h&&p+d<=h+m)&&(c.includes(f)||(c.push(e),c.push(f),c=r(r([],c,!0),[e,f],!1),u(f)))})};return u(e),Array.from(new Set(c.sort()))}(i,a,t,n,l,u,c),p=c(n[i].toFixed(u));if(d.length){var h=d.reduce(function(e,t,n,o){return e.length?r(r([],e,!0),[a[o[n]].x],!1):[a[o[n]].x]},[]);if(Math.min.apply(Math,h)===a[i].x){var m=[];d.forEach(function(e){m.push(n[e].toFixed(u))}),p=Array.from(new Set(m.sort(function(e,t){return parseFloat(e)-parseFloat(t)}))).map(c).join(l);var v=Math.min.apply(Math,h),y=Math.max.apply(Math,h),b=t[d[h.indexOf(y)]].getBoundingClientRect().width;o.left="".concat(Math.abs(v-(y+b))/2,"px"),o.transform="translate(-50%, 0)"}else o.visibility="hidden"}g(p),f(o)}},[e,n]),[m,p]},t.isIOS=function(){var e,t=(null===(e=navigator.userAgentData)||void 0===e?void 0:e.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}},8989(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,l=60109,s=60110,c=60112,u=60113,d=60120,p=60115,f=60116;if("function"==typeof Symbol&&Symbol.for){var h=Symbol.for;n=h("react.element"),r=h("react.portal"),o=h("react.fragment"),i=h("react.strict_mode"),a=h("react.profiler"),l=h("react.provider"),s=h("react.context"),c=h("react.forward_ref"),u=h("react.suspense"),d=h("react.suspense_list"),p=h("react.memo"),f=h("react.lazy"),h("react.block"),h("react.server.block"),h("react.fundamental"),h("react.debug_trace_mode"),h("react.legacy_hidden")}t.isContextConsumer=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case u:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case p:case l:return e;default:return t}}case r:return t}}}(e)===s}},4737(e,t,n){"use strict";e.exports=n(8989)},6691(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNavigator=t.isBrowser=t.off=t.on=t.noop=void 0,t.noop=function(){},t.on=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)},t.off=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)},t.isBrowser="undefined"!=typeof window,t.isNavigator="undefined"!=typeof navigator},2877(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1609);t.default=function(e){r.useEffect(e,[])}},47(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1635),o=n(1609),i=r.__importDefault(n(9905));t.default=function(e){var t=o.useRef(0),n=o.useState(e),r=n[0],a=n[1],l=o.useCallback(function(e){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){a(e)})},[]);return i.default(function(){cancelAnimationFrame(t.current)}),[r,l]}},9905(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1635),o=n(1609),i=r.__importDefault(n(2877));t.default=function(e){var t=o.useRef(e);t.current=e,i.default(function(){return function(){return t.current()}})}},4364(e,t,n){"use strict";var r=n(1635),o=n(1609),i=r.__importDefault(n(47)),a=n(6691);t.A=function(e){var t=void 0===e?{}:e,n=t.initialWidth,r=void 0===n?1/0:n,l=t.initialHeight,s=void 0===l?1/0:l,c=t.onChange,u=i.default({width:a.isBrowser?window.innerWidth:r,height:a.isBrowser?window.innerHeight:s}),d=u[0],p=u[1];return o.useEffect(function(){if(a.isBrowser){var e=function(){var e=window.innerWidth,t=window.innerHeight;p({width:e,height:t}),c&&c(e,t)};return a.on(window,"resize",e),function(){a.off(window,"resize",e)}}},[]),d}},4803(e,t,n){"use strict";var r=n(8859),o=n(9675),i=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+r(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return i(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=i(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t}},507(e,t,n){"use strict";var r=n(453),o=n(6556),i=n(8859),a=n(9675),l=r("%Map%",!0),s=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),d=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);e.exports=!!l&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(t){if(e){var n=d(e,t);return 0===p(e)&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,n){e||(e=new l),c(e,t,n)}};return t}},2271(e,t,n){"use strict";var r=n(453),o=n(6556),i=n(8859),a=n(507),l=n(9675),s=r("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);e.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new l("Side channel does not contain "+i(e))},delete:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&("object"==typeof n||"function"==typeof n)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&("object"==typeof n||"function"==typeof n)&&e?d(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,r)):a&&(t||(t=a()),t.set(n,r))}};return n}:a},920(e,t,n){"use strict";var r=n(9675),o=n(8859),i=n(4803),a=n(507),l=n(2271)||a||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=l()),e.set(t,n)}};return t}},4361(e,t,n){var r=n(8829),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function a(){this._array=[],this._set=i?new Map:Object.create(null)}a.fromArray=function(e,t){for(var n=new a,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},a.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(e,t){var n=i?e:r.toSetString(e),a=i?this.has(e):o.call(this._set,n),l=this._array.length;a&&!t||this._array.push(e),a||(i?this._set.set(e,l):this._set[n]=l)},a.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},a.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},a.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},a.prototype.toArray=function(){return this._array.slice()},t.C=a},582(e,t,n){var r=n(1642);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,a,l,s=e.length,c=0,u=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<u,u+=5}while(o);n.value=(l=(a=c)>>1,1&~a?l:-l),n.rest=t}},1642(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},6260(e,t,n){var r=n(8829);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,a,l;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,a=t.generatedColumn,l=n.generatedColumn,i>o||i==o&&l>=a||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=o},1527(e,t,n){var r=n(582),o=n(8829),i=n(4361).C,a=n(6260).P;function l(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=o.getArg(e,"ignoreInvalidMapping",!1),this._sources=new i,this._names=new i,this._mappings=new a,this._sourcesContents=null}l.prototype._version=3,l.fromSourceMap=function(e,t){var n=e.sourceRoot,r=new l(Object.assign(t||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=o.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var i=t;null!==n&&(i=o.relative(n,t)),r._sources.has(i)||r._sources.add(i);var a=e.sourceContentFor(t);null!=a&&r.setSourceContent(t,a)}),r},l.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);(this._skipValidation||!1!==this._validateMapping(t,n,r,i))&&(null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i}))},l.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},l.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var a=this._sourceRoot;null!=a&&(r=o.relative(a,r));var l=new i,s=new i;this._mappings.unsortedForEach(function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=a&&(t.source=o.relative(a,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||l.has(c)||l.add(c);var u=t.name;null==u||s.has(u)||s.add(u)},this),this._sources=l,this._names=s,e.sources.forEach(function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=a&&(t=o.relative(a,t)),this.setSourceContent(t,r))},this)},l.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column){var o="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(o),!1;throw new Error(o)}if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)){if(o="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}),this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(o),!1;throw new Error(o)}},l.prototype._serializeMappings=function(){for(var e,t,n,i,a=0,l=1,s=0,c=0,u=0,d=0,p="",f=this._mappings.toArray(),h=0,m=f.length;h<m;h++){if(e="",(t=f[h]).generatedLine!==l)for(a=0;t.generatedLine!==l;)e+=";",l++;else if(h>0){if(!o.compareByGeneratedPositionsInflated(t,f[h-1]))continue;e+=","}e+=r.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),p+=e}return p},l.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},l.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},l.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.x=l},8829(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}t.urlParse=o,t.urlGenerate=i;var a,l,s=(a=function(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var a=t.isAbsolute(n),l=[],s=0,c=0;;){if(s=c,-1===(c=n.indexOf("/",s))){l.push(n.slice(s));break}for(l.push(n.slice(s,c));c<n.length&&"/"===n[c];)c++}var u,d=0;for(c=l.length-1;c>=0;c--)"."===(u=l[c])?l.splice(c,1):".."===u?d++:d>0&&(""===u?(l.splice(c+1,d),d=0):(l.splice(c,2),d--));return""===(n=l.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n},l=[],function(e){for(var t=0;t<l.length;t++)if(l[t].input===e){var n=l[0];return l[0]=l[t],l[t]=n,l[0].result}var r=a(e);return l.unshift({input:e,result:r}),l.length>32&&l.pop(),r});function c(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,i(a)):l}t.normalize=s,t.join=c,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function d(e){return e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?d:function(e){return p(e)?"$"+e:e},t.fromSetString=u?d:function(e){return p(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=f(e.source,t.source);return 0!==r||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:f(e.name,t.name)},t.compareByOriginalPositionsNoSource=function(e,t,n){var r;return 0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)||n||0!==(r=e.generatedColumn-t.generatedColumn)||0!==(r=e.generatedLine-t.generatedLine)?r:f(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!==(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=f(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:f(e.name,t.name)},t.compareByGeneratedPositionsDeflatedNoLine=function(e,t,n){var r=e.generatedColumn-t.generatedColumn;return 0!==r||n||0!==(r=f(e.source,t.source))||0!==(r=e.originalLine-t.originalLine)||0!==(r=e.originalColumn-t.originalColumn)?r:f(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=f(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:f(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var a=r.path.lastIndexOf("/");a>=0&&(r.path=r.path.substring(0,a+1))}t=c(i(r),t)}return s(t)}},5229(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(9108)),i=n(8917);t.default=function(e,t){var n={};return e&&"string"==typeof e?((0,o.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n):n}},8917(e,t){"use strict";t.__esModule=!0,t.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,o=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||o.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,s):e.replace(i,s)).replace(r,l))}},9108(e,t,n){var r=n(9788);function o(e,t){var n,o=null;if(!e||"string"!=typeof e)return o;for(var i,a,l=r(e),s="function"==typeof t,c=0,u=l.length;c<u;c++)i=(n=l[c]).property,a=n.value,s?t(i,a,n):a&&(o||(o={}),o[i]=a);return o}e.exports=o,e.exports.default=o},9644(e,t,n){e.exports=function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e),o=n(t);const i=[{key:"title",getter:e=>e.getTitle()},{key:"html",getter:e=>e.getHtmlContainer()},{key:"confirmButtonText",getter:e=>e.getConfirmButton()},{key:"denyButtonText",getter:e=>e.getDenyButton()},{key:"cancelButtonText",getter:e=>e.getCancelButton()},{key:"footer",getter:e=>e.getFooter()},{key:"closeButtonHtml",getter:e=>e.getCloseButton()},{key:"iconHtml",getter:e=>e.getIcon().querySelector(".swal2-icon-content")},{key:"loaderHtml",getter:e=>e.getLoader()}],a=()=>{};return function(e){function t(e){const t={},n={},o=i.map(e=>e.key);return Object.entries(e).forEach(([e,i])=>{o.includes(e)&&r.default.isValidElement(i)?(t[e]=i,n[e]=" "):n[e]=i}),[t,n]}function n(t,n){Object.entries(n).forEach(([n,r])=>{const a=i.find(e=>e.key===n).getter(e);o.default.render(r,a),t.__mountedDomElements.push(a)})}function l(e){e.__mountedDomElements.forEach(e=>{o.default.unmountComponentAtNode(e)}),e.__mountedDomElements=[]}return class extends e{static argsToParams(t){if(r.default.isValidElement(t[0])||r.default.isValidElement(t[1])){const e={};return["title","html","icon"].forEach((n,r)=>{void 0!==t[r]&&(e[n]=t[r])}),e}return e.argsToParams(t)}_main(e,r){this.__mountedDomElements=[],this.__params=Object.assign({},r,e);const[o,i]=t(this.__params),s=i.didOpen||a,c=i.didDestroy||a;return super._main(Object.assign({},i,{didOpen:e=>{n(this,o),s(e)},didDestroy:e=>{c(e),l(this)}}))}update(e){Object.assign(this.__params,e),l(this);const[r,o]=t(this.__params);super.update(o),n(this,r)}}}}(n(1609),n(5795))},8465(e){e.exports=function(){"use strict";const e="SweetAlert2:",t=e=>e.charAt(0).toUpperCase()+e.slice(1),n=e=>Array.prototype.slice.call(e),r=t=>{console.warn("".concat(e," ").concat("object"==typeof t?t.join(" "):t))},o=t=>{console.error("".concat(e," ").concat(t))},i=[],a=(e,t)=>{var n;n='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),i.includes(n)||(i.push(n),r(n))},l=e=>"function"==typeof e?e():e,s=e=>e&&"function"==typeof e.toPromise,c=e=>s(e)?e.toPromise():Promise.resolve(e),u=e=>e&&Promise.resolve(e)===e,d={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},p=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],f={},h=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],m=e=>Object.prototype.hasOwnProperty.call(d,e),g=e=>-1!==p.indexOf(e),v=e=>f[e],y=e=>{m(e)||r('Unknown parameter "'.concat(e,'"'))},b=e=>{h.includes(e)&&r('The parameter "'.concat(e,'" is incompatible with toasts'))},w=e=>{v(e)&&a(e,v(e))},E=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t},k=E(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),O=E(["success","warning","info","question","error"]),S=()=>document.body.querySelector(".".concat(k.container)),x=e=>{const t=S();return t?t.querySelector(e):null},_=e=>x(".".concat(e)),C=()=>_(k.popup),D=()=>_(k.icon),P=()=>_(k.title),A=()=>_(k["html-container"]),T=()=>_(k.image),F=()=>_(k["progress-steps"]),M=()=>_(k["validation-message"]),I=()=>x(".".concat(k.actions," .").concat(k.confirm)),N=()=>x(".".concat(k.actions," .").concat(k.deny)),j=()=>x(".".concat(k.loader)),L=()=>x(".".concat(k.actions," .").concat(k.cancel)),R=()=>_(k.actions),B=()=>_(k.footer),z=()=>_(k["timer-progress-bar"]),W=()=>_(k.close),U=()=>{const e=n(C().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>{const n=parseInt(e.getAttribute("tabindex")),r=parseInt(t.getAttribute("tabindex"));return n>r?1:n<r?-1:0}),t=n(C().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(e=>"-1"!==e.getAttribute("tabindex"));return(e=>{const t=[];for(let n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t})(e.concat(t)).filter(e=>ae(e))},V=()=>Q(document.body,k.shown)&&!Q(document.body,k["toast-shown"])&&!Q(document.body,k["no-backdrop"]),H=()=>C()&&Q(C(),k.toast),G={previousBodyPadding:null},q=(e,t)=>{if(e.textContent="",t){const r=(new DOMParser).parseFromString(t,"text/html");n(r.querySelector("head").childNodes).forEach(t=>{e.appendChild(t)}),n(r.querySelector("body").childNodes).forEach(t=>{e.appendChild(t)})}},Q=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},$=(e,t,o)=>{if(((e,t)=>{n(e.classList).forEach(n=>{Object.values(k).includes(n)||Object.values(O).includes(n)||Object.values(t.showClass).includes(n)||e.classList.remove(n)})})(e,t),t.customClass&&t.customClass[o]){if("string"!=typeof t.customClass[o]&&!t.customClass[o].forEach)return r("Invalid type of customClass.".concat(o,'! Expected string or iterable object, got "').concat(typeof t.customClass[o],'"'));Z(e,t.customClass[o])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(k.popup," > .").concat(k[t]));case"checkbox":return e.querySelector(".".concat(k.popup," > .").concat(k.checkbox," input"));case"radio":return e.querySelector(".".concat(k.popup," > .").concat(k.radio," input:checked"))||e.querySelector(".".concat(k.popup," > .").concat(k.radio," input:first-child"));case"range":return e.querySelector(".".concat(k.popup," > .").concat(k.range," input"));default:return e.querySelector(".".concat(k.popup," > .").concat(k.input))}},X=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},K=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},Z=(e,t)=>{K(e,t,!0)},J=(e,t)=>{K(e,t,!1)},ee=(e,t)=>{const r=n(e.childNodes);for(let e=0;e<r.length;e++)if(Q(r[e],t))return r[e]},te=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},ne=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e.style.display=t},re=e=>{e.style.display="none"},oe=(e,t,n,r)=>{const o=e.querySelector(t);o&&(o.style[n]=r)},ie=(e,t,n)=>{t?ne(e,n):re(e)},ae=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),le=e=>!!(e.scrollHeight>e.clientHeight),se=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ce=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=z();ae(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},ue=()=>"undefined"==typeof window||"undefined"==typeof document,de={},pe=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;de.restoreFocusTimeout=setTimeout(()=>{de.previousActiveElement&&de.previousActiveElement.focus?(de.previousActiveElement.focus(),de.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(n,r)}),fe='\n <div aria-labelledby="'.concat(k.title,'" aria-describedby="').concat(k["html-container"],'" class="').concat(k.popup,'" tabindex="-1">\n <button type="button" class="').concat(k.close,'"></button>\n <ul class="').concat(k["progress-steps"],'"></ul>\n <div class="').concat(k.icon,'"></div>\n <img class="').concat(k.image,'" />\n <h2 class="').concat(k.title,'" id="').concat(k.title,'"></h2>\n <div class="').concat(k["html-container"],'" id="').concat(k["html-container"],'"></div>\n <input class="').concat(k.input,'" />\n <input type="file" class="').concat(k.file,'" />\n <div class="').concat(k.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(k.select,'"></select>\n <div class="').concat(k.radio,'"></div>\n <label for="').concat(k.checkbox,'" class="').concat(k.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(k.label,'"></span>\n </label>\n <textarea class="').concat(k.textarea,'"></textarea>\n <div class="').concat(k["validation-message"],'" id="').concat(k["validation-message"],'"></div>\n <div class="').concat(k.actions,'">\n <div class="').concat(k.loader,'"></div>\n <button type="button" class="').concat(k.confirm,'"></button>\n <button type="button" class="').concat(k.deny,'"></button>\n <button type="button" class="').concat(k.cancel,'"></button>\n </div>\n <div class="').concat(k.footer,'"></div>\n <div class="').concat(k["timer-progress-bar-container"],'">\n <div class="').concat(k["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),he=()=>{de.currentInstance.resetValidationMessage()},me=e=>{const t=(()=>{const e=S();return!!e&&(e.remove(),J([document.documentElement,document.body],[k["no-backdrop"],k["toast-shown"],k["has-column"]]),!0)})();if(ue())return void o("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=k.container,t&&Z(n,k["no-transition"]),q(n,fe);const r="string"==typeof(i=e.target)?document.querySelector(i):i;var i;r.appendChild(n),(e=>{const t=C();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Z(S(),k.rtl)})(r),(()=>{const e=C(),t=ee(e,k.input),n=ee(e,k.file),r=e.querySelector(".".concat(k.range," input")),o=e.querySelector(".".concat(k.range," output")),i=ee(e,k.select),a=e.querySelector(".".concat(k.checkbox," input")),l=ee(e,k.textarea);t.oninput=he,n.onchange=he,i.onchange=he,a.onchange=he,l.oninput=he,r.oninput=()=>{he(),o.value=r.value},r.onchange=()=>{he(),r.nextSibling.value=r.value}})()},ge=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ve(e,t):e&&q(t,e)},ve=(e,t)=>{e.jquery?ye(t,e):q(t,e.toString())},ye=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},be=(()=>{if(ue())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),we=(e,t)=>{const n=R(),r=j();t.showConfirmButton||t.showDenyButton||t.showCancelButton?ne(n):re(n),$(n,t,"actions"),function(e,t,n){const r=I(),o=N(),i=L();Ee(r,"confirm",n),Ee(o,"deny",n),Ee(i,"cancel",n),function(e,t,n,r){if(!r.buttonsStyling)return J([e,t,n],k.styled);Z([e,t,n],k.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,Z(e,k["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,Z(t,k["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,Z(n,k["default-outline"]))}(r,o,i,n),n.reverseButtons&&(n.toast?(e.insertBefore(i,r),e.insertBefore(o,r)):(e.insertBefore(i,t),e.insertBefore(o,t),e.insertBefore(r,t)))}(n,r,t),q(r,t.loaderHtml),$(r,t,"loader")};function Ee(e,n,r){ie(e,r["show".concat(t(n),"Button")],"inline-block"),q(e,r["".concat(n,"ButtonText")]),e.setAttribute("aria-label",r["".concat(n,"ButtonAriaLabel")]),e.className=k[n],$(e,r,"".concat(n,"Button")),Z(e,r["".concat(n,"ButtonClass")])}const ke=(e,t)=>{const n=S();n&&(function(e,t){"string"==typeof t?e.style.background=t:t||Z([document.documentElement,document.body],k["no-backdrop"])}(n,t.backdrop),function(e,t){t in k?Z(e,k[t]):(r('The "position" parameter is not valid, defaulting to "center"'),Z(e,k.center))}(n,t.position),function(e,t){if(t&&"string"==typeof t){const n="grow-".concat(t);n in k&&Z(e,k[n])}}(n,t.grow),$(n,t,"container"))};var Oe={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Se=["input","file","range","select","radio","checkbox","textarea"],xe=e=>{if(!Te[e.input])return o('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Ae(e.input),n=Te[e.input](t,e);ne(n),setTimeout(()=>{X(n)})},_e=(e,t)=>{const n=Y(C(),e);if(n){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}})(n);for(const e in t)n.setAttribute(e,t[e])}},Ce=e=>{const t=Ae(e.input);e.customClass&&Z(t,e.customClass.input)},De=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Pe=(e,t,n)=>{if(n.inputLabel){e.id=k.input;const r=document.createElement("label"),o=k["input-label"];r.setAttribute("for",e.id),r.className=o,Z(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Ae=e=>{const t=k[e]?k[e]:k.input;return ee(C(),t)},Te={};Te.text=Te.email=Te.password=Te.number=Te.tel=Te.url=(e,t)=>("string"==typeof t.inputValue||"number"==typeof t.inputValue?e.value=t.inputValue:u(t.inputValue)||r('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),Pe(e,e,t),De(e,t),e.type=t.input,e),Te.file=(e,t)=>(Pe(e,e,t),De(e,t),e),Te.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,r.value=t.inputValue,Pe(n,e,t),e},Te.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");q(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Pe(e,e,t),e},Te.radio=e=>(e.textContent="",e),Te.checkbox=(e,t)=>{const n=Y(C(),"checkbox");n.value="1",n.id=k.checkbox,n.checked=Boolean(t.inputValue);const r=e.querySelector("span");return q(r,t.inputPlaceholder),e},Te.textarea=(e,t)=>{e.value=t.inputValue,De(e,t),Pe(e,e,t);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(C()).width);new MutationObserver(()=>{const n=e.offsetWidth+(r=e,parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight));var r;C().style.width=n>t?"".concat(n,"px"):null}).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const Fe=(e,t)=>{const n=A();$(n,t,"htmlContainer"),t.html?(ge(t.html,n),ne(n,"block")):t.text?(n.textContent=t.text,ne(n,"block")):re(n),((e,t)=>{const n=C(),r=Oe.innerParams.get(e),o=!r||t.input!==r.input;Se.forEach(e=>{const r=k[e],i=ee(n,r);_e(e,t.inputAttributes),i.className=r,o&&re(i)}),t.input&&(o&&xe(t),Ce(t))})(e,t)},Me=(e,t)=>{for(const n in O)t.icon!==n&&J(e,O[n]);Z(e,O[t.icon]),je(e,t),Ie(),$(e,t,"icon")},Ie=()=>{const e=C(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},Ne=(e,t)=>{e.textContent="",t.iconHtml?q(e,Le(t.iconHtml)):"success"===t.icon?q(e,'\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n'):"error"===t.icon?q(e,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n'):q(e,Le({question:"?",warning:"!",info:"i"}[t.icon]))},je=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},Le=e=>'<div class="'.concat(k["icon-content"],'">').concat(e,"</div>"),Re=(e,t)=>{const n=F();if(!t.progressSteps||0===t.progressSteps.length)return re(n);ne(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&r("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((e,r)=>{const o=(e=>{const t=document.createElement("li");return Z(t,k["progress-step"]),q(t,e),t})(e);if(n.appendChild(o),r===t.currentProgressStep&&Z(o,k["active-progress-step"]),r!==t.progressSteps.length-1){const e=(e=>{const t=document.createElement("li");return Z(t,k["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t})(t);n.appendChild(e)}})},Be=(e,t)=>{e.className="".concat(k.popup," ").concat(ae(e)?t.showClass.popup:""),t.toast?(Z([document.documentElement,document.body],k["toast-shown"]),Z(e,k.toast)):Z(e,k.modal),$(e,t,"popup"),"string"==typeof t.customClass&&Z(e,t.customClass),t.icon&&Z(e,k["icon-".concat(t.icon)])},ze=(e,t)=>{((e,t)=>{const n=S(),r=C();t.toast?(te(n,"width",t.width),r.style.width="100%",r.insertBefore(j(),D())):te(r,"width",t.width),te(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),re(M()),Be(r,t)})(0,t),ke(0,t),Re(0,t),((e,t)=>{const n=Oe.innerParams.get(e),r=D();n&&t.icon===n.icon?(Ne(r,t),Me(r,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(O).indexOf(t.icon)?(o('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),re(r)):(ne(r),Ne(r,t),Me(r,t),Z(r,t.showClass.icon)):re(r)})(e,t),((e,t)=>{const n=T();if(!t.imageUrl)return re(n);ne(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),te(n,"width",t.imageWidth),te(n,"height",t.imageHeight),n.className=k.image,$(n,t,"image")})(0,t),((e,t)=>{const n=P();ie(n,t.title||t.titleText,"block"),t.title&&ge(t.title,n),t.titleText&&(n.innerText=t.titleText),$(n,t,"title")})(0,t),((e,t)=>{const n=W();q(n,t.closeButtonHtml),$(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)})(0,t),Fe(e,t),we(0,t),((e,t)=>{const n=B();ie(n,t.footer),t.footer&&ge(t.footer,n),$(n,t,"footer")})(0,t),"function"==typeof t.didRender&&t.didRender(C())},We=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ue=()=>{n(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Ve=["swal-title","swal-html","swal-footer"],He=e=>{const t={};return n(e.querySelectorAll("swal-param")).forEach(e=>{Ke(e,["name","value"]);const n=e.getAttribute("name"),r=e.getAttribute("value");"boolean"==typeof d[n]&&"false"===r&&(t[n]=!1),"object"==typeof d[n]&&(t[n]=JSON.parse(r))}),t},Ge=e=>{const r={};return n(e.querySelectorAll("swal-button")).forEach(e=>{Ke(e,["type","color","aria-label"]);const n=e.getAttribute("type");r["".concat(n,"ButtonText")]=e.innerHTML,r["show".concat(t(n),"Button")]=!0,e.hasAttribute("color")&&(r["".concat(n,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(r["".concat(n,"ButtonAriaLabel")]=e.getAttribute("aria-label"))}),r},qe=e=>{const t={},n=e.querySelector("swal-image");return n&&(Ke(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},Qe=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Ke(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},$e=e=>{const t={},r=e.querySelector("swal-input");r&&(Ke(r,["type","label","placeholder","value"]),t.input=r.getAttribute("type")||"text",r.hasAttribute("label")&&(t.inputLabel=r.getAttribute("label")),r.hasAttribute("placeholder")&&(t.inputPlaceholder=r.getAttribute("placeholder")),r.hasAttribute("value")&&(t.inputValue=r.getAttribute("value")));const o=e.querySelectorAll("swal-input-option");return o.length&&(t.inputOptions={},n(o).forEach(e=>{Ke(e,["value"]);const n=e.getAttribute("value"),r=e.innerHTML;t.inputOptions[n]=r})),t},Ye=(e,t)=>{const n={};for(const r in t){const o=t[r],i=e.querySelector(o);i&&(Ke(i,[]),n[o.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},Xe=e=>{const t=Ve.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);n(e.children).forEach(e=>{const n=e.tagName.toLowerCase();-1===t.indexOf(n)&&r("Unrecognized element <".concat(n,">"))})},Ke=(e,t)=>{n(e.attributes).forEach(n=>{-1===t.indexOf(n.name)&&r(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})};var Ze={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function Je(e){(function(e){e.inputValidator||Object.keys(Ze).forEach(t=>{e.input===t&&(e.inputValidator=Ze[t])})})(e),e.showLoaderOnConfirm&&!e.preConfirm&&r("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(r('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),me(e)}class et{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const tt=()=>{null===G.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(G.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(G.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=k["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},nt=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);if(t&&n&&!e.match(/CriOS/i)){const e=44;C().scrollHeight>window.innerHeight-e&&(S().style.paddingBottom="".concat(e,"px"))}},rt=()=>{const e=S();let t;e.ontouchstart=e=>{t=ot(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},ot=e=>{const t=e.target,n=S();return!(it(e)||at(e)||t!==n&&(le(n)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||le(A())&&A().contains(t)))},it=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,at=e=>e.touches&&e.touches.length>1,lt=e=>{const t=S(),r=C();"function"==typeof e.willOpen&&e.willOpen(r);const o=window.getComputedStyle(document.body).overflowY;dt(t,r,e),setTimeout(()=>{ct(t,r)},10),V()&&(ut(t,e.scrollbarPadding,o),n(document.body.children).forEach(e=>{e===S()||e.contains(S())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})),H()||de.previousActiveElement||(de.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(r)),J(t,k["no-transition"])},st=e=>{const t=C();if(e.target!==t)return;const n=S();t.removeEventListener(be,st),n.style.overflowY="auto"},ct=(e,t)=>{be&&se(t)?(e.style.overflowY="hidden",t.addEventListener(be,st)):e.style.overflowY="auto"},ut=(e,t,n)=>{(()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!Q(document.body,k.iosfix)){const e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),Z(document.body,k.iosfix),rt(),nt()}})(),t&&"hidden"!==n&&tt(),setTimeout(()=>{e.scrollTop=0})},dt=(e,t,n)=>{Z(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),ne(t,"grid"),setTimeout(()=>{Z(t,n.showClass.popup),t.style.removeProperty("opacity")},10),Z([document.documentElement,document.body],k.shown),n.heightAuto&&n.backdrop&&!n.toast&&Z([document.documentElement,document.body],k["height-auto"])},pt=e=>{let t=C();t||new xn,t=C();const n=j();H()?re(D()):ft(t,e),ne(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},ft=(e,t)=>{const n=R(),r=j();!t&&ae(I())&&(t=I()),ne(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),Z([e,n],k.loading)},ht=e=>e.checked?1:0,mt=e=>e.checked?e.value:null,gt=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,vt=(e,t)=>{const n=C(),r=e=>bt[t.input](n,wt(e),t);s(t.inputOptions)||u(t.inputOptions)?(pt(I()),c(t.inputOptions).then(t=>{e.hideLoading(),r(t)})):"object"==typeof t.inputOptions?r(t.inputOptions):o("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},yt=(e,t)=>{const n=e.getInput();re(n),c(t.inputValue).then(r=>{n.value="number"===t.input?parseFloat(r)||0:"".concat(r),ne(n),n.focus(),e.hideLoading()}).catch(t=>{o("Error in inputValue promise: ".concat(t)),n.value="",ne(n),n.focus(),e.hideLoading()})},bt={select:(e,t,n)=>{const r=ee(e,k.select),o=(e,t,r)=>{const o=document.createElement("option");o.value=r,q(o,t),o.selected=Et(r,n.inputValue),e.appendChild(o)};t.forEach(e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,r.appendChild(e),n.forEach(t=>o(e,t[1],t[0]))}else o(r,n,t)}),r.focus()},radio:(e,t,n)=>{const r=ee(e,k.radio);t.forEach(e=>{const t=e[0],o=e[1],i=document.createElement("input"),a=document.createElement("label");i.type="radio",i.name=k.radio,i.value=t,Et(t,n.inputValue)&&(i.checked=!0);const l=document.createElement("span");q(l,o),l.className=k.label,a.appendChild(i),a.appendChild(l),r.appendChild(a)});const o=r.querySelectorAll("input");o.length&&o[0].focus()}},wt=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach((e,n)=>{let r=e;"object"==typeof r&&(r=wt(r)),t.push([n,r])}):Object.keys(e).forEach(n=>{let r=e[n];"object"==typeof r&&(r=wt(r)),t.push([n,r])}),t},Et=(e,t)=>t&&t.toString()===e.toString();function kt(){const e=Oe.innerParams.get(this);if(!e)return;const t=Oe.domCache.get(this);re(t.loader),H()?e.icon&&ne(D()):Ot(t),J([t.popup,t.actions],k.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Ot=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?ne(t[0],"inline-block"):!ae(I())&&!ae(N())&&!ae(L())&&re(e.actions)};var St={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const xt=()=>I()&&I().click(),_t=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Ct=(e,t,n)=>{const r=U();if(r.length)return(t+=n)===r.length?t=0:-1===t&&(t=r.length-1),r[t].focus();C().focus()},Dt=["ArrowRight","ArrowDown"],Pt=["ArrowLeft","ArrowUp"],At=(e,t,n)=>{const r=Oe.innerParams.get(e);r&&(t.isComposing||229===t.keyCode||(r.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Tt(e,t,r):"Tab"===t.key?Ft(t,r):[...Dt,...Pt].includes(t.key)?Mt(t.key):"Escape"===t.key&&It(t,r,n)))},Tt=(e,t,n)=>{if(l(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;xt(),t.preventDefault()}},Ft=(e,t)=>{const n=e.target,r=U();let o=-1;for(let e=0;e<r.length;e++)if(n===r[e]){o=e;break}e.shiftKey?Ct(0,o,-1):Ct(0,o,1),e.stopPropagation(),e.preventDefault()},Mt=e=>{if(![I(),N(),L()].includes(document.activeElement))return;const t=Dt.includes(e)?"nextElementSibling":"previousElementSibling";let n=document.activeElement;for(let e=0;e<R().children.length;e++){if(n=n[t],!n)return;if(ae(n)&&n instanceof HTMLButtonElement)break}n instanceof HTMLButtonElement&&n.focus()},It=(e,t,n)=>{l(t.allowEscapeKey)&&(e.preventDefault(),n(We.esc))};function Nt(e,t,n,r){H()?Ut(e,r):(pe(n).then(()=>Ut(e,r)),_t(de)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),V()&&(null!==G.previousBodyPadding&&(document.body.style.paddingRight="".concat(G.previousBodyPadding,"px"),G.previousBodyPadding=null),(()=>{if(Q(document.body,k.iosfix)){const e=parseInt(document.body.style.top,10);J(document.body,k.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Ue()),J([document.documentElement,document.body],[k.shown,k["height-auto"],k["no-backdrop"],k["toast-shown"]])}function jt(e){e=Bt(e);const t=St.swalPromiseResolve.get(this),n=Lt(this);this.isAwaitingPromise()?e.isDismissed||(Rt(this),t(e)):n&&t(e)}const Lt=e=>{const t=C();if(!t)return!1;const n=Oe.innerParams.get(e);if(!n||Q(t,n.hideClass.popup))return!1;J(t,n.showClass.popup),Z(t,n.hideClass.popup);const r=S();return J(r,n.showClass.backdrop),Z(r,n.hideClass.backdrop),zt(e,t,n),!0};const Rt=e=>{e.isAwaitingPromise()&&(Oe.awaitingPromise.delete(e),Oe.innerParams.get(e)||e._destroy())},Bt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),zt=(e,t,n)=>{const r=S(),o=be&&se(t);"function"==typeof n.willClose&&n.willClose(t),o?Wt(e,t,r,n.returnFocus,n.didClose):Nt(e,r,n.returnFocus,n.didClose)},Wt=(e,t,n,r,o)=>{de.swalCloseEventFinishedCallback=Nt.bind(null,e,n,r,o),t.addEventListener(be,function(e){e.target===t&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback)})},Ut=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function Vt(e,t,n){const r=Oe.domCache.get(e);t.forEach(e=>{r[e].disabled=n})}function Ht(e,t){if(!e)return!1;if("radio"===e.type){const n=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;e<n.length;e++)n[e].disabled=t}else e.disabled=t}const Gt=e=>{const t={};return Object.keys(e).forEach(n=>{g(n)?t[n]=e[n]:r('Invalid parameter to update: "'.concat(n,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}),t};const qt=e=>{Qt(e),delete e.params,delete de.keydownHandler,delete de.keydownTarget,delete de.currentInstance},Qt=e=>{e.isAwaitingPromise()?($t(Oe,e),Oe.awaitingPromise.set(e,!0)):($t(St,e),$t(Oe,e))},$t=(e,t)=>{for(const n in e)e[n].delete(t)};var Yt=Object.freeze({hideLoading:kt,disableLoading:kt,getInput:function(e){const t=Oe.innerParams.get(e||this),n=Oe.domCache.get(e||this);return n?Y(n.popup,t.input):null},close:jt,isAwaitingPromise:function(){return!!Oe.awaitingPromise.get(this)},rejectPromise:function(e){const t=St.swalPromiseReject.get(this);Rt(this),t&&t(e)},handleAwaitingPromise:Rt,closePopup:jt,closeModal:jt,closeToast:jt,enableButtons:function(){Vt(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){Vt(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Ht(this.getInput(),!1)},disableInput:function(){return Ht(this.getInput(),!0)},showValidationMessage:function(e){const t=Oe.domCache.get(this),n=Oe.innerParams.get(this);q(t.validationMessage,e),t.validationMessage.className=k["validation-message"],n.customClass&&n.customClass.validationMessage&&Z(t.validationMessage,n.customClass.validationMessage),ne(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",k["validation-message"]),X(r),Z(r,k.inputerror))},resetValidationMessage:function(){const e=Oe.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),J(t,k.inputerror))},getProgressSteps:function(){return Oe.domCache.get(this).progressSteps},update:function(e){const t=C(),n=Oe.innerParams.get(this);if(!t||Q(t,n.hideClass.popup))return r("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o=Gt(e),i=Object.assign({},n,o);ze(this,i),Oe.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){const e=Oe.domCache.get(this),t=Oe.innerParams.get(this);t?(e.popup&&de.swalCloseEventFinishedCallback&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback),de.deferDisposalTimer&&(clearTimeout(de.deferDisposalTimer),delete de.deferDisposalTimer),"function"==typeof t.didDestroy&&t.didDestroy(),qt(this)):Qt(this)}});const Xt=(e,n)=>{const r=Oe.innerParams.get(e);if(!r.input)return o('The "input" parameter is needed to be set when using returnInputValueOn'.concat(t(n)));const i=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ht(n);case"radio":return mt(n);case"file":return gt(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,r);r.inputValidator?Kt(e,i,n):e.getInput().checkValidity()?"deny"===n?Zt(e,i):tn(e,i):(e.enableButtons(),e.showValidationMessage(r.validationMessage))},Kt=(e,t,n)=>{const r=Oe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>c(r.inputValidator(t,r.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):"deny"===n?Zt(e,t):tn(e,t)})},Zt=(e,t)=>{const n=Oe.innerParams.get(e||void 0);n.showLoaderOnDeny&&pt(N()),n.preDeny?(Oe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>c(n.preDeny(t,n.validationMessage))).then(n=>{!1===n?(e.hideLoading(),Rt(e)):e.closePopup({isDenied:!0,value:void 0===n?t:n})}).catch(t=>en(e||void 0,t))):e.closePopup({isDenied:!0,value:t})},Jt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},en=(e,t)=>{e.rejectPromise(t)},tn=(e,t)=>{const n=Oe.innerParams.get(e||void 0);n.showLoaderOnConfirm&&pt(),n.preConfirm?(e.resetValidationMessage(),Oe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>c(n.preConfirm(t,n.validationMessage))).then(n=>{ae(M())||!1===n?(e.hideLoading(),Rt(e)):Jt(e,void 0===n?t:n)}).catch(t=>en(e||void 0,t))):Jt(e,t)},nn=(e,t,n)=>{t.popup.onclick=()=>{const t=Oe.innerParams.get(e);t&&(rn(t)||t.timer||t.input)||n(We.close)}},rn=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let on=!1;const an=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(on=!0)}}},ln=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(on=!0)}}},sn=(e,t,n)=>{t.container.onclick=r=>{const o=Oe.innerParams.get(e);on?on=!1:r.target===t.container&&l(o.allowOutsideClick)&&n(We.backdrop)}},cn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const un=()=>{if(de.timeout)return(()=>{const e=z(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.removeProperty("transition"),e.style.width="".concat(n,"%")})(),de.timeout.stop()},dn=()=>{if(de.timeout){const e=de.timeout.start();return ce(e),e}};let pn=!1;const fn={};const hn=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in fn){const n=t.getAttribute(e);if(n)return void fn[e].fire({template:n})}};var mn=Object.freeze({isValidParameter:m,isUpdatableParameter:g,isDeprecatedParameter:v,argsToParams:e=>{const t={};return"object"!=typeof e[0]||cn(e[0])?["title","html","icon"].forEach((n,r)=>{const i=e[r];"string"==typeof i||cn(i)?t[n]=i:void 0!==i&&o("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof i))}):Object.assign(t,e[0]),t},isVisible:()=>ae(C()),clickConfirm:xt,clickDeny:()=>N()&&N().click(),clickCancel:()=>L()&&L().click(),getContainer:S,getPopup:C,getTitle:P,getHtmlContainer:A,getImage:T,getIcon:D,getInputLabel:()=>_(k["input-label"]),getCloseButton:W,getActions:R,getConfirmButton:I,getDenyButton:N,getCancelButton:L,getLoader:j,getFooter:B,getTimerProgressBar:z,getFocusableElements:U,getValidationMessage:M,isLoading:()=>C().hasAttribute("data-loading"),fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},showLoading:pt,enableLoading:pt,getTimerLeft:()=>de.timeout&&de.timeout.getTimerLeft(),stopTimer:un,resumeTimer:dn,toggleTimer:()=>{const e=de.timeout;return e&&(e.running?un():dn())},increaseTimer:e=>{if(de.timeout){const t=de.timeout.increase(e);return ce(t,!0),t}},isTimerRunning:()=>de.timeout&&de.timeout.isRunning(),bindClickHandler:function(){fn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,pn||(document.body.addEventListener("click",hn),pn=!0)}});let gn;class vn{constructor(){if("undefined"==typeof window)return;gn=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:r,writable:!1,enumerable:!0,configurable:!0}});const o=this._main(this.params);Oe.promise.set(this,o)}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!e.backdrop&&e.allowOutsideClick&&r('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)y(t),e.toast&&b(t),w(t)})(Object.assign({},t,e)),de.currentInstance&&(de.currentInstance._destroy(),V()&&Ue()),de.currentInstance=this;const n=bn(e,t);Je(n),Object.freeze(n),de.timeout&&(de.timeout.stop(),delete de.timeout),clearTimeout(de.restoreFocusTimeout);const o=wn(this);return ze(this,n),Oe.innerParams.set(this,n),yn(this,o,n)}then(e){return Oe.promise.get(this).then(e)}finally(e){return Oe.promise.get(this).finally(e)}}const yn=(e,t,n)=>new Promise((r,o)=>{const i=t=>{e.closePopup({isDismissed:!0,dismiss:t})};St.swalPromiseResolve.set(e,r),St.swalPromiseReject.set(e,o),t.confirmButton.onclick=()=>(e=>{const t=Oe.innerParams.get(e);e.disableButtons(),t.input?Xt(e,"confirm"):tn(e,!0)})(e),t.denyButton.onclick=()=>(e=>{const t=Oe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Xt(e,"deny"):Zt(e,!1)})(e),t.cancelButton.onclick=()=>((e,t)=>{e.disableButtons(),t(We.cancel)})(e,i),t.closeButton.onclick=()=>i(We.close),((e,t,n)=>{Oe.innerParams.get(e).toast?nn(e,t,n):(an(t),ln(t),sn(e,t,n))})(e,t,i),((e,t,n,r)=>{_t(t),n.toast||(t.keydownHandler=t=>At(e,t,r),t.keydownTarget=n.keydownListenerCapture?window:C(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(e,de,n,i),((e,t)=>{"select"===t.input||"radio"===t.input?vt(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(s(t.inputValue)||u(t.inputValue))&&(pt(I()),yt(e,t))})(e,n),lt(n),En(de,n,i),kn(t,n),setTimeout(()=>{t.container.scrollTop=0})}),bn=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Xe(n),Object.assign(He(n),Ge(n),qe(n),Qe(n),$e(n),Ye(n,Ve))})(e),r=Object.assign({},d,t,n,e);return r.showClass=Object.assign({},d.showClass,r.showClass),r.hideClass=Object.assign({},d.hideClass,r.hideClass),r},wn=e=>{const t={popup:C(),container:S(),actions:R(),confirmButton:I(),denyButton:N(),cancelButton:L(),loader:j(),closeButton:W(),validationMessage:M(),progressSteps:F()};return Oe.domCache.set(e,t),t},En=(e,t,n)=>{const r=z();re(r),t.timer&&(e.timeout=new et(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(ne(r),$(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ce(t.timer)})))},kn=(e,t)=>{if(!t.toast)return l(t.allowEnterKey)?void(On(e,t)||Ct(0,-1,1)):Sn()},On=(e,t)=>t.focusDeny&&ae(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ae(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ae(e.confirmButton)||(e.confirmButton.focus(),0)),Sn=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Object.assign(vn.prototype,Yt),Object.assign(vn,mn),Object.keys(Yt).forEach(e=>{vn[e]=function(){if(gn)return gn[e](...arguments)}}),vn.DismissReason=We,vn.version="11.4.8";const xn=vn;return xn.default=xn,xn}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}')},4552(e){"use strict";var t={linear:function(e,t,n,r){return(n-t)*e/r+t},easeInQuad:function(e,t,n,r){return(n-t)*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-(n-t)*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e+t:-o/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return(n-t)*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return(n-t)*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return(n-t)*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-(n-t)*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e+t:-o/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return(n-t)*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return(n-t)*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?o/2*e*e*e*e*e+t:o/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){var o=n-t;return-o*Math.cos(e/r*(Math.PI/2))+o+t},easeOutSine:function(e,t,n,r){return(n-t)*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-(n-t)/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0==e?t:(n-t)*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){var o=n-t;return e==r?t+o:o*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){var o=n-t;return 0===e?t:e===r?t+o:(e/=r/2)<1?o/2*Math.pow(2,10*(e-1))+t:o/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-(n-t)*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return(n-t)*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){var o=n-t;return(e/=r/2)<1?-o/2*(Math.sqrt(1-e*e)-1)+t:o/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:1===(e/=r)?t+l:((i=0)||(i=.3*r),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),-o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)+t)},easeOutElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:1===(e/=r)?t+l:((i=0)||(i=.3*r),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),o*Math.pow(2,-10*e)*Math.sin((e*r-a)*(2*Math.PI)/i)+l+t)},easeInOutElastic:function(e,t,n,r){var o,i,a,l=n-t;return a=1.70158,0===e?t:2==(e/=r/2)?t+l:((i=0)||(i=r*(.3*1.5)),(o=l)<Math.abs(l)?(o=l,a=i/4):a=i/(2*Math.PI)*Math.asin(l/o),e<1?o*Math.pow(2,10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)*-.5+t:o*Math.pow(2,-10*(e-=1))*Math.sin((e*r-a)*(2*Math.PI)/i)*.5+l+t)},easeInBack:function(e,t,n,r,o){return void 0===o&&(o=1.70158),(n-t)*(e/=r)*e*((o+1)*e-o)+t},easeOutBack:function(e,t,n,r,o){return void 0===o&&(o=1.70158),(n-t)*((e=e/r-1)*e*((o+1)*e+o)+1)+t},easeInOutBack:function(e,t,n,r,o){var i=n-t;return void 0===o&&(o=1.70158),(e/=r/2)<1?i/2*(e*e*((1+(o*=1.525))*e-o))+t:i/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},easeInBounce:function(e,n,r,o){var i=r-n;return i-t.easeOutBounce(o-e,0,i,o)+n},easeOutBounce:function(e,t,n,r){var o=n-t;return(e/=r)<1/2.75?o*(7.5625*e*e)+t:e<2/2.75?o*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?o*(7.5625*(e-=2.25/2.75)*e+.9375)+t:o*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,n,r,o){var i=r-n;return e<o/2?.5*t.easeInBounce(2*e,0,i,o)+n:.5*t.easeOutBounce(2*e-o,0,i,o)+.5*i+n}};e.exports=t},9771(e){"use strict";e.exports=function(){}},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM},2634(){},6942(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},2225(e,t,n){"use strict";n.d(t,{k5:()=>d,Vx:()=>i});var r=n(1609),o={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},i=r.createContext&&r.createContext(o),a=["attr","size","title"];function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){var r,o,i,a;r=e,o=t,i=n[t],(o="symbol"==typeof(a=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o))?a:a+"")in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e){return e&&e.map((e,t)=>r.createElement(e.tag,c({key:t},e.attr),u(e.child)))}function d(e){return t=>r.createElement(p,l({attr:c({},e.attr)},t),u(e.child))}function p(e){var t=t=>{var n,{attr:o,size:i,title:s}=e,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,a),d=i||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),r.createElement("svg",l({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,u,{className:n,style:c(c({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),s&&r.createElement("title",null,s),e.children)};return void 0!==i?r.createElement(i.Consumer,null,e=>t(e)):t(o)}},1635(e,t,n){"use strict";n.r(t),n.d(t,{__addDisposableResource:()=>N,__assign:()=>i,__asyncDelegator:()=>x,__asyncGenerator:()=>S,__asyncValues:()=>_,__await:()=>O,__awaiter:()=>h,__classPrivateFieldGet:()=>F,__classPrivateFieldIn:()=>I,__classPrivateFieldSet:()=>M,__createBinding:()=>g,__decorate:()=>l,__disposeResources:()=>L,__esDecorate:()=>c,__exportStar:()=>v,__extends:()=>o,__generator:()=>m,__importDefault:()=>T,__importStar:()=>A,__makeTemplateObject:()=>C,__metadata:()=>f,__param:()=>s,__propKey:()=>d,__read:()=>b,__rest:()=>a,__rewriteRelativeImportExtension:()=>R,__runInitializers:()=>u,__setFunctionName:()=>p,__spread:()=>w,__spreadArray:()=>k,__spreadArrays:()=>E,__values:()=>y,default:()=>B});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function l(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){return function(n,r){t(n,r,e)}}function c(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,s=r.kind,c="getter"===s?"get":"setter"===s?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var m in r)h[m]="access"===m?{}:r[m];for(var m in r.access)h.access[m]=r.access[m];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[f])("accessor"===s?{get:d.get,set:d.set}:d[c],h);if("accessor"===s){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(l=a(g.get))&&(d.get=l),(l=a(g.set))&&(d.set=l),(l=a(g.init))&&o.unshift(l)}else(l=a(g))&&("field"===s?o.unshift(l):d[c]=l)}u&&Object.defineProperty(u,r.name,d),p=!0}function u(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})}function m(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}var g=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||g(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function E(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,o++)r[o]=i[a];return r}function k(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function O(e){return this instanceof O?(this.v=e,this):new O(e)}function S(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||l(e,t)})},t&&(r[e]=t(r[e])))}function l(e,t){try{(n=o[e](t)).value instanceof O?Promise.resolve(n.value.v).then(s,c):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function s(e){l("next",e)}function c(e){l("throw",e)}function u(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function x(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:O(e[r](t)),done:!1}:o?o(t):t}:o}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,o,(t=e[n](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var D=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},P=function(e){return P=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},P(e)};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=P(e),r=0;r<n.length;r++)"default"!==n[r]&&g(t,e,n[r]);return D(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function F(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function M(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function I(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function N(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var j="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function L(e){function t(t){e.error=e.hasError?new j(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var n,r=0;return function o(){for(;n=e.stack.pop();)try{if(!n.async&&1===r)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else r|=1}catch(e){t(e)}if(1===r)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function R(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,n,r,o,i){return n?t?".jsx":".js":!r||o&&i?r+o+"."+i.toLowerCase()+"js":e}):e}const B={__extends:o,__assign:i,__rest:a,__decorate:l,__param:s,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:p,__metadata:f,__awaiter:h,__generator:m,__createBinding:g,__exportStar:v,__values:y,__read:b,__spread:w,__spreadArrays:E,__spreadArray:k,__await:O,__asyncGenerator:S,__asyncDelegator:x,__asyncValues:_,__makeTemplateObject:C,__importStar:A,__importDefault:T,__classPrivateFieldGet:F,__classPrivateFieldSet:M,__classPrivateFieldIn:I,__addDisposableResource:N,__disposeResources:L,__rewriteRelativeImportExtension:R}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a),n.exports}a.m=o,a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&r&&n;("object"==typeof l||"function"==typeof l)&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>"js/chunks/"+{607:"react-icons-io5",705:"react-icons-md",773:"react-icons-tfi",961:"react-icons-fa6",969:"konva-vendor"}[e]+".js",a.miniCssF=e=>{},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="templately:",a.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var l,s;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+o){l=d;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+o),l.src=e),n[e]=[t];var p=(t,r)=>{l.onerror=l.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach(e=>e(r)),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),s&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{var e={44:0};a.f.j=(t,n)=>{var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=e[t]=[n,o]);n.push(r[2]=o);var i=a.p+a.u(t),l=new Error;a.l(i,n=>{if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,r[1](l)}},"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,l,s]=n,c=0;if(i.some(t=>0!==e[t])){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);s&&s(a)}for(t&&t(n);c<i.length;c++)o=i[c],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=globalThis.webpackChunktemplately=globalThis.webpackChunktemplately||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),a.nc=void 0,(()=>{"use strict";var e={};a.r(e),a.d(e,{safe:()=>_4,spec:()=>x4});var t={};a.r(t),a.d(t,{angle:()=>O6,decibel:()=>D6,flex:()=>C6,frequency:()=>x6,length:()=>k6,resolution:()=>_6,semitones:()=>P6,time:()=>S6});var n={};a.r(n),a.d(n,{getTrace:()=>s8,isKeyword:()=>d8,isProperty:()=>u8,isType:()=>c8});var r={};a.r(r),a.d(r,{generate:()=>V8,name:()=>z8,parse:()=>U8,structure:()=>W8});var o={};a.r(o),a.d(o,{generate:()=>X8,name:()=>q8,parse:()=>Y8,structure:()=>$8,walkContext:()=>Q8});var i={};a.r(i),a.d(i,{generate:()=>t7,name:()=>K8,parse:()=>e7,structure:()=>J8,walkContext:()=>Z8});var l={};a.r(l),a.d(l,{generate:()=>f7,name:()=>u7,parse:()=>p7,structure:()=>d7});var s={};a.r(s),a.d(s,{generate:()=>O7,name:()=>b7,parse:()=>k7,structure:()=>E7,walkContext:()=>w7});var c={};a.r(c),a.d(c,{generate:()=>C7,name:()=>S7,parse:()=>_7,structure:()=>x7});var u={};a.r(u),a.d(u,{generate:()=>T7,name:()=>D7,parse:()=>A7,structure:()=>P7});var d={};a.r(d),a.d(d,{generate:()=>N7,name:()=>F7,parse:()=>I7,structure:()=>M7});var p={};a.r(p),a.d(p,{generate:()=>z7,name:()=>L7,parse:()=>B7,structure:()=>R7});var f={};a.r(f),a.d(f,{generate:()=>$7,name:()=>G7,parse:()=>Q7,structure:()=>q7});var h={};a.r(h),a.d(h,{generate:()=>e9,name:()=>K7,parse:()=>J7,structure:()=>Z7});var m={};a.r(m),a.d(m,{generate:()=>l9,name:()=>n9,parse:()=>a9,structure:()=>r9});var g={};a.r(g),a.d(g,{generate:()=>k9,name:()=>y9,parse:()=>E9,structure:()=>w9,walkContext:()=>b9});var v={};a.r(v),a.d(v,{generate:()=>A9,name:()=>C9,parse:()=>P9,structure:()=>D9});var y={};a.r(y),a.d(y,{generate:()=>I9,name:()=>T9,parse:()=>M9,structure:()=>F9});var b={};a.r(b),a.d(b,{generate:()=>B9,name:()=>j9,parse:()=>R9,structure:()=>L9});var w={};a.r(w),a.d(w,{generate:()=>H9,name:()=>z9,parse:()=>V9,structure:()=>W9});var E={};a.r(E),a.d(E,{generate:()=>eee,name:()=>Y9,parse:()=>J9,structure:()=>X9});var k={};a.r(k),a.d(k,{generate:()=>iee,name:()=>tee,parse:()=>oee,structure:()=>ree,walkContext:()=>nee});var O={};a.r(O),a.d(O,{generate:()=>cee,name:()=>aee,parse:()=>see,structure:()=>lee});var S={};a.r(S),a.d(S,{generate:()=>hee,name:()=>dee,parse:()=>fee,structure:()=>pee,xxx:()=>uee});var x={};a.r(x),a.d(x,{generate:()=>yee,name:()=>mee,parse:()=>vee,structure:()=>gee});var _={};a.r(_),a.d(_,{generate:()=>kee,name:()=>bee,parse:()=>Eee,structure:()=>wee});var C={};a.r(C),a.d(C,{generate:()=>Cee,name:()=>See,parse:()=>_ee,structure:()=>xee});var D={};a.r(D),a.d(D,{generate:()=>Tee,name:()=>Dee,parse:()=>Aee,structure:()=>Pee});var P={};a.r(P),a.d(P,{generate:()=>Nee,name:()=>Fee,parse:()=>Iee,structure:()=>Mee});var A={};a.r(A),a.d(A,{generate:()=>Bee,name:()=>jee,parse:()=>Ree,structure:()=>Lee});var T={};a.r(T),a.d(T,{generate:()=>Hee,name:()=>Wee,parse:()=>Vee,structure:()=>Uee});var F={};a.r(F),a.d(F,{generate:()=>$ee,name:()=>Gee,parse:()=>Qee,structure:()=>qee});var M={};a.r(M),a.d(M,{generate:()=>Zee,name:()=>Yee,parse:()=>Kee,structure:()=>Xee});var I={};a.r(I),a.d(I,{generate:()=>nte,name:()=>Jee,parse:()=>tte,structure:()=>ete});var N={};a.r(N),a.d(N,{generate:()=>ate,name:()=>rte,parse:()=>ite,structure:()=>ote});var j={};a.r(j),a.d(j,{generate:()=>ute,name:()=>lte,parse:()=>cte,structure:()=>ste});var L={};a.r(L),a.d(L,{generate:()=>mte,name:()=>dte,parse:()=>hte,structure:()=>fte,walkContext:()=>pte});var R={};a.r(R),a.d(R,{generate:()=>wte,name:()=>gte,parse:()=>bte,structure:()=>yte,walkContext:()=>vte});var B={};a.r(B),a.d(B,{generate:()=>_te,name:()=>Ote,parse:()=>xte,structure:()=>Ste});var z={};a.r(z),a.d(z,{generate:()=>Tte,name:()=>Dte,parse:()=>Ate,structure:()=>Pte});var W={};a.r(W),a.d(W,{generate:()=>Rte,name:()=>Ite,parse:()=>Lte,structure:()=>jte,walkContext:()=>Nte});var U={};a.r(U),a.d(U,{generate:()=>Ute,name:()=>Bte,parse:()=>Wte,structure:()=>zte});var V={};a.r(V),a.d(V,{generate:()=>qte,name:()=>Vte,parse:()=>Gte,structure:()=>Hte});var H={};a.r(H),a.d(H,{generate:()=>Kte,name:()=>Qte,parse:()=>Xte,structure:()=>Yte,walkContext:()=>$te});var G={};a.r(G),a.d(G,{generate:()=>ine,name:()=>nne,parse:()=>one,structure:()=>rne});var q={};a.r(q),a.d(q,{generate:()=>pne,name:()=>sne,parse:()=>dne,structure:()=>une,walkContext:()=>cne});var Q={};a.r(Q),a.d(Q,{generate:()=>gne,name:()=>fne,parse:()=>mne,structure:()=>hne});var $={};a.r($),a.d($,{generate:()=>One,name:()=>wne,parse:()=>kne,structure:()=>Ene});var Y={};a.r(Y),a.d(Y,{generate:()=>Ine,name:()=>Tne,parse:()=>Mne,structure:()=>Fne});var X={};a.r(X),a.d(X,{generate:()=>Hne,name:()=>Wne,parse:()=>Vne,structure:()=>Une});var K={};a.r(K),a.d(K,{generate:()=>$ne,name:()=>Gne,parse:()=>Qne,structure:()=>qne});var Z={};a.r(Z),a.d(Z,{generate:()=>Jne,name:()=>Xne,parse:()=>Zne,structure:()=>Kne});var J={};a.r(J),a.d(J,{AnPlusB:()=>r,Atrule:()=>o,AtrulePrelude:()=>i,AttributeSelector:()=>l,Block:()=>s,Brackets:()=>c,CDC:()=>u,CDO:()=>d,ClassSelector:()=>p,Combinator:()=>f,Comment:()=>h,Condition:()=>m,Declaration:()=>g,DeclarationList:()=>v,Dimension:()=>y,Feature:()=>b,FeatureFunction:()=>w,FeatureRange:()=>E,Function:()=>k,GeneralEnclosed:()=>O,Hash:()=>S,IdSelector:()=>_,Identifier:()=>x,Layer:()=>C,LayerList:()=>D,MediaQuery:()=>P,MediaQueryList:()=>A,NestingSelector:()=>T,Nth:()=>F,Number:()=>M,Operator:()=>I,Parentheses:()=>N,Percentage:()=>j,PseudoClassSelector:()=>L,PseudoElementSelector:()=>R,Ratio:()=>B,Raw:()=>z,Rule:()=>W,Scope:()=>U,Selector:()=>V,SelectorList:()=>H,String:()=>G,StyleSheet:()=>q,SupportsDeclaration:()=>Q,TypeSelector:()=>$,UnicodeRange:()=>Y,Url:()=>X,Value:()=>K,WhiteSpace:()=>Z});var ee={};a.r(ee),a.d(ee,{AtrulePrelude:()=>nre,Selector:()=>rre,Value:()=>ire});var te={};function ne(e){return ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ne(e)}function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},re.apply(null,arguments)}a.r(te),a.d(te,{AnPlusB:()=>U8,Atrule:()=>Y8,AtrulePrelude:()=>e7,AttributeSelector:()=>p7,Block:()=>k7,Brackets:()=>_7,CDC:()=>A7,CDO:()=>I7,ClassSelector:()=>B7,Combinator:()=>Q7,Comment:()=>J7,Condition:()=>a9,Declaration:()=>E9,DeclarationList:()=>P9,Dimension:()=>M9,Feature:()=>R9,FeatureFunction:()=>V9,FeatureRange:()=>J9,Function:()=>oee,GeneralEnclosed:()=>see,Hash:()=>fee,IdSelector:()=>Eee,Identifier:()=>vee,Layer:()=>_ee,LayerList:()=>Aee,MediaQuery:()=>Iee,MediaQueryList:()=>Ree,NestingSelector:()=>Vee,Nth:()=>Qee,Number:()=>Kee,Operator:()=>tte,Parentheses:()=>ite,Percentage:()=>cte,PseudoClassSelector:()=>hte,PseudoElementSelector:()=>bte,Ratio:()=>xte,Raw:()=>Ate,Rule:()=>Lte,Scope:()=>Wte,Selector:()=>Gte,SelectorList:()=>Xte,String:()=>one,StyleSheet:()=>dne,SupportsDeclaration:()=>mne,TypeSelector:()=>kne,UnicodeRange:()=>Mne,Url:()=>Vne,Value:()=>Qne,WhiteSpace:()=>Zne});var oe=a(5795),ie=a.n(oe);const ae=window.wp.hooks;function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e,t){if(e){if("string"==typeof e)return le(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}function ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||se(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ue,de,pe=a(1609),fe=a.t(pe,2),he=a.n(pe);function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},me.apply(this,arguments)}function ge(e,t){if(!1===e||null==e)throw new Error(t)}function ve(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function ye(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function be(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function we(e,t,n){return void 0===n&&(n="/"),function(e,t,n,r){let o=Ie(("string"==typeof t?be(t):t).pathname||"/",n);if(null==o)return null;let i=Ee(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(i);let a=null;for(let e=0;null==a&&e<i.length;++e){let t=Me(o);a=Te(i[e],t,r)}return a}(e,t,n,!1)}function Ee(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let o=(e,o,i)=>{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(ge(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(r.length));let l=We([r,a.relativePath]),s=n.concat(a);e.children&&e.children.length>0&&(ge(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),Ee(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:Ae(l,e.index),routesMeta:s})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of ke(e.path))o(e,t,n);else o(e,t)}),t}function ke(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=ke(r.join("/")),l=[];return l.push(...a.map(e=>""===e?i:[i,e].join("/"))),o&&l.push(...a),l.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ue||(ue={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(de||(de={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const Oe=/^:[\w-]+$/,Se=3,xe=2,_e=1,Ce=10,De=-2,Pe=e=>"*"===e;function Ae(e,t){let n=e.split("/"),r=n.length;return n.some(Pe)&&(r+=De),t&&(r+=xe),n.filter(e=>!Pe(e)).reduce((e,t)=>e+(Oe.test(t)?Se:""===t?_e:Ce),r)}function Te(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let e=0;e<r.length;++e){let l=r[e],s=e===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Fe({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},c),d=l.route;if(!u&&s&&n&&!r[r.length-1].route.index&&(u=Fe({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),a.push({params:o,pathname:We([i,u.pathname]),pathnameBase:Ue(We([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=We([i,u.pathnameBase]))}return a}function Fe(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),ve("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1),s=r.reduce((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e},{});return{params:s,pathname:i,pathnameBase:a,pattern:e}}function Me(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return ve(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function Ie(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}const Ne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function je(e,t){void 0===t&&(t="/");let n,{pathname:r,search:o="",hash:i=""}="string"==typeof e?be(e):e;if(r)if(a=r,Ne.test(a))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),ve(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+r)}n=r.startsWith("/")?Le(r.substring(1),"/"):Le(r,t)}else n=t;var a;return{pathname:n,search:Ve(o),hash:He(i)}}function Le(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function Re(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Be(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function ze(e,t,n,r){let o;void 0===r&&(r=!1),"string"==typeof e?o=be(e):(o=me({},e),ge(!o.pathname||!o.pathname.includes("?"),Re("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Re("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Re("#","search","hash",o)));let i,a=""===e||""===o.pathname,l=a?"/":o.pathname;if(null==l)i=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let s=je(o,i),c=l&&"/"!==l&&l.endsWith("/"),u=(a||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const We=e=>e.join("/").replace(/\/\/+/g,"/"),Ue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ve=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",He=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const Ge=["post","put","patch","delete"],qe=(new Set(Ge),["get",...Ge]);function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qe.apply(this,arguments)}new Set(qe),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const $e=pe.createContext(null),Ye=pe.createContext(null),Xe=pe.createContext(null),Ke=pe.createContext(null),Ze=pe.createContext({outlet:null,matches:[],isDataRoute:!1}),Je=pe.createContext(null);function et(){return null!=pe.useContext(Ke)}function tt(){return et()||ge(!1),pe.useContext(Ke).location}function nt(e){pe.useContext(Xe).static||pe.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=pe.useContext(Ze);return e?function(){let{router:e}=function(){let e=pe.useContext($e);return e||ge(!1),e}(pt.UseNavigateStable),t=ht(ft.UseNavigateStable),n=pe.useRef(!1);nt(()=>{n.current=!0});let r=pe.useCallback(function(r,o){void 0===o&&(o={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,Qe({fromRouteId:t},o)))},[e,t]);return r}():function(){et()||ge(!1);let e=pe.useContext($e),{basename:t,future:n,navigator:r}=pe.useContext(Xe),{matches:o}=pe.useContext(Ze),{pathname:i}=tt(),a=JSON.stringify(Be(o,n.v7_relativeSplatPath)),l=pe.useRef(!1);nt(()=>{l.current=!0});let s=pe.useCallback(function(n,o){if(void 0===o&&(o={}),!l.current)return;if("number"==typeof n)return void r.go(n);let s=ze(n,JSON.parse(a),i,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:We([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)},[t,r,a,i,e]);return s}()}const ot=pe.createContext(null);function it(){let{matches:e}=pe.useContext(Ze),t=e[e.length-1];return t?t.params:{}}function at(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=pe.useContext(Xe),{matches:o}=pe.useContext(Ze),{pathname:i}=tt(),a=JSON.stringify(Be(o,r.v7_relativeSplatPath));return pe.useMemo(()=>ze(e,JSON.parse(a),i,"path"===n),[e,a,i,n])}function lt(e,t){return function(e,t,n,r){et()||ge(!1);let{navigator:o}=pe.useContext(Xe),{matches:i}=pe.useContext(Ze),a=i[i.length-1],l=a?a.params:{},s=(a&&a.pathname,a?a.pathnameBase:"/");a&&a.route;let c,u=tt();if(t){var d;let e="string"==typeof t?be(t):t;"/"===s||(null==(d=e.pathname)?void 0:d.startsWith(s))||ge(!1),c=e}else c=u;let p=c.pathname||"/",f=p;if("/"!==s){let e=s.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let h=we(e,{pathname:f}),m=function(e,t,n,r){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var i;if(!n)return null;if(n.errors)e=n.matches;else{if(!(null!=(i=r)&&i.v7_partialHydration&&0===t.length&&!n.initialized&&n.matches.length>0))return null;e=n.matches}}let a=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=a.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||ge(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,o=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||o){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,o)=>{let i,u=!1,d=null,p=null;var f;n&&(i=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||ct,s&&(c<0&&0===o?(mt[f="route-fallback"]||(mt[f]=!0),u=!0,p=null):c===o&&(u=!0,p=r.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,o+1)),m=()=>{let t;return t=i?d:u?p:r.route.Component?pe.createElement(r.route.Component,null):r.route.element?r.route.element:e,pe.createElement(dt,{match:r,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?pe.createElement(ut,{location:n.location,revalidation:n.revalidation,component:d,error:i,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()},null)}(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:We([s,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?s:We([s,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),i,n,r);return t&&m?pe.createElement(Ke.Provider,{value:{location:Qe({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ue.Pop}},m):m}(e,t)}function st(){let e=function(){var e;let t=pe.useContext(Je),n=function(){let e=pe.useContext(Ye);return e||ge(!1),e}(ft.UseRouteError),r=ht(ft.UseRouteError);return void 0!==t?t:null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return pe.createElement(pe.Fragment,null,pe.createElement("h2",null,"Unexpected Application Error!"),pe.createElement("h3",{style:{fontStyle:"italic"}},t),n?pe.createElement("pre",{style:r},n):null,null)}const ct=pe.createElement(st,null);class ut extends pe.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?pe.createElement(Ze.Provider,{value:this.props.routeContext},pe.createElement(Je.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dt(e){let{routeContext:t,match:n,children:r}=e,o=pe.useContext($e);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),pe.createElement(Ze.Provider,{value:t},r)}var pt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pt||{}),ft=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ft||{});function ht(e){let t=function(){let e=pe.useContext(Ze);return e||ge(!1),e}(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}const mt={};function gt(e){let{to:t,replace:n,state:r,relative:o}=e;et()||ge(!1);let{future:i,static:a}=pe.useContext(Xe),{matches:l}=pe.useContext(Ze),{pathname:s}=tt(),c=rt(),u=ze(t,Be(l,i.v7_relativeSplatPath),s,"path"===o),d=JSON.stringify(u);return pe.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:o}),[c,d,o,n,r]),null}function vt(e){return function(e){let t=pe.useContext(Ze).outlet;return t?pe.createElement(ot.Provider,{value:e},t):t}(e.context)}function yt(e){let{basename:t="/",children:n=null,location:r,navigationType:o=ue.Pop,navigator:i,static:a=!1,future:l}=e;et()&&ge(!1);let s=t.replace(/^\/*/,"/"),c=pe.useMemo(()=>({basename:s,navigator:i,static:a,future:Qe({v7_relativeSplatPath:!1},l)}),[s,l,i,a]);"string"==typeof r&&(r=be(r));let{pathname:u="/",search:d="",hash:p="",state:f=null,key:h="default"}=r,m=pe.useMemo(()=>{let e=Ie(u,s);return null==e?null:{location:{pathname:e,search:d,hash:p,state:f,key:h},navigationType:o}},[s,u,d,p,f,h,o]);return null==m?null:pe.createElement(Xe.Provider,{value:c},pe.createElement(Ke.Provider,{children:n,value:m}))}function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(this,arguments)}function wt(e){return void 0===e&&(e=""),new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}pe.startTransition,new Promise(()=>{}),pe.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const Et=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map,pe.startTransition,oe.flushSync,pe.useId;const kt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,St=pe.forwardRef(function(e,t){let n,{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:s,to:c,preventScrollReset:u,viewTransition:d}=e,p=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,Et),{basename:f}=pe.useContext(Xe),h=!1;if("string"==typeof c&&Ot.test(c)&&(n=c,kt))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Ie(t.pathname,f);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:h=!0}catch(e){}let m=function(e,t){let{relative:n}=void 0===t?{}:t;et()||ge(!1);let{basename:r,navigator:o}=pe.useContext(Xe),{hash:i,pathname:a,search:l}=at(e,{relative:n}),s=a;return"/"!==r&&(s="/"===a?r:We([r,a])),o.createHref({pathname:s,search:l,hash:i})}(c,{relative:o}),g=function(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,viewTransition:l}=void 0===t?{}:t,s=rt(),c=tt(),u=at(e,{relative:a});return pe.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:ye(c)===ye(u);s(e,{replace:n,state:o,preventScrollReset:i,relative:a,viewTransition:l})}},[c,s,u,r,o,n,e,i,a,l])}(c,{replace:a,state:l,target:s,preventScrollReset:u,relative:o,viewTransition:d});return pe.createElement("a",bt({},p,{href:n||m,onClick:h||i?r:function(e){r&&r(e),e.defaultPrevented||g(e)},ref:t,target:s}))});var xt,_t;function Ct(e){let t=pe.useRef(wt(e)),n=pe.useRef(!1),r=tt(),o=pe.useMemo(()=>function(e,t){let n=wt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}(r.search,n.current?null:t.current),[r.search]),i=rt(),a=pe.useCallback((e,t)=>{const r=wt("function"==typeof e?e(o):e);n.current=!0,i("?"+r,t)},[i,o]);return[o,a]}function Dt(e){var t=function(e){if("object"!=ne(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ne(t)?t:t+""}function Pt(e,t,n){return(t=Dt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xt||(xt={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(_t||(_t={}));const At=window.wp.i18n;var Tt=he().createContext(null),Ft=function(e){e()},Mt=function(){return Ft},It={notify:function(){},get:function(){return[]}};function Nt(e,t){var n,r=It;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=Mt(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=It)},getListeners:function(){return r}};return a}var jt="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?pe.useLayoutEffect:pe.useEffect;const Lt=function(e){var t=e.store,n=e.context,r=e.children,o=(0,pe.useMemo)(function(){var e=Nt(t);return{store:t,subscription:e}},[t]),i=(0,pe.useMemo)(function(){return t.getState()},[t]);jt(function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[o,i]);var a=n||Tt;return he().createElement(a.Provider,{value:o},r)};function Rt(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var Bt=a(4146),zt=a.n(Bt),Wt=a(4737),Ut=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Vt=["reactReduxForwardedRef"],Ht=[],Gt=[null,null];function qt(e,t){var n=e[1];return[t.payload,n+1]}function Qt(e,t,n){jt(function(){return e.apply(void 0,t)},n)}function $t(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function Yt(e,t,n,r,o,i,a,l,s,c){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||s():(i.current=e,l.current=e,a.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=p,n.trySubscribe(),p(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var Xt=function(){return[null,0]};function Kt(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,a=void 0===i?"connectAdvanced":i,l=n.renderCountProp,s=void 0===l?void 0:l,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,p=void 0===d?"store":d,f=(n.withRef,n.forwardRef),h=void 0!==f&&f,m=n.context,g=void 0===m?Tt:m,v=Rt(n,Ut),y=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=re({},v,{getDisplayName:o,methodName:a,renderCountProp:s,shouldHandleStateChanges:u,storeKey:p,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=v.pure,c=l?pe.useMemo:function(e){return e()};function d(n){var r=(0,pe.useMemo)(function(){var e=n.reactReduxForwardedRef,t=Rt(n,Vt);return[n.context,e,t]},[n]),o=r[0],a=r[1],l=r[2],s=(0,pe.useMemo)(function(){return o&&o.Consumer&&(0,Wt.isContextConsumer)(he().createElement(o.Consumer,null))?o:y},[o,y]),d=(0,pe.useContext)(s),p=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var f=p?n.store:d.store,h=(0,pe.useMemo)(function(){return function(t){return e(t.dispatch,i)}(f)},[f]),m=(0,pe.useMemo)(function(){if(!u)return Gt;var e=Nt(f,p?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[f,p,d]),g=m[0],v=m[1],b=(0,pe.useMemo)(function(){return p?d:re({},d,{subscription:g})},[p,d,g]),w=(0,pe.useReducer)(qt,Ht,Xt),E=w[0][0],k=w[1];if(E&&E.error)throw E.error;var O=(0,pe.useRef)(),S=(0,pe.useRef)(l),x=(0,pe.useRef)(),_=(0,pe.useRef)(!1),C=c(function(){return x.current&&l===S.current?x.current:h(f.getState(),l)},[f,E,l]);Qt($t,[S,O,_,l,C,x,v]),Qt(Yt,[u,f,g,h,S,O,_,x,v,k],[f,g,h]);var D=(0,pe.useMemo)(function(){return he().createElement(t,re({},C,{ref:a}))},[a,t,C]);return(0,pe.useMemo)(function(){return u?he().createElement(s.Provider,{value:b},D):D},[s,D,b])}var f=l?he().memo(d):d;if(f.WrappedComponent=t,f.displayName=d.displayName=r,h){var m=he().forwardRef(function(e,t){return he().createElement(f,re({},e,{reactReduxForwardedRef:t}))});return m.displayName=r,m.WrappedComponent=t,zt()(m,t)}return zt()(f,t)}}function Zt(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Jt(e,t){if(Zt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Zt(e[n[o]],t[n[o]]))return!1;return!0}function en(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function tn(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function nn(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=tn(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=tn(o),o=r(t,n)),o},r}}const rn=[function(e){return"function"==typeof e?nn(e):void 0},function(e){return e?void 0:en(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?en(function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)}):void 0}],on=[function(e){return"function"==typeof e?nn(e):void 0},function(e){return e?void 0:en(function(){return{}})}];function an(e,t,n){return re({},n,e,t)}const ln=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(t,n,l){var s=e(t,n,l);return a?o&&i(s,r)||(r=s):(a=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return an}}];var sn=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function cn(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function un(e,t,n,r,o){var i,a,l,s,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,f=!1;return function(o,h){return f?function(o,f){var h,m,g=!d(f,a),v=!u(o,i,f,a);return i=o,a=f,g&&v?(l=e(i,a),t.dependsOnOwnProps&&(s=t(r,a)),c=n(l,s,a)):g?(e.dependsOnOwnProps&&(l=e(i,a)),t.dependsOnOwnProps&&(s=t(r,a)),c=n(l,s,a)):v?(h=e(i,a),m=!p(h,l),l=h,m&&(c=n(l,s,a)),c):c}(o,h):(l=e(i=o,a=h),s=t(r,a),c=n(l,s,a),f=!0,c)}}function dn(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=Rt(t,sn),a=n(e,i),l=r(e,i),s=o(e,i);return(i.pure?un:cn)(a,l,s,e,i)}var pn=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function fn(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function hn(e,t){return e===t}function mn(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?Kt:n,o=t.mapStateToPropsFactories,i=void 0===o?on:o,a=t.mapDispatchToPropsFactories,l=void 0===a?rn:a,s=t.mergePropsFactories,c=void 0===s?ln:s,u=t.selectorFactory,d=void 0===u?dn:u;return function(e,t,n,o){void 0===o&&(o={});var a=o,s=a.pure,u=void 0===s||s,p=a.areStatesEqual,f=void 0===p?hn:p,h=a.areOwnPropsEqual,m=void 0===h?Jt:h,g=a.areStatePropsEqual,v=void 0===g?Jt:g,y=a.areMergedPropsEqual,b=void 0===y?Jt:y,w=Rt(a,pn),E=fn(e,i,"mapStateToProps"),k=fn(t,l,"mapDispatchToProps"),O=fn(n,c,"mergeProps");return r(d,re({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:O,pure:u,areStatesEqual:f,areOwnPropsEqual:m,areStatePropsEqual:v,areMergedPropsEqual:b},w))}}const gn=mn();function vn(){return(0,pe.useContext)(Tt)}function yn(e){void 0===e&&(e=Tt);var t=e===Tt?vn:function(){return(0,pe.useContext)(e)};return function(){return t().store}}var bn=yn();function wn(e){void 0===e&&(e=Tt);var t=e===Tt?bn:yn(e);return function(){return t().dispatch}}var En=wn(),kn=function(e,t){return e===t};function On(e){void 0===e&&(e=Tt);var t=e===Tt?vn:function(){return(0,pe.useContext)(e)};return function(e,n){void 0===n&&(n=kn);var r=t(),o=function(e,t,n,r){var o,i=(0,pe.useReducer)(function(e){return e+1},0)[1],a=(0,pe.useMemo)(function(){return Nt(n,r)},[n,r]),l=(0,pe.useRef)(),s=(0,pe.useRef)(),c=(0,pe.useRef)(),u=(0,pe.useRef)(),d=n.getState();try{if(e!==s.current||d!==c.current||l.current){var p=e(d);o=void 0!==u.current&&t(p,u.current)?u.current:p}else o=u.current}catch(e){throw l.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+l.current.stack+"\n\n"),e}return jt(function(){s.current=e,c.current=d,u.current=o,l.current=void 0}),jt(function(){function e(){try{var e=n.getState();if(e===c.current)return;var r=s.current(e);if(t(r,u.current))return;u.current=r,c.current=e}catch(e){l.current=e}i()}return a.onStateChange=e,a.trySubscribe(),e(),function(){return a.tryUnsubscribe()}},[n,a]),o}(e,n,r.store,r.subscription);return(0,pe.useDebugValue)(o),o}}var Sn,xn=On();Sn=oe.unstable_batchedUpdates,Ft=Sn;const Cn=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22"},he().createElement("path",{d:"M11 12.778L18.778 5 21 7.222l-10 10-10-10L3.222 5 11 12.778z"}))},Dn=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},he().createElement("g",null,he().createElement("path",{d:"M76.8 76.5H11.6C5.2 76.5 0 81.7 0 88.1s5.2 11.6 11.6 11.6h65.2c6.4 0 11.6-5.2 11.6-11.6.1-6.4-5.1-11.6-11.6-11.6zM71 93.4c-2.9 0-5.2-2.3-5.2-5.2S68.1 83 71 83s5.2 2.3 5.2 5.2c.1 2.8-2.3 5.2-5.2 5.2zM90.2 21.4C88.9 12.7 81.3 6 72.3 6H71C67.4 2.3 62.2.2 57 .2 46.1.2 37.2 9 37 19.8c-4.8 3.8-7.7 9.6-7.7 15.7 0 11 9 20 20 20h32.6c10 0 18.1-8.1 18.1-18.1 0-6.8-3.8-13-9.8-16zm-8.3 24.8H49.3c-5.9 0-10.7-4.8-10.7-10.7 0-3.8 2.1-7.4 5.4-9.3l2.7-1.6-.4-3.2c-.1-.4-.1-.9-.1-1.3 0-5.9 4.8-10.7 10.7-10.7 3.4 0 6.6 1.6 8.6 4.3l1.8 2.5 3-.7c.6-.2 1.3-.2 2-.2 4.8 0 8.8 3.9 8.8 8.7l-.1 4 3.4 1c3.7 1.1 6.3 4.6 6.3 8.4 0 4.9-3.9 8.8-8.8 8.8z"}),he().createElement("path",{d:"M76.8 71.8c4.2 0 8 1.6 10.9 4.2L82 59H49.3c-12.7 0-23.1-10.3-23.4-23h-2c-5.1 0-8.4 2.6-11.4 9.3L.3 76.5c2.9-2.9 7-4.7 11.4-4.7z"})))},Pn=function(e){return he().createElement("svg",re({viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{fill:"#29c581"},he().createElement("path",{d:"M123 0H36.6c-2.8 0-5.1 2.3-5.1 5.1v26.3H5.1c-2.8 0-5.1 2.3-5.1 5.1v86.3c0 2.8 2.3 5.1 5.1 5.1h86.3c2.8 0 5.1-2.3 5.1-5.1V96.7h26.3c2.8 0 5.1-2.3 5.1-5.1V5.3c.2-3-2.1-5.3-4.9-5.3zM86.3 117.7h-76V41.8h21.2v49.6c0 2.8 2.3 5.1 5.1 5.1h49.6v21.2zm31.4-31.4H41.8V10.4h75.9z"}),he().createElement("path",{d:"M58.5 53.5h16.2v16.2c0 .9.8 1.8 1.8 1.8h6.9c.9 0 1.8-.8 1.8-1.8V53.5h16.2c.9 0 1.8-.8 1.8-1.8v-6.9c0-.9-.8-1.8-1.8-1.8H85.1V27c0-.9-.8-1.8-1.8-1.8h-6.9c-.9 0-1.8.8-1.8 1.8v16.2H58.5c-.9 0-1.8.8-1.8 1.8v6.9c0 .8.8 1.6 1.8 1.6z"})))},An=function(e){return he().createElement("svg",re({viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{fill:"#f82626"},he().createElement("path",{d:"M463.9 71.6h-97.7l-19.4-38.2C336.5 12.7 315.3-.3 292.2 0h-85.6c-23.1-.3-44.3 12.7-54.6 33.4l-18.8 38.2H35.5c-13.4 0-24.3 10.9-24.3 24.3s10.9 24.3 24.3 24.3h34V415c0 46.9 38 85 85 85h191.1c46.9 0 85-38 85-85V120.1h34c13.4 0 24.3-10.9 24.3-24.3S478 71.5 464.6 71.5h-.7zM195.7 55.2c2.1-4.1 6.3-6.7 10.9-6.7h86.2c4.6 0 8.8 2.6 10.9 6.7l7.9 16.4H187.8zM382 415c0 20.1-16.3 36.4-36.4 36.4H153.8c-20.1 0-36.4-16.3-36.4-36.4V120.1H382z"}),he().createElement("path",{d:"M303.1 401.7c13.4 0 24.3-10.9 24.3-24.3V199.6c0-13.4-10.9-24.3-24.3-24.3s-24.3 10.9-24.3 24.3v177.8c0 13.4 10.9 24.3 24.3 24.3zM196.3 401.7c13.4 0 24.3-10.9 24.3-24.3V199.6c0-13.4-10.9-24.3-24.3-24.3S172 186.2 172 199.6v177.8c0 13.4 10.9 24.3 24.3 24.3z"})))},Tn=function(e){return he().createElement("svg",re({viewBox:"0 0 500 500",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{clipRule:"evenodd",fill:"#1dc27a",fillRule:"evenodd"},he().createElement("path",{d:"M355.3 500H47.7c-24.2 0-43.8-19.6-43.8-43.8V148.6c0-24.2 19.9-43.8 44-43.8h251.9l-43.9 43.9H47.8v307.4h307.4V235.7l43.9-43.9v264.4c0 24.2-19.6 43.8-43.8 43.8z"}),he().createElement("path",{d:"M455.5 104.1 393.4 42 207.1 228.3l62.1 62.1zM248.9 308.8 184.1 327c-8.3 2.3-15.9-5.3-13.5-13.5l18.2-64.8c.5-1.8 1.5-3.5 2.8-4.8l62.1 62.1c-1.3 1.3-3 2.3-4.8 2.8zM494.3 65.3c4.3-4.3 4.3-11.2 0-15.5L447.8 3.2c-4.3-4.3-11.2-4.3-15.5 0L409 26.5l62 62.1z"})))};var Fn=function(e){return he().createElement("svg",re({viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("circle",{cx:90.5,cy:454.8,fill:"#ffb45a",r:57.2}),he().createElement("circle",{cx:256,cy:454.8,fill:"#ff7b8e",r:57.2}),he().createElement("circle",{cx:421.5,cy:454.8,fill:"#5ac0ff",r:57.2}),he().createElement("path",{d:"M356.5 94.5c-3.1 0-6.1.2-9.1.4C335 40.6 286.4 0 228.3 0c-15.3 0-29.9 2.8-43.4 8 0 15.3.1 32.9.2 40.4 15.6.1 45.8.2 59.1.2v57.8h-58.8v97.7h60.5c-1.7 4.3-4.3 10.7-5.4 13.2-11 26.5-38.3 41.3-66.6 36.2-26.9-4.9-46.9-27.8-48.4-55.9-.4-8.2-.2-16.5-.2-24.7V106h-20.7c-41.8 19.4-70.9 61.7-70.9 110.8 0 67.5 54.7 122.2 122.2 122.2h202c66.9-.7 120.8-55.1 120.8-122.2 0-67.5-54.7-122.3-122.2-122.3z",fill:"#5633d1"}))},Mn=function(e){return he().createElement("svg",re({viewBox:"0 0 143 28",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{fill:"#424c5e"},he().createElement("path",{d:"M6.6 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4V6.3H4.3l-.6-3H.8v14.2c0 2.8 1.3 4.1 3.8 4.1H8v-3.1zM17.3 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.7-2.3-7.1-6.9-7.1zM14 12.6c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1zM44.4 6.3c-1.7 0-3.3.7-4.9 2.1-.7-1.4-2-2.1-4-2.1-1.9 0-3.6.7-4.9 2.2l-.5-2.2h-3v15.3H31V11c1-1 2.1-1.5 3.2-1.5 1.4 0 2.1.9 2.1 2.6v9.6h3.9V11.1c1.1-1 2.2-1.5 3.3-1.5 1.5 0 2.3.8 2.3 2.6v9.6h3.9v-9.5c0-4.1-1.8-6-5.3-6zM59.8 6.3c-2.3 0-4.4.2-6.4.6V28h3.9v-7.1c1 .5 2.1.7 3.1.7 4.8 0 7.3-2.7 7.3-8-.1-4.9-2.7-7.3-7.9-7.3zm.5 12.1c-1.1 0-2.1-.3-3.1-.8v-8c.7-.1 1.6-.2 2.7-.2 2.5 0 3.8 1.4 3.8 4.1.1 3.3-1.1 4.9-3.4 4.9zM70.5.7h3.9v20.8h-3.9zM84.1 6.3c-1.7 0-3.5.2-5.6.7v3.1c2-.5 3.9-.7 5.6-.7 2 0 3 .7 3 2.1v1.2c-1-.2-2.1-.3-3.1-.3-4.4 0-6.6 1.5-6.6 4.6 0 3.2 1.9 4.8 5.6 4.8 1.6 0 3.1-.5 4.4-1.4l1.4 1.4H91V11.5c-.1-3.6-2.4-5.2-6.9-5.2zm-.6 12.5c-1.6 0-2.3-.7-2.3-2s.9-1.9 2.8-1.9c1.1 0 2.1.1 3.1.3v2.4c-1.2.8-2.4 1.2-3.6 1.2zM100 18.5c-1.2 0-1.9-.7-1.9-2.1v-7h3.4V6.3h-3.8l-.6-3h-2.9v14.2c0 2.8 1.3 4.1 3.8 4.1h3.4v-3.1zM110.7 6.3c-4.8 0-7.2 2.5-7.2 7.5 0 5.2 2.8 7.8 8.3 7.8 1.9 0 3.6-.1 4.9-.4v-3.1c-1.5.3-3.1.4-4.6.4-3.2 0-4.8-1.1-4.8-3.2h10.2c.1-.6.1-1.3.1-1.9.1-4.8-2.3-7.1-6.9-7.1zm-3.3 6.3c.2-2.2 1.3-3.3 3.3-3.3 2.1 0 3.2 1.1 3.2 3.2v.1zM120.6.7h3.9v20.8h-3.9zM138 6.2l-3.8 11-3.9-11h-4.1l5.9 15.4c-.8 1.7-2 2.9-3.7 3.7l1.9 2.6c2.5-1.2 4.3-3.2 5.4-5.9L142 6.2z"})))};const In=function(e){return he().createElement("svg",re({viewBox:"0 0 128 128",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{fill:"#2ec2fa"},he().createElement("path",{d:"M123 0H36.7c-2.8 0-5.1 2.3-5.1 5.1v26.3H5.1c-2.8 0-5.1 2.3-5.1 5.1v86.3c0 2.8 2.3 5.1 5.1 5.1h86.3c2.8 0 5.1-2.3 5.1-5.1V96.7h26.3c2.8 0 5.1-2.3 5.1-5.1V5.3c.2-3-2.1-5.3-4.9-5.3zM86.3 117.7H10.4V41.8h21.2v49.6c0 2.8 2.3 5.1 5.1 5.1h49.6zm31.4-31.4H41.8V10.4h75.9z"}),he().createElement("path",{d:"M74.5 49.7 91 33.1c2-2 5.1-2 7.1 0s2 5.1 0 7.1L81.6 56.8h8c2.8 0 5 2.3 5 5s-2.3 5-5 5H69.4c-2.8 0-5-2.3-5-5V41.7c0-2.8 2.3-5 5-5s5 2.3 5 5v8z"})))},Nn=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14"},he().createElement("mask",{id:"mask0_1828_1726",style:{maskType:"alpha"},width:"14",height:"14",x:"0",y:"0",maskUnits:"userSpaceOnUse"},he().createElement("path",{d:"M0 0H14V14H0z"})),he().createElement("g",{mask:"url(#mask0_1828_1726)"},he().createElement("path",{d:"M2.917 11.083h.83L9.45 5.381l-.831-.831-5.702 5.702v.831zM1.75 12.25V9.77l7.7-7.685a1.31 1.31 0 01.386-.248 1.206 1.206 0 01.897 0c.146.059.273.146.38.263l.802.817a.954.954 0 01.255.379 1.263 1.263 0 010 .882c-.054.141-.139.27-.255.387L4.229 12.25H1.75zm7.277-7.277L8.62 4.55l.831.831-.423-.408z"})))},jn=function(e){return he().createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},e),he().createElement("g",{fill:"#5453fd"},he().createElement("path",{d:"M50 0C35.7 0 24 11.7 24 26s11.7 26 26 26 26-11.7 26-26S64.3 0 50 0zM94.6 72.7c-.7-1.7-1.6-3.3-2.6-4.8-5.2-7.7-13.3-12.8-22.3-14.1-1.1-.1-2.4.1-3.3.8C61.6 58.2 55.9 60 50 60s-11.6-1.8-16.3-5.3c-.9-.7-2.2-1-3.3-.8-9.1 1.2-17.2 6.3-22.3 14.1-1 1.5-1.9 3.2-2.6 4.8-.3.7-.2 1.5.1 2.2.9 1.6 2 3.2 3.1 4.5 1.6 2.2 3.3 4.1 5.2 5.9 1.6 1.6 3.4 3.1 5.2 4.5 9 6.7 19.7 10.2 30.8 10.2s21.9-3.5 30.8-10.2c1.8-1.4 3.6-2.9 5.2-4.5 1.8-1.8 3.6-3.7 5.2-5.9 1.1-1.5 2.2-2.9 3.1-4.5.6-.9.7-1.6.4-2.3z"})))},Ln=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},he().createElement("g",null,he().createElement("path",{d:"M70.5 40.9c-11.3 0-21 6.3-26 15.6l-10.2-5.4c1.9-4.9 1.6-10.5-1-15.1l15.8-11.5c9 7.6 22.8 1.1 22.8-10.6C71.8 6.2 65.6 0 58 0 47.7 0 41.1 10.7 45.5 19.8L29.6 31.4C18.2 21.2 0 29.3 0 44.6c0 9.8 8 17.8 17.8 17.8 5.4 0 10.3-2.4 13.5-6.3l11 5.8c-.8 2.7-1.2 5.5-1.2 8.5 0 5.7 1.6 11.1 4.5 15.6.3-1.9.9-3.7 1.6-5.4 1.3-3 3.2-5.8 5.5-8.1l.9-.9c-.5-1.3-.9-2.6-1.1-3.9-.5-3.3-.1-6.8 1.2-9.9C55 54.6 57.2 52 60 50c3-2.1 6.5-3.2 10.3-3.2 9.9 0 18 8.1 18 18 0 2.3-.4 4.5-1.2 6.6l.9.9c2.5 2.3 4.4 5.1 5.7 8.2.8 1.9 1.4 3.8 1.7 5.8 2.9-4.6 4.6-10 4.6-15.8 0-16.4-13.2-29.6-29.5-29.6z"}),he().createElement("path",{d:"M65.2 75.8c8 3.7 17.2-2.2 17.2-11 0-6.7-5.4-12.2-12.1-12.2-10.7 0-16.1 13-8.7 20.6-.1 0 1.5 1.6 3.6 2.6z"}),he().createElement("path",{d:"M90 90.7c0 .7 0 1.4-.1 2-5.2 4.6-12 7.4-19.5 7.4s-14.3-2.8-19.5-7.4c-.1-.7-.1-1.3-.1-2 0-5.4 2.2-10.4 5.8-13.9 3.3 3.7 8.1 6.1 13.5 6.1 5.5 0 10.4-2.5 13.7-6.3C87.7 80 90 85.1 90 90.7z"})))},Rn=function(e){return he().createElement("svg",re({width:28,viewBox:"0 0 512 338",xmlns:"http://www.w3.org/2000/svg"},e),he().createElement("g",{fill:"none"},he().createElement("path",{d:"M357.74 291.15c-85.88 0-155.499-69.619-155.499-155.499 0-47.336 21.156-89.725 54.523-118.245C236.367 6.039 213.419.056 189.853.056c-75.901 0-137.65 61.75-137.65 137.65 0 3.896.167 7.81.497 11.709C20.377 166.672 0 200.199 0 237.457c0 55.056 44.792 99.848 99.848 99.848H359.06c49.056 0 89.963-35.561 98.296-82.259-26.981 22.537-61.712 36.104-99.616 36.104z",fill:"#a3b0c0"}),he().createElement("g",{fill:"#6d7988"},he().createElement("path",{d:"M331.409 125.365c-5.149-.234-10.317-.044-16.028-.044.77-25.252 10.37-45.087 30.462-58.479 21.943-14.626 43.882-16.65 65.44-7.828l16.061-27.998c-19.512-8.663-43.811-11.42-64.794-5.614-49.805 13.781-75.191 48.182-79.428 99.25-2.572 0-4.796.005-7.02-.001-2.429-.007-4.861-.117-7.285-.02-7.518.303-10.035 4.264-6.208 10.621 9.825 16.317 19.826 32.532 30.05 48.601 4.071 6.399 9.574 6.356 13.822-.012a2546.495 2546.495 0 0 0 30.891-47.406c4.201-6.609 1.861-10.715-5.963-11.07zM510.088 106.992a2709.272 2709.272 0 0 0-29.423-47.666c-4.464-7.066-9.893-7.168-14.476-.301a2828.15 2828.15 0 0 0-30.321 46.435c-4.742 7.417-2.366 11.519 6.522 11.784 4.93.147 9.868.026 15.186.026-1.078 26.367-11.36 46.663-32.694 59.894-20.076 12.451-39.981 14.628-59.477 7.832l-16.036 27.955c19.301 8.094 39.797 9.856 61.332 4.011 49.675-13.483 74.817-48.093 79.01-98.99 4.881 0 9.533.111 14.178-.025 7.778-.228 10.221-4.288 6.199-10.955z"}))))},Bn=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},he().createElement("g",{clipPath:"url(#clip0_57_7571)"},he().createElement("path",{stroke:"#F04438",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.333",d:"M7.999 5.334v2.667m0 2.666h.006m6.66-2.666A6.667 6.667 0 111.332 8a6.667 6.667 0 0113.333 0z"})),he().createElement("defs",null,he().createElement("clipPath",{id:"clip0_57_7571"},he().createElement("path",{fill:"#fff",d:"M0 0H16V16H0z"}))))},zn=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},he().createElement("g",null,he().createElement("path",{d:"M67.5 94.1h-8.4l-1.2-16H42.1l-1.2 16h-8.4c-1.6 0-3 1.3-3 3 0 1.6 1.3 3 3 3h35c1.6 0 3-1.3 3-3s-1.3-3-3-3zM88.4 22h-7.2L59.9 43.3c.5 4.6-1 9.3-4.4 12.7-4.8 4.8-19.9 7.2-26.7 7.9-2 .2-3.5-1.5-3.3-3.3.8-6.7 3.1-21.8 7.9-26.7 3.5-3.5 8.2-5 12.7-4.4l7.5-7.6h-42c-1.7 0-3 1.4-3 3V69c0 1.7 1.4 3 3 3h76.7c1.7 0 3-1.4 3-3V25c.1-1.6-1.3-3-2.9-3z"}),he().createElement("path",{d:"M57.8 37c.8-.8 22.3-22.2 30.6-30.5 1.4-1.5 1.4-3.9-.1-5.3C86.9-.3 84.5-.4 83 1L52.5 31.6c2 1.3 3.9 3.2 5.3 5.4zM51.2 38.2c-3.8-3.8-9.9-3.7-13.6 0-2.4 2.5-4.6 11.8-5.7 19.4 4.3-.6 16.5-2.8 19.6-6 3.5-3.8 3.4-9.7-.3-13.4z"})))};function Wn(e,t){if(null==e)return{};var n,r,o=Rt(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Un=a(6942),Vn=a.n(Un),Hn=a(2225);function Gn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"},child:[]}]})(e)}function qn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Qn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(e)}function $n(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function Yn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M192 127.338v257.324c0 17.818-21.543 26.741-34.142 14.142L29.196 270.142c-7.81-7.81-7.81-20.474 0-28.284l128.662-128.662c12.599-12.6 34.142-3.676 34.142 14.142z"},child:[]}]})(e)}function Xn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"},child:[]}]})(e)}function Kn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"},child:[]}]})(e)}function Zn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M528 448H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5 0-48 21.5-48 48 0 7.1 1.6 13.7 4.4 19.8L476 239.2c-15.4 9.2-35.3 4-44.2-11.6L350.3 85C361 76.2 368 63 368 48c0-26.5-21.5-48-48-48s-48 21.5-48 48c0 15 7 28.2 17.7 37l-81.5 142.6c-8.9 15.6-28.9 20.8-44.2 11.6l-72.3-43.4c2.7-6 4.4-12.7 4.4-19.8 0-26.5-21.5-48-48-48S0 149.5 0 176s21.5 48 48 48c2.6 0 5.2-.4 7.7-.8L128 416h384l72.3-192.8c2.5.4 5.1.8 7.7.8 26.5 0 48-21.5 48-48s-21.5-48-48-48z"},child:[]}]})(e)}function Jn(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function er(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M96 184c39.8 0 72 32.2 72 72s-32.2 72-72 72-72-32.2-72-72 32.2-72 72-72zM24 80c0 39.8 32.2 72 72 72s72-32.2 72-72S135.8 8 96 8 24 40.2 24 80zm0 352c0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72-72 32.2-72 72z"},child:[]}]})(e)}function tr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function nr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M16 288c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h112v-64zm489-183L407.1 7c-4.5-4.5-10.6-7-17-7H384v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-153 31V0H152c-13.3 0-24 10.7-24 24v264h128v-65.2c0-14.3 17.3-21.4 27.4-11.3L379 308c6.6 6.7 6.6 17.4 0 24l-95.7 96.4c-10.1 10.1-27.4 3-27.4-11.3V352H128v136c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H376c-13.2 0-24-10.8-24-24z"},child:[]}]})(e)}function rr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"},child:[]}]})(e)}function or(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function ir(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function ar(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}function lr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 32h192c13.255 0 24 10.745 24 24v160c0 13.255-10.745 24-24 24H296c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24zm-80 0H24C10.745 32 0 42.745 0 56v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zM0 296v160c0 13.255 10.745 24 24 24h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm296 184h192c13.255 0 24-10.745 24-24V296c0-13.255-10.745-24-24-24H296c-13.255 0-24 10.745-24 24v160c0 13.255 10.745 24 24 24z"},child:[]}]})(e)}function sr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function cr(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(e)}var ur="APPLICATION_SET_PLATFORM",dr="APPLICATION_SET_PLAN",pr="APPLICATION_ERROR_CLEANUP",fr="APPLICATION_IS_VERIFIED",hr="APPLICATION_IS_VERIFYING",mr="APPLICATION_IS_DISCONNECTED",gr="APPLICATION_LOGOUT",vr="APPLICATION_LOGOUT_SUCCESS",yr="APPLICATION_SIGNIN",br="APPLICATION_SIGNIN_SUCCESS",wr="APPLICATION_SIGNIN_FAILED",Er="APPLICATION_SIGNUP",kr="APPLICATION_SIGNUP_SUCCESS",Or="APPLICATION_SIGNUP_FAILED",Sr="APPLICATION_COUNTS_SUCCESS",xr="APPLICATION_SET_FILTER_META",_r="APPLICATION_RESET_FILTER_META",Cr="APPLICATION_LOAD_DEPENDENCIES",Dr="APPLICATION_LOAD_DEPENDENCIES_SUCCESS",Pr="APPLICATION_LOAD_TAGS",Ar="APPLICATION_LOAD_TAGS_SUCCESS",Tr="APPLICATION_LOAD_TYPES",Fr="APPLICATION_LOAD_TYPES_SUCCESS",Mr="APPLICATION_LOAD_PRICING_SUCCESS",Ir="APPLICATION_LOAD_PRICING_FAILED",Nr="APPLICATION_LOAD_CATEGORIES",jr="APPLICATION_LOAD_CATEGORIES_SUCCESS",Lr="APPLICATION_LOAD_CATEGORIES_FAILED",Rr="APPLICATION_SET_REDIRECT",Br="APPLICATION_LOAD_CONDITIONS",zr="APPLICATION_LOAD_CONDITIONS_SUCCESS",Wr="APPLICATION_LOAD_CONDITIONS_BY_TEMPLATE_SUCCESS",Ur="APPLICATION_SAVE_CONDITIONS",Vr="APPLICATION_SET_CONDITIONS_FOR_TEMPLATE",Hr="APPLICATION_SET_HEADER_HEIGHT",Gr="PROFILE_SYNC",qr="PROFILE_IS_VERIFIED",Qr="PROFILE_LOAD",$r="LOAD_FAVOURITES",Yr="LOAD_FAVOURITES_SUCCESS",Xr="LOAD_FAVOURITES_FAILED",Kr="FAVOURITES_FILTER",Zr="FAVOURITES_SET_PAGE",Jr="FAVOURITES_STARRED",eo="MY_RATINGS",to="PROFILE_SET_FAVOURITE",no="PROFILE_SET_FAVOURITE_SUCCESS",ro="PROFILE_SET_FAVOURITE_FAILED",oo="PROFILE_SET_RATING",io="PROFILE_SET_RATING_SUCCESS",ao="PROFILE_SET_RATING_FAILED",lo="LOAD_DOWNLOADS",so="LOAD_DOWNLOADS_SUCCESS",co="LOAD_DOWNLOADS_FAILED",uo="DOWNLOADS_SET_PAGE",po="LOAD_PURCHASED_ITEMS",fo="LOAD_ALL_PURCHASED_ITEMS",ho="LOAD_PURCHASED_ITEMS_SUCCESS",mo="LOAD_PURCHASED_ITEMS_FAILED",go="PURCHASED_ITEMS_SET_PAGE",vo="TEMPLATES_REQUESTED",yo="TEMPLATES_LOAD",bo="TEMPLATES_LOAD_SUCCESS",wo="TEMPLATES_LOAD_FAILED",Eo="TEMPLATES_SET_PAGE",ko="TEMPLATES_GET_TEMPLATE",Oo="TEMPLATES_GET_TEMPLATE_SUCCESS",So="TEMPLATES_GET_TEMPLATE_FAILED",xo="TEMPLATES_FEATURED_TEMPLATES",_o="TEMPLATES_FEATURED_TEMPLATES_SUCCESS",Co="TEMPLATES_FEATURED_TEMPLATES_FAILED",Do="TEMPLATES_TRENDING_TEMPLATES",Po="TEMPLATES_TRENDING_TEMPLATES_SUCCESS",Ao="TEMPLATES_TRENDING_TEMPLATES_FAILED",To="TEMPLATES_RELATED_TEMPLATES",Fo="TEMPLATES_RELATED_TEMPLATES_SUCCESS",Mo="TEMPLATES_RELATED_TEMPLATES_FAILED",Io="SAVED_TEMPLATES_LOAD",No="SAVED_TEMPLATES_LOADED",jo="SAVED_TEMPLATES_LOAD_SUCCESS",Lo="SAVED_TEMPLATES_SET_PAGE",Ro="SAVED_TEMPLATES_DELETE",Bo={REQUESTED:"CLOUDS_REQUESTED",LOAD:"CLOUDS_LOAD",LOAD_SUCCESS:"CLOUDS_LOAD_SUCCESS",LOAD_FAILED:"CLOUDS_LOAD_FAILED",STATUS_LOAD:"CLOUDS_STATUS_LOAD",STATUS_REQUEST:"CLOUDS_STATUS_REQUEST",STATUS_SUCCESS:"CLOUDS_STATUS_SUCCESS",STATUS_FAILED:"CLOUDS_STATUS_FAILED",SET_USAGES:"CLOUDS_SET_USAGES",SET_LIMIT:"CLOUDS_SET_LIMIT",SET_PAGE:"CLOUDS_SET_PAGE",SET_VIEW:"CLOUDS_SET_VIEW",DOWNLOAD:"CLOUDS_DOWNLOAD",DOWNLOAD_SUCCESS:"CLOUDS_DOWNLOAD_SUCCESS",COPY:"CLOUDS_COPY",COPY_SUCCESS:"CLOUDS_COPY_SUCCESS",MOVE:"CLOUDS_MOVE",MOVE_SUCCESS:"CLOUDS_MOVE_SUCCESS",DELETE:"CLOUDS_DELETE",DELETE_SUCCESS:"CLOUDS_DELETE_SUCCESS",PUSH:"CLOUDS_PUSH",CLEAR_PUSH2CLOUD:"CLEAR_PUSH2CLOUD",PUSHED:"CLOUDS_PUSHED",PUSH_SUCCESS:"CLOUDS_PUSH_SUCCESS",PUSH_FAILED:"CLOUDS_PUSH_FAILED",SEARCH:"CLOUDS_SEARCH",SEARCH_SUCCESS:"CLOUDS_SEARCH_SUCCESS",SEARCH_FAILED:"CLOUDS_SEARCH_FAILED"},zo={REQUESTED:"WORKSPACE_REQUESTED",LOAD:"WORKSPACE_LOAD",LOAD_SUCCESS:"WORKSPACE_LOAD_SUCCESS",LOAD_FAILED:"WORKSPACE_LOAD_FAILED",SET_VIEW:"WORKSPACE_SET_VIEW",LOAD_LISTS:"WORKSPACE_LOAD_LISTS",SET_LISTS:"WORKSPACE_SET_LISTS",CREATE:"WORKSPACE_CREATE",CREATE_SUCCESS:"WORKSPACE_CREATE_SUCCESS",SAVE:"WORKSPACE_SAVE",DELETE:"WORKSPACE_DELETE",DELETE_SUCCESS:"WORKSPACE_DELETE_SUCCESS",SET_PAGE:"WORKSPACE_SET_PAGE",SEARCH:"WORKSPACE_SEARCH",SEARCH_SUCCESS:"WORKSPACE_SEARCH_SUCCESS",SEARCH_FAILED:"WORKSPACE_SEARCH_FAILED"},Wo={REQUESTED:"SHARED_WORKSPACE_REQUESTED",LOAD:"SHARED_WORKSPACE_LOAD",LOAD_SUCCESS:"SHARED_WORKSPACE_LOAD_SUCCESS",LOAD_FAILED:"SHARED_WORKSPACE_LOAD_FAILED",SET_VIEW:"SHARED_WORKSPACE_SET_VIEW",LOAD_LISTS:"SHARED_WORKSPACE_LOAD_LISTS",SET_LISTS:"SHARED_WORKSPACE_SET_LISTS",SET_PAGE:"SHARED_WORKSPACE_SET_PAGE",SEARCH:"SHARED_WORKSPACE_SEARCH",SEARCH_SUCCESS:"SHARED_WORKSPACE_SEARCH_SUCCESS",SEARCH_FAILED:"SHARED_WORKSPACE_SEARCH_FAILED"},Uo={LOAD:"WORKSPACE_DETAILS_LOAD",REQUESTED:"WORKSPACE_DETAILS_REQUESTED",LOAD_FAILED:"WORKSPACE_DETAILS_LOAD_FAILED",LOAD_SUCCESS:"WORKSPACE_DETAILS_LOAD_SUCCESS",SET_VIEW:"WORKSPACE_DETAILS_SET_VIEW",SET:"WORKSPACE_DETAILS_SET",SAVE:"WORKSPACE_DETAILS_SAVE",DELETE:"WORKSPACE_DETAILS_DELETE",SET_PAGE:"WORKSPACE_DETAILS_SET_PAGE",SET_FILES:"WORKSPACE_DETAILS_SET_FILES",GET_FILES:"WORKSPACE_DETAILS_GET_FILES",GET_FILES_REQUESTED:"WORKSPACE_DETAILS_GET_FILES_REQUESTED",NO_FILES:"WORKSPACE_DETAILS_NO_FILES",ADD_FILE:"WORKSPACE_DETAILS_ADD_FILE",RESET_SEARCH:"WORKSPACE_DETAILS_RESET_SEARCH",SEARCH:"WORKSPACE_DETAILS_SEARCH",SEARCH_SUCCESS:"WORKSPACE_DETAILS_SEARCH_SUCCESS",SEARCH_FAILED:"WORKSPACE_DETAILS_SEARCH_FAILED"},Vo="FULL_SITE_IMPORT_CURRENT_STEP",Ho="FULL_SITE_IMPORT_CUSTOMIZER_STEP",Go="FULL_SITE_IMPORT_FSI_CLOSED",qo="FULL_SITE_IMPORT_SET_RESULTS",Qo="FULL_SITE_IMPORT_SET_FORMDATA",$o="FULL_SITE_IMPORT_SET_CACHE_DATA",Yo="FULL_SITE_IMPORT_RESET_FULL_SITE_IMPORT",Xo="FULL_SITE_IMPORT_UPDATE_PLUGIN_STATUS",Ko="FULL_SITE_IMPORT_SET_AVAILABLE_CREDIT",Zo="FULL_SITE_IMPORT_SHOW_AI_SIDEBAR",Jo="FULL_SITE_IMPORT_HIDE_AI_SIDEBAR",ei="FULL_SITE_IMPORT_EXPAND_AI_SIDEBAR",ti="FULL_SITE_IMPORT_COLLAPSE_AI_SIDEBAR",ni="FULL_SITE_IMPORT_SHOW_FSI_MODAL",ri="FULL_SITE_IMPORT_HIDE_FSI_MODAL",oi="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_REQUEST",ii="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_SUCCESS",ai="FULL_SITE_IMPORT_FETCH_PACK_IMPORT_INFO_FAILURE",li="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_REQUEST",si="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_SUCCESS",ci="FULL_SITE_IMPORT_FETCH_GOOGLE_FONTS_FAILURE",ui="FULL_SITE_IMPORT_RESET_PACK_INFO",di="FULL_SITE_IMPORT_TRIGGER_FSI_HANDLE_CLICK",pi=Pt(Pt(Pt(Pt(Pt(Pt(Pt({SET_SETTINGS:"SETTINGS_PAGE_SET_SETTINGS",SET_PLATFORM:"SETTINGS_PAGE_SET_PLATFORM",SET_COLORS:"SETTINGS_PAGE_SET_COLORS",SET_SELECTED_TYPOGRAPHY:"SETTINGS_PAGE_SET_SELECTED_TYPOGRAPHY"},"SET_COLORS","SETTINGS_PAGE_SET_COLORS"),"SET_SCREEN","SETTINGS_PAGE_SET_SCREEN"),"SET_CUSTOM_CSS","SETTINGS_PAGE_SET_CUSTOM_CSS"),"SET_LOGO_IMAGE","SETTINGS_PAGE_SET_LOGO_IMAGE"),"SET_LOGO_SIZE","SETTINGS_PAGE_SET_LOGO_SIZE"),"SET_SITE_TITLE","SETTINGS_PAGE_SET_SITE_TITLE"),"SET_SITE_TAGLINE","SETTINGS_PAGE_SET_SITE_TAGLINE");function fi(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function hi(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){fi(i,r,o,a,l,"next",e)}function l(e){fi(i,r,o,a,l,"throw",e)}a(void 0)})}}const mi=window.wp.apiFetch;var gi=a.n(mi);const vi=window.wp.url;var yi=a(2505),bi=a.n(yi);function wi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ei(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ei(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function Ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ki(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Oi(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Oi(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Oi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Oi(d,"constructor",c),Oi(c,"constructor",s),s.displayName="GeneratorFunction",Oi(c,o,"GeneratorFunction"),Oi(d),Oi(d,o,"Generator"),Oi(d,r,function(){return this}),Oi(d,"toString",function(){return"[object Generator]"}),(ki=function(){return{w:i,m:p}})()}function Oi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Oi=function(e,t,n,r){function i(t,n){Oi(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Oi(e,t,n,r)}var Si=function(e){return new Promise(function(t,n){var r=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach(function(t){e[t]&&(r[t]=e[t])}),e.innerHTML&&r.appendChild(document.createTextNode(e.innerHTML)),r.onload=function(){return t(!0)},r.onerror=function(){return n(new Error("Error loading asset."))},document.body.appendChild(r),("link"===r.nodeName.toLowerCase()||"script"===r.nodeName.toLowerCase()&&!r.src)&&t()})};function xi(){return _i.apply(this,arguments)}function _i(){return _i=hi(ki().m(function e(){var t,n,r,o,i,a,l,s;return ki().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,Ci(document.location.href);case 1:if(t=e.v){e.n=2;break}return e.a(2);case 2:n=(new window.DOMParser).parseFromString(t,"text/html"),r=["wp-blocks-js-after","essential-blocks-blocks-localize-js-extra","elementor-editor-js-before"],o=Array.from(n.querySelectorAll('link[rel="stylesheet"],script')).filter(function(e){return e.id&&(r.includes(e.id)||!document.getElementById(e.id))}),i=wi(o),e.p=3,i.s();case 4:if((a=i.n()).done){e.n=6;break}return l=a.value,e.n=5,Si(l);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,s=e.v,i.e(s);case 8:return e.p=8,i.f(),e.f(8);case 9:return e.a(2)}},e,null,[[3,7,8,9]])})),_i.apply(this,arguments)}var Ci=function(){var e=hi(ki().m(function e(t){var n,r,o,i;return ki().w(function(e){for(;;)if(0===e.n)return i=function(){return i=hi(ki().m(function e(t){var i,a,l;return ki().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,gi()({url:t,parse:!1,redirect:"manual"});case 1:return i=e.v,e.a(2,i.text());case 2:if(e.p=2,l=e.v,a=l.type,l.status,!("opaqueredirect"===a&&r<n)){e.n=3;break}return r++,e.a(2,o(t));case 3:return e.a(2,null)}},e,null,[[0,2]])})),i.apply(this,arguments)},o=function(e){return i.apply(this,arguments)},n=3,r=0,e.a(2,o(t))},e)}));return function(_x){return e.apply(this,arguments)}}();function Di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ai,Ti=function(e){return Pi({type:gr},e)},Fi=function(e){return Pi({type:vr},e)},Mi=function(e){return Pi({type:br},e)},Ii=function(e){return Pi({type:wr},e)},Ni=function(e){return Pi({type:kr},e)},ji=function(e){return Pi({type:Or},e)},Li=function(e){return Pi({type:pr},e)},Ri=function(e){return Pi({type:qr},e)},Bi=function(e){return Pi({type:fr},e)},zi=function(e){return Pi({type:$r},e)},Wi=function(e){return Pi({type:Yr},e)},Ui=function(e){return Pi({type:Xr},e)},Vi=function(e){return Pi({type:fo},e)},Hi=function(e){return Pi({type:po},e)},Gi=function(e){return Pi({type:ho},e)},qi=function(e){return Pi({type:mo},e)},Qi=function(e){return Pi({type:Jr},e)},$i=function(e){return Pi({type:eo},e)},Yi=function(e){return Pi({type:to},e)},Xi=function(e){return Pi({type:no},e)},Ki=function(e){return Pi({type:ro},e)},Zi=function(e){return Pi({type:io},e)},Ji=function(e){return Pi({type:ao},e)},ea=function(e){return Pi({type:lo},e)},ta=function(e){return Pi({type:so},e)},na=function(e){return Pi({type:co},e)},ra=["path"];function oa(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return ia(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ia(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ia(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,ia(d,"constructor",c),ia(c,"constructor",s),s.displayName="GeneratorFunction",ia(c,o,"GeneratorFunction"),ia(d),ia(d,o,"Generator"),ia(d,r,function(){return this}),ia(d,"toString",function(){return"[object Generator]"}),(oa=function(){return{w:i,m:p}})()}function ia(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ia=function(e,t,n,r){function i(t,n){ia(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ia(e,t,n,r)}function aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function la(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aa(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sa=window.templately.rest_args,ca=(window.templatelyDeveloper||{}).log,ua=void 0!==ca&&ca,da=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?e:204===e.status?null:e.json?e.json():Promise.reject(e)}(e,t)).catch(function(e){return pa(e,t)})};function pa(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var t={code:"invalid_json",message:(0,At.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch(function(){throw t})}(e).then(function(e){var t={code:"unknown_error",message:(0,At.__)("An unknown error occurred.")};throw e||t})}sa&&(gi().use(gi().createNonceMiddleware(null==sa?void 0:sa.nonce)),gi().use(gi().createRootURLMiddleware(null==sa?void 0:sa.endpoint))),void 0===(null===(Ai=window)||void 0===Ai?void 0:Ai.fetch)&&gi().setFetchHandler(function(e){var t=e.url,n=e.path,r=e.data,o=e.method;return bi()({url:t||n,method:o,data:r}).then(function(e){return null==e?void 0:e.data}).catch(function(e){return Promise.reject(e.response.data)})});var fa=function(){var e=hi(oa().m(function e(t,n){var r,o=arguments;return oa().w(function(e){for(;;)switch(e.n){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:{},e.n=1,ha(t,n,la(la({},r),{},{method:"GET"}));case 1:return e.a(2,e.v)}},e)}));return function(_x,t){return e.apply(this,arguments)}}(),ha=function(){var e=hi(oa().m(function e(t,n){var r,o,i,a=arguments;return oa().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:{},o=a.length>3&&void 0!==a[3]&&a[3],e.p=1,e.n=2,ya(t,n,r,o);case 2:case 5:return e.a(2,e.v);case 3:if(e.p=3,"retry_again"!==(null==(i=e.v)?void 0:i.code)){e.n=6;break}return e.n=4,xi();case 4:return e.n=5,ya(t,n,r,o);case 6:throw i;case 7:return e.a(2)}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}(),ma=function(e){if(e&&e.headers&&Yx&&Yx.dispatch)try{var t=e.headers.get("X-Templately-Verified");t&&["true","1","yes","on"].includes(t.toLowerCase())&&(Yx.dispatch(Bi({is_verified:!0})),ua&&console.log("User verification status updated via X-Templately-Verified header"))}catch(e){ua&&console.error("Error checking verification header:",e)}},ga=function(e){if(e&&e.headers&&Yx&&Yx.dispatch)try{var t=e.headers.get("X-Templately-Disconnected");t&&["true","1","yes","on"].includes(t.toLowerCase())&&(Yx.dispatch(Pi({type:mr},{is_disconnected:!0})),ua&&console.log("Site disconnection detected via X-Templately-Disconnected header"))}catch(e){ua&&console.error("Error checking disconnection header:",e)}},va=function(){var e=hi(oa().m(function e(t){var n,r,o;return oa().w(function(e){for(;;)switch(e.n){case 0:if(n=t.path,r=Wn(t,ra),n){e.n=1;break}throw new Error('secureApiFetch: Request options must include a "path" property.');case 1:return o=la(la({},r),{},{path:n,parse:!1}),(n.startsWith("http")||n.includes("/wp-admin/admin-ajax.php"))&&(o.url=n,delete o.path),e.a(2,gi()(o).then(function(e){return ma(e),ga(e),Promise.resolve(e).then(function(e){if(e.status>=200&&e.status<300)return e;throw e}).catch(function(e){return pa(e,!0)}).then(function(e){return da(e,!0)})}).catch(function(e){return ga(e),Promise.reject(e).catch(function(e){return pa(e,!0)}).then(function(e){return da(e,!0)})}))}},e)}));return function(t){return e.apply(this,arguments)}}(),ya=function(){var e=hi(oa().m(function e(t,n){var r,o,i,a,l,s,c=arguments;return oa().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=c.length>3&&void 0!==c[3]&&c[3],o={response:void 0,error:void 0},i=la({path:t,method:"POST",headers:{"Content-Type":"application/json"}},c.length>2&&void 0!==c[2]?c[2]:{}),n&&"POST"===i.method&&(i.data=n),n&&"GET"===i.method&&(a=(0,vi.addQueryArgs)(i.path,n),i.path=a),!r){e.n=2;break}return e.n=1,va(i);case 1:return e.a(2,e.v);case 2:return e.p=2,e.n=3,va(i);case 3:l=e.v,o=la(la({},o),{},{response:l}),e.n=5;break;case 4:e.p=4,s=e.v,o=la(la({},o),{},{error:s});case 5:return ua&&console.log("Templately API Return: ",t,o),e.a(2,o)}},e,null,[[2,4]])}));return function(t,n){return e.apply(this,arguments)}}(),ba=function(){var e=hi(oa().m(function e(t){var n,r,o;return oa().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!(r=null===(n=t.headers)||void 0===n?void 0:n.get("content-type"))||!r.includes("application/json")){e.n=4;break}return e.n=1,t.json();case 1:if(!(o=e.v).message){e.n=2;break}return e.a(2,o.message);case 2:if(!o.error){e.n=3;break}return e.a(2,"string"==typeof o.error?o.error:o.error.message||(0,At.__)("Request failed","templately"));case 3:if(!o.data){e.n=4;break}return e.a(2,"string"==typeof o.data?o.data:o.data.message||(0,At.__)("Request failed","templately"));case 4:e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2,"HTTP error! status: ".concat(t.status))}},e,null,[[0,5]])}));return function(t){return e.apply(this,arguments)}}(),wa=function(){var e=hi(oa().m(function e(t,n){var r,o,i,a,l,s,c,u,d,p,f=arguments;return oa().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=f.length>2&&void 0!==f[2]?f[2]:{},t){e.n=1;break}throw new Error("URL is required for FormData API call");case 1:if(n instanceof FormData){e.n=2;break}throw new Error("Second parameter must be a FormData object");case 2:return(o=la({method:"POST",body:n},r)).headers&&o.headers["Content-Type"]&&delete o.headers["Content-Type"],e.p=3,e.n=4,window.fetch(t,o);case 4:if(i=e.v,ma(i),ga(i),i.ok){e.n=6;break}return e.n=5,ba(i);case 5:throw a=e.v,new Error(a);case 6:return e.p=6,e.n=7,i.json();case 7:return l=e.v,ua&&console.log("Templately FormData API Return: ",t,l),e.a(2,l);case 8:return e.p=8,d=e.v,e.p=9,e.n=10,i.text();case 10:return s=e.v,ua&&console.log("Templately FormData API Return: ",t,s),e.a(2,s);case 11:throw e.p=11,e.v,d;case 12:if(e.p=12,p=e.v,ga(p),ga(null==p?void 0:p.response),e.p=13,!p.response){e.n=15;break}if(!(u=null===(c=p.response.headers)||void 0===c?void 0:c.get("content-type"))||!u.includes("application/json")){e.n=15;break}return e.n=14,p.response.json();case 14:case 16:throw e.v;case 15:if("function"!=typeof p.json){e.n=17;break}return e.n=16,p.json();case 17:throw p;case 18:throw e.p=18,e.v,{error:"Request and parsing failed",message:p.message||"Unknown error",originalError:p};case 19:return e.a(2)}},e,null,[[13,18],[9,11],[6,8],[3,12]])}));return function(t,n){return e.apply(this,arguments)}}();const Ea=window.lodash,ka=a.p+"images/ratting.png",Oa=a.p+"images/trending.png",Sa=a.p+"images/new.png",xa=a.p+"images/featured.png",_a=a.p+"images/popular.png",Ca=a.p+"images/exclusive.png";var Da,Pa;function Aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aa(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fa=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"packs";return"blocks"==e?"sections":e},Ma=function(e){return String(Math.floor(Number(e)))===e},Ia=function(e){return null!==e&&"object"===ne(e)&&!Na(e)},Na=function(e){return null!==e&&"object"===ne(e)&&Array.isArray(e)},ja=function(e,t){return t?e+"_"+t.toUpperCase():e},La=function(e,t,n,r){void 0===r&&(r=0);for(var o=(0,Ea.toPath)(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e},Ra=function(e,t,n){for(var r=(0,Ea.clone)(e),o=r,i=0,a=(0,Ea.toPath)(t);i<a.length-1;i++){var l=a[i],s=La(e,a.slice(0,i+1));if(s&&(Ia(s)||Array.isArray(s)))o=o[l]=(0,Ea.clone)(s);else{var c=a[i+1];o=o[l]=Ma(c)&&Number(c)>=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)},Ba=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())},za=function(e){return/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088F\u0897-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u180F\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD4A-\uDD65\uDD69-\uDD6D\uDD6F-\uDD85\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDEC2-\uDEC7\uDEFA-\uDF1C\uDF27\uDF30-\uDF50\uDF70-\uDF85\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC70-\uDC75\uDC7F-\uDCBA\uDCC2\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E-\uDE41\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD3\uDFE1\uDFE2]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B\uDF40-\uDF46]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEB0-\uDEF8\uDF60-\uDF67\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF6\uDF00-\uDF10\uDF12-\uDF3A\uDF3E-\uDF42\uDF5A\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC40-\uDC55\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD2F]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0-\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC30-\uDC6D\uDC8F\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDE90-\uDEAE\uDEC0-\uDEEF]|\uD839[\uDCD0-\uDCEF\uDDD0-\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEF5\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]|\uDB40[\uDD00-\uDDEF])+([\t-\r '\x2D\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF](?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088F\u0897-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u180F\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD4A-\uDD65\uDD69-\uDD6D\uDD6F-\uDD85\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDEC2-\uDEC7\uDEFA-\uDF1C\uDF27\uDF30-\uDF50\uDF70-\uDF85\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC70-\uDC75\uDC7F-\uDCBA\uDCC2\uDCD0-\uDCE8\uDD00-\uDD34\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE\uDDCF\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E-\uDE41\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD3\uDFE1\uDFE2]|\uD805[\uDC00-\uDC4A\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE80-\uDEB8\uDF00-\uDF1A\uDF1D-\uDF2B\uDF40-\uDF46]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEB0-\uDEF8\uDF60-\uDF67\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF6\uDF00-\uDF10\uDF12-\uDF3A\uDF3E-\uDF42\uDF5A\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC40-\uDC55\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD2F]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0-\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC30-\uDC6D\uDC8F\uDD00-\uDD2C\uDD30-\uDD3D\uDD4E\uDE90-\uDEAE\uDEC0-\uDEEF]|\uD839[\uDCD0-\uDCEF\uDDD0-\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEF5\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]|\uDB40[\uDD00-\uDDEF])+)*$/.test(e=e||"")},Wa=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},Ua=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=[];return null!=e&&e.length>0&&"object"==ne(e)&&e.map(function(e){var a=r.length>0?Wa(e,r):Ta({},e),l=!1;o.indexOf(a[n])>-1&&(l=!0),i.push(Ta(Ta({},a),{},{value:a[n],label:a.name,shared:t,isDisabled:l}))}),i},Va=function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.childNodes,r=n.length;r--;)if(1==n[r].nodeType)return!0;return!1},Ha=function(e,t){var n,r;if((null==t?void 0:t.length)>0)return null!==(n=null===(r=Fe(e,"/"+t))||void 0===r?void 0:r.params)&&void 0!==n?n:void 0},Ga=function(e){return e.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},qa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"lifetime",n="https://templately.com/checkout/",r={};return null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api&&(n="https://templately.dev/checkout/"),"lifetime"===t&&(r=Ta(Ta({},r),{},{type:"one_time"})),r=Ta(Ta({},r),{},{utm_source:"plugin",utm_medium:"upgradePlan"}),(0,vi.addQueryArgs)(n,r)},Qa=function(e,t){var n,r="https://templately.com/"+t+"/";return null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.dev_api&&(r="https://templately.dev/"+t+"/"),(r+=e)+"?utm_source=plugin&utm_medium=itemDetailsHeader"},$a=null!==(Da=window.templatelyDeveloper)&&void 0!==Da&&Da.log?window.console.log.bind(window.console):function(){},Ya=(null!==(Pa=window.templatelyDeveloper)&&void 0!==Pa&&Pa.log&&window.console.trace.bind(window.console),function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t="",n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return t}),Xa=[{key:"top_rated",title:"Top Rated",image:ka,class:"ratting"},{key:"trending",title:"Trending",image:Oa,class:"trending"},{key:"popular",title:"Popular",image:_a,class:"popular"},{key:"new_arrival",title:"New Arrival",image:Sa,class:"new"},{key:"exclusive",title:"Exclusive",image:Ca,class:"exclusive"},{key:"featured",title:"Featured",image:xa,class:"featured"}],Ka=function(e,t){var n,r,o,i,a,l="",s=!0;if(null==(null==t?void 0:t[e])&&"email"!=e)return{isValid:s=!0};switch(e){case"email":0!=(null===(n=t.email)||void 0===n||null===(n=n.trim())||void 0===n?void 0:n.length)&&Ba(t.email)||(s=!1,l=(0,At.__)("Please enter a valid email address.","templately"));break;case"api_key":0==(null===(r=t.api_key)||void 0===r||null===(r=r.trim())||void 0===r?void 0:r.length)&&(s=!1),l=(0,At.__)("Please provide a valid API Key.","templately");break;case"first_name":0==(null===(o=t.first_name)||void 0===o||null===(o=o.trim())||void 0===o?void 0:o.length)?(s=!1,l=(0,At.__)("First name cannot be empty.","templately")):za(t.first_name)||(s=!1,l=(0,At.__)("The First Name may only contain letters, dashes and spaces.","templately"));break;case"last_name":0==(null===(i=t.last_name)||void 0===i||null===(i=i.trim())||void 0===i?void 0:i.length)?(s=!1,l=(0,At.__)("Last name cannot be empty.","templately")):za(t.last_name)||(s=!1,l=(0,At.__)("The Last Name may only contain letters, dashes and spaces.","templately"));break;case"password":l=(0,At.__)("Password cannot be empty.","templately"),null!=t.password&&((a=t.password).length<8||!/[A-Z]/g.test(a)||!/[a-z]/g.test(a)||!/[0-9]/g.test(a)||/["\\]/g.test(a))&&(s=!1,l=(0,At.__)("Password must contain at least 8 characters, uppercase, lowercase and numbers.","templately"));break;case"confirm_password":null!=(null==t?void 0:t.confirm_password)&&t.password!==t.confirm_password&&(s=!1,l=(0,At.__)("Password not matched!","templately"))}return{title:(0,At.__)("Oops...!","templately"),content:l,isValid:s}},Za=a(8465),Ja=a.n(Za),el=a(9644),tl=a.n(el);const nl=function(e){var t=e.header,n=e.className,r=void 0===n?"":n;return he().createElement("div",{className:"templately-sweetalert-header ".concat(r)},he().createElement("h3",null,t))},rl=function(e){var t=e.children;return he().createElement("div",{className:"templately-sweetalert-body"},t)},ol=function(e){var t=e.icon,n=void 0===t?null:t,r=e.children,o=e.className,i=void 0===o?"":o,a=e.header,l=void 0===a?null:a,s=e.headerClass,c=void 0===s?"":s,u=e.hideHeader,d=void 0!==u&&u;return he().createElement(he().Fragment,null,n&&he().createElement("span",{className:"templately-sweetalert-icon --shape-1"},n),he().createElement("div",{className:"templately-sweetalert-container ".concat(i)},null!=l&&!d&&he().createElement(nl,{className:c,header:l}),he().createElement(rl,null,r)))},il=function(e){var t=e.children,n=e.className,r=void 0===n?"":n;return he().createElement("div",{className:"templately-row ".concat(r)},t)},al=function(e){var t=e.wrapper,n=void 0!==t&&t,r=e.wrapperClass,o=void 0===r?"":r,i=e.children,a=e.className,l=void 0===a?"":a,s=e.column,c=void 0===s?null:s,u=Vn()(l,Pt({"templately-col":null==c},"templately-col-".concat(c),null!=c));return he().createElement("div",{className:u},n&&he().createElement("div",{className:o},i),!n&&i)},ll=function(e){var t=e.template,n="";return"lists"===t&&(n=he().createElement(he().Fragment,null,he().createElement("div",{className:"tph-col-4 small rounded"}),he().createElement("div",{className:"tph-item small rounded"}),he().createElement("div",{className:"tph-col-3 small rounded"}),he().createElement("div",{className:"tph-col-7 small rounded"}))),"clouds_status"===t&&(n=he().createElement(he().Fragment,null,he().createElement("div",{className:"tph-col-10 medium"}),he().createElement("div",{className:"tph-item small rounded"}),he().createElement("div",{className:"tph-col-7 tiny"}))),"featuredItems"===t&&(n=he().createElement("div",{className:"tph-row d-flex"},he().createElement("div",{className:"tph-col-3 rounded",style:{height:"200px",margin:"0px 10px"}}),he().createElement("div",{className:"tph-col-3 rounded",style:{height:"200px",margin:"0px 10px"}}),he().createElement("div",{className:"tph-col-3 rounded",style:{height:"200px",margin:"0px 10px"}}),he().createElement("div",{className:"tph-col-3 rounded",style:{height:"200px",margin:"0px 10px"}}))),he().createElement("div",{className:"templately-ph-wrapper"},n)};var sl=["code","message","platform"];const cl=function(e){var t=e.code,n=e.message,r=e.platform,o=Wn(e,sl),i=rt();return(0,pe.useEffect)(function(){"invalid_api_key"!==t&&"is_signed_failed"!==t||(o.logout({isGloballySigned:o.isGloballySigned}),i(nb("sign-in",{platform:r}),{replace:!0,state:{signed_in_failed:!0}}))},[t]),React.createElement("div",{className:"templately-error-wrapper"},React.createElement("div",{className:"templately-error"},React.createElement("p",null,React.createElement("strong",null,t,":")," ",n)))},ul=function(e){var t,n=e.className,r=ce(Ct(),1)[0],o=ce((0,pe.useState)(null!==(t=null==r?void 0:r.get("q"))&&void 0!==t?t:""),2),i=o[0],a=o[1],l=ce((0,pe.useState)(!1),2),s=l[0],c=l[1],u=rt(),d=tt();(0,pe.useEffect)(function(){var e=(0,vi.getQueryArgs)(d.search),t=e.path;i.length>=3&&!0===s&&(e.q=i,u(nb(t,e),{replace:!0}),c(!1)),"reset"===s&&(u(nb(t,e,["q"]),{replace:!0}),a(""),c(!1))},[s]);var p=Vn()("templately-search",n,{"search-active":null!==(null==r?void 0:r.get("q"))});return he().createElement("div",{className:p},he().createElement(hl,{wrapper:!1,onKeyDown:function(e){return c(13===(null==e?void 0:e.keyCode))},value:i,onChange:function(e){return a(e.currentTarget.value)},placeholder:(0,At.__)("Type and hit enter...","templately")}),he().createElement(pl,{className:"templately-search-button",onClick:function(){null==r.get("q")?c(!0):c("reset")}},null!=r.get("q")?he().createElement(sr,null):he().createElement(ir,null)))};var dl=["label","onClick","className","children"];const pl=function(e){var t=e.label,n=void 0===t?"":t,r=e.onClick,o=void 0===r?function(e){}:r,i=e.className,a=void 0===i?"":i,l=e.children,s=Wn(e,dl);return he().createElement("button",re({},s,{className:"templately-button ".concat(a),onClick:function(e){return o(e)}}),n,l)};var fl=["wrapper","className"];const hl=function(e){var t=e.wrapper,n=void 0===t||t,r=e.className,o=Wn(e,fl);return he().createElement(he().Fragment,null,n?he().createElement("div",{className:r},he().createElement("input",re({type:"text"},o))):he().createElement("input",re({type:"text",className:r},o)))};var ml=["href","name","wrapper","children"];const gl=function(e){var t,n=e.href,r=e.name,o=e.wrapper,i=void 0!==o&&o,a=e.children,l=Wn(e,ml),s=he().createElement(he().Fragment,null,n&&(t=n,new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t))?he().createElement("a",{target:"_blank",rel:"nofollow",href:n},r):r,a);return he().createElement("label",l,i?he().createElement("span",null,s):s)};var vl={animation:"spin 2s linear infinite"};const yl=function(e){return he().createElement("svg",re({width:"154",height:"154",viewBox:"0 0 154 154",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:vl},e),he().createElement("style",null,"@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"),he().createElement("g",{filter:"url(#filter0_ii_267_161)"},he().createElement("path",{d:"M146.804 76.976C150.752 76.976 153.986 73.7689 153.62 69.8383C152.084 53.3371 145.251 37.6999 134.045 25.3191C121.233 11.1647 103.617 2.27656 84.62 0.380621C65.6226 -1.51532 46.5984 3.71622 31.2416 15.0594C17.8091 24.9812 8.02095 38.9597 3.2538 54.8318C2.11826 58.6125 4.65527 62.3956 8.52501 63.1758L11.2711 63.7294C15.1408 64.5096 18.8694 61.9851 20.1048 58.2358C23.9668 46.5151 31.3798 36.2125 41.3995 28.8115C53.3454 19.9877 68.1442 15.9181 82.9222 17.3929C97.7002 18.8678 111.403 25.7818 121.369 36.7924C129.729 46.0277 134.959 57.5921 136.429 69.8449C136.899 73.7644 140.055 76.976 144.003 76.976H146.804Z",fill:"url(#paint0_radial_267_161)"})),he().createElement("defs",null,he().createElement("filter",{id:"filter0_ii_267_161",x:"1.9812",y:"-2",width:"155.667",height:"80.976",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},he().createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),he().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),he().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),he().createElement("feMorphology",{radius:"2",operator:"erode",in:"SourceAlpha",result:"effect1_innerShadow_267_161"}),he().createElement("feOffset",{dx:"-1",dy:"-2"}),he().createElement("feGaussianBlur",{stdDeviation:"1.5"}),he().createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),he().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),he().createElement("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_267_161"}),he().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),he().createElement("feMorphology",{radius:"1",operator:"dilate",in:"SourceAlpha",result:"effect2_innerShadow_267_161"}),he().createElement("feOffset",{dx:"4",dy:"2"}),he().createElement("feGaussianBlur",{stdDeviation:"4.5"}),he().createElement("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),he().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),he().createElement("feBlend",{mode:"normal",in2:"effect1_innerShadow_267_161",result:"effect2_innerShadow_267_161"})),he().createElement("radialGradient",{id:"paint0_radial_267_161",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(143.2 58.9146) rotate(135.264) scale(98.1544 195.02)"},he().createElement("stop",{stopColor:"#361595"}),he().createElement("stop",{offset:"0.354309",stopColor:"#73AAF6"}),he().createElement("stop",{offset:"0.65428",stopColor:"#D7E8FF"}),he().createElement("stop",{offset:"1",stopColor:"#D7E8FF",stopOpacity:"0"}))))};var bl=["style","template","text","description","className","isWhiteLabel"],wl=window.templately.loadingImage;const El=function(e){var t=e.style,n=void 0===t?"logo":t,r=e.template,o=void 0===r?null:r,i=e.text,a=void 0===i?"":i,l=e.description,s=void 0===l?"":l,c=e.className,u=void 0===c?"":c,d=e.isWhiteLabel,p=void 0!==d&&d,f=(Wn(e,bl),Vn()("templately-preloader",u,"templately-preloader-".concat(n)));return he().createElement("div",{className:f},"logo"===n&&(p?he().createElement(yl,null):he().createElement("img",{src:wl,alt:"Templately"})),"placeholder"===n&&he().createElement(ll,{template:o}),a&&he().createElement("div",{className:"tp-waviy"},Array.from(a).map(function(e,t){return he().createElement("span",{key:t,style:Pt({},"--i",t+1)},e)})),s&&he().createElement("p",{className:"tp-description"},s))};function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kl(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Sl=tl()(Ja()),xl=function(){var e,t,n,r,o,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s={target:"#templately-wrapper",heightAuto:!1,showConfirmButton:!1,allowOutsideClick:!0,showCloseButton:!1,loaderHtml:he().createElement(El,null)},c={container:"templately-sweetalert ",popup:"templately-popup ",loader:"templately-sweetalert-loader ",closeButton:"templately-sweetalert-close ",htmlContainer:"templately-sweetalert-html "};return null!==(e=a=a!={}?Ol(Ol({},s),a):s)&&void 0!==e&&e.customClass&&(c.container+=null!==(t=a.customClass.container)&&void 0!==t?t:"",c.popup+=null!==(n=a.customClass.popup)&&void 0!==n?n:"",c.loader+=null!==(r=a.customClass.loader)&&void 0!==r?r:"",c.closeButton+=null!==(o=a.customClass.closeButton)&&void 0!==o?o:"",c.htmlContainer+=null!==(i=a.customClass.htmlContainer)&&void 0!==i?i:""),a.customClass=c,l&&(a.html=he().createElement(Lt,{store:Yx},a.html)),Sl.fire(a).then(function(e){var t,n;return e.isDismissed?((null===(n=a)||void 0===n?void 0:n.dispatch)&&a.dispatch((0,vy.closeModal)()),e):(null!==(t=a)&&void 0!==t&&t.onConfirm&&a.onConfirm(e),e)}).catch(function(e){var t;return null!==(t=a)&&void 0!==t&&t.onError&&a.onError(e),e})},_l=function(e,t){var n={icon:"success",timer:1500,html:null},r=null;if(!0===(null==t?void 0:t[e.key])){var o,i=Ol({},e.success);t.message&&(i.content=t.message),r=null!==(o=null==i?void 0:i.args)&&void 0!==o?o:null,n=Ol(Ol({},n),{},{html:he().createElement(oC,re({},i,{contentArgs:null==t?void 0:t.contentArgs}))})}else if(!1===(null==t?void 0:t[e.key])){var a,l=Ol({},e.error);t.message&&(l.content=t.message),r=null!==(a=null==l?void 0:l.args)&&void 0!==a?a:null,n=Ol(Ol({},n),{},{icon:"error",html:he().createElement(oC,re({},l,{contentArgs:null==t?void 0:t.contentArgs}))})}null!=r&&(n=Ol(Ol({},n),r)),null!=n.html&&xl(n)},Cl=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Sl.getCloseButton();e?(t.classList.add("is-disabled"),t.setAttribute("disabled",!0)):(t.removeAttribute("disabled"),t.classList.remove("is-disabled"))};function Dl(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Pl=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Al=()=>Math.random().toString(36).substring(7).split("").join("."),Tl={INIT:`@@redux/INIT${Al()}`,REPLACE:`@@redux/REPLACE${Al()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Al()}`};function Fl(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Ml(e,t,n){if("function"!=typeof e)throw new Error(Dl(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Dl(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Dl(1));return n(Ml)(e,t)}let r=e,o=t,i=new Map,a=i,l=0,s=!1;function c(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function u(){if(s)throw new Error(Dl(3));return o}function d(e){if("function"!=typeof e)throw new Error(Dl(4));if(s)throw new Error(Dl(5));let t=!0;c();const n=l++;return a.set(n,e),function(){if(t){if(s)throw new Error(Dl(6));t=!1,c(),a.delete(n),i=null}}}function p(e){if(!Fl(e))throw new Error(Dl(7));if(void 0===e.type)throw new Error(Dl(8));if("string"!=typeof e.type)throw new Error(Dl(17));if(s)throw new Error(Dl(9));try{s=!0,o=r(o,e)}finally{s=!1}return(i=a).forEach(e=>{e()}),e}return p({type:Tl.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Dl(10));r=e,p({type:Tl.REPLACE})},[Pl]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Dl(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Pl](){return this}}}}}function Il(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:Tl.INIT}))throw new Error(Dl(12));if(void 0===n(void 0,{type:Tl.PROBE_UNKNOWN_ACTION()}))throw new Error(Dl(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const l=r[o],s=n[l],c=e[l],u=s(c,t);if(void 0===u)throw t&&t.type,new Error(Dl(14));a[l]=u,i=i||u!==c}return i=i||r.length!==Object.keys(e).length,i?a:e}}function Nl(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||se(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var jl,Ll,Rl,Bl,zl=["type"];function Wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ul(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vl={isLoading:!0,items:[],error:null},Hl={isLoading:!0,items:[],error:null},Gl={dependencies:{include:[],exclude:[]},tags:[],results:{},doQuery:!1,prevQuery:!1},ql={platform:"elementor",has_elementor:null!==(jl=Boolean(window.templately.has_elementor))&&void 0!==jl&&jl,has_elementor_pro:null!==(Ll=Boolean(window.templately.has_elementor_pro))&&void 0!==Ll&&Ll,current_screen:null!==(Rl=window.templately.current_screen)&&void 0!==Rl?Rl:"templately",ui_theme:null!==(Bl=window.templately.theme)&&void 0!==Bl?Bl:"light",plan:"all",headerHeight:0,categories:{isLoading:!0,lists:[]},templateTypes:{isLoading:!0,lists:[]},dependencies:{},tags:[],pricing:{isLoading:!0,error:null,data:[]},error:null,filter:Gl,counts:null,featured:Vl,trending:Hl,related:{isLoading:!0,items:[],error:null},redirect:null,fullSiteImport:{currentStep:1,results:null,aiSidebarContext:{id:null,show:!1,content:{},expanded:!1},fsiModalContext:{show:!1,aiTemplates:null},packInfo:{data:null,loading:!1,error:null},googleFonts:{data:null,loading:!1,error:null}}};var Ql=["type","current_page","total_page","platform","data","meta"],$l=["meta"];function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kl=window.templately.is_signed.user,Zl=null!=Kl?Kl:{},Jl=Zl.meta,es=void 0===Jl?null:Jl,ts=Wn(Zl,["meta"]),ns={isLoading:!1,syncing:!1,error:null,prevData:null,favourites:{isLoading:!0,currentPage:1,totalPage:1,type:"all",plan:"all"},downloads:{isLoading:!0},purchasedItems:{isLoading:!0,all:null},data:null,favourite:{loading:!1,error:null},rating:{loading:!1,error:null}};Object.keys(ts).length>0&&(ns=Xl(Xl({},ns),{},{data:ts})),null!=es&&(ns=Xl(Xl({},ns),es));var rs=["search"],os=["type"],is=["type"],as=["type"];function ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ss(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ls(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ls(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var cs={isLoading:!0,limit:0,usage:0,error:null},us={status:cs,isLoading:!0,view:"list",error:null,items:{},search:{},push2cloud:{isLoading:!1}};var ds=["type"];function ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ps(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ps(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var hs={isLoading:!0,currentPage:1,totalPage:1,error:null,view:"grid",lists:[],search:{keyword:"",context:"",data:[]}};function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var vs={isLoading:!0,currentPage:1,totalPage:1,view:"list",error:null,lists:[],search:{keyword:"",context:"",data:[]}};var ys=["type"];function bs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ws(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bs(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Es={isLoading:!1,keyword:"",context:"",data:{currentPage:1,totalPage:1,1:[]}},ks={isLoading:!0,isFilesLoading:!0,view:"list",error:null,search:Es};var Os=["type","platform","currentPage","totalPage","data"];function Ss(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ss(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ss(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _s={isLoading:!0,elementor:{currentPage:1,totalPage:1}};var Cs=["type"];function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ds(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var As={platform:"elementor",isLoading:!1,conditions:[],conditionsByTemplate:{},conditionsForSave:{}};var Ts,Fs,Ms,Is,Ns=["type"];function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ls(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rs=(0,Ea.cloneDeep)(null!==(Ts=null===(Fs=window.templately)||void 0===Fs?void 0:Fs.settings)&&void 0!==Ts?Ts:{}),Bs={settings:Rs,platform:(null==Rs?void 0:Rs.imported_platform)||(null!=Rs&&Rs.has_elementor?"elementor":"gutenberg"),logoImage:null!==(Ms=null==Rs?void 0:Rs.site_logo)&&void 0!==Ms?Ms:null,customCSS:null!==(Is=null==Rs?void 0:Rs.customCSS)&&void 0!==Is?Is:null};var zs=Symbol.for("immer-nothing"),Ws=Symbol.for("immer-draftable"),Us=Symbol.for("immer-state");function Vs(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Hs=Object,Gs=Hs.getPrototypeOf,qs="constructor",Qs="prototype",$s="configurable",Ys="enumerable",Xs="writable",Ks="value",Zs=e=>!!e&&!!e[Us];function Js(e){return!!e&&(nc(e)||sc(e)||!!e[Ws]||!!e[qs]?.[Ws]||cc(e)||uc(e))}var ec=Hs[Qs][qs].toString(),tc=new WeakMap;function nc(e){if(!e||!dc(e))return!1;const t=Gs(e);if(null===t||t===Hs[Qs])return!0;const n=Hs.hasOwnProperty.call(t,qs)&&t[qs];if(n===Object)return!0;if(!pc(n))return!1;let r=tc.get(n);return void 0===r&&(r=Function.toString.call(n),tc.set(n,r)),r===ec}function rc(e,t,n=!0){0===oc(e)?(n?Reflect.ownKeys(e):Hs.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function oc(e){const t=e[Us];return t?t.type_:sc(e)?1:cc(e)?2:uc(e)?3:0}var ic=(e,t,n=oc(e))=>2===n?e.has(t):Hs[Qs].hasOwnProperty.call(e,t),ac=(e,t,n=oc(e))=>2===n?e.get(t):e[t],lc=(e,t,n,r=oc(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},sc=Array.isArray,cc=e=>e instanceof Map,uc=e=>e instanceof Set,dc=e=>"object"==typeof e,pc=e=>"function"==typeof e,fc=e=>"boolean"==typeof e,hc=e=>e.copy_||e.base_,mc=e=>e.modified_?e.copy_:e.base_;function gc(e,t){if(cc(e))return new Map(e);if(uc(e))return new Set(e);if(sc(e))return Array[Qs].slice.call(e);const n=nc(e);if(!0===t||"class_only"===t&&!n){const t=Hs.getOwnPropertyDescriptors(e);delete t[Us];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i[Xs]&&(i[Xs]=!0,i[$s]=!0),(i.get||i.set)&&(t[o]={[$s]:!0,[Xs]:!0,[Ys]:i[Ys],[Ks]:e[o]})}return Hs.create(Gs(e),t)}{const t=Gs(e);if(null!==t&&n)return{...e};const r=Hs.create(t);return Hs.assign(r,e)}}function vc(e,t=!1){return bc(e)||Zs(e)||!Js(e)||(oc(e)>1&&Hs.defineProperties(e,{set:yc,add:yc,clear:yc,delete:yc}),Hs.freeze(e),t&&rc(e,(e,t)=>{vc(t,!0)},!1)),e}var yc={[Ks]:function(){Vs(2)}};function bc(e){return null===e||!dc(e)||Hs.isFrozen(e)}var wc="MapSet",Ec="Patches",kc="ArrayMethods",Oc={};function Sc(e){const t=Oc[e];return t||Vs(0),t}var xc,_c=e=>!!Oc[e],Cc=()=>xc;function Dc(e,t){t&&(e.patchPlugin_=Sc(Ec),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pc(e){Ac(e),e.drafts_.forEach(Fc),e.drafts_=null}function Ac(e){e===xc&&(xc=e.parent_)}var Tc=e=>xc={drafts_:[],parent_:xc,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:_c(wc)?Sc(wc):void 0,arrayMethodsPlugin_:_c(kc)?Sc(kc):void 0};function Fc(e){const t=e[Us];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Mc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(void 0!==e&&e!==n){n[Us].modified_&&(Pc(t),Vs(4)),Js(e)&&(e=Ic(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Us].base_,e,t)}else e=Ic(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&vc(t,n)}(t,e,!0),Pc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zs?e:void 0}function Ic(e,t){if(bc(t))return t;const n=t[Us];if(!n)return zc(t,e.handledSet_,e);if(!jc(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Bc(n,e)}return n.copy_}function Nc(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var jc=(e,t)=>e.scope_===t,Lc=[];function Rc(e,t,n,r){const o=hc(e),i=e.type_;if(void 0!==r&&ac(o,r,i)===t)return void lc(o,r,n,i);if(!e.draftLocations_){const t=e.draftLocations_=new Map;rc(o,(e,n)=>{if(Zs(n)){const r=t.get(n)||[];r.push(e),t.set(n,r)}})}const a=e.draftLocations_.get(t)??Lc;for(const e of a)lc(o,e,n,i)}function Bc(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:n}=t;if(n){const r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Nc(e)}}function zc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Zs(e)||t.has(e)||!Js(e)||bc(e)||(t.add(e),rc(e,(r,o)=>{if(Zs(o)){const t=o[Us];if(jc(t,n)){const n=mc(t);lc(e,r,n,e.type_),Nc(t)}}else Js(o)&&zc(o,t,n)})),e}var Wc={get(e,t){if(t===Us)return e;let n=e.scope_.arrayMethodsPlugin_;const r=1===e.type_&&"string"==typeof t;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const o=hc(e);if(!ic(o,t,e.type_))return function(e,t,n){const r=Hc(t,n);return r?Ks in r?r[Ks]:r.get?.call(e.draft_):void 0}(e,o,t);const i=o[t];if(e.finalized_||!Js(i))return i;if(r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return i;if(i===Vc(e.base_,t)){qc(e);const n=1===e.type_?+t:t,r=Qc(e.scope_,i,e,n);return e.copy_[n]=r}return i},has:(e,t)=>t in hc(e),ownKeys:e=>Reflect.ownKeys(hc(e)),set(e,t,n){const r=Hc(hc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Vc(hc(e),t),a=r?.[Us];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||ic(e.base_,t,e.type_)))return!0;qc(e),Gc(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),function(e,t,n){const{scope_:r}=e;if(Zs(n)){const o=n[Us];jc(o,r)&&o.callbacks_.push(function(){qc(e);const r=mc(o);Rc(e,n,r,t)})}else Js(n)&&e.callbacks_.push(function(){const o=hc(e);3===e.type_?o.has(n)&&zc(n,r.handledSet_,r):ac(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&zc(ac(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>(qc(e),void 0!==Vc(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),Gc(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=hc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[Xs]:!0,[$s]:1!==e.type_||"length"!==t,[Ys]:r[Ys],[Ks]:n[t]}:r},defineProperty(){Vs(11)},getPrototypeOf:e=>Gs(e.base_),setPrototypeOf(){Vs(12)}},Uc={};for(let e in Wc){let t=Wc[e];Uc[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function Vc(e,t){const n=e[Us];return(n?hc(n):e)[t]}function Hc(e,t){if(!(t in e))return;let n=Gs(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Gs(n)}}function Gc(e){e.modified_||(e.modified_=!0,e.parent_&&Gc(e.parent_))}function qc(e){e.copy_||(e.assigned_=new Map,e.copy_=gc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Qc(e,t,n,r){const[o,i]=cc(t)?Sc(wc).proxyMap_(t,n):uc(t)?Sc(wc).proxySet_(t,n):function(e,t){const n=sc(e),r={type_:n?1:0,scope_:t?t.scope_:Cc(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,i=Wc;n&&(o=[r],i=Uc);const{revoke:a,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=a,[l,r]}(t,n);return(n?.scope_??Cc()).drafts_.push(o),i.callbacks_=n?.callbacks_??[],i.key_=r,n&&void 0!==r?function(e,t,n){e.callbacks_.push(function(r){const o=t;if(!o||!jc(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const i=mc(o);Rc(e,o.draft_??o,i,n),Bc(o,r)})}(n,i,r):i.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(i);const{patchPlugin_:t}=e;i.modified_&&t&&t.generatePatches_(i,[],e)}),o}function $c(e){if(!Js(e)||bc(e))return e;const t=e[Us];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=gc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=gc(e,!0);return rc(n,(e,t)=>{lc(n,e,$c(t))},r),t&&(t.finalized_=!1),n}Uc.deleteProperty=function(e,t){return Uc.set.call(this,e,t,void 0)},Uc.set=function(e,t,n){return Wc.set.call(this,e[0],t,n,e[0])};var Yc=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(pc(e)&&!pc(t)){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if(pc(t)||Vs(6),void 0===n||pc(n)||Vs(7),Js(e)){const o=Tc(this),i=Qc(0,e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Pc(o):Ac(o)}return Dc(o,n),Mc(r,o)}if(!e||!dc(e)){if(r=t(e),void 0===r&&(r=e),r===zs&&(r=void 0),this.autoFreeze_&&vc(r,!0),n){const t=[],o=[];Sc(Ec).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}Vs(1)},this.produceWithPatches=(e,t)=>{if(pc(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;const o=this.produce(e,t,(e,t)=>{n=e,r=t});return[o,n,r]},fc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),fc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),fc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Js(e)||Vs(8),Zs(e)&&(e=function(e){return Zs(e)||Vs(10),$c(e)}(e));const t=Tc(this),n=Qc(0,e,void 0);return n[Us].isManual_=!0,Ac(t),n}finishDraft(e,t){const n=e&&e[Us];n&&n.isManual_||Vs(9);const{scope_:r}=n;return Dc(r,t),Mc(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Sc(Ec).applyPatches_;return Zs(e)?r(e,t):this.produce(e,e=>r(e,t))}},Xc=Yc.produce;function Kc(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(su(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return Fl(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}function Zc(e){return Js(e)?Xc(e,()=>{}):e}function Jc(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function eu(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(su(28));if(r in t)throw new Error(su(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,Symbol.species;var tu=Symbol.for("rtk-slice-createasyncthunk");function nu(e,t){return`${e}/${t}`}function ru({creators:e}={}){const t=e?.asyncThunk?.[tu];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(su(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(su(12));if(n in a.sliceCaseReducersByType)throw new Error(su(13));return a.sliceCaseReducersByType[n]=t,l},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),l),exposeAction:(e,t)=>(a.actionCreators[e]=t,l),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,l)};function s(){const[t={},n=[],r]="function"==typeof e.extraReducers?eu(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[i,l,s]=eu(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)});if("function"==typeof e)t=()=>Zc(e());else{const n=Zc(e);t=()=>n}function c(e=t(),n){let r=[i[n.type],...l.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[s]),r.reduce((e,t)=>{if(t){if(Zs(e)){const r=t(e,n);return void 0===r?e:r}if(Js(e))return Xc(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return c.getInitialState=t,c}(e.initialState)}i.forEach(r=>{const i=o[r],a={reducerName:r,type:nu(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(su(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Kc(e,a):Kc(e))}(a,i,l):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(su(18));const{payloadCreator:i,fulfilled:a,pending:l,rejected:s,settled:c,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),l&&r.addCase(d.pending,l),s&&r.addCase(d.rejected,s),c&&r.addMatcher(d.settled,c),r.exposeCaseReducer(t,{fulfilled:a||au,pending:l||au,rejected:s||au,settled:c||au})}(a,i,l,t)});const c=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=s()),p(e,t)}function h(){return p||(p=s()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=Jc(d,r,h)),o}function o(t=c){const r=Jc(u,n,()=>new WeakMap);return Jc(r,t,()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=ou(i,t,()=>Jc(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:f,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...g,...m(o,!0)}}};return g}}function ou(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var iu=ru();function au(){}var{assign:lu}=Object;function su(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original");const cu=iu({name:"aiContent",initialState:{},reducers:{}}).reducer;var uu=["type","plan","platform"],du=["itemType","key"],pu=["itemType","key"];function fu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var mu={isLoading:!0};const gu=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mu,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=n.plan,i=n.platform,a=Wn(n,uu),l=null!==a.search;switch(r){case ja(vo,e):return t=Ra(t,[o,i],La(t,[o,i],{})),Ra(t,["error"],null);case ja(yo,e):return hu(hu({},t),{},{isLoading:!0});case ja(Eo,e):var s=[o,i,"currentPage"];return a.filtering&&(s=[o,i,"filteredResults","currentPage"]),Ra(t,s,a.page);case ja(bo,e):if(t=hu(hu({},t),{},{isLoading:!1}),null!=a&&a.currentPage){var c=[o,i,"currentPage"];a.isFilterableQuery&&(c=[o,i,"filteredResults","currentPage"]),l&&(c=[o,i,"search","currentPage"]),t=Ra(t,c,a.currentPage)}if(null!=a&&a.totalPage){var u=[o,i,"totalPage"];a.isFilterableQuery&&(u=[o,i,"filteredResults","totalPage"]),l&&(u=[o,i,"search","totalPage"]),t=Ra(t,u,a.totalPage)}var d=[o,i,a.currentPage];return a.isFilterableQuery&&(d=[o,i,"filteredResults",a.currentPage]),l&&(d=[o,i,"search",a.currentPage]),Ra(t,d,a.data);case ja(wo,e):return hu(hu({},t),{},{isLoading:!1,error:null==a?void 0:a.error});case ja(ko,e):return Ra(t,[i,"itemsDetails","isLoading"],!0);case ja(Oo,e):var p=a.itemType,f=(a.key,Wn(a,du));return t=Ra(t,[i,"itemsDetails","isLoading"],!1),Ra(t,[i,"itemsDetails",f.slug],hu(hu({},f),{},{type:p}));case ja(So,e):var h=a.itemType,m=(a.key,Wn(a,pu));return t=Ra(t,[i,"itemsDetails","isLoading"],!1),Ra(t,[i,"itemsDetails","error"],hu(hu({},m),{},{type:h}))}return t}},vu={profile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ns,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.current_page,o=void 0===r?1:r,i=t.total_page,a=void 0===i?1:i,l=t.platform,s=t.data,c=void 0===s?[]:s,u=t.meta,d=void 0===u?null:u,p=Wn(t,Ql);switch(n){case Gr:return Xl(Xl({},e),{},{syncing:!0});case"APPLICATION_IS_SIGNED":case Er:case yr:return Xl(Xl({},e),{},{isLoading:!0,error:null});case pr:return Xl(Xl({},e),{},{isLoading:!1,error:null,profile:Xl(Xl({},e.profile),{},{error:null})});case kr:case br:var f=null!=d?Xl(Xl({},e),d):e;return Xl(Xl({},f),{},{isLoading:!1,syncing:!1,data:p,prevData:null,error:null});case hr:return Xl(Xl({},e),{},{isVerifying:!0});case fr:var h=Xl(Xl({},e),{},{isVerifying:!1,data:Xl(Xl({},e.data),{},{is_verified:null==p?void 0:p.is_verified})});return Xl(Xl({},h),{},{isLoading:!1,syncing:!1,prevData:null,error:null});case mr:var m;return Xl(Xl({},e),{},{data:Xl(Xl({},e.data),{},{is_disconnected:null===(m=null==p?void 0:p.is_disconnected)||void 0===m||m})});case vr:var g=Xl(Xl({},e),{},{data:null,is_globally_signed:!(null!=p&&p.isGloballySigned)});if(void 0!==(null==p?void 0:p.global_user)){var v=null==p?void 0:p.global_user,y=v.meta,b=Wn(v,$l);g=Xl(Xl({},g),{},{data:b},y)}return null!=p&&p.linking&&(g=Xl(Xl({},g),{},{prevData:e.data})),null!=p&&p.trying_logout&&(g=Xl(Xl({},g),{},{data:null,error:null})),g;case Or:case wr:return Xl(Xl({},e),{},{isLoading:!1,data:null,error:p});case Kr:var w=p.filter;return Xl(Xl({},e),{},{favourites:Xl(Xl({},e.favourites),{},Pt({},"".concat(w),c))});case go:case uo:case Zr:var E=p.page,k=p.states;return k.splice(0,1),E&&(e=Ra(e,[].concat(Nl(k),["currentPage"]),E)),e;case $r:var O=Xl(Xl({},e.favourites),{},{isLoading:!0,error:null});return Xl(Xl({},e),{},{favourites:O});case Yr:var S=p.plan,x=p.itemType,_=Xl(Xl({},e.favourites),{},{isLoading:!1});return e=Xl(Xl({},e),{},{favourites:_}),o&&(e=Ra(e,["favourites",S,l,x,"currentPage"],o)),a&&(e=Ra(e,["favourites",S,l,x,"totalPage"],a)),c&&(e=Ra(e,["favourites",S,l,x,o],c)),e;case Xr:var C=Xl(Xl({},e.favourites),{},{isLoading:!1,error:null});return C=Ra(C,"error",c),Xl(Xl({},e),{},{favourites:C});case lo:var D=Xl(Xl({},e.downloads),{},{isLoading:!0,error:null});return Xl(Xl({},e),{},{downloads:D});case so:var P=Xl(Xl({},e.downloads),{},{isLoading:!1,error:null});return P=Ra(P,"currentPage",o),P=Ra(P,"totalPage",a),P=Ra(P,o,c),Xl(Xl({},e),{},{downloads:P});case co:var A=Xl(Xl({},e.downloads),{},{isLoading:!1,error:null});return A=Ra(A,"error",c),Xl(Xl({},e),{},{downloads:A});case po:var T=Xl(Xl({},e.purchasedItems),{},{isLoading:!0,error:null});return Xl(Xl({},e),{},{purchasedItems:T});case ho:var F=Xl(Xl({},e.purchasedItems),{},{isLoading:!1,error:null});return F=Ra(F,"currentPage",o),F=Ra(F,"totalPage",a),F=Ra(F,o,c),Xl(Xl({},e),{},{purchasedItems:F});case fo:var M=Xl(Xl({},e.purchasedItems),{},{all:null,isLoading:!1,error:null});return M=Ra(M,"all",c),Xl(Xl({},e),{},{purchasedItems:M});case mo:var I=Xl(Xl({},e.purchasedItems),{},{isLoading:!1,error:null});return I=Ra(I,"error",c),Xl(Xl({},e),{},{purchasedItems:I});case Jr:var N=Xl({},p.starred);return Xl(Xl({},e),{},{starred:N});case eo:var j=Xl({},p.reviews);return Xl(Xl({},e),{},{reviews:j});case to:return Xl(Xl({},e),{},{favourite:{loading:!0,error:null}});case no:return Xl(Xl({},e),{},{favourite:{loading:!1,error:null}});case ro:return Xl(Xl({},e),{},{favourite:{loading:!1,error:p.error||"Failed to update favourite"}});case oo:return Xl(Xl({},e),{},{rating:{loading:!0,error:null}});case io:return Xl(Xl({},e),{},{rating:{loading:!1,error:null}});case ao:return Xl(Xl({},e),{},{rating:{loading:!1,error:p.error||"Failed to update rating"}})}return e},conditions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:As,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Cs);switch(n){case ur:return Ps(Ps({},e),{},{platform:r.platform});case Br:return Ps(Ps({},e),{},{isLoading:!0});case zr:return Ps(Ps({},e),{},{isLoading:!1,conditions:r});case Wr:return Ps(Ps({},e),{},{isLoading:!1,conditionsByTemplate:Ps(Ps({},e.conditionsByTemplate),{},Pt({},r.id,r.data))});case Vr:return Ps(Ps({},e),{},{isLoading:!1,conditionsForSave:null!=r?r:{}})}return e},general:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ql,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,zl);switch(r){case Xo:return Ul(Ul({},t),{},{has_elementor:o.has_elementor,has_elementor_pro:o.has_elementor_pro});case Vo:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{currentStep:o.step})});case Ho:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{customizerStep:o.step})});case Go:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{fsiClosed:o.payload})});case qo:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{results:o.payload})});case Qo:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{formData:o.payload})});case $o:return t=Ra(t,["fullSiteImport","cache_data","isLoading"],!1),Ra(t,["fullSiteImport","cache_data",o.payload.type],o.payload.value);case"FULL_SITE_IMPORT_RESET_CACHE_DATA":return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{cache_data:null})});case Yo:return Ul(Ul({},t),{},{fullSiteImport:{currentStep:1,results:null,aiSidebarContext:{id:null,show:!1,content:{},expanded:!1},fsiModalContext:{show:!1,aiTemplates:null},packInfo:{data:null,loading:!1,error:null},googleFonts:{data:null,loading:!1,error:null}}});case"FULL_SITE_IMPORT_SET_PROCESS_ID":return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{processId:o.payload})});case Ko:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{availableCredit:o.payload})});case"FULL_SITE_IMPORT_SET_AI_PAGE_IDS":return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{AIPageIDs:o.payload})});case"FULL_SITE_IMPORT_SET_AI_SIDEBAR_CONTEXT":case Zo:case Jo:case ei:case ti:return Ra(t,["fullSiteImport","aiSidebarContext"],Ul(Ul({},t.fullSiteImport.aiSidebarContext),o.payload));case ni:case ri:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{fsiModalContext:o.payload})});case oi:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{packInfo:Ul(Ul({},t.fullSiteImport.packInfo),{},{loading:!0,error:null})})});case ii:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{packInfo:{data:o.payload,loading:!1,error:null}})});case ai:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:o.payload}})});case li:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{googleFonts:Ul(Ul({},t.fullSiteImport.googleFonts),{},{loading:!0,error:null})})});case si:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{googleFonts:{data:o.payload,loading:!1,error:null}})});case ci:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{googleFonts:{data:null,loading:!1,error:o.payload}})});case ui:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:null}})});case di:return Ul(Ul({},t),{},{fullSiteImport:Ul(Ul({},t.fullSiteImport),{},{triggerHandleClick:{id:o.payload.id,isWithAI:o.payload.isWithAI,timestamp:Date.now()}})});case Rr:return Ul(Ul({},t),{},{redirect:Ul({},o)});case ur:return Ul(Ul({},t),{},{platform:o.platform});case dr:return Ul(Ul({},t),{},{plan:o.plan});case Hr:return Ul(Ul({},t),{},{headerHeight:o.height});case"APPLICATION_META_REQUESTED":return Ul(Ul({},t),{},{isLoading:!0,error:null});case"APPLICATION_META_REQUEST_FAILED":return Ul(Ul({},t),{},{error:Ul(Ul({},t.error),o.error)});case xr:return t=Ul({},t),Ra(t,["filter",o.key],o.data);case _r:return Ra(t,["filter"],Gl);case Dr:t=Ul(Ul({},t),{},{isLoading:!1});var i=o.dependencies,a=i.elementor,l=void 0===a?[]:a,s=i.gutenberg,c=void 0===s?[]:s,u=i.unknown,d=void 0===u?[]:u;return Ra(t,["dependencies"],{elementor:[].concat(Nl(l),Nl(d)),gutenberg:[].concat(Nl(c),Nl(d))});case Ar:return t=Ul(Ul({},t),{},{isLoading:!1}),Ra(t,["tags"],o.tags);case Tr:return Ul(Ul({},t),{},{templateTypes:{isLoading:!0,lists:[]}});case Fr:return t=Ul(Ul({},t),{},{templateTypes:{isLoading:!1}}),Ra(t,["templateTypes","lists"],o.types);case"APPLICATION_LOAD_TYPES_FAILED":return t=Ra(t,["templateTypes","isLoading"],!1),Ra(t,["error","templateTypes"],o.error);case"APPLICATION_LOAD_PRICING":return t=Ra(t,["pricing","isLoading"],!0),Ra(t,["pricing","error"],null);case Mr:return t=Ra(t,["pricing","isLoading"],!1),t=Ra(t,["pricing","data"],null!==(e=null==o?void 0:o.data)&&void 0!==e?e:[]),Ra(t,["pricing","error"],null);case Ir:return t=Ra(t,["pricing","isLoading"],!1),t=Ra(t,["pricing","data"],[]),Ra(t,["pricing","error"],null==o?void 0:o.error);case Nr:return Ul(Ul({},t),{},{categories:{isLoading:!0,lists:[]}});case jr:return t=Ra(t,["categories","isLoading"],!1),Ra(t,["categories","lists"],o.categories);case Lr:return t=Ra(t,["categories","isLoading"],!1),Ra(t,["error","categories"],o.error);case Sr:return Ul(Ul({},t),{},{counts:Ul({},o)});case xo:return Ul(Ul({},t),{},{featured:Ul(Ul({},Vl),{},{isLoading:!0})});case _o:return Ul(Ul({},t),{},{featured:{isLoading:!1,items:n.items}});case Co:return Ul(Ul({},t),{},{featured:{isLoading:!1,items:[],error:n.error}});case Do:return Ul(Ul({},t),{},{trending:Ul(Ul({},Hl),{},{isLoading:!0})});case Po:return Ul(Ul({},t),{},{trending:{isLoading:!1,items:n.items}});case Ao:return Ul(Ul({},t),{},{trending:{isLoading:!1,items:[],error:n.error}});case To:return Ul(Ul({},t),{},{related:Ul(Ul({},o),{},{isLoading:!0})});case Fo:return Ul(Ul({},t),{},{related:{isLoading:!1,items:n.items}});case Mo:return Ul(Ul({},t),{},{related:{isLoading:!1,items:[],error:n.error}})}return t},settingsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bs,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Ns);switch(n){case pi.SET_PLATFORM:return Ls(Ls({},e),{},{platform:r.platform});case pi.SET_COLORS:return Ra(e,[e.platform,"colors"],r.colors);case pi.SET_SELECTED_TYPOGRAPHY:return Ra(e,[e.platform,"selectedTypography"],r.typography);case pi.SET_SCREEN:return Ra(e,[e.platform,"screen"],r.screen);case pi.SET_CUSTOM_CSS:return Ra(e,["customCSS"],r.customCSS);case pi.SET_LOGO_IMAGE:return Ra(e,["logoImage"],r.logoImage);case pi.SET_SITE_TITLE:return Ls(Ls({},e),{},{siteTitle:r.siteTitle});case pi.SET_SITE_TAGLINE:return Ls(Ls({},e),{},{siteTagline:r.siteTagline})}return e},savedTemplates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_s,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=t.platform,o=void 0===r?"elementor":r,i=t.currentPage,a=t.totalPage,l=t.data,s=Wn(t,Os);switch(n){case Io:return xs(xs({},e),{},{isLoading:!0});case No:return xs(xs({},e),{},{isLoading:!1});case Lo:return Ra(e,[o,"currentPage"],s.page);case jo:return e=xs(xs({},e),{},{isLoading:!1}),i&&(e=Ra(e,[o,"currentPage"],i)),a&&(e=Ra(e,[o,"totalPage"],a)),l&&(e=Ra(e,[o,i],l)),e}return e},clouds:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:us,t=arguments.length>1?arguments[1]:void 0,n=t.search,r=Wn(t,rs),o=null===n?"items":"search";switch(r.type){case Bo.PUSH:return ss(ss({},e),{},{push2cloud:{isLoading:!0}});case Bo.CLEAR_PUSH2CLOUD:return ss(ss({},e),{},{push2cloud:{isLoading:!1}});case Bo.PUSH_SUCCESS:r.type;var i=Wn(r,os);return ss(ss({},e),{},{push2cloud:ss({isLoading:!1},i)});case Bo.PUSH_FAILED:r.type;var a=Wn(r,is);return ss(ss({},e),{},{push2cloud:ss({isLoading:!1},a)});case Bo.SET_VIEW:return ss(ss({},e),{},{view:r.view});case Bo.SET_PAGE:return null!=r&&r.page&&(e=Ra(e,[o,r.platform,"currentPage"],r.page)),e;case Bo.LOAD:case Bo.REQUESTED:return ss(ss({},e),{},{isLoading:!0,error:null});case Bo.LOAD_SUCCESS:return e=ss(ss({},e),{},{isLoading:!1,push2cloud:{isLoading:null},error:null}),null!=r&&r.currentPage&&(e=Ra(e,[o,r.platform,"currentPage"],r.currentPage)),null!=r&&r.totalPage&&(e=Ra(e,[o,r.platform,"totalPage"],r.totalPage)),null!=r&&r.data&&(e=Ra(e,[o,r.platform,r.currentPage],r.data)),e;case Bo.LOAD_FAILED:r.type;var l=Wn(r,as);return ss(ss({},e),{},{error:l,isLoading:!1});case Bo.STATUS_REQUEST:return ss(ss({},e),{},{status:ss(ss({},cs),{},{isLoading:!0,error:null})});case Bo.STATUS_SUCCESS:return ss(ss({},e),{},{status:ss(ss({},cs),{},{usage:r.usages,limit:r.limit,isLoading:!1,error:null})});case Bo.STATUS_FAILED:return ss(ss({},e),{},{status:ss(ss({},cs),{},{isLoading:!1,error:r.error})});case Bo.SEARCH:return ss(ss({},e),{},{search:ss(ss({},e.search),{},{isLoading:!0,context:null==r?void 0:r.context,keyword:null==r?void 0:r.search})});case Bo.SEARCH_SUCCESS:return e=ss(ss({},e),{},{search:ss(ss({},e.search),{},{isLoading:!1})}),e=Ra(e,["search","context"],r.context),Ra(e,["search","data"],r.data)}return e},workspaces:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hs,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,ds);switch(r){case zo.SET_VIEW:return fs(fs({},t),{},{view:o.view});case zo.LOAD:case zo.LOAD_LISTS:return fs(fs({},t),{},{isLoading:!0});case zo.SET_LISTS:return fs(fs({},t),{},{isLoading:!1,lists:o.payload});case zo.SET_PAGE:return fs(fs({},t),{},{currentPage:o.page});case zo.DELETE_SUCCESS:if((t=fs({},t)).hasOwnProperty(o.page)){var i=Nl(t[o.page]).filter(function(e){return e.id!=o.id});t[o.page]=i}return t;case zo.CREATE_SUCCESS:var a=(t=fs(fs({},t),{},{isLoading:!1})).currentPage;if(t.hasOwnProperty(a)){var l=[];l=(e=l=[fs({},o)].concat(Nl(t[a])),e.reduce(function(e,t,n){var r=Math.floor(n/11)+1;return(e[r]||(e[r]=[])).push(t),e},[]))[1],t=Ra(t,[a],l)}else t=Ra(t,[a],[fs({},o)]);return t;case zo.LOAD_SUCCESS:return t=fs(fs({},t),{},{isLoading:!1,currentPage:o.currentPage,error:null}),o.totalPage&&(t=fs(fs({},t),{},{totalPage:o.totalPage})),Ra(t,[o.currentPage],o.data);case zo.LOAD_FAILED:return fs(fs({},t),{},{error:o.error,isLoading:!1});case zo.SEARCH:return fs(fs({},t),{},{search:fs(fs({},t.search),{},{isLoading:!0,context:null==o?void 0:o.context,keyword:null==o?void 0:o.search})});case zo.SEARCH_SUCCESS:return t=fs(fs({},t),{},{search:fs(fs({},t.search),{},{isLoading:!1})}),t=Ra(t,["search","context"],o.context),Ra(t,["search","data"],o.data)}return t},sharedWorkspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vs,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Wo.SET_VIEW:return gs(gs({},e),{},{view:t.view});case Wo.LOAD:case Wo.LOAD_LISTS:return gs(gs({},e),{},{isLoading:!0});case Wo.SET_LISTS:return gs(gs({},e),{},{isLoading:!1,lists:t.payload});case Wo.LOAD_SUCCESS:return e=gs(gs({},e),{},{isLoading:!1,currentPage:t.currentPage}),t.totalPage&&(e=gs(gs({},e),{},{totalPage:t.totalPage})),Ra(e,[t.currentPage],t.data);case Wo.LOAD_FAILED:return gs(gs({},e),{},{isLoading:!1,error:t.error||t.payload});case Wo.SEARCH:return gs(gs({},e),{},{search:gs(gs({},e.search),{},{isLoading:!0,context:null==t?void 0:t.context,keyword:null==t?void 0:t.search})});case Wo.SEARCH_SUCCESS:return e=gs(gs({},e),{},{search:gs(gs({},e.search),{},{isLoading:!1})}),e=Ra(e,["search","context"],t.context),Ra(e,["search","data"],t.data)}return e},workspaceDetails:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ks,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,ys);switch(r){case Uo.SET_VIEW:return ws(ws({},t),{},{view:o.view});case Uo.REQUESTED:return ws(ws({},t),{},{error:null});case Uo.LOAD:return ws(ws({},t),{},{isLoading:!0,isFilesLoading:!0,error:null});case Uo.SET:return ws(ws({},t),{},Pt({isLoading:!1,isFilesLoading:!0},o.slug,o));case Uo.DELETE:return null!==(e=t=ws({},t))&&void 0!==e&&e[o.slug]&&delete t[o.slug],t;case Uo.SET_PAGE:return t=ws(ws({},t),{},{isFilesLoading:!0}),null!=o&&o.page&&(t=Ra(t,[o.platform,o.slug,"currentPage"],o.page)),t;case Uo.LOAD_SUCCESS:return delete o.files,delete o.platform,delete o.args,ws(ws({},t),{},Pt({isLoading:!1},o.slug,o));case Uo.LOAD_FAILED:return ws(ws({},t),{},{error:o,isLoading:!1,isFilesLoading:!1});case Uo.GET_FILES_REQUESTED:return ws(ws({},t),{},{isFilesLoading:!0});case Uo.SET_FILES:return t=ws(ws({},t),{},{isLoading:!1,isFilesLoading:!1}),null!=o&&o.currentPage&&(t=Ra(t,[o.platform,o.slug,"currentPage"],o.currentPage)),null!=o&&o.totalPage&&(t=Ra(t,[o.platform,o.slug,"totalPage"],o.totalPage)),Ra(t,[o.platform,o.slug,o.currentPage],o.data);case Uo.RESET_SEARCH:return ws(ws({},t),{},{search:ws({},Es)});case Uo.SEARCH:return ws(ws({},t),{},{search:ws(ws({},t.search),{},{isLoading:!0,context:null==n?void 0:n.context,keyword:null==n?void 0:n.search})});case Uo.SEARCH_SUCCESS:t=ws(ws({},t),{},{search:ws(ws({},t.search),{},{isLoading:!1})});var i=n.currentPage,a=n.totalPage;return t=Ra(t,["search","context"],n.context),t=Ra(t,["search","data",i],n.data),t=Ra(t,["search","data","currentPage"],i),Ra(t,["search","data","totalPage"],a)}return t},aiContent:cu};function yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wu(e){return bu(bu({},vu),e)}var Eu=function(e){var t={elementor:"https://assets.templately.com/frontend/Elementor.png",gutenberg:"https://assets.templately.com/frontend/Gutenberg.png"};return t.hasOwnProperty(e)&&t[e]},ku=["dispatch"],Ou=function(e,t){var n=e.ModalComponent,r=e.content,o={key:"isSaved",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong regarding changes in your WorkSpace. Try Later or Contact support.","templately")},success:{title:(0,At.__)("Successfully Saved","templately"),content:(0,At.__)("You have succesfully saved your WorkSpace changes.","templately")}};xl({showCloseButton:!0,onConfirm:function(e){return _l(o,e)},html:React.createElement(n,re({},t,r))},!0)},Su=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=Wn(t,ku),a={key:"isDeleted",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong regarding deleting your WorkSpace. Try Later or Contact Support.","templately")},success:{redirectTo:-1,title:(0,At.__)("Successfully Deleted","templately"),content:(0,At.__)("You have deleted a WorkSpace from your account.","templately")}};xl({showCloseButton:!0,onConfirm:function(e){return _l(a,e)},html:React.createElement(n,re({page:i.workspaces.currentPage},r,{dispatch:o}))},!0)},xu=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return[{name:(0,At.__)("Edit","templately"),icon:React.createElement(Tn,null),disabled:e,action:Ou,ModalComponent:Rg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:Su,ModalComponent:gd}]};const _u=window.wp.blocks;function Cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Du(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Pu=gn(null,function(e){return{forceDelete:function(t){return e(Sy(Du(Du({},t),{},{force_delete_kit:!0})))}}})(function(e){return he().createElement("div",{className:"t-kit-warning-modal"},he().createElement("h4",null,(0,At.__)("Are you sure you want to delete your Site Settings?","elementor")),he().createElement("p",null,(0,At.__)("By removing this template you will delete your entire Site Settings. If this template is deleted, all associated settings: Global Colors & Fonts, Theme Style, Layout, Background, and Lightbox settings will be removed from your existing site. This action can not be undone.","elementor")),he().createElement("div",{className:"btns"},he().createElement("button",{onClick:function(){e.forceDelete({id:e.id})},className:"templately-button force-delete"},(0,At.__)("Force Delete","templately")),he().createElement("button",{className:"templately-button keep-settings"},(0,At.__)("Keep my settings","templately"))))}),Au=function(e){var t=e.id,n=e.isImport,r=e.setImport,o=ce((0,pe.useState)(!1),2),i=o[0],a=o[1];return(0,pe.useEffect)(function(){0!=n&&a(!i)},[n]),he().createElement("div",{className:"templately-import tm-section"},he().createElement("p",null,(0,At.__)("Import this template to your library to make it available in your Elementor Saved Templates(opens in a new tab) list for future use.","templately")),he().createElement("button",{disabled:i,className:"templately-button tb-import",onClick:function(){return r(t)}},he().createElement(nr,null),(0,At.__)("Import to Library","templately")))},Tu=function(e){var t=e.id,n=e.isCreate,r=e.createPage,o=e.setPageTitle,i=ce((0,pe.useState)(!0),2),a=i[0],l=i[1],s=ce((0,pe.useState)(""),2),c=s[0],u=s[1];return(0,pe.useEffect)(function(){0!=n||c.length>0?l(!1):l(!0),o(c)},[n,c]),he().createElement("div",{className:"templately-create-page tm-section"},he().createElement("p",null,(0,At.__)("Create a new page from this template to make it available as a draft page in your pages list.","templately")),he().createElement("div",{className:"templately-create-page-form"},he().createElement(hl,{wrapper:!1,placeholder:(0,At.__)("Type a title here...","templately"),value:c,onChange:function(e){return u(e.target.value)}}),he().createElement(pl,{disabled:a,label:(0,At.__)("Create a Page","templately"),className:"tb-create-page",onClick:function(){return r(t)}})))};var Fu=["name","id","platform"];const Mu=function(e){var t=e.name,n=e.id,r=e.platform,o=Wn(e,Fu),i=ce((0,pe.useState)(!1),2),a=i[0],l=i[1],s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1],d=ce((0,pe.useState)(null),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!1),2),m=h[0],g=h[1],v=ce((0,pe.useState)(!1),2),y=v[0],b=v[1],w=ce((0,pe.useState)(""),2),E=w[0],k=w[1];return(0,pe.useEffect)(function(){0!=m&&"elementor"===r&&(Cl(),l(!0),cd({id:m,platform:r}).then(function(e){Cl(!1),l(!1),u(e)}).catch(function(e){Cl(!1),l(!1),f(e)}),g(!1))},[m]),(0,pe.useEffect)(function(){0!=y&&(Cl(),l(!0),sd({id:y,title:E,platform:r}).then(function(e){Cl(!1),l(!1),u(e)}).catch(function(e){Cl(!1),l(!1),f(e)}),b(!1))},[y]),he().createElement("div",{className:"templately-import-modal templately-modal"},!a&&!(0!=c||null!=p)&&he().createElement("div",{className:"tm-header"},he().createElement("h3",null,t)),a&&he().createElement(El,{text:(0,At.__)("Importing...","templately"),description:(0,At.__)("Your chosen template is being imported right now, please do not refresh or close this tab.","templately")}),!a&&he().createElement("div",{className:"tm-body"},0==c&&null==p&&he().createElement(he().Fragment,null,he().createElement(Tu,{id:n,isCreate:y,createPage:b,setPageTitle:k}),"elementor"===r&&he().createElement(Au,{isImport:m,id:n,setImport:g})),null!=p&&he().createElement(Yu,re({},p,{type:null==o?void 0:o.type,slug:null==o?void 0:o.slug})),0!=c&&null==p&&he().createElement(id,re({platform:r},c))))};function Iu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const ju=function(e){var t=e.requirement,n=e.completeCallback,r=e.setErrors,o=e.errors,i=ce((0,pe.useState)(!0),2),a=i[0],l=i[1],s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!1),2),p=d[0],f=d[1],h=ce((0,pe.useState)({}),2),m=h[0],g=h[1];return t?((0,pe.useEffect)(function(){qg(t).then(function(e){l(e.loading),g(e.data)}).catch(function(e){var n=e;"invalid_requirements"===(null==e?void 0:e.code)&&(n={message:e.message}),u(n),r([].concat(Nl(o),[Nu(Nu({},n),t)])),l(!1)})},[]),(0,pe.useEffect)(function(){p&&(l(!0),u(!1),qg(t).then(function(e){g(e.data),l(e.loading)}).catch(function(e){var n=o.filter(function(e){return e.id!==t.id});if("invalid_requirements"===(null==e?void 0:e.code)){var i=Nu({message:e.message},t);n.push(i)}r(n),u(e),l(!1)}),f(!1))},[p]),(0,pe.useEffect)(function(){a||n(c)},[a]),(0,pe.useEffect)(function(){c&&r([].concat(Nl(o),[Nu(Nu({},c),t)]))},[c]),he().createElement(he().Fragment,null,a?he().createElement(Lu,{className:"t-info-installing",title:(0,At.__)("Installing...","templately")}):null,c?m&&m.errorMessage?he().createElement(Lu,{className:"t-info-error",icon:"no",title:m.errorMessage}):he().createElement(pl,{className:"tb-retry-install",onClick:function(){return f(!0)}},he().createElement("span",{className:"dashicons dashicons-no text-danger"}),(0,At.__)("Retry & Proceed to Import","templately")):null,a||c?null:he().createElement(Lu,{className:"t-info-success",icon:"yes-alt",title:(0,At.__)("Success","templately")}))):((0,pe.useEffect)(function(){n()},[]),he().createElement("span",{className:"templately-warning"},he().createElement("span",{className:"dashicons dashicons-warning"})," ",(0,At.__)("Ignored","templately")))};var Lu=function(e){var t=e.icon,n=void 0===t?"update":t,r=e.title,o=void 0===r?"":r,i=e.iconStyle,a=void 0===i?null:i,l=e.hide;if(void 0!==l&&l)return null;var s=Vn()("templately-installation-info align-center d-flex",null==e?void 0:e.className);return he().createElement("div",{className:s},he().createElement("span",{className:"dashicons dashicons-".concat(n),style:a}),he().createElement("p",null,o))},Ru=["dependencies"];function Bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wu=a(6614);const Uu=function(e){var t=e.dependencies,n=void 0===t?[]:t,r=Wn(e,Ru),o=r.current_screen,i=r.clickCancel,a=r.setImportModal,l=r.setIsImporting,s=ce((0,pe.useState)({}),2),c=s[0],u=s[1],d=ce((0,pe.useState)(null),2),p=d[0],f=d[1],h=ce((0,pe.useState)([]),2),m=h[0],g=h[1],v=(0,pe.useMemo)(function(){return!(0,Ea.isEmpty)(c)&&Object.values(c).every(function(e){return!e})},[c]),y=function(e){return void 0===c[e]||c[e]},b=function(){f(function(e){return e+1})};return(0,pe.useEffect)(function(){n.length&&n.map(function(e,t){var n=e.is_pro,r=e.is_active;void 0===c[t]&&u(function(e){return zu(zu({},e),{},Pt({},t,!r&&!n))})})},[n]),(0,pe.useEffect)(function(){n.length<=0&&("templately"==o?a(!0):l(!0))},[n]),(0,pe.useEffect)(function(){null!=p&&p>n.length-1&&0===m.length&&("templately"==o?a(!0):l(!0))},[p,m]),console.warn("dependencies",n,r),he().createElement(he().Fragment,null,he().createElement("h4",null,(0,At.__)("Required Dependencies","templately")),he().createElement("p",null,(0,At.__)("To import this item you need to install all the Plugin(s) listed below:","templately")),(null==n?void 0:n.length)>0&&he().createElement("ul",{className:"templately-dependency-list"},n.map(function(e,t){var n=e.is_pro,r=e.link,o=e.name,i=e.slug,a=e.is_active;return he().createElement("li",{className:"templately-dependency-item",key:t},he().createElement("div",{className:"tdi-checkbox"},he().createElement(hl,{wrapper:!1,className:"tdi-checkbox-input",type:"checkbox",id:"requirement".concat(t),value:"1",disabled:n,checked:a||"elementor"===i||y(t)&&!n,onChange:function(){return!a&&!n&&u(function(e){var n;return zu(zu({},e),{},Pt({},t,!(null===(n=e[t])||void 0===n||n)))})}}),he().createElement(gl,{wrapper:!0,htmlFor:"requirement".concat(t),style:{marginLeft:"5px"},href:r,name:o},a&&he().createElement(he().Fragment,null," | ",he().createElement("span",{className:"plugin-installed"},"Installed")))),p===t||p>t?he().createElement(ju,{key:"installing".concat(t),requirement:y(t)&&!n?e:null,completeCallback:b,errors:m,setErrors:function(e){g(e)}}):null)})),he().createElement("p",null,he().createElement("strong",null,(0,At.__)("Note","templately"),": "),Wu((0,At.sprintf)((0,At.__)("Make sure you have manually installed & activated the <em><strong>%s</strong></em> listed above","templately"),(0,At._n)("Pro Plugin","Pro Plugin's",n.length,"templately")))),he().createElement("div",{className:"templately-buttons-group"},he().createElement(pl,{label:(0,At.__)("Cancel","templately"),className:"tb-rd-btn bg-danger tm-btn-cancel",onClick:function(){return i(!0)},disabled:null!==p}),he().createElement(pl,{label:v?(0,At.__)("Proceed to Import","templately"):(0,At.__)("Install & Proceed to Import","templately"),className:"tb-rd-btn tm-btn-confirm",onClick:function(){return f(0)},disabled:null!==p})))};function Vu(e){return(0,Hn.k5)({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},child:[]}]})(e)}function Hu(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{d:"M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"},child:[]}]})(e)}function Gu(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{fill:"#D9D9D9",d:"M911.9 283.9v.5L835.5 865c-1 8-7.9 14-15.9 14H204.5c-8.1 0-14.9-6.1-16-14l-76.4-580.6v-.6 1.6L188.5 866c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.1-.5.1-1 0-1.5z"},child:[]},{tag:"path",attr:{fill:"#D9D9D9",d:"M773.6 810.6l53.9-409.4-139.8 86.1L512 252.9 336.3 487.3l-139.8-86.1 53.8 409.4h523.3zm-374.2-189c0-62.1 50.5-112.6 112.6-112.6s112.6 50.5 112.6 112.6v1c0 62.1-50.5 112.6-112.6 112.6s-112.6-50.5-112.6-112.6v-1z"},child:[]},{tag:"path",attr:{d:"M512 734.2c61.9 0 112.3-50.2 112.6-112.1v-.5c0-62.1-50.5-112.6-112.6-112.6s-112.6 50.5-112.6 112.6v.5c.3 61.9 50.7 112.1 112.6 112.1zm0-160.9c26.6 0 48.2 21.6 48.2 48.3 0 26.6-21.6 48.3-48.2 48.3s-48.2-21.6-48.2-48.3c0-26.6 21.6-48.3 48.2-48.3z"},child:[]},{tag:"path",attr:{d:"M188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6v-.5c.3-6.4-6.7-10.8-12.3-7.4L705 396.4 518.4 147.5a8.06 8.06 0 0 0-12.9 0L319 396.4 124.3 276.5c-5.5-3.4-12.6.9-12.2 7.3v.6L188.5 865zm147.8-377.7L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4H250.3l-53.8-409.4 139.8 86.1z"},child:[]}]})(e)}var qu=["code","message","title","contentStyles"];function Qu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Yu=function(e){var t=e.code,n=e.message,r=e.title,o=void 0===r?null:r,i=e.contentStyles,a=void 0===i?{}:i,l=Wn(e,qu);return he().createElement("div",re({className:"tm-import-failed aligncenter"},l),null!=o?o:he().createElement("h4",null,(0,At.__)("Importing Failed","templately")),Va(n)?he().createElement("p",{dangerouslySetInnerHTML:{__html:n}}):he().createElement("p",{style:$u({},a)},n),"required_pro_templately"===t&&he().createElement("div",{className:"templately-pro-required-btns"},he().createElement("a",{className:"templately-button tb-import tb-upgrade-pro-btn",href:"https://templately.com?utm_source=plugin&utm_medium=importFailedPopup#pricing",target:"_blank"},he().createElement(Gu,null),(0,At.__)("Upgrade to Pro","templately")),he().createElement("a",{className:"templately-button tb-import tb-upgrade-pro-btn",href:Qa(l.slug,l.type),target:"_blank"},he().createElement(Hu,null),(0,At.__)("Purchase This Item","templately"))))},Xu=window.wp.data;var Ku=["dependencies","origin","hasElementorPro"];function Zu(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Ju(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ju(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ju(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Ju(d,"constructor",c),Ju(c,"constructor",s),s.displayName="GeneratorFunction",Ju(c,o,"GeneratorFunction"),Ju(d),Ju(d,o,"Generator"),Ju(d,r,function(){return this}),Ju(d,"toString",function(){return"[object Generator]"}),(Zu=function(){return{w:i,m:p}})()}function Ju(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ju=function(e,t,n,r){function i(t,n){Ju(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Ju(e,t,n,r)}function ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function td(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ed(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ed(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var nd=a(6614);const rd=gn(function(e){return{platform:e.general.platform,hasElementorPro:e.general.has_elementor_pro,current_screen:e.general.current_screen}},function(e){return{checkDependencies:function(t){return e(Qg(t))}}})(function(e){var t=e.dependencies,n=e.origin,r=void 0===n?"remote":n,o=e.hasElementorPro,i=Wn(e,Ku),a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=ce((0,pe.useState)(!0),2),u=c[0],d=c[1],p=ce((0,pe.useState)(null),2),f=p[0],h=p[1],m=ce((0,pe.useState)(!1),2),g=m[0],v=m[1],y=ce((0,pe.useState)(null),2),b=y[0],w=y[1],E=ce((0,pe.useState)(null),2),k=E[0],O=(E[1],(0,Xu.useSelect)(function(e){return e("core/editor")},[]));return(0,pe.useEffect)(function(){var n,r,a,l;d(!0),"elementor"!==e.platform||"templately"!==templately.current_screen||!["header","footer"].includes(null==i||null===(n=i.template_type)||void 0===n?void 0:n.slug)||o?(console.log({dependencies:t,platform:e.platform}),Qg({dependencies:t,platform:e.platform}).then(function(e){d(!1),h(e.dependencies),0==e.dependencies.length&&("templately"==templately.current_screen?v(!0):w(!0))}).catch(function(e){d(!1),h([])})):xl({iconHtml:'<img width="100px" src="'.concat(null===(r=templately)||void 0===r||null===(r=r.icons)||void 0===r?void 0:r.warning,'" alt="warning"/>'),showCloseButton:!0,allowOutsideClick:!1,showClass:{icon:"templately-warning-icon"},html:he().createElement(Yu,{style:{textAlign:"center",marginTop:"-35px"},contentStyles:{backgroundColor:"#F7F7F7",padding:"15px",fontSize:"14px",borderRadius:"12px"},title:he().createElement(he().Fragment,null,he().createElement("p",{style:{fontSize:"18px"}},nd((0,At.sprintf)((0,At.__)("Oops! Seems you don't have %s to import the %s Template","templately"),(0,At.sprintf)("<strong>%s</strong>","Elementor Pro"),Ga(null==i||null===(a=i.template_type)||void 0===a?void 0:a.slug))))),message:nd((0,At.sprintf)((0,At.__)("%6$s %1$s is a part of a %2$s which is available in %3$s. You need to install Elementor Pro to import %1$s template from here. %4$s, you can insert this template from %5$s on your single page.","templately"),Ga(null==i||null===(l=i.template_type)||void 0===l?void 0:l.slug),(0,At.sprintf)("<strong>%s</strong>","Elementor Theme Builder"),(0,At.sprintf)('<a target="_blank" href="https://wpdeveloper.com/go/elementor">%s</a>',"Elementor Pro"),(0,At.sprintf)("<strong>%s</strong>","Alternatively"),(0,At.sprintf)("<strong>%s</strong>","Elementor Editor"),(0,At.sprintf)('<span style="color: red;">%s:</span>',(0,At.__)("NOTE","templately"))))})},!0)},[]),(0,pe.useEffect)(function(){if(null!==b&&!0===b){var t=function(){var t=hi(Zu().m(function t(){return Zu().w(function(t){for(;;)switch(t.n){case 0:if(!(f.length>0)){t.n=2;break}if("gutenberg"!=templately.current_screen&&"elementor"!==templately.current_screen){t.n=2;break}return t.n=1,xi();case 1:void 0!==("undefined"==typeof elementor?"undefined":ne(elementor))&&"elementor"===templately.current_screen&&elementor.addWidgetsCache(elementor.getConfig().initial_document.widgets);case 2:Cl(),ud({id:e.id,postId:null==O?void 0:O.getCurrentPostId(),origin:r,platform:e.platform}).then(function(t){Cl(!1),Sl.close(td({insertCompleted:void 0===(null==t?void 0:t.error),platform:e.platform},t))});case 3:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}();t()}},[b]),(0,pe.useEffect)(function(){l&&(Sl.close({isDismissed:!0}),s(!1))},[l]),null!=b&&!0===b?he().createElement(El,{className:"align-center",text:(0,At.__)("Importing...","templately"),description:(0,At.__)("Your chosen template is being imported right now, please do not refresh or close this tab.","templately")}):1==u?he().createElement(El,{text:(0,At.__)("Checking...","templately"),description:(0,At.__)("Checking template dependencies are installed or not...","templately")}):he().createElement("div",{className:"templately-dependency-installer-modal"},null===k&&g&&!u&&he().createElement(Mu,re({},e,{platform:e.platform})),null===k&&!u&&!g&&he().createElement(he().Fragment,null,null!==f&&he().createElement(Uu,{dependencies:f,clickCancel:function(e){return s(e)},current_screen:e.current_screen,setIsImporting:w,setImportModal:v})))});var od=["platform"];const id=function(e){var t=e.platform,n=Wn(e,od);return he().createElement("div",{className:"tm-import-success"},he().createElement("h3",null,(0,At.__)("Imported successfully!","templately")),he().createElement("p",null,(0,At.__)("You can now edit or preview the template or, you can push it to Templately Cloud to share with your team.","templately")),he().createElement("div",{className:"tm-import-links"},"gutenberg"==t&&he().createElement("a",{className:"templately-button templately-import-button tb-edit-link",href:n.edit_link},(0,At.__)("Edit Template","templately")),(null==n?void 0:n.elementor_edit_link)&&"elementor"===t&&he().createElement("a",{className:"templately-button templately-import-button tb-edit-with-el",href:n.elementor_edit_link},(0,At.__)("Edit Template with Elementor","templately")),he().createElement("a",{className:"templately-button templately-import-button tb-visit",href:n.visit},(0,At.__)("View Template","templately"))))};function ad(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ad(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sd=function(e){return ha("/templately/v1/import/page",e,{},!0)},cd=function(e){return ha("/templately/v1/import",e,{},!0)},ud=function(e){return ha("/templately/v1/insert",e,{},!0).then(function(t){return"elementor"===(null==e?void 0:e.platform)&&pd(t),"gutenberg"===(null==e?void 0:e.platform)&&dd(t),ld(ld({},e),t)}).catch(function(t){return ld(ld({},e),t)})},dd=function(e){var t=wp.data.dispatch("core/block-editor").insertBlocks;return!(null==e||!e.content||(t((0,_u.parse)(e.content)),0))},pd=function(e){var t=window.elementor,n=window.$e;if(void 0!==t){var r=window.TemplatelyIndex;if(void 0!==n){for(var o=0;o<e.content.length;o++)n.run("document/elements/create",{container:t.getPreviewContainer(),model:e.content[o],options:r>=0?{at:r++}:{}});n.run("document/elements/settings",{container:t.getPreviewContainer(),settings:{template:e.page_settings.template}})}else{var i=new Backbone.Model({getTitle:function(){return"Templately Insert"}});t.channels.data.trigger("template:before:insert",i);for(var a=window.TemplatelyIndex,l=0;l<e.content.length;l++)t.getPreviewView().addChildElement(e.content[l],a>=0?{at:a++}:null);t.channels.data.trigger("template:after:insert",{})}return!0}return!1},fd=function(e,t){var n=e.ModalComponent,r=e.content;r.my_cloud_id&&(r.id=r.my_cloud_id),xl({showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(n,r)},!0).then(function(e){void 0===(null==e?void 0:e.code)?hd(e.platform):xl({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(Yu,e)},!0)})},hd=function(e){"templately"!=window.templately.current_screen&&("gutenberg"!==e&&window.TemplatelyModal.destroy(),"gutenberg"===e&&window.TemplatelyAppManager.close("templately-gutenberg"))},md=["dispatch","page","slug","id"],gd=function(e){var t=e.dispatch,n=e.page,r=e.slug,o=e.id,i=(Wn(e,md),ce((0,pe.useState)(!1),2)),a=i[0],l=i[1];return he().createElement("div",{className:"templately-workspace-modal delete-workspace-modal"},he().createElement("div",{className:"tm-container"},he().createElement("h3",null,(0,At.__)("Are You Sure?","templately")),he().createElement("p",null,he().createElement("strong",null,(0,At.__)("Note","templately"),": "),(0,At.__)("The WorkSpace will be permanently deleted.","templately")),he().createElement("p",null,he().createElement("input",{type:"checkbox",name:"delete_files_too",id:"delete_files_too",onChange:function(){return l(!a)}}),he().createElement("label",{htmlFor:"delete_files_too"},(0,At.__)("Want To Delete Files Too?","templately"))),he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column"},he().createElement("button",{className:"tm-btn-cancel",onClick:function(){Sl.hideLoading(),Sl.close({isDismissed:!0})}},(0,At.__)("Cancel","templately"))),he().createElement("div",{className:"tm-column"},he().createElement("button",{className:"tm-btn-confirm",onClick:function(){Sl.showLoading(),t(ay({id:o,slug:r,delete_files:a,page:n}))}},(0,At.__)("Delete","templately"))))))},vd=function(e){var t=e.dispatch,n=e.setTitle,r=ce((0,pe.useState)(!0),2),o=r[0],i=r[1],a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=ce((0,pe.useState)(""),2),u=c[0],d=c[1],p=ce((0,pe.useState)([]),2),f=p[0],h=p[1],m=ce((0,pe.useState)(!1),2),g=m[0],v=m[1],y=ce((0,pe.useState)(""),2),b=y[0],w=y[1],E=ce((0,pe.useState)(!1),2),k=E[0],O=E[1],S=ce((0,pe.useState)([]),2),x=S[0],_=S[1];return(0,pe.useEffect)(function(){if(g){var e=Nl(x),t=b.toLowerCase();Ba(t)&&(e.includes(t)||(e.push(t),_(e)),w("")),v(!1)}},[g]),(0,pe.useEffect)(function(){if(!1!==k){var e=Nl(x).filter(function(e){return k!=e});_(e),O(!1)}},[k]),(0,pe.useEffect)(function(){var e=[];x.length>0&&x.map(function(t,n){return e.push(he().createElement("li",{key:n},t,he().createElement("span",{onClick:function(){return O(t)}})))}),h(e)},[x]),(0,pe.useEffect)(function(){i(!(u.trim().length>0))},[u]),(0,pe.useEffect)(function(){l&&(Sl.showLoading(),t(oy({title:u,share_with:x})),s(!1))},[l]),he().createElement("div",{className:"templately-workspace-modal create-workspace-modal"},he().createElement("div",{className:"tm-container"},he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column tm-title"},he().createElement("span",{className:"tm-title-icon"})),he().createElement("div",{className:"tm-column bg-light"},he().createElement("div",{className:"tmw-name"},he().createElement(hl,{placeholder:(0,At.__)("Type workspace title here...","templately"),value:u,onChange:function(e){d(e.target.value),null==n||n(e.target.value)}})))),he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column tm-title"},he().createElement("p",null,(0,At.__)("Add People","templately"),": ")),he().createElement("div",{className:"tm-column bg-light templately-new-shared"},f.length>0&&he().createElement("ul",{className:"templately-wem-new-email-list"},f),he().createElement("div",null,he().createElement(hl,{onKeyUp:function(e){return v(13===e.keyCode)},onChange:function(e){return w(e.target.value)},value:b,placeholder:(0,At.__)("Type email to add","templately")}),he().createElement(pl,{disabled:0===b.length||!Ba(b),onClick:function(){return v(!0)},label:(0,At.__)("Add","templately")})))),he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column flex-end"},he().createElement(pl,{disabled:o,onClick:function(){return s(!0)},label:(0,At.__)("Create Workspace","templately")})))))};function yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yd(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var wd=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Ed(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,i=e.defaultValue,a=void 0===i?null:i,l=e.inputValue,s=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,f=e.value,h=Wn(e,wd),m=ce((0,pe.useState)(void 0!==l?l:n),2),g=m[0],v=m[1],y=ce((0,pe.useState)(void 0!==s?s:o),2),b=y[0],w=y[1],E=ce((0,pe.useState)(void 0!==f?f:a),2),k=E[0],O=E[1],S=(0,pe.useCallback)(function(e,t){"function"==typeof c&&c(e,t),O(e)},[c]),x=(0,pe.useCallback)(function(e,t){var n;"function"==typeof u&&(n=u(e,t)),v(void 0!==n?n:e)},[u]),_=(0,pe.useCallback)(function(){"function"==typeof p&&p(),w(!0)},[p]),C=(0,pe.useCallback)(function(){"function"==typeof d&&d(),w(!1)},[d]),D=void 0!==l?l:g,P=void 0!==s?s:b,A=void 0!==f?f:k;return bd(bd({},h),{},{inputValue:D,menuIsOpen:P,onChange:S,onInputChange:x,onMenuClose:C,onMenuOpen:_,value:A})}function kd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Od(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dt(r.key),r)}}function Sd(e,t,n){return t&&Od(e.prototype,t),n&&Od(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xd(e,t){return xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xd(e,t)}function _d(e){return _d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_d(e)}function Cd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Cd=function(){return!!e})()}function Dd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Pd=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Ad=Math.abs,Td=String.fromCharCode,Fd=Object.assign;function Md(e){return e.trim()}function Id(e,t,n){return e.replace(t,n)}function Nd(e,t){return e.indexOf(t)}function jd(e,t){return 0|e.charCodeAt(t)}function Ld(e,t,n){return e.slice(t,n)}function Rd(e){return e.length}function Bd(e){return e.length}function zd(e,t){return t.push(e),e}var Wd=1,Ud=1,Vd=0,Hd=0,Gd=0,qd="";function Qd(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Wd,column:Ud,length:a,return:""}}function $d(e,t){return Fd(Qd("",null,null,"",null,null,0),e,{length:-e.length},t)}function Yd(){return Gd=Hd>0?jd(qd,--Hd):0,Ud--,10===Gd&&(Ud=1,Wd--),Gd}function Xd(){return Gd=Hd<Vd?jd(qd,Hd++):0,Ud++,10===Gd&&(Ud=1,Wd++),Gd}function Kd(){return jd(qd,Hd)}function Zd(){return Hd}function Jd(e,t){return Ld(qd,e,t)}function ep(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tp(e){return Wd=Ud=1,Vd=Rd(qd=e),Hd=0,[]}function np(e){return qd="",e}function rp(e){return Md(Jd(Hd-1,ap(91===e?e+2:40===e?e+1:e)))}function op(e){for(;(Gd=Kd())&&Gd<33;)Xd();return ep(e)>2||ep(Gd)>3?"":" "}function ip(e,t){for(;--t&&Xd()&&!(Gd<48||Gd>102||Gd>57&&Gd<65||Gd>70&&Gd<97););return Jd(e,Zd()+(t<6&&32==Kd()&&32==Xd()))}function ap(e){for(;Xd();)switch(Gd){case e:return Hd;case 34:case 39:34!==e&&39!==e&&ap(Gd);break;case 40:41===e&&ap(e);break;case 92:Xd()}return Hd}function lp(e,t){for(;Xd()&&e+Gd!==57&&(e+Gd!==84||47!==Kd()););return"/*"+Jd(t,Hd-1)+"*"+Td(47===e?e:Xd())}function sp(e){for(;!ep(Kd());)Xd();return Jd(e,Hd)}var cp="-ms-",up="-moz-",dp="-webkit-",pp="comm",fp="rule",hp="decl",mp="@keyframes";function gp(e,t){for(var n="",r=Bd(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function vp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case hp:return e.return=e.return||e.value;case pp:return"";case mp:return e.return=e.value+"{"+gp(e.children,r)+"}";case fp:e.value=e.props.join(",")}return Rd(n=gp(e.children,r))?e.return=e.value+"{"+n+"}":""}function yp(e){return np(bp("",null,null,null,[""],e=tp(e),0,[0],e))}function bp(e,t,n,r,o,i,a,l,s){for(var c=0,u=0,d=a,p=0,f=0,h=0,m=1,g=1,v=1,y=0,b="",w=o,E=i,k=r,O=b;g;)switch(h=y,y=Xd()){case 40:if(108!=h&&58==jd(O,d-1)){-1!=Nd(O+=Id(rp(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=rp(y);break;case 9:case 10:case 13:case 32:O+=op(h);break;case 92:O+=ip(Zd()-1,7);continue;case 47:switch(Kd()){case 42:case 47:zd(kp(lp(Xd(),Zd()),t,n),s);break;default:O+="/"}break;case 123*m:l[c++]=Rd(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(O=Id(O,/\f/g,"")),f>0&&Rd(O)-d&&zd(f>32?Op(O+";",r,n,d-1):Op(Id(O," ","")+";",r,n,d-2),s);break;case 59:O+=";";default:if(zd(k=Ep(O,t,n,c,u,o,l,b,w=[],E=[],d),i),123===y)if(0===u)bp(O,t,k,k,w,i,d,l,E);else switch(99===p&&110===jd(O,3)?100:p){case 100:case 108:case 109:case 115:bp(e,k,k,r&&zd(Ep(e,k,k,0,0,o,l,b,o,w=[],d),E),o,E,d,l,r?w:E);break;default:bp(O,k,k,k,[""],E,0,l,E)}}c=u=f=0,m=v=1,b=O="",d=a;break;case 58:d=1+Rd(O),f=h;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Yd())continue;switch(O+=Td(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:l[c++]=(Rd(O)-1)*v,v=1;break;case 64:45===Kd()&&(O+=rp(Xd())),p=Kd(),u=d=Rd(b=O+=sp(Zd())),y++;break;case 45:45===h&&2==Rd(O)&&(m=0)}}return i}function Ep(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,p=0===o?i:[""],f=Bd(p),h=0,m=0,g=0;h<r;++h)for(var v=0,y=Ld(e,d+1,d=Ad(m=a[h])),b=e;v<f;++v)(b=Md(m>0?p[v]+" "+y:Id(y,/&\f/g,p[v])))&&(s[g++]=b);return Qd(e,t,n,0===o?fp:l,s,c,u)}function kp(e,t,n){return Qd(e,t,n,pp,Td(Gd),Ld(e,2,-2),0)}function Op(e,t,n,r){return Qd(e,t,n,hp,Ld(e,0,r),Ld(e,r+1,-1),r)}var Sp=function(e,t,n){for(var r=0,o=0;r=o,o=Kd(),38===r&&12===o&&(t[n]=1),!ep(o);)Xd();return Jd(e,Hd)},xp=new WeakMap,_p=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||xp.get(n))&&!r){xp.set(e,!0);for(var o=[],i=function(e,t){return np(function(e,t){var n=-1,r=44;do{switch(ep(r)){case 0:38===r&&12===Kd()&&(t[n]=1),e[n]+=Sp(Hd-1,t,n);break;case 2:e[n]+=rp(r);break;case 4:if(44===r){e[++n]=58===Kd()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Td(r)}}while(r=Xd());return e}(tp(e),t))}(t,o),a=n.props,l=0,s=0;l<i.length;l++)for(var c=0;c<a.length;c++,s++)e.props[s]=o[l]?i[l].replace(/&\f/g,a[c]):a[c]+" "+i[l]}}},Cp=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Dp(e,t){switch(function(e,t){return 45^jd(e,0)?(((t<<2^jd(e,0))<<2^jd(e,1))<<2^jd(e,2))<<2^jd(e,3):0}(e,t)){case 5103:return dp+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return dp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return dp+e+up+e+cp+e+e;case 6828:case 4268:return dp+e+cp+e+e;case 6165:return dp+e+cp+"flex-"+e+e;case 5187:return dp+e+Id(e,/(\w+).+(:[^]+)/,dp+"box-$1$2"+cp+"flex-$1$2")+e;case 5443:return dp+e+cp+"flex-item-"+Id(e,/flex-|-self/,"")+e;case 4675:return dp+e+cp+"flex-line-pack"+Id(e,/align-content|flex-|-self/,"")+e;case 5548:return dp+e+cp+Id(e,"shrink","negative")+e;case 5292:return dp+e+cp+Id(e,"basis","preferred-size")+e;case 6060:return dp+"box-"+Id(e,"-grow","")+dp+e+cp+Id(e,"grow","positive")+e;case 4554:return dp+Id(e,/([^-])(transform)/g,"$1"+dp+"$2")+e;case 6187:return Id(Id(Id(e,/(zoom-|grab)/,dp+"$1"),/(image-set)/,dp+"$1"),e,"")+e;case 5495:case 3959:return Id(e,/(image-set\([^]*)/,dp+"$1$`$1");case 4968:return Id(Id(e,/(.+:)(flex-)?(.*)/,dp+"box-pack:$3"+cp+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+dp+e+e;case 4095:case 3583:case 4068:case 2532:return Id(e,/(.+)-inline(.+)/,dp+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Rd(e)-1-t>6)switch(jd(e,t+1)){case 109:if(45!==jd(e,t+4))break;case 102:return Id(e,/(.+:)(.+)-([^]+)/,"$1"+dp+"$2-$3$1"+up+(108==jd(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Nd(e,"stretch")?Dp(Id(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==jd(e,t+1))break;case 6444:switch(jd(e,Rd(e)-3-(~Nd(e,"!important")&&10))){case 107:return Id(e,":",":"+dp)+e;case 101:return Id(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dp+(45===jd(e,14)?"inline-":"")+"box$3$1"+dp+"$2$3$1"+cp+"$2box$3")+e}break;case 5936:switch(jd(e,t+11)){case 114:return dp+e+cp+Id(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dp+e+cp+Id(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dp+e+cp+Id(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dp+e+cp+e+e}return e}var Pp=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case hp:e.return=Dp(e.value,e.length);break;case mp:return gp([$d(e,{value:Id(e.value,"@","@"+dp)})],r);case fp:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return gp([$d(e,{props:[Id(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return gp([$d(e,{props:[Id(t,/:(plac\w+)/,":"+dp+"input-$1")]}),$d(e,{props:[Id(t,/:(plac\w+)/,":-moz-$1")]}),$d(e,{props:[Id(t,/:(plac\w+)/,cp+"input-$1")]})],r)}return""})}}],Ap=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,i=e.stylisPlugins||Pp,a={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;l.push(e)});var s,c,u,d,p=[vp,(d=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],f=(c=[_p,Cp].concat(i,p),u=Bd(c),function(e,t,n,r){for(var o="",i=0;i<u;i++)o+=c[i](e,t,n,r)||"";return o});o=function(e,t,n,r){s=n,function(e){gp(yp(e),f)}(e?e+"{"+t.styles+"}":t.styles),r&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new Pd({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return h.sheet.hydrate(l),h},Tp=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Fp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Mp(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Ip=/[A-Z]|^ms/g,Np=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jp=function(e){return 45===e.charCodeAt(1)},Lp=function(e){return null!=e&&"boolean"!=typeof e},Rp=Mp(function(e){return jp(e)?e:e.replace(Ip,"-$&").toLowerCase()}),Bp=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Np,function(e,t,n){return Wp={name:t,styles:n,next:Wp},t})}return 1===Fp[e]||jp(e)||"number"!=typeof t||0===t?t:t+"px"};function zp(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Wp={name:o.name,styles:o.styles,next:Wp},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Wp={name:a.name,styles:a.styles,next:Wp},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=zp(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var l=a;null!=t&&void 0!==t[l]?r+=i+"{"+t[l]+"}":Lp(l)&&(r+=Rp(i)+":"+Bp(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=zp(e,t,a);switch(i){case"animation":case"animationName":r+=Rp(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)Lp(a[c])&&(r+=Rp(i)+":"+Bp(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=Wp,s=n(e);return Wp=l,zp(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Wp,Up=/label:\s*([^\s;{]+)\s*(;|$)/g;function Vp(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Wp=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=zp(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=zp(n,t,e[a]),r&&(o+=i[a]);Up.lastIndex=0;for(var l,s="";null!==(l=Up.exec(o));)s+="-"+l[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+s;return{name:c,styles:o,next:Wp}}var Hp,Gp,qp=!!pe.useInsertionEffect&&pe.useInsertionEffect,Qp=qp||function(e){return e()},$p=(qp||pe.useLayoutEffect,pe.createContext("undefined"!=typeof HTMLElement?Ap({key:"css"}):null)),Yp=($p.Provider,function(e){return(0,pe.forwardRef)(function(t,n){var r=(0,pe.useContext)($p);return e(t,r,n)})}),Xp=pe.createContext({}),Kp={}.hasOwnProperty,Zp="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Jp=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Tp(t,n,r),Qp(function(){return function(e,t,n){Tp(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)}),null},ef=Yp(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[Zp],i=[r],a="";"string"==typeof e.className?a=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,i,e.className):null!=e.className&&(a=e.className+" ");var l=Vp(i,void 0,pe.useContext(Xp));a+=t.key+"-"+l.name;var s={};for(var c in e)Kp.call(e,c)&&"css"!==c&&c!==Zp&&(s[c]=e[c]);return s.className=a,n&&(s.ref=n),pe.createElement(pe.Fragment,null,pe.createElement(Jp,{cache:t,serialized:l,isStringTag:"string"==typeof o}),pe.createElement(o,s))}),tf=ef,nf=function(e,t){var n=arguments;if(null==t||!Kp.call(t,"css"))return pe.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=tf,o[1]=function(e,t){var n={};for(var r in t)Kp.call(t,r)&&(n[r]=t[r]);return n[Zp]=e,n}(e,t);for(var i=2;i<r;i++)o[i]=n[i];return pe.createElement.apply(null,o)};function rf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Vp(t)}Hp=nf||(nf={}),Gp||(Gp=Hp.JSX||(Hp.JSX={}));const of=["top","right","bottom","left"],af=Math.min,lf=Math.max,sf=Math.round,cf=Math.floor,uf=e=>({x:e,y:e}),df={left:"right",right:"left",bottom:"top",top:"bottom"},pf={start:"end",end:"start"};function ff(e,t,n){return lf(e,af(t,n))}function hf(e,t){return"function"==typeof e?e(t):e}function mf(e){return e.split("-")[0]}function gf(e){return e.split("-")[1]}function vf(e){return"x"===e?"y":"x"}function yf(e){return"y"===e?"height":"width"}const bf=new Set(["top","bottom"]);function wf(e){return bf.has(mf(e))?"y":"x"}function Ef(e){return vf(wf(e))}function kf(e){return e.replace(/start|end/g,e=>pf[e])}const Of=["left","right"],Sf=["right","left"],xf=["top","bottom"],_f=["bottom","top"];function Cf(e){return e.replace(/left|right|bottom|top/g,e=>df[e])}function Df(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Pf(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Af(e,t,n){let{reference:r,floating:o}=e;const i=wf(t),a=Ef(t),l=yf(a),s=mf(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let f;switch(s){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(gf(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function Tf(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=hf(t,e),h=Df(f),m=l[p?"floating"===d?"reference":"floating":d],g=Pf(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Pf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:s}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Ff(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mf(e){return of.some(t=>e[t]>=0)}const If=new Set(["left","top"]);function Nf(){return"undefined"!=typeof window}function jf(e){return Bf(e)?(e.nodeName||"").toLowerCase():"#document"}function Lf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Rf(e){var t;return null==(t=(Bf(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Bf(e){return!!Nf()&&(e instanceof Node||e instanceof Lf(e).Node)}function zf(e){return!!Nf()&&(e instanceof Element||e instanceof Lf(e).Element)}function Wf(e){return!!Nf()&&(e instanceof HTMLElement||e instanceof Lf(e).HTMLElement)}function Uf(e){return!(!Nf()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Lf(e).ShadowRoot)}const Vf=new Set(["inline","contents"]);function Hf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Vf.has(o)}const Gf=new Set(["table","td","th"]);function qf(e){return Gf.has(jf(e))}const Qf=[":popover-open",":modal"];function $f(e){return Qf.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Yf=["transform","translate","scale","rotate","perspective"],Xf=["transform","translate","scale","rotate","perspective","filter"],Kf=["paint","layout","strict","content"];function Zf(e){const t=Jf(),n=zf(e)?nh(e):e;return Yf.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Xf.some(e=>(n.willChange||"").includes(e))||Kf.some(e=>(n.contain||"").includes(e))}function Jf(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const eh=new Set(["html","body","#document"]);function th(e){return eh.has(jf(e))}function nh(e){return Lf(e).getComputedStyle(e)}function rh(e){return zf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oh(e){if("html"===jf(e))return e;const t=e.assignedSlot||e.parentNode||Uf(e)&&e.host||Rf(e);return Uf(t)?t.host:t}function ih(e){const t=oh(e);return th(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wf(t)&&Hf(t)?t:ih(t)}function ah(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ih(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Lf(o);if(i){const e=lh(a);return t.concat(a,a.visualViewport||[],Hf(o)?o:[],e&&n?ah(e):[])}return t.concat(o,ah(o,[],n))}function lh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sh(e){const t=nh(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Wf(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=sf(n)!==i||sf(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ch(e){return zf(e)?e:e.contextElement}function uh(e){const t=ch(e);if(!Wf(t))return uf(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=sh(t);let a=(i?sf(n.width):n.width)/r,l=(i?sf(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const dh=uf(0);function ph(e){const t=Lf(e);return Jf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:dh}function fh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ch(e);let a=uf(1);t&&(r?zf(r)&&(a=uh(r)):a=uh(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Lf(e))&&t}(i,n,r)?ph(i):uf(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Lf(i),t=r&&zf(r)?Lf(r):r;let n=e,o=lh(n);for(;o&&r&&t!==n;){const e=uh(o),t=o.getBoundingClientRect(),r=nh(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,d*=e.y,s+=i,c+=a,n=Lf(o),o=lh(n)}}return Pf({width:u,height:d,x:s,y:c})}function hh(e,t){const n=rh(e).scrollLeft;return t?t.left+n:fh(Rf(e)).left+n}function mh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-hh(e,n),y:n.top+t.scrollTop}}const gh=new Set(["absolute","fixed"]);function vh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Lf(e),r=Rf(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=Jf();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}const c=hh(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=Rf(e),n=rh(e),r=e.ownerDocument.body,o=lf(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=lf(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+hh(e);const l=-n.scrollTop;return"rtl"===nh(r).direction&&(a+=lf(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(Rf(e));else if(zf(t))r=function(e,t){const n=fh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Wf(e)?uh(e):uf(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ph(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Pf(r)}function yh(e,t){const n=oh(e);return!(n===t||!zf(n)||th(n))&&("fixed"===nh(n).position||yh(n,t))}function bh(e,t,n){const r=Wf(t),o=Rf(t),i="fixed"===n,a=fh(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=uf(0);function c(){s.x=hh(o)}if(r||!r&&!i)if(("body"!==jf(t)||Hf(o))&&(l=rh(t)),r){const e=fh(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?uf(0):mh(o,l);return{x:a.left+l.scrollLeft-s.x-u.x,y:a.top+l.scrollTop-s.y-u.y,width:a.width,height:a.height}}function wh(e){return"static"===nh(e).position}function Eh(e,t){if(!Wf(e)||"fixed"===nh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Rf(e)===n&&(n=n.ownerDocument.body),n}function kh(e,t){const n=Lf(e);if($f(e))return n;if(!Wf(e)){let t=oh(e);for(;t&&!th(t);){if(zf(t)&&!wh(t))return t;t=oh(t)}return n}let r=Eh(e,t);for(;r&&qf(r)&&wh(r);)r=Eh(r,t);return r&&th(r)&&wh(r)&&!Zf(r)?n:r||function(e){let t=oh(e);for(;Wf(t)&&!th(t);){if(Zf(t))return t;if($f(t))return null;t=oh(t)}return null}(e)||n}const Oh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Rf(r),l=!!t&&$f(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},c=uf(1);const u=uf(0),d=Wf(r);if((d||!d&&!i)&&(("body"!==jf(r)||Hf(a))&&(s=rh(r)),Wf(r))){const e=fh(r);c=uh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?uf(0):mh(a,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-s.scrollTop*c.y+u.y+p.y}},getDocumentElement:Rf,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?$f(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ah(e,[],!1).filter(e=>zf(e)&&"body"!==jf(e)),o=null;const i="fixed"===nh(e).position;let a=i?oh(e):e;for(;zf(a)&&!th(a);){const t=nh(a),n=Zf(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&gh.has(o.position)||Hf(a)&&!n&&yh(e,a))?r=r.filter(e=>e!==a):o=t,a=oh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],l=a[0],s=a.reduce((e,n)=>{const r=vh(t,n,o);return e.top=lf(r.top,e.top),e.right=af(r.right,e.right),e.bottom=af(r.bottom,e.bottom),e.left=lf(r.left,e.left),e},vh(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:kh,getElementRects:async function(e){const t=this.getOffsetParent||kh,n=this.getDimensions,r=await n(e.floating);return{reference:bh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=sh(e);return{width:t,height:n}},getScale:uh,isElement:zf,isRTL:function(e){return"rtl"===nh(e).direction}};function Sh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xh(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ch(e),u=o||i?[...c?ah(c):[],...ah(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&l?function(e,t){let n,r=null;const o=Rf(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(l||t(),!p||!f)return;const h={rootMargin:-cf(d)+"px "+-cf(o.clientWidth-(u+p))+"px "+-cf(o.clientHeight-(d+f))+"px "+-cf(u)+"px",threshold:lf(0,af(1,s))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==s){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Sh(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),h.observe(t));let m=s?fh(e):null;return s&&function t(){const r=fh(e);m&&!Sh(m,r)&&n(),m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const _h=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=mf(n),l=gf(n),s="y"===wf(n),c=If.has(a)?-1:1,u=i&&s?-1:1,d=hf(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof h&&(f="end"===l?-1*h:h),s?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ch=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=hf(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=wf(mf(o)),f=vf(p);let h=u[f],m=u[p];if(a){const e="y"===f?"bottom":"right";h=ff(h+d["y"===f?"top":"left"],h,h-d[e])}if(l){const e="y"===p?"bottom":"right";m=ff(m+d["y"===p?"top":"left"],m,m-d[e])}const g=s.fn({...t,[f]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:a,[p]:l}}}}}},Dh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=hf(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=mf(o),y=wf(l),b=mf(l)===l,w=await(null==s.isRTL?void 0:s.isRTL(c.floating)),E=p||(b||!m?[Cf(l)]:function(e){const t=Cf(e);return[kf(e),t,kf(t)]}(l)),k="none"!==h;!p&&k&&E.push(...function(e,t,n,r){const o=gf(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Sf:Of:t?Of:Sf;case"left":case"right":return t?xf:_f;default:return[]}}(mf(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(kf)))),i}(l,m,h,w));const O=[l,...E],S=await s.detectOverflow(t,g),x=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&x.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=gf(e),o=Ef(e),i=yf(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Cf(a)),[a,Cf(a)]}(o,a,w);x.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:x}],!x.every(e=>e<=0)){var C,D;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=O[e];if(t&&("alignment"!==d||y===wf(t)||_.every(e=>wf(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(D=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var P;const e=null==(P=_.filter(e=>{if(k){const t=wf(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},Ph=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:s=()=>{},...c}=hf(e,t),u=await a.detectOverflow(t,c),d=mf(o),p=gf(o),f="y"===wf(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,b=h-u.left-u.right,w=af(m-u[g],y),E=af(h-u[v],b),k=!t.middlewareData.shift;let O=w,S=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(O=y),k&&!p){const e=lf(u.left,0),t=lf(u.right,0),n=lf(u.top,0),r=lf(u.bottom,0);f?S=h-2*(0!==e||0!==t?e+t:lf(u.left,u.right)):O=m-2*(0!==n||0!==r?n+r:lf(u.top,u.bottom))}await s({...t,availableWidth:S,availableHeight:O});const x=await a.getDimensions(l.floating);return h!==x.width||m!==x.height?{reset:{rects:!0}}:{}}}},Ah=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=hf(e,t);switch(o){case"referenceHidden":{const e=Ff(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Mf(e)}}}case"escaped":{const e=Ff(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Mf(e)}}}default:return{}}}}},Th=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=hf(e,t)||{};if(null==c)return{};const d=Df(u),p={x:n,y:r},f=Ef(o),h=yf(f),m=await a.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],E=p[f]-i.reference[f],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let O=k?k[b]:0;O&&await(null==a.isElement?void 0:a.isElement(k))||(O=l.floating[b]||i.floating[h]);const S=w/2-E/2,x=O/2-m[h]/2-1,_=af(d[v],x),C=af(d[y],x),D=_,P=O-m[h]-C,A=O/2-m[h]/2+S,T=ff(D,A,P),F=!s.arrow&&null!=gf(o)&&A!==T&&i.reference[h]/2-(A<D?_:C)-m[h]/2<0,M=F?A<D?A-D:A-P:0;return{[f]:p[f]+M,data:{[f]:T,centerOffset:A-T-M,...F&&{alignmentOffset:M}},reset:F}}}),Fh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=hf(e,t),u={x:n,y:r},d=wf(o),p=vf(d);let f=u[p],h=u[d];const m=hf(l,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===p?"width":"height",t=If.has(mf(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},Mh=(e,t,n)=>{const r=new Map,o={platform:Oh,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Af(c,r,s),p=r,f={},h=0;for(let n=0;n<l.length;n++){var m;const{name:i,fn:g}=l[n],{x:v,y,data:b,reset:w}=await g({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...a,detectOverflow:null!=(m=a.detectOverflow)?m:Tf},elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:d}=Af(c,p,s))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var Ih=pe.useLayoutEffect,Nh=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],jh=function(){};function Lh(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Rh(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(Lh(e,a)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var Bh=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===ne(e)&&null!==e?[e]:[];var t},zh=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,bd({},Wn(e,Nh))},Wh=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(null!=n?n:{},i(t,e),a)}};function Uh(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Vh(e){return Uh(e)?window.pageYOffset:e.scrollTop}function Hh(e,t){Uh(e)?window.scrollTo(0,t):e.scrollTop=t}function Gh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:jh,o=Vh(e),i=t-o,a=0;!function t(){var l=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(a+=10,o,i,n);Hh(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function qh(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Hh(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Hh(e,Math.max(t.offsetTop-o,0))}function Qh(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var $h=!1,Yh={get passive(){return $h=!0}},Xh="undefined"!=typeof window?window:{};Xh.addEventListener&&Xh.removeEventListener&&(Xh.addEventListener("p",jh,Yh),Xh.removeEventListener("p",jh,!1));var Kh=$h;function Zh(e){return null!=e}function Jh(e,t,n){return e?t:n}var em=["children","innerProps"],tm=["children","innerProps"];var nm,rm=function(e){return"auto"===e?"bottom":e},om=(0,pe.createContext)(null),im=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,s=((0,pe.useContext)(om)||{}).setPortalPlacement,c=(0,pe.useRef)(null),u=ce((0,pe.useState)(r),2),d=u[0],p=u[1],f=ce((0,pe.useState)(null),2),h=f[0],m=f[1],g=l.spacing.controlHeight;return Ih(function(){var e=c.current;if(e){var t="fixed"===i,l=function(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=s.getBoundingClientRect().height,p=n.getBoundingClientRect(),f=p.bottom,h=p.height,m=p.top,g=n.offsetParent.getBoundingClientRect().top,v=a||Uh(u=s)?window.innerHeight:u.clientHeight,y=Vh(s),b=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),E=g-w,k=v-m,O=E+y,S=d-y-m,x=f-v+y+b,_=y+m-w,C=160;switch(o){case"auto":case"bottom":if(k>=h)return{placement:"bottom",maxHeight:t};if(S>=h&&!a)return i&&Gh(s,x,C),{placement:"bottom",maxHeight:t};if(!a&&S>=r||a&&k>=r)return i&&Gh(s,x,C),{placement:"bottom",maxHeight:a?k-b:S-b};if("auto"===o||a){var D=t,P=a?E:O;return P>=r&&(D=Math.min(P-b-l,t)),{placement:"top",maxHeight:D}}if("bottom"===o)return i&&Hh(s,x),{placement:"bottom",maxHeight:t};break;case"top":if(E>=h)return{placement:"top",maxHeight:t};if(O>=h&&!a)return i&&Gh(s,_,C),{placement:"top",maxHeight:t};if(!a&&O>=r||a&&E>=r){var A=t;return(!a&&O>=r||a&&E>=r)&&(A=a?E-w:O-w),i&&Gh(s,_,C),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}({maxHeight:r,menuEl:e,minHeight:n,placement:o,shouldScroll:a&&!t,isFixedPosition:t,controlHeight:g});p(l.maxHeight),m(l.placement),null==s||s(l.placement)}},[r,o,i,a,n,s,g]),t({ref:c,placerProps:bd(bd({},e),{},{placement:h||rm(o),maxHeight:d})})},am=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return bd({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},lm=am,sm=am,cm=["size"],um=["innerProps","isRtl","size"],dm={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},pm=function(e){var t=e.size,n=Wn(e,cm);return nf("svg",re({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:dm},n))},fm=function(e){return nf(pm,re({size:20},e),nf("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},hm=function(e){return nf(pm,re({size:20},e),nf("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},mm=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return bd({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},gm=mm,vm=mm,ym=function(){var e=rf.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(nm||(nm=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),bm=function(e){var t=e.delay,n=e.offset;return nf("span",{css:rf({animation:"".concat(ym," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},wm=["data"],Em=["innerRef","isDisabled","isHidden","inputClassName"],km={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Om={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":bd({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},km)},Sm=function(e){return bd({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},km)},xm=function(e){var t=e.children,n=e.innerProps;return nf("div",n,t)},_m={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return nf("div",re({},Wh(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||nf(fm,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return nf("div",re({ref:o},Wh(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return nf("div",re({},Wh(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||nf(hm,null))},DownChevron:hm,CrossIcon:fm,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return nf("div",re({},Wh(e,"group",{group:!0}),l),nf(i,re({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),nf("div",null,t))},GroupHeading:function(e){var t=zh(e);t.data;var n=Wn(t,wm);return nf("div",re({},Wh(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return nf("div",re({},Wh(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return nf("span",re({},t,Wh(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=zh(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=Wn(r,Em);return nf("div",re({},Wh(e,"input",{"input-container":!0}),{"data-value":n||""}),nf("input",re({className:t({input:!0},l),ref:o,style:Sm(a),disabled:i},s)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=Wn(e,um);return nf("div",re({},Wh(bd(bd({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),nf(bm,{delay:0,offset:n}),nf(bm,{delay:160,offset:!0}),nf(bm,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return nf("div",re({},Wh(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return nf("div",re({},Wh(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,r=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=(0,pe.useRef)(null),s=(0,pe.useRef)(null),c=ce((0,pe.useState)(rm(i)),2),u=c[0],d=c[1],p=(0,pe.useMemo)(function(){return{setPortalPlacement:d}},[]),f=ce((0,pe.useState)(null),2),h=f[0],m=f[1],g=(0,pe.useCallback)(function(){if(r){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),t="fixed"===a?0:window.pageYOffset,n=e[u]+t;n===(null==h?void 0:h.offset)&&e.left===(null==h?void 0:h.rect.left)&&e.width===(null==h?void 0:h.rect.width)||m({offset:n,rect:e})}},[r,a,u,null==h?void 0:h.offset,null==h?void 0:h.rect.left,null==h?void 0:h.rect.width]);Ih(function(){g()},[g]);var v=(0,pe.useCallback)(function(){"function"==typeof s.current&&(s.current(),s.current=null),r&&l.current&&(s.current=xh(r,l.current,g,{elementResize:"ResizeObserver"in window}))},[r,g]);Ih(function(){v()},[v]);var y=(0,pe.useCallback)(function(e){l.current=e,v()},[v]);if(!t&&"fixed"!==a||!h)return null;var b=nf("div",re({ref:y},Wh(bd(bd({},e),{},{offset:h.offset,position:a,rect:h.rect}),"menuPortal",{"menu-portal":!0}),o),n);return nf(om.Provider,{value:p},t?(0,oe.createPortal)(b,t):b)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=Wn(e,tm);return nf("div",re({},Wh(bd(bd({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,o=Wn(e,em);return nf("div",re({},Wh(bd(bd({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return nf(s,{data:r,innerProps:bd(bd({},Wh(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},nf(c,{data:r,innerProps:bd({},Wh(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),nf(u,{data:r,innerProps:bd(bd({},Wh(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},MultiValueContainer:xm,MultiValueLabel:xm,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return nf("div",re({role:"button"},n),t||nf(fm,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return nf("div",re({},Wh(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return nf("div",re({},Wh(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return nf("div",re({},Wh(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return nf("div",re({},Wh(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return nf("div",re({},Wh(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},Cm=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Dm(e,t){return e===t||!(!Cm(e)||!Cm(t))}function Pm(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dm(e[n],t[n]))return!1;return!0}for(var Am={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Tm=function(e){return nf("span",re({css:Am},e))},Fm={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t&&c){var d=l?" disabled":"",p="".concat(s?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Mm=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,d=l.getOptionLabel,p=l.inputValue,f=l.isMulti,h=l.isOptionDisabled,m=l.isSearchable,g=l.menuIsOpen,v=l.options,y=l.screenReaderStatus,b=l.tabSelectsValue,w=l.isLoading,E=l["aria-label"],k=l["aria-live"],O=(0,pe.useMemo)(function(){return bd(bd({},Fm),u||{})},[u]),S=(0,pe.useMemo)(function(){var e,n="";if(t&&O.onChange){var r=t.option,o=t.options,i=t.removedValue,l=t.removedValues,s=t.value,c=i||r||(e=s,Array.isArray(e)?null:e),u=c?d(c):"",p=o||l||void 0,f=p?p.map(d):[],m=bd({isDisabled:c&&h(c,a),label:u,labels:f},t);n=O.onChange(m)}return n},[t,O,h,a,d]),x=(0,pe.useMemo)(function(){var e="",t=n||r,i=!!(n&&a&&a.includes(n));if(t&&O.onFocus){var l={focused:t,label:d(t),isDisabled:h(t,a),isSelected:i,options:o,context:t===n?"menu":"value",selectValue:a,isAppleDevice:c};e=O.onFocus(l)}return e},[n,r,d,h,O,o,a,c]),_=(0,pe.useMemo)(function(){var e="";if(g&&v.length&&!w&&O.onFilter){var t=y({count:o.length});e=O.onFilter({inputValue:p,resultsMessage:t})}return e},[o,p,g,O,v,y,w]),C="initial-input-focus"===(null==t?void 0:t.action),D=(0,pe.useMemo)(function(){var e="";if(O.guidance){var t=r?"value":g?"menu":"input";e=O.guidance({"aria-label":E,context:t,isDisabled:n&&h(n,a),isMulti:f,isSearchable:m,tabSelectsValue:b,isInitialFocus:C})}return e},[E,n,r,f,h,m,g,O,a,b,C]),P=nf(pe.Fragment,null,nf("span",{id:"aria-selection"},S),nf("span",{id:"aria-focused"},x),nf("span",{id:"aria-results"},_),nf("span",{id:"aria-guidance"},D));return nf(pe.Fragment,null,nf(Tm,{id:s},C&&P),nf(Tm,{"aria-live":k,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!C&&P))},Im=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Nm=new RegExp("["+Im.map(function(e){return e.letters}).join("")+"]","g"),jm={},Lm=0;Lm<Im.length;Lm++)for(var Rm=Im[Lm],Bm=0;Bm<Rm.letters.length;Bm++)jm[Rm.letters[Bm]]=Rm.base;var zm=function(e){return e.replace(Nm,function(e){return jm[e]})},Wm=function(e,t){void 0===t&&(t=Pm);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}(zm),Um=function(e){return e.replace(/^\s+|\s+$/g,"")},Vm=function(e){return"".concat(e.label," ").concat(e.value)},Hm=["innerRef"];function Gm(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter(function(e){var t=ce(e,1)[0];return!n.includes(t)});return o.reduce(function(e,t){var n=ce(t,2),r=n[0],o=n[1];return e[r]=o,e},{})}(Wn(e,Hm),"onExited","in","enter","exit","appear");return nf("input",re({ref:t},n,{css:rf({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var qm=["boxSizing","height","overflow","paddingRight","position"],Qm={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function $m(e){e.cancelable&&e.preventDefault()}function Ym(e){e.stopPropagation()}function Xm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Km(){return"ontouchstart"in window||navigator.maxTouchPoints}var Zm=!("undefined"==typeof window||!window.document||!window.document.createElement),Jm=0,eg={capture:!1,passive:!1},tg=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},ng={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function rg(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=function(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=(0,pe.useRef)(!1),l=(0,pe.useRef)(!1),s=(0,pe.useRef)(0),c=(0,pe.useRef)(null),u=(0,pe.useCallback)(function(e,t){if(null!==c.current){var s=c.current,u=s.scrollTop,d=s.scrollHeight,p=s.clientHeight,f=c.current,h=t>0,m=d-p-u,g=!1;m>t&&a.current&&(r&&r(e),a.current=!1),h&&l.current&&(i&&i(e),l.current=!1),h&&t>m?(n&&!a.current&&n(e),f.scrollTop=d,g=!0,a.current=!0):!h&&-t>u&&(o&&!l.current&&o(e),f.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,r,o,i]),d=(0,pe.useCallback)(function(e){u(e,e.deltaY)},[u]),p=(0,pe.useCallback)(function(e){s.current=e.changedTouches[0].clientY},[]),f=(0,pe.useCallback)(function(e){var t=s.current-e.changedTouches[0].clientY;u(e,t)},[u]),h=(0,pe.useCallback)(function(e){if(e){var t=!!Kh&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",f,t)}},[f,p,d]),m=(0,pe.useCallback)(function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",f,!1))},[f,p,d]);return(0,pe.useEffect)(function(){if(t){var e=c.current;return h(e),function(){m(e)}}},[t,h,m]),function(e){c.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,pe.useRef)({}),i=(0,pe.useRef)(null),a=(0,pe.useCallback)(function(e){if(Zm){var t=document.body,n=t&&t.style;if(r&&qm.forEach(function(e){var t=n&&n[e];o.current[e]=t}),r&&Jm<1){var i=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,l=window.innerWidth-a+i||0;Object.keys(Qm).forEach(function(e){var t=Qm[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(l,"px"))}t&&Km()&&(t.addEventListener("touchmove",$m,eg),e&&(e.addEventListener("touchstart",Xm,eg),e.addEventListener("touchmove",Ym,eg))),Jm+=1}},[r]),l=(0,pe.useCallback)(function(e){if(Zm){var t=document.body,n=t&&t.style;Jm=Math.max(Jm-1,0),r&&Jm<1&&qm.forEach(function(e){var t=o.current[e];n&&(n[e]=t)}),t&&Km()&&(t.removeEventListener("touchmove",$m,eg),e&&(e.removeEventListener("touchstart",Xm,eg),e.removeEventListener("touchmove",Ym,eg)))}},[r]);return(0,pe.useEffect)(function(){if(t){var e=i.current;return a(e),function(){l(e)}}},[t,a,l]),function(e){i.current=e}}({isEnabled:n});return nf(pe.Fragment,null,n&&nf("div",{onClick:tg,css:ng}),t(function(e){o(e),i(e)}))}var og={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ig=function(e){var t=e.name,n=e.onFocus;return nf("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:og,value:"",onChange:function(){}})};function ag(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function lg(){return ag(/^Mac/i)}var sg=function(e){return e.label},cg=function(e){return e.value},ug={clearIndicator:vm,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return bd({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:gm,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return bd({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return bd({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return bd(bd({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Om),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return bd({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:sm,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return bd((Pt(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),Pt(n,"position","absolute"),Pt(n,"width","100%"),Pt(n,"zIndex",1),n),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return bd({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return bd({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return bd({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return bd({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:lm,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return bd({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return bd({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return bd({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return bd({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},dg={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},pg={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Qh(),captureMenuScroll:!Qh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=bd({ignoreCase:!0,ignoreAccents:!0,stringify:Vm,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,l=n.matchFrom,s=a?Um(t):t,c=a?Um(i(e)):i(e);return r&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Wm(s),c=zm(c)),"start"===l?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:sg,getOptionValue:cg,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function fg(e,t,n,r){return{type:"option",data:t,isDisabled:Eg(e,t,n),isSelected:kg(e,t,n),label:bg(e,t),value:wg(e,t),index:r}}function hg(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return fg(e,n,t,r)}).filter(function(t){return vg(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=fg(e,n,t,r);return vg(e,i)?i:void 0}).filter(Zh)}function mg(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,Nl(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function gg(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,Nl(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function vg(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!Sg(e)||!i)&&Og(e,{label:a,value:l,data:o},r)}var yg=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},bg=function(e,t){return e.getOptionLabel(t)},wg=function(e,t){return e.getOptionValue(t)};function Eg(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function kg(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=wg(e,t);return n.some(function(t){return wg(e,t)===r})}function Og(e,t,n){return!e.filterOption||e.filterOption(t,n)}var Sg=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},xg=1,_g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xd(e,t)}(n,e);var t=function(e){var t=Cd();return function(){var n,r=_d(e);if(t){var o=_d(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dd(e)}(this,n)}}(n);function n(e){var r;if(kd(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,l=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:l}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,l=o&&r.isOptionSelected(e,a),s=r.isOptionDisabled(e,a);if(l){var c=r.getOptionValue(e);r.setValue(a.filter(function(e){return r.getOptionValue(e)!==c}),"deselect-option",e)}else{if(s)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(Nl(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter(function(e){return r.getOptionValue(e)!==o}),a=Jh(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(Jh(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=Jh(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return yg(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return gg(hg(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Rh.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return bg(r.props,e)},r.getOptionValue=function(e){return wg(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=ug[e](t,n);o.boxSizing="border-box";var i=r.props.styles[e];return i?i(o,t):o},r.getClassNames=function(e,t){var n,o;return null===(n=(o=r.props.classNames)[e])||void 0===n?void 0:n.call(o,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,bd(bd({},_m),e.components);var e},r.buildCategorizedOptions=function(){return hg(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return mg(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:bd({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,o=t.menuIsOpen;r.focusInput(),o?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Uh(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-r.initialTouchX),i=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return Sg(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,l=t.isClearable,s=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=r.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!(s||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)r.removeValue(m);else{if(!o)return;n?r.popValue():l&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!h||p&&r.isOptionSelected(h,g))return;r.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h)return;if(r.isComposing)return;r.selectOption(h);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):l&&i&&r.clearValue();break;case" ":if(a)return;if(!c){r.openMenu("first");break}if(!h)return;r.selectOption(h);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++xg),r.state.selectValue=Bh(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=i[a],r.state.focusedOptionId=yg(o,i[a])}return r}return Sd(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&qh(this.menuListRef,this.focusedOptionRef),(lg()||ag(/^iPhone/i)||ag(/^iPad/i)||lg()&&navigator.maxTouchPoints>1)&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(qh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var l=i.indexOf(r[0]);l>-1&&(a=l)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o<i&&(a=o+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(dg):bd(bd({},dg),this.props.theme):dg}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,l=this.props,s=l.isMulti,c=l.isRtl,u=l.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:i,selectProps:l,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return Eg(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return kg(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Og(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,a=e.form,l=e.menuIsOpen,s=e.required,c=this.getComponents().Input,u=this.state,d=u.inputIsHidden,p=u.ariaSelection,f=this.commonProps,h=r||this.getElementId("input"),m=bd(bd(bd({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":s,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==p?void 0:p.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?pe.createElement(c,re({},f,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:a,type:"text",value:o},m)):pe.createElement(Gm,re({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:jh,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:a,value:""},m))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,a=t.SingleValue,l=t.Placeholder,s=this.commonProps,c=this.props,u=c.controlShouldRenderValue,d=c.isDisabled,p=c.isMulti,f=c.inputValue,h=c.placeholder,m=this.state,g=m.selectValue,v=m.focusedValue,y=m.isFocused;if(!this.hasValue()||!u)return f?null:pe.createElement(l,re({},s,{key:"placeholder",isDisabled:d,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return g.map(function(t,a){var l=t===v,c="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return pe.createElement(n,re({},s,{components:{Container:r,Label:o,Remove:i},isFocused:l,isDisabled:d,key:c,index:a,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(f)return null;var b=g[0];return pe.createElement(a,re({},s,{data:b,isDisabled:d}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var a={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return pe.createElement(e,re({},t,{innerProps:a,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?pe.createElement(e,re({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return pe.createElement(n,re({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return pe.createElement(e,re({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,a=t.MenuPortal,l=t.LoadingMessage,s=t.NoOptionsMessage,c=t.Option,u=this.commonProps,d=this.state.focusedOption,p=this.props,f=p.captureMenuScroll,h=p.inputValue,m=p.isLoading,g=p.loadingMessage,v=p.minMenuHeight,y=p.maxMenuHeight,b=p.menuIsOpen,w=p.menuPlacement,E=p.menuPosition,k=p.menuPortalTarget,O=p.menuShouldBlockScroll,S=p.menuShouldScrollIntoView,x=p.noOptionsMessage,_=p.onMenuScrollToTop,C=p.onMenuScrollToBottom;if(!b)return null;var D,P=function(t,n){var r=t.type,o=t.data,i=t.isDisabled,a=t.isSelected,l=t.label,s=t.value,p=d===o,f=i?void 0:function(){return e.onOptionHover(o)},h=i?void 0:function(){return e.selectOption(o)},m="".concat(e.getElementId("option"),"-").concat(n),g={id:m,onClick:h,onMouseMove:f,onMouseOver:f,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:a};return pe.createElement(c,re({},u,{innerProps:g,data:o,isDisabled:i,isSelected:a,key:m,label:l,type:r,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())D=this.getCategorizedOptions().map(function(t){if("group"===t.type){var o=t.data,i=t.options,a=t.index,l="".concat(e.getElementId("group"),"-").concat(a),s="".concat(l,"-heading");return pe.createElement(n,re({},u,{key:l,data:o,options:i,Heading:r,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e,"".concat(a,"-").concat(e.index))}))}if("option"===t.type)return P(t,"".concat(t.index))});else if(m){var A=g({inputValue:h});if(null===A)return null;D=pe.createElement(l,u,A)}else{var T=x({inputValue:h});if(null===T)return null;D=pe.createElement(s,u,T)}var F={minMenuHeight:v,maxMenuHeight:y,menuPlacement:w,menuPosition:E,menuShouldScrollIntoView:S},M=pe.createElement(im,re({},u,F),function(t){var n=t.ref,r=t.placerProps,a=r.placement,l=r.maxHeight;return pe.createElement(o,re({},u,F,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:m,placement:a}),pe.createElement(rg,{captureEnabled:f,onTopArrive:_,onBottomArrive:C,lockEnabled:O},function(t){return pe.createElement(i,re({},u,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":u.isMulti,id:e.getElementId("listbox")},isLoading:m,maxHeight:l,focusedOption:d}),D)}))});return k||"fixed"===E?pe.createElement(a,re({},u,{appendTo:k,controlElement:this.controlRef,menuPlacement:w,menuPosition:E}),M):M}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=t.required,l=this.state.selectValue;if(a&&!this.hasValue()&&!r)return pe.createElement(ig,{name:i,onFocus:this.onValueInputFocus});if(i&&!r){if(o){if(n){var s=l.map(function(t){return e.getOptionValue(t)}).join(n);return pe.createElement("input",{name:i,type:"hidden",value:s})}var c=l.length>0?l.map(function(t,n){return pe.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):pe.createElement("input",{name:i,type:"hidden",value:""});return pe.createElement("div",null,c)}var u=l[0]?this.getOptionValue(l[0]):"";return pe.createElement("input",{name:i,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.isFocused,a=t.selectValue,l=this.getFocusableOptions();return pe.createElement(Mm,re({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:i,selectValue:a,focusableOptions:l,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,a=i.className,l=i.id,s=i.isDisabled,c=i.menuIsOpen,u=this.state.isFocused,d=this.commonProps=this.getCommonProps();return pe.createElement(r,re({},d,{className:a,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:u}),this.renderLiveRegion(),pe.createElement(t,re({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:u,menuIsOpen:c}),pe.createElement(o,re({},d,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),pe.createElement(n,re({},d,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,l=t.prevWasFocused,s=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,h=Bh(u),m={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return mg(hg(e,t))}(e,h):[],v=d?gg(hg(e,h),"".concat(s,"-option")):[],y=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,h):null,b=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);m={selectValue:h,focusedOption:b,focusedOptionId:yg(v,b),focusableOptionsWithIds:v,focusedValue:y,clearFocusValueOnUpdate:!1}}var w=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},E=i,k=a&&l;return a&&!k&&(E={value:Jh(f,h,h[0]||null),options:h,action:"initial-input-focus"},k=!l),"initial-input-focus"===(null==i?void 0:i.action)&&(E=null),bd(bd(bd({},m),w),{},{prevProps:e,ariaSelection:E,prevWasFocused:k})}}]),n}(pe.Component);_g.defaultProps=pg;var Cg=(0,pe.forwardRef)(function(e,t){var n=Ed(e);return pe.createElement(_g,re({ref:t},n))}),Dg=Cg,Pg=["action","dispatch","workspaces","sharedWorkspaces","workspacesLoading","sharedWorkspacesLoading"],Ag=["value"];const Tg=gn(function(e){var t,n;return{workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading}})(function(e){var t=e.action,n=e.dispatch,r=e.workspaces,o=e.sharedWorkspaces,i=e.workspacesLoading,a=e.sharedWorkspacesLoading,l=Wn(e,Pg),s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!0),2),p=d[0],f=d[1],h=ce((0,pe.useState)(null),2),m=h[0],g=h[1],v=ce((0,pe.useState)([]),2),y=v[0],b=v[1];return(0,pe.useEffect)(function(){0==r.length&&n(ey({list_only:!0})),0==o.length&&n(ey({list_only:!0,shared:!0}))},[]),(0,pe.useEffect)(function(){var e=[];r.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:Ua(r)}),o.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Ua(o)}),e.length>0&&b(e)},[r,o]),(0,pe.useEffect)(function(){f(null==m)},[m]),(0,pe.useEffect)(function(){if(c){var r=e.my_cloud_id,o=m.value,i=Wn(m,Ag);Sl.showLoading(),"copy"===t?n(Rv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})):"move"===t&&n(zv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})),u(!1)}},[c]),he().createElement(ol,{className:"templately-cloud-copy-n-move-modal",headerClass:"text-center",header:(0,At.sprintf)((0,At.__)("%s to WorkSpace","templately"),"copy"===t?(0,At.__)("Copy","templately"):(0,At.__)("Move","templately"))},he().createElement(il,{className:"align-center"},he().createElement(al,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Item Name","templately"),":")),he().createElement(al,{column:8,wrapper:!0,wrapperClass:"cloud-item-name"},he().createElement("p",null,he().createElement("strong",null,l.name)))),he().createElement(il,null,he().createElement(al,{className:"text-right",column:4},he().createElement("p",null,"copy"===t?(0,At.__)("Copy to","templately"):(0,At.__)("Move to","templately"),":")),he().createElement(al,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(Dg,{isClearable:!0,isLoading:i||a,placeholder:(0,At.__)("Select WorkSpace","templately"),noOptionsMessage:function(){return(0,At.__)("No WorkSpace Found","templately")},options:y,onChange:function(e){return g(e)}}))),he().createElement(il,{className:"flex-end"},he().createElement(al,null,he().createElement(pl,{className:"templately-copy-move-btn",disabled:p,onClick:function(){return u(!0)},label:"copy"===t?(0,At.__)("Copy","templately"):(0,At.__)("Move","templately")}))))}),Fg=function(e){var t=e.id,n=e.source,r=e.slug;return he().createElement("div",{className:"templately-workspace-modal delete-file"},he().createElement("h4",null,(0,At.__)("Are You Sure?","templately")),he().createElement("p",null,(0,At.__)("You want to delete the file from your cloud.","templately")),he().createElement("div",{className:"twm-df-actions"},he().createElement("button",{onClick:function(){return Sl.close({isDismissed:!0})},className:"templately-button tb-cancel"},(0,At.__)("Cancel","templately")),he().createElement("button",{onClick:function(){Sl.showLoading(),e.dispatch(Uv({id:t,source:n,slug:r}))},className:"templately-button tb-delete"},(0,At.__)("Delete","templately"))))};function Mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ig(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mg(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ng=gn(function(e){var t,n;return{workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading,templates:{clouds:e.clouds.search,workspaces:e.workspaces.search,shared_workspaces:e.sharedWorkspaces.search}}},function(e){return{searchFiles:function(t){return e(Yv(Ig(Ig({},t),{},{context:"modal"})))},addFiles:function(t){return e(gy(t))}}})(function(e){var t,n=ce((0,pe.useState)(!1),2),r=n[0],o=n[1],i=ce((0,pe.useState)(!0),2),a=i[0],l=i[1],s=ce((0,pe.useState)(null),2),c=s[0],u=s[1],d=ce((0,pe.useState)([]),2),p=d[0],f=d[1],h=ce((0,pe.useState)([]),2),m=h[0],g=h[1],v=ce((0,pe.useState)(""),2),y=v[0],b=v[1],w=ce((0,pe.useState)({value:"clouds",label:(0,At.__)("My Clouds","templately")}),2),E=w[0],k=w[1],O=(0,pe.useMemo)(function(){return[{value:"clouds",label:(0,At.__)("My Clouds","templately")},{value:"workspaces",label:(0,At.__)("My Workspaces","templately")},{value:"shared_workspaces",label:(0,At.__)("Shared Workspaces","templately")}]},[]),S=(0,pe.useCallback)(function(){var t,n;return"workspaces"===E.value&&(null===(t=e.workspaces)||void 0===t?void 0:t.length)>0?Ua(e.workspaces,!1,"slug",[],[e.slug]):"shared_workspaces"===E.value&&(null===(n=e.sharedWorkspaces)||void 0===n?void 0:n.length)>0?Ua(e.sharedWorkspaces,!0,"slug",[],[e.slug]):[]},[E,e.workspaces,e.sharedWorkspaces]);(0,pe.useEffect)(function(){u(null),f(null),l(!0)},[E]),(0,pe.useEffect)(function(){g([])},[c,E]),(0,pe.useEffect)(function(){(null==p?void 0:p.length)>0?l(!1):l(!0)},[p]),(0,pe.useEffect)(function(){if((null==y?void 0:y.length)>=3){var t={search:y};"clouds"!==E.value&&(t.source=E.value,t.slug=c.slug),e.searchFiles(t)}},[y]);var x=(0,pe.useCallback)(function(){var t={};"clouds"!==E.value&&(t.source=E.value,t.slug=c.slug),e.searchFiles(t)},[E,c]);return(0,pe.useEffect)(function(){var t;null!==(t=e.templates[E.value])&&void 0!==t&&t.isLoading?g([]):g(Ua(e.templates[E.value].data,"shared_workspaces"===E.value,"clouds"===E.value?"id":"my_cloud_id",["slug","owner","last_modified"]))},[e.templates]),(0,pe.useEffect)(function(){r&&(e.addFiles({files:p.map(function(e){return e.value}),workspace_id:null==e?void 0:e.id,slug:null==e?void 0:e.slug}),Sl.showLoading(),o(!1))},[r]),he().createElement(ol,{className:"add-file-to-workspace",headerClass:"text-center",header:(0,At.__)("Add Template to WorkSpace","templately")},he().createElement(il,{className:"align-center"},he().createElement(al,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Source","templately"),":")),he().createElement(al,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(Dg,{isSearchable:!1,placeholder:(0,At.__)("Select a source","templately"),noOptionsMessage:function(){return(0,At.__)("No Sources Found","templately")},value:E,options:O,onChange:function(e){return k(e)}}))),"clouds"!==(null==E?void 0:E.value)&&he().createElement(il,{className:"align-center"},he().createElement(al,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Workspace","templately"),":")),he().createElement(al,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(Dg,{isSearchable:!1,placeholder:(0,At.__)("Select a workspace","templately"),noOptionsMessage:function(){return(0,At.sprintf)((0,At.__)("No %s Found","templately"),"workspaces"==E.value?(0,At.__)("Workspace","templately"):(0,At.__)("Shared Workspace","templately"))},value:c,options:S(),onChange:function(e){return u(e)}}))),(void 0!==(null==c?void 0:c.slug)&&"clouds"!==E.value||"clouds"===E.value)&&he().createElement(il,{className:"align-center"},he().createElement(al,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Templates","templately"),":")),he().createElement(al,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(Dg,{isMulti:!0,isClearable:!0,isLoading:null===(t=e.templates[E.value])||void 0===t?void 0:t.isLoading,placeholder:(0,At.__)("Search by typing...","templately"),noOptionsMessage:function(){return(0,At.__)("No Templates Found","templately")},loadingMessage:function(){return(0,At.__)("Loading templates...","templately")},onFocus:x,options:m,onChange:function(e){return f(e)},onInputChange:function(e){return b(e)}}),he().createElement("p",null,he().createElement("small",null,he().createElement("strong",null,(0,At.__)("Note","templately"),": "),(0,At.__)("You are seeing fewer items after initial load. You can search more to find your desire templates from the selected source.","templately"))))),he().createElement(il,{className:"flex-end"},he().createElement(al,null,he().createElement(pl,{className:"templately-add-templates",disabled:a,onClick:function(){return o(!0)},label:(0,At.__)("Add to WorkSpace","templately")}))))});function jg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jg(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Rg=gn(function(e,t){var n,r,o=null!==(n=null===(r=e.workspaceDetails)||void 0===r?void 0:r[null==t?void 0:t.slug])&&void 0!==n?n:{};return Lg(Lg({},t),o)})(function(e){var t=e.sharedWith,n=e.pending_invitations,r=e.dispatch,o=ce((0,pe.useState)(e.name),2),i=o[0],a=o[1],l=ce((0,pe.useState)(!0),2),s=l[0],c=l[1],u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1],f=ce((0,pe.useState)([]),2),h=f[0],m=f[1],g=ce((0,pe.useState)([]),2),v=g[0],y=g[1],b=ce((0,pe.useState)(!1),2),w=b[0],E=b[1],k=ce((0,pe.useState)(!1),2),O=k[0],S=k[1],x=ce((0,pe.useState)(!1),2),_=x[0],C=x[1],D=ce((0,pe.useState)(""),2),P=D[0],A=D[1],T=ce((0,pe.useState)(!1),2),F=T[0],M=T[1],I=ce((0,pe.useState)([]),2),N=I[0],j=I[1],L=ce((0,pe.useState)([]),2),R=L[0],B=L[1],z=ce((0,pe.useState)([]),2),W=(z[0],z[1]),U=ce((0,pe.useState)([]),2),V=U[0],H=U[1];return(0,pe.useEffect)(function(){var e=[],r=[];if(t&&t.length>0&&(t.map(function(t,n){r.push(t.email),e.push(he().createElement("li",{key:n},t.profile_photo&&he().createElement("img",{src:t.profile_photo}),he().createElement("span",{className:"tae-name "},t.name),he().createElement("span",{className:"tae-remove",onClick:function(e){S({email:t.email,currentTarget:e.currentTarget.parentElement})}}),he().createElement("span",{className:"tae-undo",onClick:function(e){C({email:t.email,currentTarget:e.currentTarget.parentElement})}})))}),j(r),m(e)),n&&n.length>0){var o=JSON.parse(n),i=[],a=[];o.map(function(e){Ba(e)&&(a.push(e),i.push(he().createElement("li",{key:e},he().createElement("span",{className:"tae-name "},e,he().createElement("em",null,(0,At.__)("invited","templately"))),he().createElement("span",{className:"tae-remove",onClick:function(t){S({email:e,currentTarget:t.currentTarget.parentElement})}}),he().createElement("span",{className:"tae-undo",onClick:function(t){C({email:e,currentTarget:t.currentTarget.parentElement})}}))))}),W(a),j([].concat(r,a)),m([].concat(e,i))}},[]),(0,pe.useEffect)(function(){if(w){var e=Nl(R),t=P.toLowerCase();Ba(t)&&(e.includes(t)||(e.push(t),B(e)),A("")),E(!1)}},[w]),(0,pe.useEffect)(function(){if(!1!==F){var e=Nl(R).filter(function(e){return F!=e});B(e),M(!1)}},[F]),(0,pe.useEffect)(function(){if(!1!==O||!1!==_){var e=Nl(N),t=Nl(V);if(0!=O&&(O.currentTarget.classList.add("removed"),t.push(O.email),e=e.filter(function(e){return O.email!=e}),j(e),H(t),S(!1)),0!=_){_.currentTarget.classList.remove("removed"),e.push(_.email);var n=t.filter(function(e){return _.email!=e});j(e),H(n),C(!1)}}},[O,_]),(0,pe.useEffect)(function(){var e=[];R.length>0&&R.map(function(t,n){return e.push(he().createElement("li",{key:n},t,he().createElement("span",{onClick:function(){return M(t)}})))}),y(e)},[R]),(0,pe.useEffect)(function(){R.length>0||V.length>0?c(!1):c(!0)},[N,R,V]),(0,pe.useEffect)(function(){if(d){var t=R,n=Nl(V);Sl.showLoading();var o=e.slug,a=e.id;r(sy({slug:o,id:a,title:i,share_with:t,remove:n})),p(!1)}},[d]),he().createElement("div",{className:"templately-workspace-modal edit-workspace-modal"},he().createElement("div",{className:"tm-container"},he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column tm-title"},he().createElement("span",{className:"tm-title-icon"})),he().createElement("div",{className:"tm-column bg-light"},he().createElement("div",{className:"tmw-name"},he().createElement(hl,{value:i,onChange:function(e){c(0===e.target.value.trim().length),a(e.target.value)}})))),h.length>0&&he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column tm-title"},he().createElement("p",null,(0,At.__)("Shared with","templately"),": ")),he().createElement("div",{className:"tm-column templately-shared-with"},he().createElement("ul",{className:"templately-added-email-list"},h))),he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column tm-title"},he().createElement("p",null,(0,At.__)("Add People","templately"),": ")),he().createElement("div",{className:"tm-column bg-light templately-new-shared"},v.length>0&&he().createElement("ul",{className:"templately-wem-new-email-list"},v),he().createElement("div",null,he().createElement(hl,{onKeyUp:function(e){return E(13===e.keyCode)},onChange:function(e){return A(e.target.value)},value:P,placeholder:(0,At.__)("Type email to add","templately")}),he().createElement(pl,{disabled:0===P.length||!Ba(P),onClick:function(){return E(!0)},label:(0,At.__)("Add","templately")})))),he().createElement("div",{className:"tm-row"},he().createElement("div",{className:"tm-column flex-end"},he().createElement(pl,{disabled:s,onClick:function(){return p(!0)},label:(0,At.__)("Save Changes","templately")})))))});var Bg=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=t.general;o(Qv({id:r.my_cloud_id,platform:i.platform}));var a={key:"isDownloaded",error:{title:(0,At.__)("Download Failed!!!","templately"),content:""},success:{title:(0,At.__)("Successfully Downloaded!","templately"),content:""}};xl({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return _l(a,e)},html:React.createElement(n,null)},!0)},zg=function(e,t){var n=e.ModalComponent,r=e.content,o={key:"copy"===t?"isCopied":"isMoved",error:{title:(0,At.__)("Something went wrong.","templately"),content:function(e){var t=e.message;return React.createElement("p",{dangerouslySetInnerHTML:{__html:t}})},args:{showCloseButton:!0,timer:null}},success:{title:(0,At.__)("Successfully Copied","templately"),content:function(e){var n=e.title;return React.createElement(React.Fragment,null,"copy"==t?(0,At.__)("Your file has been copied to a WorkSpace called: ","templately"):(0,At.__)("Your file has been moved to a WorkSpace called: ","templately"),React.createElement("strong",null,n))}}};xl({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return _l(o,e)},html:React.createElement(n,re({},r,{action:t}))},!0)},Wg=function(e,t){var n=e.ModalComponent,r=e.content,o=e.source,i=t.dispatch,a={key:"isDeleted",error:{title:(0,At.__)("Something went wrong!","templately"),content:"Something went wrong regarding deleting your file. Try Later or Contact for Support."},success:{title:(0,At.__)("Successfully Deleted!","templately"),content:"You have deleted a file from your cloud."}};xl({showCloseButton:!0,onConfirm:function(e){return _l(a,e)},html:React.createElement(n,re({},r,{source:o,dispatch:i}))},!0)},Ug=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"templately",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"list";return[{include:("templately"===t||"list"!==n)&&void 0,hidden:"templately"===t||"grid"===n,className:"tb-import templately-button",name:(0,At.__)("Insert","templately"),icon:"",action:fd,ModalComponent:rd},{className:"tw-download",name:(0,At.__)("Download","templately"),icon:"",action:Bg,ModalComponent:El},{name:(0,At.__)("Copy to WorkSpace","templately"),icon:React.createElement(Pn,null),action:function(e,t){return zg(e,"copy")},ModalComponent:Tg},{name:(0,At.__)("Move to WorkSpace","templately"),icon:React.createElement(In,null),disabled:e,action:function(e,t){return zg(e,"move")},ModalComponent:Tg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:Wg,ModalComponent:Fg}]},Vg=function(e,t){var n;(0,t.dispatch)(Sy({id:null==e||null===(n=e.content)||void 0===n?void 0:n.id}))},Hg=function(e,t){var n,r,o=e.ModalComponent,i=e.content;(0,t.dispatch)(Vv({id:null==e||null===(n=e.content)||void 0===n?void 0:n.id,page:null==e||null===(r=e.content)||void 0===r?void 0:r.currentPage}));var a={key:"isPushed",error:{args:{timer:null,showCloseButton:!0},title:(0,At.__)("Something went wrong.","templately"),content:function(e){var t=e.message;return React.createElement(React.Fragment,null,React.createElement("p",{dangerouslySetInnerHTML:{__html:t}}))}},success:{title:(0,At.__)("Successfully Pushed","templately"),content:function(){return React.createElement(React.Fragment,null,(0,At.__)("Your file has been pushed successfully to your cloud store.","templately"))}}};xl({showCloseButton:!1,allowOutsideClick:!1,onConfirm:function(e){return _l(a,e)},html:React.createElement(o,i)},!0)},Gg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"templately",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r={condition:!1===(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]),modalArgs:{title:"",message:React.createElement(React.Fragment,null,React.createElement("p",null,(0,At.__)("The required dependency ‘Elementor’ is missing. Please install it before proceeding.","templately")))},sweetArgs:{icon:"error",title:(0,At.__)("Elementor not installed.","templately")}};return[{include:"templately"===t&&void 0,hidden:"templately"===t,className:"tb-import templately-button",name:(0,At.__)("Insert","templately"),icon:"",action:fd,ModalComponent:rd,disabled:"Kit"===n},{include:"templately"!==t,className:"tw-preview templately-button",name:(0,At.__)("Preview","templately"),icon:"",href:"Kit"!==n,hrefKey:"preview_url",error:r,disabled:"Kit"===n},{include:"templately"!==t,className:"tw-push2cloud templately-button",name:(0,At.__)("Push To Cloud","templately"),icon:"",redirect:{state:["profile","data"],if:null,then:"sign-in"},disabled:e||"Kit"===n,action:Hg,ModalComponent:El,error:r},{className:"tw-download",name:(0,At.__)("Export","templately"),icon:"",href:"Kit"!==n,hrefKey:"export_url",error:r,disabled:"Kit"===n},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e||"Kit"===n,action:Vg,error:r}]},qg=function(e){var t={requirement:e},n=(0,vi.addQueryArgs)("/templately/v1/dependencies/install",{disable_redirect:!0});return ha(n,t,{},!0)},Qg=function(e){return ha("/templately/v1/dependencies/check",e,{},!0)},$g=function(e){return!e||!!e.startsWith("clouds/")||["favourites","downloads","clouds","clouds/shared-workspace","clouds/workspace","clouds/save-template","purchased-items"].includes(e)},Yg=function(e,t){var n,r,o=null!==(n=null==t||null===(r=t.data)||void 0===r?void 0:r.is_verified)&&void 0!==n?n:t;return!(!e||o||(xl({icon:!1,showCloseButton:!0,allowOutsideClick:!0,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(Yu,{code:"invalid_data",title:(0,At.__)("Template Import Failed!","templately"),message:(0,At.sprintf)((0,At.__)('Looks like your account is not verified. Verify your account to start creating your website. Need help? Reach out to our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a> anytime.',"templately"),"https://wpdeveloper.com/support/")}))},!0),0))};function Xg(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Kg(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Kg(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Kg(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Kg(d,"constructor",c),Kg(c,"constructor",s),s.displayName="GeneratorFunction",Kg(c,o,"GeneratorFunction"),Kg(d),Kg(d,o,"Generator"),Kg(d,r,function(){return this}),Kg(d,"toString",function(){return"[object Generator]"}),(Xg=function(){return{w:i,m:p}})()}function Kg(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Kg=function(e,t,n,r){function i(t,n){Kg(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Kg(e,t,n,r)}function Zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Jg=function(e,t){var n="elementor"===t,r=e[n?"system_colors":"global_colors"]||[],o=e.custom_colors||[],i={},a=[];return[].concat(Nl(r),Nl(o)).forEach(function(e){var t=n?"_id":"var",r=n?"title":"name";i[e[t]]=e.color,a.push({_id:e[t],title:e[r],color:e.color})}),{colors:i,_systemColors:a}},ev=function(e,t){return(0,pe.useMemo)(function(){return Jg(e,t)},[e,t])},tv=function(e,t){var n="elementor"===t,r="gutenberg"===t,o=(0,Ea.cloneDeep)(e),i=n?"custom_typography":"global_typography.custom",a=La(o,n?"system_typography":"global_typography",[]),l=La(o,i,[]);return r&&delete a.custom,{systemTypography:a,customTypography:l}},nv=function(e,t){var n="elementor"===t,r="gutenberg"===t,o=e||{},i=o.systemTypography,a=o.customTypography,l=i,s=a;if(r){var c={body:"Text",link:"Link",button:"Button",heading:"Headings",allHeadings:"All"},u=function(e){return e&&"object"===ne(e)?Object.entries(e).map(function(e){var t=ce(e,2),n=t[0],r=t[1];return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zg(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({_id:n,name:c[n]||r.name||n},r)}):[]};l=u(l),s=u(s)}var d=["all","h1","h2","h3","h4","h5","h6"],p={_id:"_id",_index:"_index",title:"title",selectedFont:"typography_font_family",selectedFontWeight:"typography_font_weight",transform:"typography_text_transform",decoration:"typography_text_decoration","selectedSize.desktop.value":"typography_font_size.size","selectedSize.desktop.unit":"typography_font_size.unit","selectedLineHeight.desktop.value":"typography_line_height.size","selectedLineHeight.desktop.unit":"typography_line_height.unit","selectedLetterSpacing.desktop.value":"typography_letter_spacing.size","selectedLetterSpacing.desktop.unit":"typography_letter_spacing.unit","selectedSize.tablet.value":"typography_font_size_tablet.size","selectedSize.tablet.unit":"typography_font_size_tablet.unit","selectedLineHeight.tablet.value":"typography_line_height_tablet.size","selectedLineHeight.tablet.unit":"typography_line_height_tablet.unit","selectedLetterSpacing.tablet.value":"typography_letter_spacing_tablet.size","selectedLetterSpacing.tablet.unit":"typography_letter_spacing_tablet.unit","selectedSize.mobile.value":"typography_font_size_mobile.size","selectedSize.mobile.unit":"typography_font_size_mobile.unit","selectedLineHeight.mobile.value":"typography_line_height_mobile.size","selectedLineHeight.mobile.unit":"typography_line_height_mobile.unit","selectedLetterSpacing.mobile.value":"typography_letter_spacing_mobile.size","selectedLetterSpacing.mobile.unit":"typography_letter_spacing_mobile.unit"},f={_id:"_id",_index:"_index",title:"name",selectedFont:"fontFamily",selectedFontWeight:"fontWeight",transform:"textTransform",decoration:"textDecoration","selectedSize.desktop.value":"fontSize","selectedSize.desktop.unit":"fontSizeUnit","selectedLineHeight.desktop.value":"lineHeight","selectedLineHeight.desktop.unit":"lineHeightUnit","selectedLetterSpacing.desktop.value":"letterSpacing","selectedLetterSpacing.desktop.unit":"letterSpacingUnit","selectedSize.tablet.value":"TABfontSize","selectedSize.tablet.unit":"TABfontSizeUnit","selectedLineHeight.tablet.value":"TABlineHeight","selectedLineHeight.tablet.unit":"TABlineHeightUnit","selectedLetterSpacing.tablet.value":"TABletterSpacing","selectedLetterSpacing.tablet.unit":"TABletterSpacingUnit","selectedSize.mobile.value":"MOBfontSize","selectedSize.mobile.unit":"MOBfontSizeUnit","selectedLineHeight.mobile.value":"MOBlineHeight","selectedLineHeight.mobile.unit":"MOBlineHeightUnit","selectedLetterSpacing.mobile.value":"MOBletterSpacing","selectedLetterSpacing.mobile.unit":"MOBletterSpacingUnit"},h=(0,pe.useMemo)(function(){if(!l&&!s)return{normalizedTypography:{},groupedData:[]};for(var e=Array.isArray(l)?l:Object.values(l||{}),t=Array.isArray(s)?s:Object.values(s||{}),r=function(e){var t={};return Object.entries(e).forEach(function(e,r){var o=ce(e,2),i=(o[0],o[1]),a={},s=(0,Ea.cloneDeep)(i);s._index=r;for(var c=0,u=Object.entries(n?p:f);c<u.length;c++){var d=ce(u[c],2),h=d[0],m=d[1],g=La(s,m,null);a=Ra(a,h,g)}a._isSystem=l.some(function(e){return e._id===s._id}),t[a._id]=a}),t}([].concat(Nl(e),Nl(t))),o=[{key:"System Font",items:[]},{key:"Headings",items:[]},{key:"Custom",items:[]}],i=function(){var e=ce(c[a],2),t=(e[0],e[1]),n=d.includes(t.title.trim().toLowerCase())?1:l.some(function(e){return e._id===t._id})?0:2;o[n].items.push({_id:La(t,"_id",null),_index:La(t,"_index",null),title:La(t,"title",null)})},a=0,c=Object.entries(r);a<c.length;a++)i();return o[1].items.sort(function(e,t){return e.title.localeCompare(t.title,"en",{sensitivity:"base"})}),o[1].items.forEach(function(e){r[e._id].title=e.title.toUpperCase()}),o[0].items.sort(function(e,t){return e._index-t._index}),o[2].items.sort(function(e,t){return e._index-t._index}),o=o.filter(function(e){return e.items.length}),{normalizedTypography:r,groupedData:o}},[l,s]);return{normalizedTypography:h.normalizedTypography,groupedData:h.groupedData,getDeNormalizedTypography:function(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){for(var i=ce(o[r],2),a=i[0],l=i[1],s={},c=(0,Ea.cloneDeep)(l),u=0,d=Object.entries(n?p:f);u<d.length;u++){var h=ce(d[u],2),m=h[0],g=h[1],v=La(c,m,null);s=Ra(s,g,v)}t[a]=s}return t}}},rv=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=null!==(n=null==t||null===(r=t.data)||void 0===r?void 0:r.is_verified)&&void 0!==n?n:t;if(e&&!i){var a=o||(0,At.sprintf)((0,At.__)('Something went wrong. Need help? Reach out to our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a> anytime.',"templately"),"https://wpdeveloper.com/support/");return xl({showCloseButton:!0,allowOutsideClick:!1,icon:"error",title:"Oops...",html:React.createElement("p",{className:"text-danger text-center",dangerouslySetInnerHTML:{__html:a}})},!1),!0}return!1};function ov(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function iv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ov(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ov(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var av=function(e){return{type:ur,platform:e}},lv=function(e){return iv({type:xr},e)},sv=function(e){return iv({type:_r},e)},cv=function(){return lv({key:"doQuery",data:Date.now()})},uv=function(e){return iv({type:Dr},e)},dv=function(e){return iv({type:Ar},e)},pv=function(e){return iv({type:Fr},e)},fv=function(e){return{type:Mr,data:e}},hv=function(e){return{type:Ir,error:e}},mv=function(e){return iv({type:jr},e)},gv=function(e){return iv({type:Lr},e)},vv=function(e){return iv({type:Sr},e)},yv=function(e){return iv({type:Rr},e)},bv=function(e){return iv({type:zr},e)},wv=function(e,t){return{type:Wr,id:e,data:t}};function Ev(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ev(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ev(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ov=function(e){return kv({type:ja(Oo,e.key)},e)},Sv=function(e){return kv({type:ja(So,e.key)},e)},xv=function(e){return kv({type:_o},e)},_v=function(e){return kv({type:Co},e)},Cv=function(e){return kv({type:Po},e)},Dv=function(e){return kv({type:Ao},e)},Pv=function(e){return kv({type:Fo},e)},Av=function(e){return kv({type:Mo},e)};function Tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tv(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mv=function(e){return Fv({type:Bo.LOAD},e)},Iv=function(e){return Fv({type:Bo.LOAD_SUCCESS},e)},Nv=function(e){return Fv({type:Bo.LOAD_FAILED},e)},jv=function(e){return Fv({type:Bo.STATUS_SUCCESS},e)},Lv=function(e){return Fv({type:Bo.STATUS_FAILED},e)},Rv=function(e){return Fv({type:Bo.COPY},e)},Bv=function(e){return Fv({type:Bo.COPY_SUCCESS},e)},zv=function(e){return Fv({type:Bo.MOVE},e)},Wv=function(e){return Fv({type:Bo.MOVE_SUCCESS},e)},Uv=function(e){return Fv({type:Bo.DELETE},e)},Vv=function(e){return Fv({type:Bo.PUSH},e)},Hv=function(e){return Fv({type:Bo.CLEAR_PUSH2CLOUD},e)},Gv=function(e){return Fv({type:Bo.PUSH_SUCCESS},e)},qv=function(e){return Fv({type:Bo.PUSH_FAILED},e)},Qv=function(e){return Fv({type:Bo.DOWNLOAD},e)},$v=function(){switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"clouds"){case"clouds":return Bo;case"workspaces":return zo;case"shared_workspaces":return Wo;case"workspace_details":return Uo}},Yv=function(e){return Fv({type:$v(null==e?void 0:e.source).SEARCH},e)},Xv=function(e){return Fv({type:$v(null==e?void 0:e.source).SEARCH_SUCCESS},e)};function Kv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kv(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Jv=function(e){var t;return Zv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD:zo.LOAD},e)},ey=function(e){var t;return Zv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_LISTS:zo.LOAD_LISTS},e)},ty=function(e){var t;return Zv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.SET_LISTS:zo.SET_LISTS},e)},ny=function(e){var t;return Zv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_SUCCESS:zo.LOAD_SUCCESS},e)},ry=function(e){var t;return Zv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_FAILED:zo.LOAD_FAILED},e)},oy=function(e){return Zv({type:zo.CREATE},e)},iy=function(e){return Zv({type:zo.CREATE_SUCCESS},e)},ay=function(e){return Zv({type:zo.DELETE},e)},ly=function(e){return Zv({type:zo.DELETE_SUCCESS},e)},sy=function(e){return Zv({type:zo.SAVE},e)},cy=function(e){return Zv({type:Uo.SET},e)},uy=function(e){return Zv({type:Uo.LOAD},e)},dy=function(e){return Zv({type:Uo.LOAD_SUCCESS},e)},py=function(e){return Zv({type:Uo.DELETE},e)},fy=function(e){return Zv({type:Uo.GET_FILES},e)},hy=function(e){return Zv({type:Uo.SET_FILES},e)},my=function(e){return Zv({type:Uo.LOAD_FAILED},e)},gy=function(e){return Zv({type:Uo.ADD_FILE},e)},vy=a(4765);function yy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function by(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yy(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var wy=function(e){return by({type:Io},e)},Ey=function(e){return by({type:No},e)},ky=function(e){return by({type:jo},e)},Oy=function(e){return by({type:"SAVED_TEMPLATES_LOAD_FAILED"},e)},Sy=function(e){return by({type:Ro},e)};function xy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xy(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Cy=function(e){return _y({type:Xo},e)},Dy=function(e){return{type:Vo,step:e}},Py=function(e){return{type:Ho,step:e}},Ay=function(e){return{type:Go,payload:e}},Ty=function(e){return{type:Yo,payload:e}},Fy=function(e){return{type:Ko,payload:e}},My=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:Zo,payload:_y({id:null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,show:!0},t)}},Iy=function(){return{type:ni,payload:_y({show:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},Ny=function(){return{type:ri,payload:{show:!1,aiTemplates:null}}},jy=function(e){return{type:oi,payload:{packId:e,isAi:arguments.length>1&&void 0!==arguments[1]&&arguments[1]}}},Ly=function(e){return{type:ii,payload:e}},Ry=function(e){return{type:ai,payload:e}},By=function(e){return{type:si,payload:e}},zy=function(e){return{type:ci,payload:e}},Wy=function(){return{type:ui}},Uy=function(e){return{type:pi.SET_PLATFORM,platform:e}},Vy=(0,pe.createContext)();Vy.displayName="Anonymous";var Hy,Gy=Vy.Provider;Vy.Consumer,function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(Hy||(Hy={}));var qy="beforeunload";function Qy(e){e.preventDefault(),e.returnValue=""}function $y(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter(function(e){return e!==t})}},call:function(t){e.forEach(function(e){return e&&e(t)})}}}var Yy,Xy=a(5373);function Ky(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ky(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ky(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jy(){if(!Yy){var e=document.location.pathname,t=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,r=n.history;function o(){var e=n.location,t=e.pathname,o=e.search,i=e.hash,a=r.state||{};return[a.idx,{pathname:t,search:o,hash:i,state:a.usr||null,key:a.key||"default"}]}var i=null;n.addEventListener("popstate",function(){if(i)d.call(i),i=null;else{var e=Hy.Pop,t=o(),n=t[0],r=t[1];if(d.length){if(null!=n){var a=s-n;a&&(i={action:e,location:r,retry:function(){v(-1*a)}},v(a))}}else g(e)}});var a=Hy.Pop,l=o(),s=l[0],c=l[1],u=$y(),d=$y();function p(e){return"string"==typeof e?e:(n=(t=e).pathname,r=void 0===n?"/":n,o=t.search,i=void 0===o?"":o,a=t.hash,l=void 0===a?"":a,i&&"?"!==i&&(r+="?"===i.charAt(0)?i:"?"+i),l&&"#"!==l&&(r+="#"===l.charAt(0)?l:"#"+l),r);var t,n,r,o,i,a,l}function f(e,t){return void 0===t&&(t=null),re({pathname:c.pathname,hash:"",search:""},"string"==typeof e?function(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}(e):e,{state:t,key:Math.random().toString(36).substr(2,8)})}function h(e,t){return[{usr:e.state,key:e.key,idx:t},p(e)]}function m(e,t,n){return!d.length||(d.call({action:e,location:t,retry:n}),!1)}function g(e){a=e;var t=o();s=t[0],c=t[1],u.call({action:a,location:c})}function v(e){r.go(e)}return null==s&&(s=0,r.replaceState(re({},r.state,{idx:s}),"")),{get action(){return a},get location(){return c},createHref:p,push:function e(t,o){var i=Hy.Push,a=f(t,o);if(m(i,a,function(){e(t,o)})){var l=h(a,s+1),c=l[0],u=l[1];try{r.pushState(c,"",u)}catch(e){n.location.assign(u)}g(i)}},replace:function e(t,n){var o=Hy.Replace,i=f(t,n);if(m(o,i,function(){e(t,n)})){var a=h(i,s),l=a[0],c=a[1];r.replaceState(l,"",c),g(o)}},go:v,back:function(){v(-1)},forward:function(){v(1)},listen:function(e){return u.push(e)},block:function(e){var t=d.push(e);return 1===d.length&&n.addEventListener(qy,Qy),function(){t(),d.length||n.removeEventListener(qy,Qy)}}}}({basename:e.substring(0,e.lastIndexOf("/"))});Yy={get length(){return t.length},get action(){return t.action},get location(){var n=t.location,r=(0,Xy.parse)(n.search.substring(1)).path||"/";return r.startsWith("/")||(r="/"+r),Zy(Zy({},n),{},{actualPathname:e,pathname:r})},get pathname(){return this.location.pathname.substring(1)},createHref:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.createHref.apply(t,n)},push:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.push.apply(t,n)},replace:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.replace.apply(t,n)},go:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.go.apply(t,n)},goBack:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goBack.apply(t,n)},goForward:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.goForward.apply(t,n)},block:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.block.apply(t,n)},listen:function(e){var n=this;return t.listen(function(){e(n.location,n.action)})}}}return Yy}var eb=Jy();function tb(){var e=Jy().location.search;return e.length&&(0,Xy.parse)(e.substring(1))||{}}var nb=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=(0,vi.getQueryArgs)(e),a=tb(),l=Zy(Zy({},a),i);return null!=r&&(l=Zy(Zy({},l),r)),"/"===e||Array.isArray(e)?Array.isArray(e)&&(l.path=e.join("/")):l.path=e,l.path.startsWith("../")&&(l.path=l.path.substring("3")),"elementor"!==(null==a?void 0:a.action)&&"edit"!==(null==a?void 0:a.action)||null==o||o.push("page"),!0===Boolean(null==r?void 0:r.isGutenbergEditor)&&(null==o||o.push("page"),null==o||o.push("isGutenbergEditor")),null!==(t=l)&&void 0!==t&&t.platform&&null!==(n=l.path)&&void 0!==n&&n.startsWith(l.platform)&&(null==o||o.push("platform")),!0===Boolean(null==r?void 0:r.closing)&&(null==o||o.push("closing")),""===e&&(null==o||o.push("path")),(null==o?void 0:o.length)>0&&(l=Wa(l,o)),(0,vi.addQueryArgs)(Jy().location.actualPathname,l)},rb=function(e){return"@@redux-saga/"+e},ob=rb("CANCEL_PROMISE"),ib=rb("CHANNEL_END"),ab=rb("IO"),lb=rb("MATCH"),sb=rb("MULTICAST"),cb=rb("SAGA_ACTION"),ub=rb("SELF_CANCELLATION"),db=rb("TASK"),pb=rb("TASK_CANCEL"),fb=rb("TERMINATE"),hb=rb("LOCATION"),mb=function(e){return null==e},gb=function(e){return null!=e},vb=function(e){return"function"==typeof e},yb=function(e){return"string"==typeof e},bb=Array.isArray,wb=function(e){return e&&vb(e.then)},Eb=function(e){return e&&vb(e.next)&&vb(e.throw)},kb=function(e){return e&&(yb(e)||xb(e)||vb(e)||bb(e)&&e.every(kb))},Ob=function(e){return e&&vb(e.take)&&vb(e.close)},Sb=function(e){return vb(e)&&e.hasOwnProperty("toString")},xb=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype},_b=function(){return function(){return true}}(),Cb=function(){},Db=function(e){return e},Pb=function(e,t){re(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(function(n){e[n]=t[n]})};function Ab(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Tb=function(e){throw e},Fb=function(e){return{value:e,done:!0}};function Mb(e,t,n){void 0===t&&(t=Tb),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:Fb,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Ib(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var Nb=function(e){return Array.apply(null,new Array(e))},jb=function(e){return function(t){return e(Object.defineProperty(t,cb,{value:!0}))}},Lb=function(e){return e===fb},Rb=function(e){return e===pb},Bb=function(e){return Lb(e)||Rb(e)};function zb(e,t){var n,r=Object.keys(e),o=r.length,i=0,a=bb(e)?Nb(o):{},l={};return r.forEach(function(e){var r=function(r,l){n||(l||Bb(r)?(t.cancel(),t(r,l)):(a[e]=r,++i===o&&(n=!0,t(a))))};r.cancel=Cb,l[e]=r}),t.cancel=function(){n||(n=!0,r.forEach(function(e){return l[e].cancel()}))},l}function Wb(e){return{name:e.name||"anonymous",location:Ub(e)}}function Ub(e){return e[hb]}function Vb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var Hb=function(e){return function(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},l=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},s=function(){for(var e=[];r;)e.push(l());return e};return{isEmpty:function(){return 0==r},put:function(l){var c;if(r<e)a(l);else switch(t){case 1:throw new Error("Channel's Buffer overflow!");case 3:n[o]=l,i=o=(o+1)%e;break;case 4:c=2*e,n=s(),r=n.length,o=n.length,i=0,n.length=c,e=c,a(l)}},take:l,flush:s}}(e,4)},Gb="TAKE",qb="CALL",Qb="FORK",$b="CANCEL",Yb="SELECT",Xb=function(e,t){var n;return(n={})[ab]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function Kb(e,t){return void 0===e&&(e="*"),kb(e)?(gb(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),Xb(Gb,{pattern:e})):Ob(n=e)&&n[sb]&&gb(t)&&kb(t)?Xb(Gb,{channel:e,pattern:t}):Ob(e)?(gb(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),Xb(Gb,{channel:e})):void 0;var n}function Zb(e,t){return mb(t)&&(t=e,e=void 0),Xb("PUT",{channel:e,action:t})}function Jb(e){var t=Xb("ALL",e);return t.combinator=!0,t}function ew(e,t){var n,r=null;return vb(e)?n=e:(bb(e)?(r=e[0],n=e[1]):(r=e.context,n=e.fn),r&&yb(n)&&vb(r[n])&&(n=r[n])),{context:r,fn:n,args:t}}function tw(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Xb(qb,ew(e,n))}function nw(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Xb(Qb,ew(e,n))}function rw(e){void 0===e&&(e=Db);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Xb(Yb,{selector:e,args:n})}var ow=[],iw=0;function aw(e){try{cw(),e()}finally{uw()}}function lw(e){ow.push(e),iw||(cw(),dw())}function sw(e){try{return cw(),e()}finally{dw()}}function cw(){iw++}function uw(){iw--}function dw(){var e;for(uw();!iw&&void 0!==(e=ow.shift());)aw(e)}var pw=function(e){return function(t){return e.some(function(e){return vw(e)(t)})}},fw=function(e){return function(t){return e(t)}},hw=function(e){return function(t){return t.type===String(e)}},mw=function(e){return function(t){return t.type===e}},gw=function(){return _b};function vw(e){var t="*"===e?gw:yb(e)?hw:bb(e)?pw:Sb(e)?hw:vb(e)?fw:xb(e)?mw:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var yw={type:ib},bw=function(e){return e&&e.type===ib};function ww(){var e,t,n,r,o,i,a=(t=!1,r=n=[],o=function(){r===n&&(r=n.slice())},i=function(){t=!0;var e=n=r;r=[],e.forEach(function(e){e(yw)})},(e={})[sb]=!0,e.put=function(e){if(!t)if(bw(e))i();else for(var o=n=r,a=0,l=o.length;a<l;a++){var s=o[a];s[lb](e)&&(s.cancel(),s(e))}},e.take=function(e,n){var i,a;void 0===n&&(n=gw),t?e(yw):(e[lb]=n,o(),r.push(e),e.cancel=(i=function(){o(),Ab(r,e)},a=!1,function(){a||(a=!0,i())}))},e.close=i,e),l=a.put;return a.put=function(e){e[cb]?l(e):lw(function(){l(e)})},a}function Ew(e,t){var n=e[ob];vb(n)&&(t.cancel=n),e.then(t,function(e){t(e,!0)})}var kw,Ow=0,Sw=function(){return++Ow};function xw(e){e.isRunning()&&e.cancel()}var _w=((kw={})[Gb]=function(e,t,n){var r=t.channel,o=void 0===r?e.channel:r,i=t.pattern,a=t.maybe,l=function(e){e instanceof Error?n(e,!0):!bw(e)||a?n(e):n(fb)};try{o.take(l,gb(i)?vw(i):null)}catch(e){return void n(e,!0)}n.cancel=l.cancel},kw.PUT=function(e,t,n){var r=t.channel,o=t.action,i=t.resolve;lw(function(){var t;try{t=(r?r.put:e.dispatch)(o)}catch(e){return void n(e,!0)}i&&wb(t)?Ew(t,n):n(t)})},kw.ALL=function(e,t,n,r){var o=r.digestEffect,i=Ow,a=Object.keys(t);if(0!==a.length){var l=zb(t,n);a.forEach(function(e){o(t[e],i,l[e],e)})}else n(bb(t)?[]:{})},kw.RACE=function(e,t,n,r){var o=r.digestEffect,i=Ow,a=Object.keys(t),l=bb(t)?Nb(a.length):{},s={},c=!1;a.forEach(function(e){var t=function(t,r){c||(r||Bb(t)?(n.cancel(),n(t,r)):(n.cancel(),c=!0,l[e]=t,n(l)))};t.cancel=Cb,s[e]=t}),n.cancel=function(){c||(c=!0,a.forEach(function(e){return s[e].cancel()}))},a.forEach(function(e){c||o(t[e],i,s[e],e)})},kw[qb]=function(e,t,n,r){var o=t.context,i=t.fn,a=t.args,l=r.task;try{var s=i.apply(o,a);if(wb(s))return void Ew(s,n);if(Eb(s))return void Lw(e,s,l.context,Ow,Wb(i),!1,n);n(s)}catch(e){n(e,!0)}},kw.CPS=function(e,t,n){var r=t.context,o=t.fn,i=t.args;try{var a=function(e,t){mb(e)?n(t):n(e,!0)};o.apply(r,i.concat(a)),a.cancel&&(n.cancel=a.cancel)}catch(e){n(e,!0)}},kw[Qb]=function(e,t,n,r){var o=t.context,i=t.fn,a=t.args,l=t.detached,s=r.task,c=function(e){var t=e.context,n=e.fn,r=e.args;try{var o=n.apply(t,r);if(Eb(o))return o;var i=!1;return Mb(function(e){return i?{value:e,done:!0}:(i=!0,{value:o,done:!wb(o)})})}catch(e){return Mb(function(){throw e})}}({context:o,fn:i,args:a}),u=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Wb(t)}(c,i);sw(function(){var t=Lw(e,c,s.context,Ow,u,l,void 0);l?n(t):t.isRunning()?(s.queue.addTask(t),n(t)):t.isAborted()?s.queue.abort(t.error()):n(t)})},kw.JOIN=function(e,t,n,r){var o=r.task,i=function(e,t){if(e.isRunning()){var n={task:o,cb:t};t.cancel=function(){e.isRunning()&&Ab(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(bb(t)){if(0===t.length)return void n([]);var a=zb(t,n);t.forEach(function(e,t){i(e,a[t])})}else i(t,n)},kw[$b]=function(e,t,n,r){var o=r.task;t===ub?xw(o):bb(t)?t.forEach(xw):xw(t),n()},kw[Yb]=function(e,t,n){var r=t.selector,o=t.args;try{n(r.apply(void 0,[e.getState()].concat(o)))}catch(e){n(e,!0)}},kw.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,o=function(e){void 0===e&&(e=Hb());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(yw):e.isEmpty()?(n.push(r),r.cancel=function(){Ab(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(yw):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r<o;r++)(0,e[r])(yw)}}}}(t.buffer),i=vw(r),a=function(t){bw(t)||e.channel.take(a,i),o.put(t)},l=o.close;o.close=function(){a.cancel(),l()},e.channel.take(a,i),n(o)},kw.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},kw.FLUSH=function(e,t,n){t.flush(n)},kw.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},kw.SET_CONTEXT=function(e,t,n,r){var o=r.task;Pb(o.context,t),n()},kw);function Cw(e,t){return e+"?"+t}function Dw(e){var t=e.name,n=e.location;return n?t+" "+Cw(n.fileName,n.lineNumber):t}function Pw(e){var t,n,r=(t=e,(n=[]).concat.apply(n,t.map(function(e){return e.cancelledTasks})));return r.length?["Tasks cancelled due to error:"].concat(r).join("\n"):""}var Aw=null,Tw=[],Fw=function(e){e.crashedEffect=Aw,Tw.push(e)},Mw=function(){Aw=null,Tw.length=0},Iw=function(e){Aw=e},Nw=function(){var e=Tw[0],t=Tw.slice(1),n=e.crashedEffect?function(e){var t=Ub(e);return t?t.code+" "+Cw(t.fileName,t.lineNumber):""}(e.crashedEffect):null;return["The above error occurred in task "+Dw(e.meta)+(n?" \n when executing effect "+n:"")].concat(t.map(function(e){return" created by "+Dw(e.meta)}),[Pw(Tw)]).join("\n")};function jw(e,t,n,r,o,i,a){var l;void 0===a&&(a=Cb);var s,c,u=0,d=null,p=[],f=Object.create(n),h=function(e,t,n){var r,o=[],i=!1;function a(e){p.push.apply(p,h.getTasks().map(function(e){return e.meta.name})),s(),n(e,!0)}function l(t){o.push(t),t.cont=function(l,s){i||(Ab(o,t),t.cont=Cb,s?a(l):(t===e&&(r=l),o.length||(i=!0,n(r))))}}function s(){i||(i=!0,o.forEach(function(e){e.cont=Cb,e.cancel()}),o=[])}return l(e),{addTask:l,cancelAll:s,abort:a,getTasks:function(){return o}}}(t,0,m);function m(t,n){if(n){if(u=2,Fw({meta:o,cancelledTasks:p}),g.isRoot){var r=Nw();Mw(),e.onError(t,{sagaStack:r})}c=t,d&&d.reject(t)}else t===pb?u=1:1!==u&&(u=3),s=t,d&&d.resolve(t);g.cont(t,n),g.joiners.forEach(function(e){e.cb(t,n)}),g.joiners=null}var g=((l={})[db]=!0,l.id=r,l.meta=o,l.isRoot=i,l.context=f,l.joiners=[],l.queue=h,l.cancel=function(){0===u&&(u=1,h.cancelAll(),m(pb,!1))},l.cont=a,l.end=m,l.setContext=function(e){Pb(f,e)},l.toPromise=function(){return d||((e={}).promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),d=e,2===u?d.reject(c):0!==u&&d.resolve(s)),d.promise;var e},l.isRunning=function(){return 0===u},l.isCancelled=function(){return 1===u||0===u&&1===t.status},l.isAborted=function(){return 2===u},l.result=function(){return s},l.error=function(){return c},l);return g}function Lw(e,t,n,r,o,i,a){var l=e.finalizeRunEffect(function(t,n,r){wb(t)?Ew(t,r):Eb(t)?Lw(e,t,c.context,n,o,!1,r):t&&t[ab]?(0,_w[t.type])(e,t.payload,r,u):r(t)});d.cancel=Cb;var s={meta:o,cancel:function(){0===s.status&&(s.status=1,d(pb))},status:0},c=jw(e,s,n,r,o,i,a),u={task:c,digestEffect:p};return a&&(a.cancel=c.cancel),d(),c;function d(e,n){try{var o;n?(o=t.throw(e),Mw()):Rb(e)?(s.status=1,d.cancel(),o=vb(t.return)?t.return(pb):{done:!0,value:pb}):o=Lb(e)?vb(t.return)?t.return():{done:!0}:t.next(e),o.done?(1!==s.status&&(s.status=3),s.cont(o.value)):p(o.value,r,d)}catch(e){if(1===s.status)throw e;s.status=2,s.cont(e,!0)}}function p(t,n,r,o){void 0===o&&(o="");var i,a=Sw();function s(n,o){i||(i=!0,r.cancel=Cb,e.sagaMonitor&&(o?e.sagaMonitor.effectRejected(a,n):e.sagaMonitor.effectResolved(a,n)),o&&Iw(t),r(n,o))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:a,parentEffectId:n,label:o,effect:t}),s.cancel=Cb,r.cancel=function(){i||(i=!0,s.cancel(),s.cancel=Cb,e.sagaMonitor&&e.sagaMonitor.effectCancelled(a))},l(t,a,s)}}function Rw(e,t){for(var n=e.channel,r=void 0===n?ww():n,o=e.dispatch,i=e.getState,a=e.context,l=void 0===a?{}:a,s=e.sagaMonitor,c=e.effectMiddlewares,u=e.onError,d=void 0===u?Ib:u,p=arguments.length,f=new Array(p>2?p-2:0),h=2;h<p;h++)f[h-2]=arguments[h];var m,g=t.apply(void 0,f),v=Sw();if(s&&(s.rootSagaStarted=s.rootSagaStarted||Cb,s.effectTriggered=s.effectTriggered||Cb,s.effectResolved=s.effectResolved||Cb,s.effectRejected=s.effectRejected||Cb,s.effectCancelled=s.effectCancelled||Cb,s.actionDispatched=s.actionDispatched||Cb,s.rootSagaStarted({effectId:v,saga:t,args:f})),c){var y=Vb.apply(void 0,c);m=function(e){return function(t,n,r){return y(function(t){return e(t,n,r)})(t)}}}else m=Db;var b={channel:r,dispatch:jb(o),getState:i,sagaMonitor:s,onError:d,finalizeRunEffect:m};return sw(function(){var e=Lw(b,g,l,v,Wb(t),!0,void 0);return s&&s.effectResolved(v,e),e})}var Bw=["context","channel","sagaMonitor"];var zw,Ww=({dispatch:e,getState:t})=>n=>r=>"function"==typeof r?r(e,t,zw):n(r),Uw=function(e){return{done:!0,value:e}},Vw={};function Hw(e){return Ob(e)?"channel":Sb(e)?String(e):vb(e)?e.name:String(e)}function Gw(e,t,n){var r,o,i,a=t;function l(t,n){if(a===Vw)return Uw(t);if(n&&!o)throw a=Vw,n;r&&r(t);var l=n?e[o](n):e[a]();return a=l.nextState,i=l.effect,r=l.stateUpdater,o=l.errorState,a===Vw?Uw(t):i}return Mb(l,function(e){return l(null,e)},n)}function qw(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i,a={done:!1,value:Kb(e)},l=function(e){return i=e};return Gw({q1:function(){return{nextState:"q2",effect:a,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:(e=i,{done:!1,value:nw.apply(void 0,[t].concat(r,[e]))})};var e}},"q1","takeEvery("+Hw(e)+", "+t.name+")")}function Qw(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i,a,l={done:!1,value:Kb(e)},s=function(e){return{done:!1,value:nw.apply(void 0,[t].concat(r,[e]))}},c=function(e){return{done:!1,value:(t=e,void 0===t&&(t=ub),Xb($b,t))};var t},u=function(e){return i=e},d=function(e){return a=e};return Gw({q1:function(){return{nextState:"q2",effect:l,stateUpdater:d}},q2:function(){return i?{nextState:"q3",effect:c(i)}:{nextState:"q1",effect:s(a),stateUpdater:u}},q3:function(){return{nextState:"q1",effect:s(a),stateUpdater:u}}},"q1","takeLatest("+Hw(e)+", "+t.name+")")}function $w(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return nw.apply(void 0,[qw,e,t].concat(r))}function Yw(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return nw.apply(void 0,[Qw,e,t].concat(r))}var Xw=["type"],Kw=Zw().m(tE);function Zw(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Jw(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Jw(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Jw(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Jw(d,"constructor",c),Jw(c,"constructor",s),s.displayName="GeneratorFunction",Jw(c,o,"GeneratorFunction"),Jw(d),Jw(d,o,"Generator"),Jw(d,r,function(){return this}),Jw(d,"toString",function(){return"[object Generator]"}),(Zw=function(){return{w:i,m:p}})()}function Jw(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Jw=function(e,t,n,r){function i(t,n){Jw(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Jw(e,t,n,r)}function eE(e){return e.type,Wn(e,Xw),Zw().m(function e(){var t,n,r;return Zw().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/dependencies");case 1:if(t=e.v,n=t.response,t.error,!n){e.n=2;break}return e.n=2,Zb(uv({dependencies:n}));case 2:e.n=4;break;case 3:e.p=3,r=e.v,console.error("DEPENDENCIES ERROR: ",r);case 4:return e.a(2)}},e,null,[[0,3]])})()}function tE(){return Zw().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Cr,eE);case 1:return e.a(2)}},Kw)}var nE=["type"],rE=oE().m(lE);function oE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return iE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(iE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,iE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,iE(d,"constructor",c),iE(c,"constructor",s),s.displayName="GeneratorFunction",iE(c,o,"GeneratorFunction"),iE(d),iE(d,o,"Generator"),iE(d,r,function(){return this}),iE(d,"toString",function(){return"[object Generator]"}),(oE=function(){return{w:i,m:p}})()}function iE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}iE=function(e,t,n,r){function i(t,n){iE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},iE(e,t,n,r)}function aE(e){return e.type,Wn(e,nE),oE().m(function e(){var t,n;return oE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/tags");case 1:if(t=e.v,n=t.response,t.error,!n){e.n=2;break}return e.n=2,Zb(dv({tags:n}));case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[0,3]])})()}function lE(){return oE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Pr,aE);case 1:return e.a(2)}},rE)}var sE=["type"],cE=uE().m(fE);function uE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return dE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(dE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,dE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,dE(d,"constructor",c),dE(c,"constructor",s),s.displayName="GeneratorFunction",dE(c,o,"GeneratorFunction"),dE(d),dE(d,o,"Generator"),dE(d,r,function(){return this}),dE(d,"toString",function(){return"[object Generator]"}),(uE=function(){return{w:i,m:p}})()}function dE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}dE=function(e,t,n,r){function i(t,n){dE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},dE(e,t,n,r)}function pE(e){e.type;var t=Wn(e,sE);return uE().m(function e(){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g;return uE().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,n=t.key,r=t.data,!(o={tags:"tags",dependencies:"dependencies",activeFilter:"activeFilter",template_type_id:"templateType",category_id:"category"}).hasOwnProperty(n)){e.n=8;break}if(i=[],a=tb(),l=o[n],"dependencies"!==n){e.n=1;break}a.exclude=r.exclude.join(","),a.include=r.include.join(","),0===r.exclude.length&&i.push("exclude"),0===r.include.length&&i.push("include"),e.n=7;break;case 1:if("tags"!==n){e.n=2;break}a.tags=r.join(","),e.n=7;break;case 2:if("template_type_id"!==n){e.n=4;break}return e.n=3,rw(function(e){var t,n;return{types:null!==(t=null===(n=e.general.templateTypes)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 3:s=e.v,c=s.types,u=c.find(function(e){return e.id===r}),a[l]=(null==u?void 0:u.slug)||"all",e.n=7;break;case 4:if("category_id"!==n){e.n=6;break}return e.n=5,rw(function(e){var t,n;return{categories:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 5:d=e.v,p=d.categories,f=p.find(function(e){return e.id===r}),a[l]=(null==f?void 0:f.slug)||"all",e.n=7;break;case 6:a[l]=r;case 7:null!=a&&a[l]||i.push(l),h=nb(a.path,a,i),(m=Jy().location).actualPathname+m.search!==h&&Jy().push(h,{resetFilter:!1});case 8:e.n=10;break;case 9:e.p=9,g=e.v,console.error("FILTER ERROR: ",g);case 10:return e.a(2)}},e,null,[[0,9]])})()}function fE(){return uE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(xr,pE);case 1:return e.a(2)}},cE)}var hE=["type"],mE=["type"],gE=vE().m(EE);function vE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return yE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(yE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,yE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,yE(d,"constructor",c),yE(c,"constructor",s),s.displayName="GeneratorFunction",yE(c,o,"GeneratorFunction"),yE(d),yE(d,o,"Generator"),yE(d,r,function(){return this}),yE(d,"toString",function(){return"[object Generator]"}),(vE=function(){return{w:i,m:p}})()}function yE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}yE=function(e,t,n,r){function i(t,n){yE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},yE(e,t,n,r)}function bE(e){e.type;var t=Wn(e,hE);return vE().m(function e(){var n,r;return vE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){var n,r;return{typeLists:null!==(n=null===(r=e.general.templateTyps)||void 0===r||null===(r=r.lists)||void 0===r?void 0:r[null==t?void 0:t.itemType])&&void 0!==n?n:[]}});case 1:if(!(e.v.typeLists.length>0)){e.n=2;break}return e.a(2);case 2:return e.n=3,fa("/templately/v1/templateTypes",t);case 3:if(n=e.v,r=n.response,n.error,!r){e.n=4;break}return e.n=4,Zb(pv({types:r}));case 4:e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2)}},e,null,[[0,5]])})()}function wE(e){return e.type,Wn(e,mE),vE().m(function e(){var t,n,r,o;return vE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,fa("/templately/v1/pricing");case 1:if(t=e.v,n=t.response,r=t.error,!n){e.n=3;break}return e.n=2,Zb(fv(n));case 2:case 4:return e.a(2);case 3:if(!r){e.n=4;break}return e.n=4,Zb(hv({code:null!==(o=null==r?void 0:r.code)&&void 0!==o?o:"pricing_fetch_failed",message:null==r?void 0:r.message,additional_errors:null==r?void 0:r.additional_errors}))}},e)})()}function EE(){return vE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(ur,wE);case 1:return e.n=2,Yw(Tr,bE);case 2:return e.a(2)}},gE)}var kE=["type"],OE=["type"],SE=["type"],xE=["type"],_E=["type"],CE=DE().m(LE);function DE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return PE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(PE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,PE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,PE(d,"constructor",c),PE(c,"constructor",s),s.displayName="GeneratorFunction",PE(c,o,"GeneratorFunction"),PE(d),PE(d,o,"Generator"),PE(d,r,function(){return this}),PE(d,"toString",function(){return"[object Generator]"}),(DE=function(){return{w:i,m:p}})()}function PE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}PE=function(e,t,n,r){function i(t,n){PE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},PE(e,t,n,r)}function AE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AE(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function FE(e){e.type;var t=Wn(e,kE);return DE().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return DE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.platform,r=t.itemType,o=t.plan,i=t.page,e.n=1,rw(function(e){var t,a,l;return{favLists:null!==(t=null===(a=e.profile.favourites)||void 0===a||null===(a=a[o])||void 0===a||null===(a=a[n])||void 0===a||null===(a=a[r])||void 0===a?void 0:a[i])&&void 0!==t?t:[],totalPage:null===(l=e.profile.favourites)||void 0===l||null===(l=l[o])||void 0===l||null===(l=l[n])||void 0===l||null===(l=l[r])||void 0===l?void 0:l.totalPage}});case 1:if(a=e.v,l=a.favLists,s=a.totalPage,!((null==l?void 0:l.length)>0)){e.n=3;break}return e.n=2,Zb(Wi({data:l,current_page:i,total_page:s,platform:n,itemType:r,plan:o}));case 2:return e.a(2);case 3:return e.n=4,fa("/templately/v1/profile/my-favourites",t);case 4:if(c=e.v,u=c.response,d=c.error,!u){e.n=7;break}if(!0!==(null==u?void 0:u.redirect)){e.n=6;break}return e.n=5,Zb(yv(u));case 5:e.n=7;break;case 6:return e.n=7,Zb(Wi(TE(TE({},u),{},{platform:n,itemType:r,plan:o})));case 7:if(!d){e.n=8;break}return console.error("Error: P100",d),e.n=8,Zb(Ui(d));case 8:e.n=10;break;case 9:e.p=9,p=e.v,console.error("Error: P100",p);case 10:return e.a(2)}},e,null,[[0,9]])})()}function ME(e){var t=e.type,n=Wn(e,OE);return DE().m(function e(){var r,o,i,a;return DE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){return null!==e.profile.data});case 1:if(e.v){e.n=2;break}return e.a(2);case 2:return e.n=3,fa("/templately/v1/profile/download-history",n);case 3:if(r=e.v,o=r.response,i=r.error,!o){e.n=6;break}if(!0!==(null==o?void 0:o.redirect)||t===ur){e.n=5;break}return e.n=4,Zb(yv(o));case 4:e.n=6;break;case 5:return e.n=6,Zb(ta(o));case 6:if(!i){e.n=7;break}return console.error("Error P101: ",i),e.n=7,Zb(na(i));case 7:e.n=9;break;case 8:return e.p=8,a=e.v,console.error("Error P101: ",a),e.n=9,Zb(na(a));case 9:return e.a(2)}},e,null,[[0,8]])})()}function IE(e){return e.type,Wn(e,SE),DE().m(function e(){var t,n,r,o;return DE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/profile/sync");case 1:if(t=e.v,n=t.response,r=t.error,!n){e.n=4;break}if("success"!=(null==n?void 0:n.status)){e.n=3;break}return e.n=2,Zb(Mi(null==n?void 0:n.user));case 2:xl({icon:"success",timer:2e3,html:React.createElement(oC,{title:(0,At.__)("Successfully Synced Account","templately")})},!1);case 3:if("error"!=(null==n?void 0:n.status)){e.n=4;break}return e.n=4,Zb(Ii({code:"sync_failed",message:n.message}));case 4:if(!r){e.n=5;break}return e.n=5,Zb(Ii({code:"sync_failed",message:r}));case 5:e.n=8;break;case 6:return e.p=6,o=e.v,e.n=7,Zb(Ii({code:"sync_failed",message:o}));case 7:console.error("Sync Error: ",o);case 8:return e.a(2)}},e,null,[[0,6]])})()}function NE(e){return e.type,Wn(e,xE),DE().m(function e(){var t,n,r,o;return DE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Zb({type:hr});case 1:return e.n=2,fa("/templately/v1/profile/verified");case 2:if(t=e.v,n=t.response,r=t.error,null==n){e.n=3;break}return e.n=3,Zb(Bi({is_verified:n}));case 3:if(!r){e.n=4;break}return console.error("Sync Error: ",r),e.n=4,Zb(Bi({is_verified:!1}));case 4:e.n=6;break;case 5:return e.p=5,o=e.v,console.error("Sync Error: ",o),e.n=6,Zb(Bi({is_verified:!1}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function jE(e){var t=e.type,n=Wn(e,_E);return DE().m(function e(){var r,o,i,a,l,s;return DE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){return null!==e.profile.data});case 1:if(e.v){e.n=2;break}return e.a(2);case 2:return"APPLICATION_SET_PLATFORM"==t&&(n=TE(TE({},n),{},{all:!0})),e.n=3,fa("/templately/v1/profile/purchased-items",n);case 3:if(r=e.v,o=r.response,i=r.error,t===ur){e.n=4;break}if(!0!==(null==o?void 0:o.redirect)){e.n=4;break}return e.n=4,Zb(yv(o));case 4:if(!o||"APPLICATION_SET_PLATFORM"!=t){e.n=5;break}return l={},(null==o||null===(a=o.data)||void 0===a?void 0:a.length)>0&&(null==o||o.data.map(function(e){l[e.type]=null==(null==l?void 0:l[e.type])?[e.item_id]:[].concat(Nl(null==l?void 0:l[e.type]),[e.item_id])})),e.n=5,Zb(Vi({data:l}));case 5:if(!o||"APPLICATION_SET_PLATFORM"==t){e.n=6;break}return e.n=6,Zb(Gi(o));case 6:if(!i||"APPLICATION_SET_PLATFORM"==t){e.n=7;break}return console.error("Error P103: ",i),e.n=7,Zb(qi(i));case 7:e.n=9;break;case 8:if(e.p=8,s=e.v,console.error("Error P103: ",s),"APPLICATION_SET_PLATFORM"==t){e.n=9;break}return e.n=9,Zb(qi(s));case 9:return e.a(2)}},e,null,[[0,8]])})()}function LE(){return DE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw($r,FE);case 1:return e.n=2,Yw(lo,ME);case 2:return e.n=3,Yw(Gr,IE);case 3:return e.n=4,Yw(qr,NE);case 4:return e.n=5,Yw(po,jE);case 5:return e.n=6,Yw(ur,jE);case 6:return e.n=7,Yw(ur,ME);case 7:return e.a(2)}},CE)}var RE=["type"],BE=["type","isGloballySigned"],zE=["type"],WE=["type"],UE=VE().m(YE);function VE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return HE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(HE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,HE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,HE(d,"constructor",c),HE(c,"constructor",s),s.displayName="GeneratorFunction",HE(c,o,"GeneratorFunction"),HE(d),HE(d,o,"Generator"),HE(d,r,function(){return this}),HE(d,"toString",function(){return"[object Generator]"}),(VE=function(){return{w:i,m:p}})()}function HE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}HE=function(e,t,n,r){function i(t,n){HE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},HE(e,t,n,r)}function GE(e){return e.type,Wn(e,RE),VE().m(function e(){var t,n,r,o,i,a,l,s;return VE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=null,e.n=1,rw(function(e){var t,n,r,o,i;return{user:null!==(t=null!==(n=null===(r=e.profile)||void 0===r?void 0:r.prevData)&&void 0!==n?n:null===(o=e.profile)||void 0===o?void 0:o.data)&&void 0!==t?t:null,error:null!==(i=e.profile.error)&&void 0!==i?i:null}});case 1:if(n=e.v,r=n.user,o=n.error,t=o,!r){e.n=3;break}return e.n=2,Zb(Mi(r));case 2:case 10:return e.a(2);case 3:if(null!=r){e.n=7;break}return e.n=4,fa("/templately/v1/is-signed");case 4:if(i=e.v,a=i.response,l=i.error,t=l,!a||null===(null==a?void 0:a.user)){e.n=6;break}return e.n=5,Zb(Mi(null==a?void 0:a.user));case 5:e.n=7;break;case 6:return e.n=7,Zb(Ii({code:"is_signed_failed",message:t}));case 7:if(!t){e.n=8;break}return e.n=8,Zb(Ii({code:"is_signed_failed",message:t}));case 8:e.n=10;break;case 9:return e.p=9,s=e.v,e.n=10,Zb(Ii({code:"is_signed_failed",message:s}))}},e,null,[[0,9]])})()}function qE(e){e.type;var t=e.isGloballySigned;return Wn(e,BE),VE().m(function e(){var n,r,o,i,a;return VE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/logout");case 1:if(n=e.v,r=n.response,o=n.error,!r){e.n=3;break}if("success"!=(null==r?void 0:r.status)){e.n=3;break}return e.n=2,Zb(Fi({isGloballySigned:t,global_user:null!==(i=null==r?void 0:r.global_user)&&void 0!==i?i:void 0}));case 2:case 6:return e.a(2);case 3:if(!o){e.n=4;break}return e.n=4,Zb(Ii({code:"logout_failed",message:o}));case 4:e.n=6;break;case 5:return e.p=5,a=e.v,e.n=6,Zb(Ii({code:"logout_failed",message:a}))}},e,null,[[0,5]])})()}function QE(e){e.type;var t=Wn(e,zE);return VE().m(function e(){var n,r,o,i,a,l;return VE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/login",t);case 1:if(n=e.v,r=n.response,o=n.error,!r){e.n=3;break}if("success"!==(null==r?void 0:r.status)){e.n=2;break}return e.n=2,Zb(Mi(null==r?void 0:r.user));case 2:if("error"!==(null==r?void 0:r.status)){e.n=3;break}return e.n=3,Zb(Ii({code:"login_failed",message:r.message}));case 3:if(!o){e.n=4;break}return e.n=4,Zb(Ii({code:"login_failed",message:null!==(i=null==o?void 0:o.message)&&void 0!==i?i:o}));case 4:e.n=6;break;case 5:return e.p=5,l=e.v,e.n=6,Zb(Ii({code:"login_failed",message:null!==(a=null==l?void 0:l.message)&&void 0!==a?a:l}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function $E(e){e.type;var t=Wn(e,WE);return VE().m(function e(){var n,r,o,i,a;return VE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/signup",t);case 1:if(n=e.v,r=n.response,o=n.error,!r){e.n=3;break}if("success"!=(null==r?void 0:r.status)){e.n=2;break}return e.n=2,Zb(Ni(null==r?void 0:r.user));case 2:if("error"!=(null==r?void 0:r.status)){e.n=3;break}return e.n=3,Zb(ji({code:"signup_failed",message:r.message,additional_errors:r.additional_errors}));case 3:if(!o){e.n=4;break}return e.n=4,Zb(ji({code:null!==(i=null==o?void 0:o.code)&&void 0!==i?i:"signup_failed",message:null==o?void 0:o.message,additional_errors:null==o?void 0:o.additional_errors}));case 4:e.n=6;break;case 5:return e.p=5,a=e.v,e.n=6,Zb(ji({code:"signup_failed",message:a}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function YE(){return VE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$w(Bo.LOAD,GE);case 1:return e.n=2,$w(Qr,GE);case 2:return e.n=3,Yw(yr,QE);case 3:return e.n=4,Yw(Er,$E);case 4:return e.n=5,Yw(gr,qE);case 5:return e.a(2)}},UE)}var XE=["type"],KE=ZE().m(tk);function ZE(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return JE(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(JE(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,JE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,JE(d,"constructor",c),JE(c,"constructor",s),s.displayName="GeneratorFunction",JE(c,o,"GeneratorFunction"),JE(d),JE(d,o,"Generator"),JE(d,r,function(){return this}),JE(d,"toString",function(){return"[object Generator]"}),(ZE=function(){return{w:i,m:p}})()}function JE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}JE=function(e,t,n,r){function i(t,n){JE(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},JE(e,t,n,r)}function ek(e){return e.type,Wn(e,XE),ZE().m(function e(){var t,n,r,o;return ZE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){var t,n;return{categoryLists:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.lists)&&void 0!==t?t:[]}});case 1:if(!(e.v.categoryLists.length>0)){e.n=2;break}return e.a(2);case 2:return e.n=3,fa("/templately/v1/categories");case 3:if(t=e.v,n=t.response,r=t.error,!n){e.n=4;break}return e.n=4,Zb(mv({categories:n}));case 4:if(!r){e.n=5;break}return e.n=5,Zb(gv({error:r}));case 5:e.n=7;break;case 6:return e.p=6,o=e.v,e.n=7,Zb(gv({error:o}));case 7:return e.a(2)}},e,null,[[0,6]])})()}function tk(){return ZE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Nr,ek);case 1:return e.a(2)}},KE)}var nk=["type"],rk=ok().m(lk);function ok(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return ik(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ik(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ik(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,ik(d,"constructor",c),ik(c,"constructor",s),s.displayName="GeneratorFunction",ik(c,o,"GeneratorFunction"),ik(d),ik(d,o,"Generator"),ik(d,r,function(){return this}),ik(d,"toString",function(){return"[object Generator]"}),(ok=function(){return{w:i,m:p}})()}function ik(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ik=function(e,t,n,r){function i(t,n){ik(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ik(e,t,n,r)}function ak(e){e.type;var t=Wn(e,nk);return ok().m(function e(){var n,r,o;return ok().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/dependencies/check",t);case 1:return n=e.v,r=n.response,n.error,e.a(2,r);case 2:e.p=2,o=e.v,console.error("Error D101: ",o);case 3:return e.a(2)}},e,null,[[0,2]])})()}function lk(){return ok().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw("APPLICATION_CHECK_DEPENDENCIES",ak);case 1:return e.a(2)}},rk)}var sk=["type"],ck=["type"],uk=dk().m(mk);function dk(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return pk(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(pk(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,pk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,pk(d,"constructor",c),pk(c,"constructor",s),s.displayName="GeneratorFunction",pk(c,o,"GeneratorFunction"),pk(d),pk(d,o,"Generator"),pk(d,r,function(){return this}),pk(d,"toString",function(){return"[object Generator]"}),(dk=function(){return{w:i,m:p}})()}function pk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}pk=function(e,t,n,r){function i(t,n){pk(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},pk(e,t,n,r)}function fk(e){e.type;var t=Wn(e,sk);return dk().m(function e(){var n,r,o;return dk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/conditions",t);case 1:if(n=e.v,r=n.response,n.error,!r){e.n=3;break}return e.n=2,Zb(bv(r.config));case 2:if(null==(null==r?void 0:r.template_conditions)){e.n=3;break}return e.n=3,Zb(wv(t.template_id,r.template_conditions));case 3:e.n=5;break;case 4:e.p=4,o=e.v,console.error("Condition Failed",o);case 5:return e.a(2)}},e,null,[[0,4]])})()}function hk(e){e.type;var t=Wn(e,ck);return dk().m(function e(){var n,r,o,i,a;return dk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.id,e.n=1,rw(function(e){return e.conditions.conditionsForSave[n]});case 1:return r=e.v,e.n=2,ha("/templately/v1/save-conditions",{template_id:n,conditions:null!=r?r:[]});case 2:o=e.v,i=o.response,o.error,i&&window.TemplatelyAppManager.close("templately-edit-conditions-app"),e.n=4;break;case 3:e.p=3,a=e.v,console.error("Condition Failed",a);case 4:return e.a(2)}},e,null,[[0,3]])})()}function mk(){return dk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Br,fk);case 1:return e.n=2,Yw(Ur,hk);case 2:return e.a(2)}},uk)}var gk=["type"],vk=bk().m(Sk),yk=bk().m(Ck);function bk(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return wk(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(wk(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,wk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,wk(d,"constructor",c),wk(c,"constructor",s),s.displayName="GeneratorFunction",wk(c,o,"GeneratorFunction"),wk(d),wk(d,o,"Generator"),wk(d,r,function(){return this}),wk(d,"toString",function(){return"[object Generator]"}),(bk=function(){return{w:i,m:p}})()}function wk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}wk=function(e,t,n,r){function i(t,n){wk(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},wk(e,t,n,r)}function Ek(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ek(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ek(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ok(e){var t=e.payload;return bk().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return bk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.packId,r=t.isAi,o={id:n,isAi:r,action:"templately_pack_import_info",nonce:window.templately.nonce},i=(0,vi.addQueryArgs)(window.ajaxurl,o),e.n=1,tw(fa,i,{});case 1:if(a=e.v,l=a.response,!(s=a.error)){e.n=3;break}return e.n=2,Zb(Ry(s.data.message));case 2:e.n=5;break;case 3:return c=l.data,e.n=4,Zb(Ly(c));case 4:return u=c.credit_balance,d=c.estimated_cost,e.n=5,Zb(Fy(kk(kk({},u),{},{estimated_cost:d})));case 5:e.n=7;break;case 6:return e.p=6,p=e.v,e.n=7,Zb(Ry(p.message));case 7:return e.a(2)}},e,null,[[0,6]])})()}function Sk(){var e,t,n,r,o,i;return bk().w(function(a){for(;;)switch(a.p=a.n){case 0:return a.p=0,e={action:"templately_pack_google_font",nonce:window.templately.nonce},t=(0,vi.addQueryArgs)(window.ajaxurl,e),a.n=1,tw(fa,t,{});case 1:if(n=a.v,r=n.response,!(o=n.error)){a.n=3;break}return a.n=2,Zb(zy(o));case 2:a.n=4;break;case 3:return a.n=4,Zb(By(r));case 4:a.n=6;break;case 5:return a.p=5,i=a.v,a.n=6,Zb(zy(i.message));case 6:return a.a(2)}},vk,null,[[0,5]])}function xk(e){var t=e.payload;return bk().m(function e(){var n,r;return bk().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,n=t.id){e.n=1;break}return console.error("Pack ID is missing for AI sidebar"),e.a(2);case 1:return e.n=2,Zb(jy(n,!0));case 2:e.n=4;break;case 3:e.p=3,r=e.v,console.error("Error in handleShowAiSidebar:",r);case 4:return e.a(2)}},e,null,[[0,3]])})()}function _k(e){return e.type,Wn(e,gk),bk().m(function e(){return bk().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)})()}function Ck(){return bk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jb([Yw("FULL_SITE_IMPORT_START",_k),Yw(Zo,xk),Yw(oi,Ok),Yw(li,Sk)]);case 1:return e.a(2)}},yk)}var Dk=["type"],Pk=Ak().m(Mk);function Ak(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Tk(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Tk(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Tk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Tk(d,"constructor",c),Tk(c,"constructor",s),s.displayName="GeneratorFunction",Tk(c,o,"GeneratorFunction"),Tk(d),Tk(d,o,"Generator"),Tk(d,r,function(){return this}),Tk(d,"toString",function(){return"[object Generator]"}),(Ak=function(){return{w:i,m:p}})()}function Tk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Tk=function(e,t,n,r){function i(t,n){Tk(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Tk(e,t,n,r)}function Fk(e){e.type;var t=Wn(e,Dk);return Ak().m(function e(){var n,r,o,i;return Ak().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/items/favourite",t);case 1:if(n=e.v,r=n.response,o=n.error,"success"!==(null==r?void 0:r.status)){e.n=4;break}return e.n=2,Zb(Xi());case 2:return e.n=3,Zb(Qi({starred:r.data}));case 3:e.n=5;break;case 4:if("error"!==(null==r?void 0:r.status)){e.n=5;break}return e.n=5,Zb(Ki({error:r.message||"Failed to update favourite"}));case 5:if(!o){e.n=6;break}return console.error("Error P102: ",o),e.n=6,Zb(Ki({error:o.message||"Failed to update favourite"}));case 6:e.n=8;break;case 7:return e.p=7,i=e.v,console.error("Error P102: ",i),e.n=8,Zb(Ki({error:i.message||"Failed to update favourite"}));case 8:return e.a(2)}},e,null,[[0,7]])})()}function Mk(){return Ak().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(to,Fk);case 1:return e.a(2)}},Pk)}var Ik=["type"],Nk=jk().m(Bk);function jk(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Lk(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Lk(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Lk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Lk(d,"constructor",c),Lk(c,"constructor",s),s.displayName="GeneratorFunction",Lk(c,o,"GeneratorFunction"),Lk(d),Lk(d,o,"Generator"),Lk(d,r,function(){return this}),Lk(d,"toString",function(){return"[object Generator]"}),(jk=function(){return{w:i,m:p}})()}function Lk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Lk=function(e,t,n,r){function i(t,n){Lk(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Lk(e,t,n,r)}function Rk(e){e.type;var t=Wn(e,Ik);return jk().m(function e(){var n,r,o,i;return jk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/items/rating",t);case 1:if(n=e.v,r=n.response,o=n.error,"success"!==(null==r?void 0:r.status)){e.n=3;break}return e.n=2,Zb(Zi());case 2:return e.n=3,Zb($i({reviews:r.data.reviews}));case 3:if(!o){e.n=4;break}return console.error("Error P102: ",o),e.n=4,Zb(Ji({error:o.message||"Failed to update rating"}));case 4:e.n=6;break;case 5:return e.p=5,i=e.v,console.error("Error P102: ",i),e.n=6,Zb(Ji({error:i.message||"Failed to update rating"}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function Bk(){return jk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(oo,Rk);case 1:return e.a(2)}},Nk)}var zk=["type"],Wk=["type"],Uk=["type"],Vk=qk().m(Kk);function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hk(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qk(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Qk(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Qk(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Qk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Qk(d,"constructor",c),Qk(c,"constructor",s),s.displayName="GeneratorFunction",Qk(c,o,"GeneratorFunction"),Qk(d),Qk(d,o,"Generator"),Qk(d,r,function(){return this}),Qk(d,"toString",function(){return"[object Generator]"}),(qk=function(){return{w:i,m:p}})()}function Qk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Qk=function(e,t,n,r){function i(t,n){Qk(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Qk(e,t,n,r)}function $k(e){e.type;var t=Wn(e,zk);return qk().m(function e(){var n,r,o,i,a,l;return qk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){var n,r,o,i=e.general.platform;return{items:null!==(n=(null===(r=e.savedTemplates)||void 0===r?void 0:r[i])&&(null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o[null==t?void 0:t.page]))&&void 0!==n?n:null}});case 1:if(null===e.v.items){e.n=3;break}return e.n=2,Zb(Ey());case 2:return e.a(2);case 3:return e.n=4,fa("/templately/v1/saved-templates",t);case 4:if(r=e.v,o=r.response,r.error,!(o&&(null==o||null===(n=o.items)||void 0===n?void 0:n.length)>=0)){e.n=7;break}return e.n=5,Zb(ky({platform:"elementor",data:null!==(i=null==o?void 0:o.items)&&void 0!==i?i:[],currentPage:null!==(a=null==o?void 0:o.current_page)&&void 0!==a?a:1,totalPage:null!==(l=null==o?void 0:o.total_page)&&void 0!==l?l:1}));case 5:return e.n=6,Zb(Cy({has_elementor:null==o?void 0:o.has_elementor,has_elementor_pro:null==o?void 0:o.has_elementor_pro}));case 6:e.n=8;break;case 7:return e.n=8,Zb(Oy({platform:"elementor",data:"Something went wrong."}));case 8:e.n=10;break;case 9:e.p=9,e.v;case 10:return e.a(2)}},e,null,[[0,9]])})()}function Yk(e){e.type;var t=Wn(e,Wk);return qk().m(function e(){var n,r,o,i,a,l;return qk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/saved-templates/delete",t);case 1:if(n=e.v,r=n.response,o=n.error,i={key:"isDeleted",error:{title:(0,At.__)("Something went wrong.","templately"),content:""},success:{title:null==r?void 0:r.message,content:""}},!r||"success"!==(null==r?void 0:r.status)){e.n=4;break}return e.n=2,Zb(wy());case 2:if(null!=r&&r.is_kit){e.n=3;break}return xl({icon:"success",timer:1500,html:React.createElement(oC,re({},i.success,{contentArgs:r}))},!0),e.a(2);case 3:Sl.close({isDeleted:!0,message:null==r?void 0:r.message}),e.n=5;break;case 4:return null!=o&&o.message&&xl({icon:"error",timer:1500,html:React.createElement(oC,{title:o.message})},!0),e.a(2);case 5:"cant_delete_kit"===(null==o?void 0:o.code)?xl({onConfirm:function(e){return _l(i,e)},html:React.createElement(Pu,{id:null==o||null===(a=o.data)||void 0===a?void 0:a.id})},!0):"invalid_permission"===(null==o?void 0:o.code)&&xl({icon:"error",timer:1500,html:React.createElement(oC,{title:o.message})},!0),e.n=7;break;case 6:e.p=6,l=e.v,console.error("ST501","Saved Template Deleting Error.",l);case 7:return e.a(2)}},e,null,[[0,6]])})()}function Xk(e){e.type;var t=Wn(e,Uk);return qk().m(function e(){var n,r,o,i;return qk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){var n,r,o,i=e.general.platform;return{items:null!==(n=(null===(r=e.savedTemplates)||void 0===r?void 0:r[i])&&(null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o[null==t?void 0:t.page]))&&void 0!==n?n:null,platform:i}});case 1:if(n=e.v,r=n.items,o=n.platform,!(r.length>0)){e.n=2;break}return i=r.map(function(e){return Gk(Gk({},e),{},{is_pushed:e.is_pushed?e.is_pushed:e.id===t.id})}),e.n=2,Zb(ky({platform:o,data:null!=i?i:[],currentPage:null==t?void 0:t.page}));case 2:e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[0,3]])})()}function Kk(){return qk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Io,$k);case 1:return e.n=2,Yw(Ro,Yk);case 2:return e.n=3,Yw(Bo.PUSHED,Xk);case 3:return e.a(2)}},Vk)}var Zk=["type"],Jk=eO().m(rO);function eO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return tO(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(tO(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,tO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,tO(d,"constructor",c),tO(c,"constructor",s),s.displayName="GeneratorFunction",tO(c,o,"GeneratorFunction"),tO(d),tO(d,o,"Generator"),tO(d,r,function(){return this}),tO(d,"toString",function(){return"[object Generator]"}),(eO=function(){return{w:i,m:p}})()}function tO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}tO=function(e,t,n,r){function i(t,n){tO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},tO(e,t,n,r)}function nO(e){return e.type,Wn(e,Zk),eO().m(function e(){var t,n,r,o,i,a,l,s;return eO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Zb({type:Bo.STATUS_REQUEST});case 1:return e.n=2,fa("/templately/v1/clouds/usage");case 2:if(t=e.v,n=t.response,r=t.error,"error"!==(null==n?void 0:n.status)){e.n=3;break}return e.n=3,Zb(Lv({error:{message:null==n?void 0:n.message}}));case 3:if("success"!==(null==n?void 0:n.status)){e.n=4;break}if(!(i=null!==(o=n&&JSON.parse(null==n?void 0:n.data))&&void 0!==o?o:{})){e.n=4;break}return e.n=4,Zb(jv({limit:null!==(a=null==i?void 0:i.limit)&&void 0!==a?a:0,usages:null!==(l=null==i?void 0:i.files)&&void 0!==l?l:0}));case 4:if(!r){e.n=5;break}return e.n=5,Zb(Lv({error:r}));case 5:e.n=7;break;case 6:return e.p=6,s=e.v,e.n=7,Zb(Lv({error:s}));case 7:return e.a(2)}},e,null,[[0,6]])})()}function rO(){return eO().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(br,nO);case 1:return e.n=2,Yw(Bo.LOAD,nO);case 2:return e.n=3,Yw(lo,nO);case 3:return e.n=4,Yw($r,nO);case 4:return e.n=5,Yw(po,nO);case 5:return e.n=6,Yw(zo.LOAD,nO);case 6:return e.n=7,Yw(Wo.LOAD,nO);case 7:return e.n=8,Yw(Uo.LOAD,nO);case 8:return e.a(2)}},Jk)}const oO=function(e){var t=(0,pe.useRef)(null);return(0,pe.useLayoutEffect)(function(){t.current=e}),(0,pe.useCallback)(function(){return t.current.apply(void 0,arguments)},[])};var iO=["action"];function aO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return lO(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(lO(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,lO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,lO(d,"constructor",c),lO(c,"constructor",s),s.displayName="GeneratorFunction",lO(c,o,"GeneratorFunction"),lO(d),lO(d,o,"Generator"),lO(d,r,function(){return this}),lO(d,"toString",function(){return"[object Generator]"}),(aO=function(){return{w:i,m:p}})()}function lO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}lO=function(e,t,n,r){function i(t,n){lO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},lO(e,t,n,r)}function sO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uO(e,t){return{type:e,message:t,progress:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,status:arguments.length>3&&void 0!==arguments[3]?arguments[3]:"waiting"}}var dO=0,pO=0,fO=function(){return Sd(function e(t){var n=this;kd(this,e),this.session_id=new URLSearchParams(t).get("session_id"),this.url=window.ajaxurl+"?action=templately_pack_import_status&session_id="+this.session_id+"&isNetworkAdmin="+window.templately.isNetworkAdmin,this.onmessage=null,this.onerror=null,this.isClosed=!1,this.progressInterval=1e3,this.noLogCount=0,fetch(t+"&ic="+pO+++"&li="+dO).catch(function(e){n.onerror&&n.onerror(e)}),this.fetchProgress()},[{key:"fetchProgress",value:function(){var e=this;!0!==this.isClosed&&fetch(this.url+"&nonce="+window.templately.nonce+"&lastLogIndex="+dO).then(function(e){return e.json()}).then(function(t){var n;if(e.onmessage&&!e.isClosed&&t.log.length){var r,o=t.log.some(function(e){return"error"===e.action});if(dO+=null!==(r=t.log.length)&&void 0!==r?r:0,e.isClosed)return;for(var i=0;i<t.log.length;i++)if(!["continue","error"].includes(t.log[i].action)||i+1===t.log.length){var a={data:JSON.stringify(t.log[i])};e.onmessage(a)}if(o)return void e.close()}var l,s,c=(null===(n=t.log)||void 0===n?void 0:n[t.log.length-1])||{};e.isClosed||["complete","downloadComplete","error"].includes(c.action)||(null!==(l=t.log)&&void 0!==l&&l.length&&0!==(null===(s=t.log)||void 0===s?void 0:s.length)?(e.noLogCount=0,e.progressInterval=1e3):e.noLogCount++,e.noLogCount>=5&&e.progressInterval<5e3&&(e.noLogCount=0,e.progressInterval+=500),setTimeout(function(){e.isClosed||e.fetchProgress()},e.progressInterval))}).catch(function(t){e.onerror&&e.onerror(t)})}},{key:"close",value:function(){this.isClosed=!0}},{key:"addEventListener",value:function(e,t){}}])}();const hO=function(e){var t=ce((0,pe.useState)([]),2),n=t[0],r=t[1],o=ce((0,pe.useState)({}),2),i=o[0],a=(o[1],(0,pe.useRef)(null)),l=(0,pe.useRef)(null),s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!1),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!1),2),m=h[0],g=h[1],v=(0,pe.useRef)(0),y=(0,pe.useCallback)(function(e){r(function(t){var n=t.map(function(t){var n;return(null==e?void 0:e.type)===(null==t?void 0:t.type)?cO(cO(cO({},t),e),{},{status:null!==(n=e.status)&&void 0!==n?n:100===e.progress?"complete":"processing"}):"error"===(null==e?void 0:e.type)&&"complete"!==t.status?cO(cO({},t),{},{status:e.status}):t});if(!w(e,n))if(null!=e&&e.position){var r=n.findIndex(function(t){return t.type===(null==e?void 0:e.position)});r>=0&&n.splice(r+1,0,cO({status:"processing"},e))}else n.push(cO({status:"processing"},e));return n})},[n]),b=(0,pe.useCallback)(function(){r(function(e){return e.filter(function(e){return"error"!==e.type}).map(function(e){return"error"===e.status?cO(cO({},e),{},{status:"processing"}):e})})},[n]),w=function(e,t){var n;return 1===(null==t||null===(n=t.filter(function(t){return t.type===e.type}))||void 0===n?void 0:n.length)},E=function(e){return r(function(t){return t.filter(function(t){return t.type!==e.type})})},k=function(e){var t,n,r=null===(t=e)||void 0===t?void 0:t.session_id,o=null===(n=e)||void 0===n?void 0:n.is_lightspeed,i=o?fO:EventSource;g(!1),u(!0);var s=new i((0,vi.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import",nonce:window.templately.nonce,session_id:r,is_lightspeed:o,isNetworkAdmin:window.templately.isNetworkAdmin}));a.current=s,s.addEventListener("log",function(){});var c=function(t){v.current+=1,null==t||t.preventDefault(),b(),t&&v.current>=2&&(e=cO(cO({},e),{},{is_lightspeed:!0})),s.close(),k(e)};s.onmessage=function(t){s.clearTimeout(),E({type:"error"});var n=JSON.parse(t.data),r=n.action,o=Wn(n,iO);switch(r){case"error":s.close(),null!=o&&o.retry&&v.current<2?c():(u(!1),g(!0),requestAnimationFrame(function(){y(cO(cO({},o),{},{handleRetry:c}))}));break;case"updateLog":default:requestAnimationFrame(function(){y(o)});break;case"removeLog":requestAnimationFrame(function(){E(o)});break;case"complete":u(!1),f(o),s.close();break;case"continue":s.close(),k(e);break;case"wait":s.close(),setTimeout(function(){k(e)},5e3);case"eventLog":}"error"!==r&&"complete"!==r&&"downloadComplete"!==r&&s.startTimeout()},s.onerror=function(e){var t;null!==(t=window.templately)&&void 0!==t&&t.log&&console.error("EventSource failed:",e),s.clearTimeout(),s.close(),v.current<2?c():(g(!0),u(!1),requestAnimationFrame(function(){y({type:"error",title:(0,At.__)("Oops!","templately"),message:(0,At.sprintf)((0,At.__)("It seems we're experiencing technical difficulties. Please try again or contact <a href='%s' target='_blank'>support</a>.","templately"),"https://wpdeveloper.com/support"),status:"error",handleRetry:function(e){v.current=0,c(e)}})}))},s.startTimeout=function(e){s.clearTimeout(),l.current=setTimeout(function(){s.close(),v.current<2?c():(g(!0),u(!1),requestAnimationFrame(function(){y({type:"error",title:(0,At.__)("Sorry for the delay!","templately"),message:(0,At.sprintf)((0,At.__)("If it's taking longer than expected, please try again or contact <a href='%s' target='_blank'>support</a>.","templately"),"https://wpdeveloper.com/support"),status:"error",handleRetry:function(e){v.current=0,c(e)}})}))},6e4)},s.clearTimeout=function(e){l.current&&(clearTimeout(l.current),l.current=null)},s.startTimeout()},O=function(){var e=hi(aO().m(function e(t){var n,r,o,i,a,l,s=arguments;return aO().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:null,r=s.length>2&&void 0!==s[2]?s[2]:null,dO=0,g(!1),u(!0),e.p=1,null===(o=window.wp)||void 0===o||null===(o=o.hooks)||void 0===o||!o.applyFilters){e.n=2;break}return e.n=2,window.wp.hooks.applyFilters("templately.fsi.beforeImport",t);case 2:return i=(0,vi.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_settings",nonce:window.templately.nonce}),n&&t.set("process_id",n),r&&t.set("ai_page_ids",JSON.stringify(r)),e.n=3,wa(i,t);case 3:null!=(a=e.v)&&a.success&&k(a.data),e.n=5;break;case 4:e.p=4,l=e.v,console.error("Import start error:",l),u(!1),g(!0),y({type:"error",title:(0,At.__)("Import Error","templately"),message:l.message||(0,At.__)("Failed to start import","templately"),status:"error"});case 5:return e.a(2)}},e,null,[[1,4]])}));return function(_x){return e.apply(this,arguments)}}();return{startImporting:O,steps:n,setSteps:r,removeStep:E,currentStep:i,eventSourceRef:a,isImportRunning:c,isImportComplete:p,updateStep:y,hasError:m}};function mO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return gO(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(gO(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,gO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,gO(d,"constructor",c),gO(c,"constructor",s),s.displayName="GeneratorFunction",gO(c,o,"GeneratorFunction"),gO(d),gO(d,o,"Generator"),gO(d,r,function(){return this}),gO(d,"toString",function(){return"[object Generator]"}),(mO=function(){return{w:i,m:p}})()}function gO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gO=function(e,t,n,r){function i(t,n){gO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},gO(e,t,n,r)}const vO=function(e,t){var n=ce((0,pe.useState)(t),2),r=n[0],o=n[1],i=ce((0,pe.useState)([]),2),a=i[0],l=i[1],s=function(e,t){var n=ce((0,pe.useState)(e),2),r=n[0],o=n[1];return(0,pe.useEffect)(function(){var n=setTimeout(function(){o(e)},t);return function(){clearTimeout(n)}},[e,t]),r}(r,500);return(0,pe.useEffect)(function(){l([{value:"",label:"All"}])},[t]),(0,pe.useEffect)(function(){var t=function(){var t=hi(mO().m(function t(n){var r,o,i;return mO().w(function(t){for(;;)switch(t.n){case 0:if(""!==n){t.n=1;break}return t.a(2);case 1:return t.n=2,fa("/templately/v1/autocomplete-condition",{payload:n,query:null!=e?e:[]});case 2:if(r=t.v,o=r.response,i=r.error,!o){t.n=3;break}return l(o),t.a(2);case 3:i&&l([]);case 4:return t.a(2)}},t)}));return function(_x){return t.apply(this,arguments)}}();t(s)},[s]),[a,o]},yO={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let bO;const wO=new Uint8Array(16);function EO(){if(!bO&&(bO="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bO))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bO(wO)}const kO=[];for(let e=0;e<256;++e)kO.push((e+256).toString(16).slice(1));const OO=function(e,t,n){if(yO.randomUUID&&!t&&!e)return yO.randomUUID();const r=(e=e||{}).random||(e.rng||EO)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return kO[e[t+0]]+kO[e[t+1]]+kO[e[t+2]]+kO[e[t+3]]+"-"+kO[e[t+4]]+kO[e[t+5]]+"-"+kO[e[t+6]]+kO[e[t+7]]+"-"+kO[e[t+8]]+kO[e[t+9]]+"-"+kO[e[t+10]]+kO[e[t+11]]+kO[e[t+12]]+kO[e[t+13]]+kO[e[t+14]]+kO[e[t+15]]}(r)};var SO=function(){return Sd(function e(t){kd(this,e),this.config=t},[{key:"getOptions",value:function(){return this.getSubOptions("general",!0).map(function(e){return{label:e.label,value:e.value}})}},{key:"getSubOptions",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.config[e];return r?[{label:r.plural_label,value:n?e:""}].concat(Nl(r.sub_conditions.map(function(e){var n,r=t.config[e];return null!==(n=r.sub_conditions)&&void 0!==n&&n.length?{label:r.label,value:e,options:t.getSubOptions(e,!0)}:{label:r.label,value:e}}))):[]}},{key:"getSubIdAutocomplete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.config[e];if(!t||"object"!==ne(t.controls))return{};var n=Object.values(t.controls);return null!=n&&n[0]?n[0]:{}}}])}();const xO=SO;function _O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_O(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var DO=he().createContext(),PO=function(e){var t=En(),n=xn(function(e){var t;return null!==(t=e.conditions.conditions)&&void 0!==t?t:[]}),r=new xO(n),o=ce((0,pe.useState)(!1),2),i=o[0],a=o[1],l=function(){var t,n;return 0===(null===(t=e.template)||void 0===t||null===(t=t.conditions)||void 0===t?void 0:t.length)?{}:null===(n=e.template)||void 0===n||null===(n=n.conditions)||void 0===n?void 0:n.reduce(function(e,t){var n=t.type,o=t.name,i=t.sub_name,a=void 0===i?"":i,l=t.sub_id,s=void 0===l?"":l,c=OO(),u={};return a&&(u.subIdAutocomplete=r.getSubIdAutocomplete(a)),CO(CO({},e),{},Pt({},c,CO(CO({},u),{},{id:c,type:n,name:o,sub_name:a,sub_id:s,options:r.getOptions(),subOptions:r.getSubOptions(o)})))},{})},s=ce((0,pe.useState)(l),2),c=s[0],u=s[1];(0,pe.useEffect)(function(){u(l())},[e.template.conditions]),(0,pe.useEffect)(function(){var n=Object.values(c).reduce(function(t,n){var r=[n.type,n.name,n.sub_name,n.sub_id].join("/").replace(/^\/+|\/+$/g,""),o=[].concat(Nl((null==t?void 0:t[e.template.id])||[]),[r]);return CO(CO({},t),{},Pt({},e.template.id,o))},{});t(iv({type:Vr},n))},[c]);var d={conditions:c,updateCondition:function(e,t){u(function(n){var o=n[e];return t.name&&(o.subOptions=r.getSubOptions(t.name)),(t.sub_name||t.name)&&(o.subIdAutocomplete=r.getSubIdAutocomplete(t.sub_name)),CO(CO({},n),{},Pt({},e,CO(CO({},o),t)))})},createCondition:function(e){var t=OO();u(function(e){return CO(CO({},e),{},Pt({},t,{id:t,type:"include",name:"general",sub_name:"",sub_id:"",options:r.getOptions(),subOptions:r.getSubOptions("general",!0),subIdAutocomplete:r.getSubIdAutocomplete("")}))})},removeCondition:function(e){u(function(t){return delete t[e],CO({},t)})},saveConditions:function(){var n;e.template.id&&(a(!0),t((n=e.template.id,{type:Ur,id:n})))},isSaving:i};return he().createElement(DO.Provider,{value:d},e.children)};const AO=function(){return(0,pe.useContext)(DO)};var TO=["key","type"],FO=["type"],MO=["details","fileContents"],IO=["type","saveTemplate"],NO=["type"],jO=["type"],LO=["type","context"],RO=["source","slug"];function BO(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return zO(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(zO(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,zO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,zO(d,"constructor",c),zO(c,"constructor",s),s.displayName="GeneratorFunction",zO(c,o,"GeneratorFunction"),zO(d),zO(d,o,"Generator"),zO(d,r,function(){return this}),zO(d,"toString",function(){return"[object Generator]"}),(BO=function(){return{w:i,m:p}})()}function zO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}zO=function(e,t,n,r){function i(t,n){zO(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},zO(e,t,n,r)}var WO=BO().m(GO),UO=BO().m(KO);function VO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GO(e){var t,n,r,o,i,a,l;return BO().w(function(s){for(;;)switch(s.n){case 0:return t=e.key,e.type,n=Wn(e,TO),r=(null==n?void 0:n.search)||null,s.n=1,rw(function(e){return e.general.platform});case 1:if(o=s.v,null!=(null==n?void 0:n.refresh)){s.n=2;break}return s.n=2,Zb({type:Bo.REQUESTED,platform:o});case 2:return s.n=3,fa("/templately/v1/clouds",HO({platform:o,type:t},n));case 3:if(i=s.v,a=i.response,l=i.error,!0!==(null==a?void 0:a.redirect)){s.n=4;break}return s.n=4,Zb(yv(a));case 4:if(!a){s.n=6;break}if(null==a||!a.files){s.n=5;break}return s.n=5,Zb(Iv({data:a.files.data,platform:o,currentPage:a.files.current_page,totalPage:a.files.total_page,search:r}));case 5:if(void 0!==(null==a?void 0:a.files)){s.n=6;break}return s.n=6,Zb(Iv({data:[],platform:o,currentPage:1,totalPage:0,search:r}));case 6:if(!l){s.n=7;break}return s.n=7,Zb(Nv(l));case 7:return s.a(2)}},WO)}function qO(e){e.type;var t=Wn(e,FO);return BO().m(function e(){var n,r,o,i,a,l,s;return BO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.details,r=t.fileContents,o=Wn(t,MO),e.n=1,ha("/templately/v1/clouds/copy-move",o);case 1:if(i=e.v,a=i.response,i.error,Sl.hideLoading(),l=n.label,s=n.slug,"success"!=a.status){e.n=5;break}if("copy"!==t.action){e.n=3;break}return e.n=2,Zb(Bv(HO(HO({},r),{},{slug:s})));case 2:e.n=4;break;case 3:if("move"!==t.action){e.n=4;break}return e.n=4,Zb(Wv(HO(HO({},r),{},{slug:s})));case 4:"copy"===t.action?Sl.close({isCopied:!0,contentArgs:{title:l}}):"move"===t.action&&Sl.close({isMoved:!0,contentArgs:{title:l}}),e.n=6;break;case 5:"error"==a.status&&("copy"===t.action?Sl.close({isCopied:!1,contentArgs:{title:l,message:a.message}}):"move"===t.action&&Sl.close({isMoved:!1,contentArgs:{title:l,message:a.message}}));case 6:e.n=8;break;case 7:e.p=7,e.v;case 8:return e.a(2)}},e,null,[[0,7]])})()}function QO(e){e.type;var t=e.saveTemplate,n=Wn(e,IO);return BO().m(function e(){var r,o,i,a,l,s,c,u;return BO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){return{platform:e.general.platform}});case 1:return r=e.v,o=r.platform,e.n=2,ha("/templately/v1/clouds/upload",HO(HO({},n),{},{platform:o}));case 2:if(i=e.v,a=i.response,l=i.error,!t){e.n=6;break}if(!a){e.n=5;break}if("success"!==(null==a?void 0:a.status)){e.n=4;break}return s=n.workspace,c=n.workspace_id,e.n=3,Zb(Gv(HO({refresh:!0,redirect:c>0?s.shared?"clouds/shared-workspace/".concat(s.slug):"clouds/workspace/".concat(s.slug):"clouds"},a)));case 3:e.n=5;break;case 4:return e.n=5,Zb(qv(a));case 5:if(!l){e.n=6;break}return e.n=6,Zb(qv(l));case 6:if(t){e.n=12;break}if(!a){e.n=11;break}if("success"!==(null==a?void 0:a.status)){e.n=9;break}return e.n=7,Zb(HO({type:"CLOUDS_PUSHED"},n));case 7:return e.n=8,Zb(Mv({refresh:!0,search:null}));case 8:Sl.close({isPushed:!0,contentArgs:{title:"Successfully Pushed!",message:null==a?void 0:a.message}}),e.n=10;break;case 9:Sl.close({isPushed:!1,contentArgs:{title:"Something went wrong!",message:null==a?void 0:a.message}});case 10:e.n=12;break;case 11:l&&Sl.close({isPushed:!1,contentArgs:{title:"Something went wrong!",message:null==l?void 0:l.message}});case 12:e.n=14;break;case 13:e.p=13,u=e.v,console.error("C503",u);case 14:return e.a(2)}},e,null,[[0,13]])})()}function $O(e){e.type;var t=Wn(e,NO);return BO().m(function e(){var n,r,o,i;return BO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/clouds/download/".concat(null==t?void 0:t.id),t);case 1:n=e.v,r=n.response,n.error,r&&"success"===(null==r?void 0:r.status)?((o=document.createElement("a")).setAttribute("download",null==r?void 0:r.file_name),o.href=null==r?void 0:r.fileURL,o.click(),o.remove(),Sl.close({isDownloaded:!0})):Sl.close({isDownloaded:!1}),e.n=3;break;case 2:e.p=2,i=e.v,console.error("C501","Downloading Error: ",i);case 3:return e.a(2)}},e,null,[[0,2]])})()}function YO(e){e.type;var t=Wn(e,jO);return BO().m(function e(){var n,r,o,i,a,l,s,c;return BO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.id,r=t.source,o=void 0===r?"cloud":r,i=t.slug,e.n=1,fa("cloud"===o?"/templately/v1/clouds/delete/".concat(n):"/templately/v1/workspaces/item/delete/".concat(n));case 1:if(a=e.v,l=a.response,s=a.error,!l||"success"!==(null==l?void 0:l.status)){e.n=5;break}if("cloud"!==o){e.n=3;break}return e.n=2,Zb(Mv({refresh:!0,search:null}));case 2:e.n=4;break;case 3:if("workspace"!==o&&"sharedWorkspace"!==o){e.n=4;break}return e.n=4,Zb(fy({refresh:!0,slug:i}));case 4:Sl.hideLoading(),Sl.close({isDeleted:!0}),e.n=6;break;case 5:Sl.close({isDeleted:!1});case 6:s&&console.error("Error C501: ",s),e.n=8;break;case 7:e.p=7,c=e.v,console.error("Error C501: ",c);case 8:return e.a(2)}},e,null,[[0,7]])})()}function XO(e){e.type;var t=e.context,n=void 0===t?"modal":t,r=Wn(e,LO);return BO().m(function e(){var t,o,i,a,l,s,c,u,d,p,f,h,m,g;return BO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=r.source,o=void 0===t?"clouds":t,i=r.slug,a=Wn(r,RO),e.n=1,fa("clouds"===o?"/templately/v1/clouds":"/templately/v1/workspaces/".concat(i),a);case 1:if(l=e.v,s=l.response,c=l.error,!s){e.n=2;break}return e.n=2,Zb(Xv({keyword:null==a?void 0:a.search,context:n,source:o,data:null!==(u=null===(d=s.files)||void 0===d?void 0:d.data)&&void 0!==u?u:[],totalPage:null!==(p=null===(f=s.files)||void 0===f?void 0:f.total_page)&&void 0!==p?p:1,currentPage:null!==(h=null===(m=s.files)||void 0===m?void 0:m.current_page)&&void 0!==h?h:1}));case 2:c&&console.error("Error S100: ",c),e.n=4;break;case 3:e.p=3,g=e.v,console.error("Error S100: ",g);case 4:return e.a(2)}},e,null,[[0,3]])})()}function KO(){return BO().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Bo.LOAD,GO);case 1:return e.n=2,Yw(Bo.COPY,qO);case 2:return e.n=3,Yw(Bo.MOVE,qO);case 3:return e.n=4,Yw(Bo.PUSH,QO);case 4:return e.n=5,Yw(Bo.DOWNLOAD,$O);case 5:return e.n=6,Yw(Bo.DELETE,YO);case 6:return e.n=7,Yw(Bo.SEARCH,XO);case 7:return e.n=8,Yw(zo.SEARCH,XO);case 8:return e.n=9,Yw(Wo.SEARCH,XO);case 9:return e.n=10,Yw(Uo.SEARCH,XO);case 10:return e.a(2)}},UO)}var ZO=["type"],JO=["shared","key","page"],eS=tS().m(aS);function tS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return nS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(nS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,nS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,nS(d,"constructor",c),nS(c,"constructor",s),s.displayName="GeneratorFunction",nS(c,o,"GeneratorFunction"),nS(d),nS(d,o,"Generator"),nS(d,r,function(){return this}),nS(d,"toString",function(){return"[object Generator]"}),(tS=function(){return{w:i,m:p}})()}function nS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nS=function(e,t,n,r){function i(t,n){nS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},nS(e,t,n,r)}function rS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rS(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iS(e){var t=e.type,n=Wn(e,ZO);return tS().m(function e(){var r,o,i,a,l,s,c,u,d,p;return tS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,r=n.shared,o=void 0!==r&&r,n.key,n.page,Wn(n,JO),e.n=1,rw(function(e){return{plan:e.general.plan,platform:e.general.platform}});case 1:if(i=e.v,a=i.plan,l=i.platform,t!==zo.LOAD&&t!==Wo.LOAD){e.n=2;break}return e.n=2,Zb({type:o?Wo.REQUESTED:zo.REQUESTED,platform:l,plan:a});case 2:return e.n=3,fa("/templately/v1/workspaces",oS({},n));case 3:if(s=e.v,c=s.response,u=s.error,!c){e.n=8;break}d=t,e.n=d===zo.LOAD_LISTS||d===Wo.LOAD_LISTS?4:d===zo.LOAD||d===Wo.LOAD?6:8;break;case 4:return e.n=5,Zb(ty({payload:c.data,shared:n.shared}));case 5:return e.a(3,8);case 6:return e.n=7,Zb(ny({data:c.data,shared:n.shared,currentPage:c.current_page,totalPage:c.total_page}));case 7:return e.a(3,8);case 8:if(!u){e.n=9;break}return console.error("Error W100: ",u),e.n=9,Zb(ry({shared:o,error:u}));case 9:e.n=11;break;case 10:e.p=10,p=e.v,console.error("Error W100: ",p);case 11:return e.a(2)}},e,null,[[0,10]])})()}function aS(){return tS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(zo.LOAD,iS);case 1:return e.n=2,Yw(Wo.LOAD,iS);case 2:return e.n=3,Yw(zo.LOAD_LISTS,iS);case 3:return e.n=4,Yw(Wo.LOAD_LISTS,iS);case 4:return e.a(2)}},eS)}var lS=["type"],sS=cS().m(hS);function cS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return uS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(uS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,uS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,uS(d,"constructor",c),uS(c,"constructor",s),s.displayName="GeneratorFunction",uS(c,o,"GeneratorFunction"),uS(d),uS(d,o,"Generator"),uS(d,r,function(){return this}),uS(d,"toString",function(){return"[object Generator]"}),(cS=function(){return{w:i,m:p}})()}function uS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}uS=function(e,t,n,r){function i(t,n){uS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},uS(e,t,n,r)}function dS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dS(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fS(e){e.type;var t=Wn(e,lS);return cS().m(function e(){var n,r,o,i,a,l,s;return cS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/workspaces/create",pS(pS({},t),{},{isCreate:!0}));case 1:if(n=e.v,r=n.response,o=n.error,Sl.hideLoading(),"success"!==(null==r?void 0:r.status)){e.n=3;break}return e.n=2,Zb(iy(pS({},null==r?void 0:r.workspace)));case 2:Sl.close({isCreated:!0,contentArgs:{title:null!==(i=null==t?void 0:t.title)&&void 0!==i?i:""}}),e.n=4;break;case 3:Sl.close({isCreated:!1,message:null!==(a=null!==(l=null==r?void 0:r.message)&&void 0!==l?l:null==o?void 0:o.message)&&void 0!==a?a:null});case 4:o&&console.error("Errro W101: ",o),e.n=6;break;case 5:e.p=5,s=e.v,console.error("Errro W101: ",s);case 6:return e.a(2)}},e,null,[[0,5]])})()}function hS(){return cS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(zo.CREATE,fS);case 1:return e.a(2)}},sS)}var mS=["type"],gS=["key","shared","refresh"],vS=["type"],yS=bS().m(xS);function bS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return wS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(wS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,wS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,wS(d,"constructor",c),wS(c,"constructor",s),s.displayName="GeneratorFunction",wS(c,o,"GeneratorFunction"),wS(d),wS(d,o,"Generator"),wS(d,r,function(){return this}),wS(d,"toString",function(){return"[object Generator]"}),(bS=function(){return{w:i,m:p}})()}function wS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}wS=function(e,t,n,r){function i(t,n){wS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},wS(e,t,n,r)}function ES(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ES(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ES(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OS(e){e.type;var t=Wn(e,mS);return bS().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return bS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t.key,t.shared,n=t.refresh,r=void 0!==n&&n,o=Wn(t,gS),i=o.slug,o.platform,e.n=1,rw(function(e){var t,n;return{platform:e.general.platform,data:null!==(t=null===(n=e.workspaceDetails)||void 0===n?void 0:n[i])&&void 0!==t?t:null}});case 1:return a=e.v,l=a.platform,s=a.data,e.n=2,tw(fa,"/templately/v1/workspaces/"+i,kS({file_type:l},o));case 2:if(c=e.v,u=c.response,d=c.error,!u){e.n=3;break}return e.n=3,Zb(dy(kS(kS({slug:i,platform:l,refresh:r},u),s)));case 3:if(!d){e.n=4;break}return console.error("Error W104: ",d),e.n=4,Zb(my(kS({},d)));case 4:e.n=6;break;case 5:return e.p=5,p=e.v,console.error("Error W104: ",p),e.n=6,Zb(my(p));case 6:return e.a(2)}},e,null,[[0,5]])})()}function SS(e){e.type;var t=Wn(e,vS);return bS().m(function e(){var n,r,o,i,a,l,s;return bS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.workspace_id,r=t.files,o=t.slug,e.n=1,ha("/templately/v1/workspaces/item/add",{workspace_id:n,files:r});case 1:if(i=e.v,a=i.response,l=i.error,!a){e.n=4;break}if("success"!==(null==a?void 0:a.status)){e.n=3;break}return Sl.close({isAdded:!0}),e.n=2,Zb(fy({slug:o,refresh:!0}));case 2:e.n=4;break;case 3:Sl.close({isAdded:!1});case 4:l&&console.error("Error W105: ",l),e.n=6;break;case 5:e.p=5,s=e.v,console.error("Error W105: ",s);case 6:return e.a(2)}},e,null,[[0,5]])})()}function xS(){return bS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Uo.LOAD,OS);case 1:return e.n=2,Yw(Uo.ADD_FILE,SS);case 2:return e.a(2)}},yS)}var _S=["type"],CS=["type"],DS=PS().m(MS);function PS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return AS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(AS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,AS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,AS(d,"constructor",c),AS(c,"constructor",s),s.displayName="GeneratorFunction",AS(c,o,"GeneratorFunction"),AS(d),AS(d,o,"Generator"),AS(d,r,function(){return this}),AS(d,"toString",function(){return"[object Generator]"}),(PS=function(){return{w:i,m:p}})()}function AS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}AS=function(e,t,n,r){function i(t,n){AS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},AS(e,t,n,r)}function TS(e){e.type;var t=Wn(e,_S);return PS().m(function e(){var n,r,o,i,a,l,s;return PS().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=t.platform,i=t.slug,a=t.files,t.shared,void 0===(l=t.refresh)||!l){e.n=1;break}return e.n=1,Zb(Hv({}));case 1:return e.n=2,Zb(hy({slug:i,platform:o,data:null!==(n=null==a?void 0:a.data)&&void 0!==n?n:[],currentPage:null!==(r=null==a?void 0:a.current_page)&&void 0!==r?r:1,totalPage:null==a?void 0:a.total_page}));case 2:e.n=4;break;case 3:e.p=3,s=e.v,console.error("Error W106: ",s);case 4:return e.a(2)}},e,null,[[0,3]])})()}function FS(e){e.type;var t=Wn(e,CS);return PS().m(function e(){var n,r,o,i,a,l,s,c,u,d,p,f,h,m;return PS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.slug,r=t.shared,o=void 0!==r&&r,i=t.page,a=t.refresh,l=void 0!==a&&a,e.n=1,rw(function(e){return e.general.platform});case 1:if(s=e.v,!l){e.n=2;break}return e.n=2,Zb({type:Uo.GET_FILES_REQUESTED});case 2:return e.n=3,fa("/templately/v1/workspaces/"+n,{file_type:s,shared:o,page:i,directLoad:!1});case 3:if(c=e.v,u=c.response,c.error,!u){e.n=4;break}return h=u.files,e.n=4,Zb(hy({slug:n,platform:s,data:null!==(d=null==h?void 0:h.data)&&void 0!==d?d:[],currentPage:null!==(p=null==h?void 0:h.current_page)&&void 0!==p?p:1,totalPage:null!==(f=null==h?void 0:h.total_page)&&void 0!==f?f:1}));case 4:e.n=6;break;case 5:e.p=5,m=e.v,console.error("Error W107: ",m);case 6:return e.a(2)}},e,null,[[0,5]])})()}function MS(){return PS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Uo.LOAD_SUCCESS,TS);case 1:return e.n=2,Yw(Uo.SET,FS);case 2:return e.n=3,Yw(Uo.GET_FILES,FS);case 3:return e.a(2)}},DS)}function IS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return NS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(NS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,NS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,NS(d,"constructor",c),NS(c,"constructor",s),s.displayName="GeneratorFunction",NS(c,o,"GeneratorFunction"),NS(d),NS(d,o,"Generator"),NS(d,r,function(){return this}),NS(d,"toString",function(){return"[object Generator]"}),(IS=function(){return{w:i,m:p}})()}function NS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}NS=function(e,t,n,r){function i(t,n){NS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},NS(e,t,n,r)}var jS=IS().m(WS),LS=IS().m(US),RS=IS().m(VS);function BS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BS(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WS(e){var t,n,r,o,i,a,l;return IS().w(function(s){for(;;)switch(s.p=s.n){case 0:return t=e.id,n=e.page,r=e.slug,s.p=1,s.n=2,ha("/templately/v1/workspaces/delete/"+t,zS({},e));case 2:if(o=s.v,i=o.response,a=o.error,Sl.hideLoading(),"success"!==i.status){s.n=4;break}return s.n=3,Zb(ly({id:t,slug:r,page:n}));case 3:Sl.close({isDeleted:!0}),s.n=5;break;case 4:throw Sl.close({isDeleted:!1}),new Error(i.message);case 5:a&&console.error("Error W103: ",a),s.n=7;break;case 6:s.p=6,l=s.v,console.error("Error W103: ",l);case 7:return s.a(2)}},jS,null,[[1,6]])}function US(e){var t,n;return IS().w(function(r){for(;;)switch(r.n){case 0:if(!e.id){r.n=1;break}return t=e.id,n=e.slug,r.n=1,Zb(py({id:t,slug:n}));case 1:return r.a(2)}},LS)}function VS(){return IS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(zo.DELETE,WS);case 1:return e.n=2,$w(zo.DELETE_SUCCESS,US);case 2:return e.a(2)}},RS)}function HS(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return GS(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(GS(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,GS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,GS(d,"constructor",c),GS(c,"constructor",s),s.displayName="GeneratorFunction",GS(c,o,"GeneratorFunction"),GS(d),GS(d,o,"Generator"),GS(d,r,function(){return this}),GS(d,"toString",function(){return"[object Generator]"}),(HS=function(){return{w:i,m:p}})()}function GS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}GS=function(e,t,n,r){function i(t,n){GS(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},GS(e,t,n,r)}var qS=HS().m(XS),QS=HS().m(KS);function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XS(e){var t,n,r,o,i,a,l,s,c;return HS().w(function(u){for(;;)switch(u.p=u.n){case 0:return t=e.slug,u.p=1,u.n=2,rw(function(e){return{platform:e.general.platform}});case 2:return n=u.v,r=n.platform,u.n=3,ha("/templately/v1/workspaces/"+t,YS(YS({},e),{},{platform:r}));case 3:if(o=u.v,i=o.response,a=o.error,Sl.hideLoading(),"success"!==(null==i?void 0:i.status)){u.n=5;break}return u.n=4,Zb(cy(YS({slug:t,platform:r},null==i?void 0:i.workspace)));case 4:Sl.close({isSaved:!0}),u.n=6;break;case 5:throw Sl.close({isSaved:!1,message:null!==(l=null!==(s=null==i?void 0:i.message)&&void 0!==s?s:null==a?void 0:a.message)&&void 0!==l?l:null}),new Error(i.message);case 6:a&&console.error("Error W102: ",a),u.n=8;break;case 7:u.p=7,c=u.v,console.error("Error W102: ",c);case 8:return u.a(2)}},qS,null,[[1,7]])}function KS(){return HS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(zo.SAVE,XS);case 1:return e.a(2)}},QS)}var ZS=["type"],JS=ex().m(rx);function ex(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return tx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(tx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,tx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,tx(d,"constructor",c),tx(c,"constructor",s),s.displayName="GeneratorFunction",tx(c,o,"GeneratorFunction"),tx(d),tx(d,o,"Generator"),tx(d,r,function(){return this}),tx(d,"toString",function(){return"[object Generator]"}),(ex=function(){return{w:i,m:p}})()}function tx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}tx=function(e,t,n,r){function i(t,n){tx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},tx(e,t,n,r)}function nx(e){e.type;var t=Wn(e,ZS);return ex().m(function e(){var n,r,o;return ex().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/items-count",t);case 1:if(n=e.v,r=n.response,n.error,!r){e.n=2;break}return e.n=2,Zb(vv(r));case 2:e.n=4;break;case 3:e.p=3,o=e.v,console.error("Items Count: ",o);case 4:return e.a(2)}},e,null,[[0,3]])})()}function rx(){return ex().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(ja(ko,"PAGES"),nx);case 1:return e.n=2,Yw(ja(ko,"SECTIONS"),nx);case 2:return e.n=3,Yw(ja(ko,"PACKS"),nx);case 3:return e.n=4,Yw(ja(vo,"PAGES"),nx);case 4:return e.n=5,Yw(ja(vo,"SECTIONS"),nx);case 5:return e.n=6,Yw(ja(vo,"PACKS"),nx);case 6:return e.a(2)}},JS)}var ox=["type","key","slug"],ix=["type"],ax=lx().m(px);function lx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return sx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(sx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,sx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,sx(d,"constructor",c),sx(c,"constructor",s),s.displayName="GeneratorFunction",sx(c,o,"GeneratorFunction"),sx(d),sx(d,o,"Generator"),sx(d,r,function(){return this}),sx(d,"toString",function(){return"[object Generator]"}),(lx=function(){return{w:i,m:p}})()}function sx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}sx=function(e,t,n,r){function i(t,n){sx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},sx(e,t,n,r)}function cx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ux(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cx(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dx(e){e.type;var t=e.key,n=e.slug,r=Wn(e,ox);return lx().m(function e(){var o,i,a,l,s,c,u,d,p;return lx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,rw(function(e){return{plan:e.general.plan,platform:e.general.platform}});case 1:return o=e.v,i=o.plan,a=o.platform,e.n=2,fa("/templately/v1/items/"+n,ux({plan:i,platform:a,type:t},r));case 2:if(l=e.v,s=l.response,c=l.error,!s){e.n=3;break}return u=s.type,d=Wn(s,ix),e.n=3,Zb(Ov(ux(ux({},d),{},{itemType:u,key:t,platform:a})));case 3:if(!c){e.n=4;break}return console.error("Error ID001: ",c),e.n=4,Zb(Sv(ux(ux({},c),{},{platform:a,key:t})));case 4:e.n=6;break;case 5:return e.p=5,p=e.v,console.error("Error ID002: ",p),e.n=6,Zb(Sv(p));case 6:return e.a(2)}},e,null,[[0,5]])})()}function px(){return lx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(ja(ko,"PAGES"),dx);case 1:return e.n=2,Yw(ja(ko,"SECTIONS"),dx);case 2:return e.n=3,Yw(ja(ko,"PACKS"),dx);case 3:return e.a(2)}},ax)}var fx=["key","type","isFilterableQuery","prevFilterableQuery"];function hx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return mx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(mx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,mx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,mx(d,"constructor",c),mx(c,"constructor",s),s.displayName="GeneratorFunction",mx(c,o,"GeneratorFunction"),mx(d),mx(d,o,"Generator"),mx(d,r,function(){return this}),mx(d,"toString",function(){return"[object Generator]"}),(hx=function(){return{w:i,m:p}})()}function mx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}mx=function(e,t,n,r){function i(t,n){mx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},mx(e,t,n,r)}var gx=hx().m(Ex),vx=hx().m(kx),yx=hx().m(Ox);function bx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bx(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ex(e){var t,n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y;return hx().w(function(b){for(;;)switch(b.p=b.n){case 0:return b.p=0,t=e.key,e.type,n=e.isFilterableQuery,e.prevFilterableQuery,r=Wn(e,fx),o=!1,b.n=1,rw(function(e){var n,o=e.general.plan,i=e.general.platform,a=null!==(n=null==r?void 0:r.page)&&void 0!==n?n:1,l=e.general.filter.prevQuery,s=e.general.filter.doQuery,c=[t,o,i,a];return s||null!=(null==r?void 0:r.search)||c.push(a),s&&s===l&&(c=c.concat(["filteredResults",a])),null!==(null==r?void 0:r.search)&&(c=c.concat(["search",a])),{items:La(e,c,[]),isNewQuery:s!==l,plan:e.general.plan,platform:e.general.platform,prevSearch:e.general.filter.prevSearch}});case 1:if(i=b.v,a=i.plan,l=i.platform,s=i.items,c=i.isNewQuery,u=i.prevSearch,!((null==s?void 0:s.length)>0)||c){b.n=3;break}return b.n=2,Zb({type:ja(bo,t),data:s,currentPage:null!==(d=null==r?void 0:r.page)&&void 0!==d?d:1,platform:l,plan:a});case 2:return b.a(2);case 3:return b.n=4,Zb({type:ja(vo,t),platform:l,plan:a});case 4:if(u===(null==r?void 0:r.search)){b.n=5;break}return o=!0,b.n=5,Zb(lv({key:"prevSearch",data:null==r?void 0:r.search}));case 5:return b.n=6,fa("/templately/v1/items",wx({plan:a,platform:l,include_search:o,type:t},r));case 6:if(p=b.v,f=p.response,h=p.error,!f){b.n=7;break}return b.n=7,Zb({type:ja(bo,t),data:(null===(m=f.data)||void 0===m?void 0:m.length)>0?f.data:"empty",totalPage:null!==(g=null==f?void 0:f.total_page)&&void 0!==g?g:0,currentPage:null!==(v=null==f?void 0:f.current_page)&&void 0!==v?v:1,platform:l,plan:a,isFilterableQuery:n,search:null==r?void 0:r.search});case 7:if(!h){b.n=8;break}return b.n=8,Zb({type:ja(wo,t),error:h,isFilterableQuery:n,search:null==r?void 0:r.search});case 8:b.n=10;break;case 9:b.p=9,y=b.v,console.error("ID003: ",y);case 10:return b.a(2)}},gx,null,[[0,9]])}function kx(){return hx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(ja(yo,"PAGES"),Ex);case 1:return e.n=2,Yw(ja(yo,"SECTIONS"),Ex);case 2:return e.n=3,Yw(ja(yo,"PACKS"),Ex);case 3:return e.a(2)}},vx)}function Ox(){return hx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jb([kx()]);case 1:return e.a(2)}},yx)}var Sx=["type"],xx=Cx().m(Ax);function Cx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Dx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Dx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Dx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Dx(d,"constructor",c),Dx(c,"constructor",s),s.displayName="GeneratorFunction",Dx(c,o,"GeneratorFunction"),Dx(d),Dx(d,o,"Generator"),Dx(d,r,function(){return this}),Dx(d,"toString",function(){return"[object Generator]"}),(Cx=function(){return{w:i,m:p}})()}function Dx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Dx=function(e,t,n,r){function i(t,n){Dx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Dx(e,t,n,r)}function Px(e){e.type;var t=Wn(e,Sx);return Cx().m(function e(){var n,r,o,i,a,l,s,c;return Cx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/featured-items",t);case 1:if(o=e.v,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.n=2;break}return e.n=2,Zb(xv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.n=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.n=5;break;case 4:return e.p=4,c=e.v,e.n=5,Zb(_v(c));case 5:return e.a(2)}},e,null,[[0,4]])})()}function Ax(){return Cx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(xo,Px);case 1:return e.a(2)}},xx)}var Tx=["type"],Fx=Mx().m(jx);function Mx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Ix(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ix(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ix(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Ix(d,"constructor",c),Ix(c,"constructor",s),s.displayName="GeneratorFunction",Ix(c,o,"GeneratorFunction"),Ix(d),Ix(d,o,"Generator"),Ix(d,r,function(){return this}),Ix(d,"toString",function(){return"[object Generator]"}),(Mx=function(){return{w:i,m:p}})()}function Ix(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ix=function(e,t,n,r){function i(t,n){Ix(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Ix(e,t,n,r)}function Nx(e){e.type;var t=Wn(e,Tx);return Mx().m(function e(){var n,r,o,i,a,l,s,c;return Mx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/related-items",t);case 1:if(o=e.v,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.n=2;break}return e.n=2,Zb(Pv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.n=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.n=5;break;case 4:return e.p=4,c=e.v,e.n=5,Zb(Av(c));case 5:return e.a(2)}},e,null,[[0,4]])})()}function jx(){return Mx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(To,Nx);case 1:return e.a(2)}},Fx)}var Lx=["type"],Rx=Bx().m(Ux);function Bx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return zx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(zx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,zx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,zx(d,"constructor",c),zx(c,"constructor",s),s.displayName="GeneratorFunction",zx(c,o,"GeneratorFunction"),zx(d),zx(d,o,"Generator"),zx(d,r,function(){return this}),zx(d,"toString",function(){return"[object Generator]"}),(Bx=function(){return{w:i,m:p}})()}function zx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}zx=function(e,t,n,r){function i(t,n){zx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},zx(e,t,n,r)}function Wx(e){e.type;var t=Wn(e,Lx);return Bx().m(function e(){var n,r,o,i,a,l,s,c;return Bx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fa("/templately/v1/trending-items",t);case 1:if(o=e.v,i=o.response,a=o.error,!(i&&null!=i&&i.data&&(null===(n=i.data)||void 0===n?void 0:n.length)>0)){e.n=2;break}return e.n=2,Zb(Cv({items:i.data}));case 2:if(!a&&null!=i&&i.data&&0!=(null==i||null===(r=i.data)||void 0===r?void 0:r.length)){e.n=3;break}throw{code:null!==(l=null==a?void 0:a.code)&&void 0!==l?l:"templately_api_error",message:null!==(s=null==a?void 0:a.message)&&void 0!==s?s:"Something went wrong."};case 3:e.n=5;break;case 4:return e.p=4,c=e.v,e.n=5,Zb(Dv(c));case 5:return e.a(2)}},e,null,[[0,4]])})()}function Ux(){return Bx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Yw(Do,Wx);case 1:return e.a(2)}},Rx)}function Vx(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Hx(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Hx(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Hx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Hx(d,"constructor",c),Hx(c,"constructor",s),s.displayName="GeneratorFunction",Hx(c,o,"GeneratorFunction"),Hx(d),Hx(d,o,"Generator"),Hx(d,r,function(){return this}),Hx(d,"toString",function(){return"[object Generator]"}),(Vx=function(){return{w:i,m:p}})()}function Hx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Hx=function(e,t,n,r){function i(t,n){Hx(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Hx(e,t,n,r)}var Gx=Vx().m(qx);function qx(){return Vx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jb([nw(YE),nw(LE),nw(lk),nw(mk),nw(Ck),nw(Kk),nw(rx),nw(Ox),nw(Ax),nw(Ux),nw(jx),nw(Mk),nw(Bk),nw(px),nw(tk),nw(EE),nw(tE),nw(lE),nw(fE),nw(rO),nw(KO),nw(aS),nw(hS),nw(xS),nw(MS),nw(VS),nw(KS)]);case 1:return e.a(2)}},Gx)}const Qx=qx;var $x=function(){var e,t={},n=t.context,r=void 0===n?{}:n,o=t.channel,i=void 0===o?ww():o,a=t.sagaMonitor,l=Rt(t,Bw);function s(t){var n=t.getState,o=t.dispatch;return e=Rw.bind(null,re({},l,{context:r,channel:i,dispatch:o,getState:n,sagaMonitor:a})),function(e){return function(t){a&&a.actionDispatched&&a.actionDispatched(t);var n=e(t);return i.put(t),n}}}return s.run=function(){return e.apply(void 0,arguments)},s.setContext=function(e){Pb(r,e)},s}(),Yx=null;Yx=function(e,t){var n=wu(),r=Ml(Il(n),{},t);return r.asyncReducers=null!=n?n:{},r.attachReducer=function(e,t){r.asyncReducers[e]=t,r.replaceReducer(Il(wu(r.asyncReducers)))},r}(0,function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Dl(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},l=e.map(e=>e(a));return i=function(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}(...l)(o.dispatch),{...o,dispatch:i}}}(Ww,$x)),$x.run(Qx),Yx.attachReducer("sections",gu("SECTIONS")),Yx.attachReducer("packs",gu("PACKS")),Yx.attachReducer("pages",gu("PAGES"));var Xx=["to","query","ignoreKeys","icon","isActive","children","label","hasDropdown","aria-current"],Kx=function(e){var t=e.to,n=e.query,r=e.ignoreKeys,o=void 0===r?[]:r,i=e.icon,a=void 0!==i&&i,l=e.isActive,s=e.children,c=void 0===s?"":s,u=e.label,d=void 0===u?"":u,p=e.hasDropdown,f=void 0!==p&&p,h=e["aria-current"],m=void 0===h?"page":h,g=Wn(e,Xx),v=l?m:void 0;return he().createElement(St,re({},g,{"aria-current":v,to:nb(t,n,o)}),he().isValidElement(a)?he().createElement("i",null,a):null,"function"==typeof c?c({isActive:l}):c,"function"==typeof d?d({isActive:l}):d,f&&he().createElement("span",{className:"tn-dropdown-icon"},l?he().createElement(Kn,null):he().createElement($n,null)))};Kx.displayName="NavLink";const Zx=Kx;var Jx=["caseSensitive","end","style","className","activeItemClassName","dropdown","list"],e_=he().forwardRef(function(e,t){e.caseSensitive;var n,r=e.end,o=void 0!==r&&r,i=e.style,a=e.className,l=void 0===a?"":a,s=e.activeItemClassName,c=void 0===s?"active":s,u=e.dropdown,d=e.list,p=void 0===d||d,f=Wn(e,Jx),h=null!=u,m=tt(),g=at(e.to),v=m.pathname,y=g.pathname,b=v===y||!o&&v.startsWith(y)&&"/"===v.charAt(y.length);n="function"==typeof l?l({isActive:b,toPathname:y,locationPathname:v}):[l,b?c:null].filter(Boolean).join(" ");var w="function"==typeof i?i({isActive:b}):i,E=Vn()("tn-item",n,{"tn-item-has-dropdown":h,"templately-nav-link":!p});return p?he().createElement("li",{className:E,ref:t,style:w},he().createElement(Zx,re({},f,{isActive:b,hasDropdown:h})),u&&u.length>0&&he().createElement(r_,{dropdown:!0,className:b?"dropdown-active":"",activeItemClassName:"dropdown-nav-active",routes:u})):he().createElement(Zx,re({},f,{ref:t,style:w,className:E,isActive:b}))});e_.displayName="NavItem";const t_=e_;var n_=["element"];const r_=function(e){var t=e.routes,n=e.ulClasses,r=void 0===n?"":n,o=e.liClasses,i=void 0===o?"":o,a=e.sidebar,l=void 0!==a&&a,s=e.className,c=void 0===s?"":s,u=e.activeItemClassName,d=void 0===u?"active":u,p=e.dropdown,f=void 0!==p&&p,h=Vn()("templately-nav-wrapper",c,{"templately-nav-sidebar":l,"templately-nav-dropdown":f});return he().createElement("div",{className:h},he().createElement("ul",{className:r},t.map(function(e){e.element;var t=Wn(e,n_);return he().createElement(t_,re({key:t.to,className:i,activeItemClassName:d},t))})))},o_=function(e){var t=Vn()("templately-table",e.className,"tt-view-".concat(e.view));return he().createElement("div",{className:t},"grid"!=e.view&&(null==e?void 0:e.head)&&("function"==typeof e.head?e.head():e.head),e.children)},i_=function(e){var t;return he().createElement("div",{className:"templately-table-row ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)};var a_=[{name:"Name",id:"name"},[{name:"Last Modified",id:"last_modified"},{name:"Action",id:"action"}]];const l_=function(e){var t=e.columns,n=void 0===t?a_:t;return he().createElement(i_,{className:"templately-table-head"},n.map(function(e,t){return Array.isArray(e)?he().createElement(u_,{key:e.id+"-"+t},he().createElement(i_,null,e.map(function(e,t){return he().createElement(u_,{key:e.id+"-"+t},he().createElement("p",null,e.name))}))):he().createElement(u_,{key:e.id+"-"+t},he().createElement("p",null,e.name))}))};var s_=["data","className","view"];const c_=function(e){var t=e.data,n=e.className,r=e.view,o=Wn(e,s_),i=Vn()("templately-table-body",n,"tt-view-".concat(r));return he().createElement("div",re({},o,{className:i}),t.map(function(e,t){return he().createElement(i_,{key:Math.random()*t},e.map(function(e,t){return Array.isArray(e)?he().createElement(u_,{key:"".concat(e.id,"-").concat(t)},he().createElement(i_,null,e.map(function(e,t){return he().createElement(u_,{key:"".concat(e.id,"-").concat(t)},he().isValidElement(e.data)?e.data:he().createElement("p",null,e.data))}))):he().createElement(u_,{key:"".concat(e.id,"-").concat(t)},he().isValidElement(e.data)?e.data:he().createElement("p",null,e.data))}))}))},u_=function(e){var t;return he().createElement("div",{className:"templately-table-column ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)},d_=function(e){var t=e.isPro,n=e.className,r=e.inDetails,o=void 0!==r&&r,i=Vn()("templately-badge",{"templately-pro":t,"templately-free":!t},n),a=t?(0,At.__)("Pro","templately"):(0,At.__)("Starter","templately");return he().createElement("div",{className:i},t&&!o&&he().createElement(Zn,null),he().createElement("span",null,t&&o&&he().createElement(Zn,null),a))},p_=function(e){var t=e.dependencies,n=ce((0,pe.useState)([]),2),r=n[0],o=n[1];return(0,pe.useEffect)(function(){if(t){var e=[];t.map(function(t,n){e.push(function(e,t){return e&&he().createElement("span",{key:t,className:"templately-dependency-icon tt-top","data-templately-tooltip":e.name},null!=e&&e.icon?he().createElement("img",{key:e.id,src:e.icon}):he().createElement("span",{className:"templately-dependency-icon-text-icon"},e.name[0]))}(t,n))}),o(e)}},[t]),0==r.length?null:he().createElement("span",{className:"templately-item-dependencies"},r)},f_=function(e){var t=e.type,n=(e.slug,e.dependencies);return e.platform,he().createElement("div",{className:"templately-item-hover"},"packs"!=t&&he().createElement(p_,{dependencies:n}))};var h_=["panelKey","title","isActive","onClickItem"],m_=function(e){var t=e.panelKey,n=e.title,r=e.isActive,o=e.onClickItem,i=Wn(e,h_),a=Vn()("tc-panel-header",i.className,{"tc-panel-header-active":r});return he().createElement("div",{className:a,onClick:function(){return o(t)}},he().createElement("h4",null,n),he().createElement("span",{className:"t-collapse-action-btn"},r?he().createElement(Kn,null):he().createElement($n,null)))};const g_=he().memo(m_);var v_=["isActive","children"],y_=function(e){var t=e.isActive,n=e.children,r=Wn(e,v_),o=Vn()("tc-panel-body",r.className,{"tc-content-active":t,"tc-content-hide":!t});return he().createElement("div",{className:o},n)};const b_=he().memo(y_);function w_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w_(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const k_=function(e){var t=e.children,n=ce((0,pe.useState)(["0"]),2),r=n[0],o=n[1];(0,pe.useEffect)(function(){if((null==t?void 0:t.length)>0){var e=[];t.map(function(t,n){var r;null!=t&&null!==(r=t.props)&&void 0!==r&&r.isActive&&e.push(String(n))}),e.length>0&&o(function(t){return[].concat(Nl(t),e)})}},[t]);var i=(0,pe.useCallback)(function(e){var t=Nl(r),n=t.indexOf(e);n>-1?t.splice(n,1):t.push(e),o(t)},[r]),a=(0,pe.useCallback)(function(e,t){if(!e)return null;var n=String(t),o=r.indexOf(n)>-1,a=E_(E_({},e.props),{},{key:n,panelKey:n,onClickItem:i,isActive:o});return he().cloneElement(e,a)},[t,r]);return he().createElement("div",{className:"templately-collapse"},(null==t?void 0:t.length)>0?t.map(a):t)};var O_=["panelKey","title","children","isActive","onClickItem"],S_=function(e){var t=e.panelKey,n=e.title,r=e.children,o=e.isActive,i=void 0!==o&&o,a=e.onClickItem,l=Wn(e,O_),s={isActive:i,onClickItem:a,panelKey:t},c=Vn()("tc-panel-item",l.className,{"tc-panel-active":i,"tc-panel-inactive":!i});return he().createElement("div",{className:c},he().createElement(g_,re({title:n},s)),i&&he().createElement(b_,s,r))};const x_=he().memo(S_),C_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return xn(function(o){var i,a,l,s,c=null===(i=o.profile)||void 0===i||null===(i=i.purchasedItems)||void 0===i||null===(i=i.all)||void 0===i?void 0:i[t],u=null!==(null===(a=o.profile)||void 0===a?void 0:a.data),d=(null===(l=o.profile)||void 0===l||null===(l=l.data)||void 0===l||null===(l=l.plan)||void 0===l?void 0:l.indexOf("free"))>-1,p=null==c?void 0:c.includes(e);return null==n||p||(p=null===(s=o.profile)||void 0===s||null===(s=s.purchasedItems)||void 0===s||null===(s=s.all)||void 0===s||null===(s=s.pack)||void 0===s?void 0:s.includes(n)),r&&!p&&(p=r),d||(p=!0),u?{isPurchased:p,isSubscribed:!d}:{isPurchased:!1,isSubscribed:!1}})},D_=function(e){var t,n=e.id,r=e.type,o=e.downloads,i=void 0===o?0:o,a=e.rating,l=void 0===a?0:a,s=e.likes,c=void 0===s?0:s,u=e.setInsert,d=e.isPack,p=void 0!==d&&d,f=e.price,h=void 0===f?"0.00":f,m=e.isPurchased,g=void 0!==m&&m,v=e.fullSiteImport,y=void 0!==v&&v,b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=rt(),o=ce(Ct(),1)[0],i=ce((0,pe.useState)(n),2),a=i[0],l=i[1],s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!1),2),p=d[0],f=d[1],h=En(),m=xn(function(n){var r,o,i,a=null===(r=n.profile)||void 0===r||null===(r=r.starred)||void 0===r?void 0:r["page"==t||"block"==t?"item":"pack"];return Ia(a)&&(a=Object.values(a)),{isStarred:null!==(o=null===(i=a)||void 0===i?void 0:i.includes(e))&&void 0!==o&&o,isLoggedIn:null!==n.profile.data}}),g=m.isStarred,v=m.isLoggedIn;return(0,pe.useEffect)(function(){if(c&&!v)return u(!1),r(nb("sign-in",Pt({},"redirect-to",o.get("path"))));c&&(f(function(e){return!e}),l(function(e){return g?e-1:e+1}),h(Yi({action:g?"undo":"do",id:e,itemType:t})),u(!0))},[c]),(0,pe.useEffect)(function(){f(g),u(!1)},[g]),{starred:p,isClicked:c,favouriteCount:a,setIsClicked:u,setFavouriteCount:l}}(n,r,c),w=b.starred,E=b.setIsClicked,k=b.favouriteCount,O=C_(n,r,null,g),S=O.isPurchased,x=O.isSubscribed;return he().createElement("div",{className:"templately-item-meta"},p&&y&&he().createElement("span",{className:"templately-item-meta-single tb-full-site-import"},"Full Site Import"),null!=l&&x&&he().createElement(pl,{"data-templately-tooltip":(0,At.__)("Average Rating","templately"),className:"templately-item-meta-single tb-item-rating tt-top ".concat(null==l?"not-rated":"")},he().createElement(ar,null),he().createElement("span",null,null!==(t=null==l?void 0:l.toFixed(1))&&void 0!==t?t:he().createElement("small",null,(0,At.__)("Not Rated","templately")))),!x&&he().createElement("span",{className:"templately-item-meta-single tb-item-price"},h>0&&!S?"$".concat(h):h>0&&S?he().createElement(Zx,{to:"purchased-items"},"PURCHASED"):"FREE"),!y&&he().createElement(pl,{"data-templately-tooltip":w?(0,At.__)("Added to Favourite","templately"):(0,At.__)("Add to Favourite","templately"),className:"templately-item-meta-single tb-item-favourite tt-top ".concat(w?"my-favourite":""),onClick:function(){return E(!0)}},he().createElement(rr,null),he().createElement("span",null,null!=k?k:0)),he().createElement(pl,{"data-templately-tooltip":p?(0,At.__)("Total Downloads","templately"):(0,At.__)("Insert","templately"),onClick:function(){return!p&&u(n)},className:"templately-item-meta-single tt-top tb-item-insert"},he().createElement(Jn,null),he().createElement("span",null,p?null!=i?i:0:(0,At.__)("Insert","templately"))))};var P_=a(1921);const A_=function(e){var t=e.name,n=e.price,r=e.thumbnails,o=void 0===r?[]:r;return null==o?void 0:o.map(function(e,r){return he().createElement("div",{key:"thumbnail-".concat(r),className:"templately-item-image-wrapper thumbnail-".concat(r)},he().createElement(d_,{isPro:+n>0}),he().createElement(P_.LazyLoadImage,{className:"templately-item-image",width:"100%",src:e,alt:t}))})},T_=function(e){var t=e.content,n=t.id,r=t.name,o=t.price,i=t.type,a=t.slug,l=t.rating,s=t.downloads,c=t.thumbnail,u=t.thumbnail2,d=void 0===u?null:u,p=t.thumbnail3,f=void 0===p?null:p,h=t.dependencies,m=t.favourite_count,g=t.fullsite_import,v=void 0!==g&&g,y=rt(),b=ce((0,pe.useState)(null),2),w=b[0],E=b[1],k=xn(function(e){return e.profile},Jt);(0,pe.useEffect)(function(){if(null!==w){if(!e.isLoggedIn)return void y(nb("sign-in"));if(Yg(e.isLoggedIn,k))return;xl({showCloseButton:!0,allowOutsideClick:!1,html:he().createElement(rd,e.content)},!0).then(function(e){void 0===(null==e?void 0:e.code)?e.isDismissed||hd(e.platform):xl({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:he().createElement(Yu,re({},e,{slug:a,type:i}))},!0)}),E(null)}},[w]);var O=Vn()("templately-item","templately-".concat(i,"-item"));return he().createElement("div",{className:O},he().createElement("div",{className:"templately-item-inner"},he().createElement(Zx,{ignoreKeys:["category","tag_id","templateType"],className:"templately-item-image-hover-wrapper ".concat("pack"==i?"templately-pack-images-wrapper":""),to:"".concat(e.platform,"/").concat(i,"s/").concat(a)},he().createElement("div",{className:"templately-item-image-container ".concat("pack"==i?"templately-pack-images":"")},"pack"!==i&&he().createElement(f_,{slug:a,type:i,dependencies:h,platform:e.platform}),he().createElement(A_,{name:r,price:+o,thumbnails:"pack"==i?[f,d,c]:[c]}))),he().createElement("div",{className:"templately-item-details"},he().createElement(D_,{isPurchased:null==e?void 0:e.isPurchased,isPack:"pack"===i,fullSiteImport:v,type:i,downloads:s,rating:l,likes:m,id:n,price:o,setInsert:E}),he().createElement(Zx,{className:"templately-title",to:"".concat(e.platform,"/").concat(i,"s/").concat(a)},he().createElement("h4",null,r)))))};var F_=a(5556),M_=a.n(F_),I_=a(312),N_=a.n(I_);function j_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j_(Object(n),!0).forEach(function(t){B_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z_(){return z_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z_.apply(this,arguments)}function W_(e){return W_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},W_(e)}function U_(e,t){return U_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},U_(e,t)}function V_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||q_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G_(e){return function(e){if(Array.isArray(e))return Q_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||q_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q_(e,t){if(e){if("string"==typeof e)return Q_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q_(e,t):void 0}}function Q_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $_(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";var n=e;return t&&Object.keys(t).forEach(function(e){n=n.replace(e,t[e])}),n}function Y_(){return void 0!==globalThis.window?globalThis.window.innerWidth:0}function X_(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis.window.self;return e===globalThis.window.top||function(){try{return globalThis.window.location.hostname!==globalThis.window.parent.location.hostname}catch(e){return!0}}()?e:X_(e.parent)}var K_=300,Z_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U_(e,t)}(l,e);var t,n,r,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=W_(o);if(i){var n=W_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?V_(e):t}(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},t.outerEl=he().createRef(),t.zoomInBtn=he().createRef(),t.zoomOutBtn=he().createRef(),t.caption=he().createRef(),t.closeIfClickInner=t.closeIfClickInner.bind(V_(t)),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(V_(t)),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(V_(t)),t.handleKeyInput=t.handleKeyInput.bind(V_(t)),t.handleMouseUp=t.handleMouseUp.bind(V_(t)),t.handleMouseDown=t.handleMouseDown.bind(V_(t)),t.handleMouseMove=t.handleMouseMove.bind(V_(t)),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(V_(t)),t.handleTouchStart=t.handleTouchStart.bind(V_(t)),t.handleTouchMove=t.handleTouchMove.bind(V_(t)),t.handleTouchEnd=t.handleTouchEnd.bind(V_(t)),t.handlePointerEvent=t.handlePointerEvent.bind(V_(t)),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(V_(t)),t.handleWindowResize=t.handleWindowResize.bind(V_(t)),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(V_(t)),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(V_(t)),t.requestClose=t.requestClose.bind(V_(t)),t.requestMoveNext=t.requestMoveNext.bind(V_(t)),t.requestMovePrev=t.requestMovePrev.bind(V_(t)),t.timeouts=[],t.currentAction=0,t.eventsSource=0,t.pointerList=[],t.preventInnerClose=!1,t.preventInnerCloseTimeout=null,t.keyPressed=!1,t.imageCache={},t.lastKeyDownTime=0,t.resizeTimeout=null,t.wheelActionTimeout=null,t.resetScrollTimeout=null,t.scrollX=0,t.scrollY=0,t.moveStartX=0,t.moveStartY=0,t.moveStartOffsetX=0,t.moveStartOffsetY=0,t.swipeStartX=0,t.swipeStartY=0,t.swipeEndX=0,t.swipeEndY=0,t.pinchTouchList=null,t.pinchDistance=0,t.keyCounter=0,t.moveRequested=!1,t}return t=l,n=[{key:"componentDidMount",value:function(){var e=this;this.props.animationDisabled||this.setState({isClosing:!1}),this.windowContext=X_(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent},Object.keys(this.listeners).forEach(function(t){e.windowContext.addEventListener(t,e.listeners[t])}),this.loadAllImages()}},{key:"shouldComponentUpdate",value:function(e){var t=this;return this.getSrcTypes().forEach(function(n){t.props[n.name]!==e[n.name]&&(t.moveRequested=!1)}),!this.moveRequested}},{key:"componentDidUpdate",value:function(e){var t=this,n=!1,r={},o={};this.getSrcTypes().forEach(function(i){e[i.name]!==t.props[i.name]&&(n=!0,r[e[i.name]]=!0,o[t.props[i.name]]=!0)}),(n||this.moveRequested)&&(Object.keys(r).forEach(function(e){!(e in o)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)}),this.moveRequested=!1,this.loadAllImages(this.props))}},{key:"componentWillUnmount",value:function(){var e=this;this.didUnmount=!0,Object.keys(this.listeners).forEach(function(t){e.windowContext.removeEventListener(t,e.listeners[t])}),this.timeouts.forEach(function(e){return clearTimeout(e)})}},{key:"setTimeout",value:function(e){function t(_x,t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e,t){var n=this,r=setTimeout(function(){n.timeouts=n.timeouts.filter(function(e){return e!==r}),e()},t);return this.timeouts.push(r),r})},{key:"setPreventInnerClose",value:function(){var e=this;this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout(function(){e.preventInnerClose=!1,e.preventInnerCloseTimeout=null},100)}},{key:"getBestImageForType",value:function(e){var t=this.props[e],n={};if(this.isImageLoaded(t))n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:n.height,targetWidth:n.width}}},{key:"getFitSizes",value:function(e,t,n){var r=this.getLightboxRect(),o=r.height-2*this.props.imagePadding,i=r.width-2*this.props.imagePadding;return n||(o=Math.min(o,t),i=Math.min(i,e)),i/o>e/t?{width:e*o/t,height:o}:{width:i,height:t*i/e}}},{key:"getMaxOffsets",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var n,r,o=this.getLightboxRect(),i=this.getZoomMultiplier(e);return{maxX:n=i*t.width-o.width<0?(o.width-i*t.width)/2:(i*t.width-o.width)/2,maxY:r=i*t.height-o.height<0?(o.height-i*t.height)/2:(i*t.height-o.height)/2,minX:-1*n,minY:-1*r}}},{key:"getSrcTypes",value:function(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return Math.pow(1.007,e)}},{key:"getLightboxRect",value:function(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:Y_(),height:void 0!==globalThis.window?globalThis.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}},{key:"clearTimeout",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){this.timeouts=this.timeouts.filter(function(t){return t!==e}),clearTimeout(e)})},{key:"changeZoom",value:function(e,t,n){if(this.props.enableZoom){var r=Math.max(0,Math.min(K_,e));if(r!==this.state.zoomLevel)if(0!==r){var o=this.getBestImageForType("mainSrc");if(null!==o){var i=this.getZoomMultiplier(),a=this.getZoomMultiplier(r),l=this.getLightboxRect(),s=void 0!==t?t-l.left:l.width/2,c=void 0!==n?n-l.top:l.height/2,u=(l.width-o.width*i)/2,d=(l.height-o.height*i)/2,p=s-(s-(u-this.state.offsetX))/i*a,f=c-(c-(d-this.state.offsetY))/i*a,h=(l.width-o.width*a)/2-p,m=(l.height-o.height*a)/2-f;if(3!==this.currentAction){var g=this.getMaxOffsets();this.state.zoomLevel>r&&(h=Math.max(g.minX,Math.min(g.maxX,h)),m=Math.max(g.minY,Math.min(g.maxY,m)))}this.setState({zoomLevel:r,offsetX:h,offsetY:m})}}else this.setState({zoomLevel:r,offsetX:0,offsetY:0})}}},{key:"closeIfClickInner",value:function(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}},{key:"handleKeyInput",value:function(e){if(e.stopPropagation(),!this.isAnimating())if("keyup"!==e.type){var t=e.which||e.keyCode,n=new Date;if(!(n.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit&&27!==t))switch(this.lastKeyDownTime=n.getTime(),t){case 27:e.preventDefault(),this.requestClose(e);break;case 37:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case 39:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}else this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus}},{key:"handleOuterMousewheel",value:function(e){var t=this;e.stopPropagation();var n=0;this.clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=this.setTimeout(function(){t.scrollX=0,t.scrollY=0},300),null!==this.wheelActionTimeout||this.isAnimating()||(Math.abs(e.deltaY)<Math.abs(e.deltaX)&&(this.scrollY=0,this.scrollX+=e.deltaX,this.scrollX>=200||e.deltaX>=100?(this.requestMoveNext(e),n=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),n=500,this.scrollX=0)),0!==n&&(this.wheelActionTimeout=this.setTimeout(function(){t.wheelActionTimeout=null},n)))}},{key:"handleImageMouseWheel",value:function(e){if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<1)return;this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)}}},{key:"handleImageDoubleClick",value:function(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}},{key:"shouldHandleEvent",value:function(e){if(this.eventsSource===e)return!0;if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:default:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:return 1===this.eventsSource&&(this.eventsSource=3,this.filterPointersBySource(),!0)}}},{key:"addPointer",value:function(e){this.pointerList.push(e)}},{key:"removePointer",value:function(e){this.pointerList=this.pointerList.filter(function(t){return t.id!==e.id})}},{key:"filterPointersBySource",value:function(){var e=this;this.pointerList=this.pointerList.filter(function(t){return t.source===e.eventsSource})}},{key:"handleMouseDown",value:function(e){this.shouldHandleEvent(1)&&l.isTargetMatchImage(e.target)&&(this.addPointer(l.parseMouseEvent(e)),this.multiPointerStart(e))}},{key:"handleMouseMove",value:function(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[l.parseMouseEvent(e)])}},{key:"handleMouseUp",value:function(e){this.shouldHandleEvent(1)&&(this.removePointer(l.parseMouseEvent(e)),this.multiPointerEnd(e))}},{key:"handlePointerEvent",value:function(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":l.isTargetMatchImage(e.target)&&(this.addPointer(l.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[l.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(l.parsePointerEvent(e)),this.multiPointerEnd(e)}}},{key:"handleTouchStart",value:function(e){var t=this;this.shouldHandleEvent(2)&&l.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,function(e){return t.addPointer(l.parseTouchPointer(e))}),this.multiPointerStart(e))}},{key:"handleTouchMove",value:function(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,function(e){return l.parseTouchPointer(e)}))}},{key:"handleTouchEnd",value:function(e){var t=this;this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,function(e){return t.removePointer(l.parseTouchPointer(e))}),this.multiPointerEnd(e))}},{key:"decideMoveOrSwipe",value:function(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}},{key:"multiPointerStart",value:function(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"multiPointerMove",value:function(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}},{key:"multiPointerEnd",value:function(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"handleEnd",value:function(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}},{key:"handleMoveStart",value:function(e){var t=e.x,n=e.y;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=n,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}},{key:"handleMove",value:function(e){var t=e.x,n=e.y,r=this.moveStartX-t+this.moveStartOffsetX,o=this.moveStartY-n+this.moveStartOffsetY;this.state.offsetX===r&&this.state.offsetY===o||this.setState({offsetX:r,offsetY:o})}},{key:"handleMoveEnd",value:function(){var e=this;this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;var t=this.getMaxOffsets(),n=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),r=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));n===this.state.offsetX&&r===this.state.offsetY||(this.setState({offsetX:n,offsetY:r,shouldAnimate:!0}),this.setTimeout(function(){e.setState({shouldAnimate:!1})},this.props.animationDuration))}},{key:"handleSwipeStart",value:function(e){var t=e.x,n=e.y;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=n,this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipe",value:function(e){var t=e.x,n=e.y;this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipeEnd",value:function(e){var t=this.swipeEndX-this.swipeStartX,n=Math.abs(t),r=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating()||n<1.5*r)){if(n<200&&n<this.getLightboxRect().width/4)return;t>0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}},{key:"calculatePinchDistance",value:function(){var e=H_(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,2),t=e[0],n=e[1];return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}},{key:"calculatePinchCenter",value:function(){var e=H_(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,2),t=e[0],n=e[1];return{x:t.x-(t.x-n.x)/2,y:t.y-(t.y-n.y)/2}}},{key:"handlePinchStart",value:function(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map(function(e){return{id:e.id,x:e.x,y:e.y}}),this.pinchDistance=this.calculatePinchDistance())}},{key:"handlePinch",value:function(e){this.pinchTouchList=this.pinchTouchList.map(function(t){for(var n=0;n<e.length;n+=1)if(e[n].id===t.id)return e[n];return t});var t=this.calculatePinchDistance(),n=this.state.zoomLevel+t-this.pinchDistance;this.pinchDistance=t;var r=this.calculatePinchCenter(this.pinchTouchList),o=r.x,i=r.y;this.changeZoom(n,o,i)}},{key:"handlePinchEnd",value:function(){this.currentAction=0,this.pinchTouchList=null,this.pinchDistance=0}},{key:"handleWindowResize",value:function(){this.clearTimeout(this.resizeTimeout),this.resizeTimeout=this.setTimeout(this.forceUpdate.bind(this),100)}},{key:"handleZoomInButtonClick",value:function(){var e=this.state.zoomLevel+100;this.changeZoom(e),e===K_&&this.zoomOutBtn.current.focus()}},{key:"handleZoomOutButtonClick",value:function(){var e=this.state.zoomLevel-100;this.changeZoom(e),0===e&&this.zoomInBtn.current.focus()}},{key:"handleCaptionMousewheel",value:function(e){if(e.stopPropagation(),this.caption.current){var t=this.caption.current.getBoundingClientRect().height,n=this.caption.current,r=n.scrollHeight,o=n.scrollTop;(e.deltaY>0&&t+o>=r||e.deltaY<0&&o<=0)&&e.preventDefault()}}},{key:"isAnimating",value:function(){return this.state.shouldAnimate||this.state.isClosing}},{key:"isImageLoaded",value:function(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}},{key:"loadImage",value:function(e,t,n){var r=this;if(this.isImageLoaded(t))this.setTimeout(function(){n()},1);else{var o=new globalThis.Image;this.props.imageCrossOrigin&&(o.crossOrigin=this.props.imageCrossOrigin),o.onerror=function(o){r.props.onImageLoadError(t,e,o),r.setState(function(t){return{loadErrorStatus:L_(L_({},t.loadErrorStatus),{},B_({},e,!0))}}),n(o)},o.onload=function(){r.props.onImageLoad(t,e,o),r.imageCache[t]={loaded:!0,width:o.width,height:o.height},n()},o.src=t}}},{key:"loadAllImages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;this.getSrcTypes().forEach(function(n){var r=n.name;t[r]&&e.state.loadErrorStatus[r]&&e.setState(function(e){return{loadErrorStatus:L_(L_({},e.loadErrorStatus),{},B_({},r,!1))}}),t[r]&&!e.isImageLoaded(t[r])&&e.loadImage(r,t[r],function(t,n){return function(r){r||e.props[t]!==n||e.didUnmount||e.forceUpdate()}}(r,t[r]))})}},{key:"requestClose",value:function(e){var t=this,n=function(){return t.props.onCloseRequest(e)};this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?n():(this.setState({isClosing:!0}),this.setTimeout(n,this.props.animationDuration))}},{key:"requestMove",value:function(e,t){var n=this,r={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(r.shouldAnimate=!0,this.setTimeout(function(){return n.setState({shouldAnimate:!1})},this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(r),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(r),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function(e){this.requestMove("prev",e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.animationDisabled,r=t.animationDuration,o=t.clickOutsideToClose,i=t.discourageDownloads,a=t.enableZoom,s=t.imageTitle,c=t.nextSrc,u=t.prevSrc,d=t.toolbarButtons,p=t.reactModalStyle,f=t.onAfterOpen,h=t.imageCrossOrigin,m=t.reactModalProps,g=t.loader,v=this.state,y=v.zoomLevel,b=v.offsetX,w=v.offsetY,E=v.isClosing,k=v.loadErrorStatus,O=this.getLightboxRect(),S={};!n&&this.isAnimating()&&(S=L_(L_({},S),{},{transition:"transform ".concat(r,"ms")}));var x={};this.getSrcTypes().forEach(function(e){var t=e.name,n=e.keyEnding;x[t]=n});var _=[],C=function(t,n,r){if(e.props[t]){var o=e.getBestImageForType(t),a=L_(L_({},S),l.getTransform(L_(L_({},r),o)));if(y>0&&(a.cursor="move"),null===o&&(d=k,Object.keys(d).some(function(e){return d[e]})))_.push(he().createElement("div",{className:"".concat(n," ril__image ril-errored"),style:a,key:e.props[t]+x[t]},he().createElement("div",{className:"ril__errorContainer"},e.props.imageLoadErrorMessage)));else if(null!==o){var c=o.src;i?(a.backgroundImage="url('".concat(c,"')"),_.push(he().createElement("div",{className:"".concat(n," ril__image ril__imageDiscourager"),onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:a,key:c+x[t]},he().createElement("div",{className:"ril-download-blocker ril__downloadBlocker"})))):_.push(he().createElement("img",z_({},h?{crossOrigin:h}:{},{className:"".concat(n," ril__image"),onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,onDragStart:function(e){return e.preventDefault()},style:a,src:c,key:c+x[t],alt:"string"==typeof s?s:$_("Image"),draggable:!1})))}else{var u=void 0!==g?g:he().createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},G_(new Array(12)).map(function(e,t){return he().createElement("div",{key:t,className:"ril-loading-circle-point ril__loadingCirclePoint"})}));_.push(he().createElement("div",{className:"".concat(n," ril__image ril-not-loaded"),style:a,key:e.props[t]+x[t]},he().createElement("div",{className:"ril__loadingContainer"},u)))}}var d},D=this.getZoomMultiplier();C("nextSrc","ril-image-next ril__imageNext",{x:O.width}),C("mainSrc","ril-image-current",{x:-1*b,y:-1*w,zoom:D}),C("prevSrc","ril-image-prev ril__imagePrev",{x:-1*O.width});var P={overlay:L_({zIndex:1e3,backgroundColor:"transparent"},p.overlay),content:L_({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},p.content)};return he().createElement(N_(),z_({isOpen:!0,onRequestClose:o?this.requestClose:void 0,onAfterOpen:function(){e.outerEl.current&&e.outerEl.current.focus(),f()},style:P,contentLabel:$_("Lightbox"),appElement:void 0!==globalThis.window?globalThis.window.document.body:void 0},m),he().createElement("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(E?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(r,"ms"),animationDuration:"".concat(r,"ms"),animationDirection:E?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},he().createElement("div",{className:"ril-inner ril__inner",onClick:o?this.closeIfClickInner:void 0},_),u&&he().createElement("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev",key:"prev","aria-label":this.props.prevLabel,title:this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}),c&&he().createElement("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext",key:"next","aria-label":this.props.nextLabel,title:this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext}),he().createElement("div",{className:"ril-toolbar ril__toolbar"},he().createElement("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide"},he().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},he().createElement("span",{className:"ril-toolbar__item__child ril__toolbarItemChild"},s))),he().createElement("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide"},d&&d.map(function(e,t){return he().createElement("li",{key:"button_".concat(t+1),className:"ril-toolbar__item ril__toolbarItem"},e)}),a&&he().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},he().createElement("button",{type:"button",key:"zoom-in","aria-label":this.props.zoomInLabel,title:this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton"].concat(G_(y===K_?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||y===K_,onClick:this.isAnimating()||y===K_?void 0:this.handleZoomInButtonClick})),a&&he().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},he().createElement("button",{type:"button",key:"zoom-out","aria-label":this.props.zoomOutLabel,title:this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton"].concat(G_(0===y?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===y,onClick:this.isAnimating()||0===y?void 0:this.handleZoomOutButtonClick})),he().createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},he().createElement("button",{type:"button",key:"close","aria-label":this.props.closeLabel,title:this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose})))),this.props.imageCaption&&he().createElement("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:function(e){return e.stopPropagation()},className:"ril-caption ril__caption",ref:this.caption},he().createElement("div",{className:"ril-caption-content ril__captionContent"},this.props.imageCaption))))}}],r=[{key:"isTargetMatchImage",value:function(e){return e&&/ril-image-current/.test(e.className)}},{key:"parseMouseEvent",value:function(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parseTouchPointer",value:function(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parsePointerEvent",value:function(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"getTransform",value:function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.zoom,a=void 0===i?1:i,l=e.width,s=e.targetWidth,c=n,u=Y_();l>u&&(c+=(u-l)/2);var d=a*(s/l);return{transform:"translate3d(".concat(c,"px,").concat(o,"px,0) scale3d(").concat(d,",").concat(d,",1)")}}}],n&&R_(t.prototype,n),r&&R_(t,r),l}(pe.Component);Z_.propTypes={mainSrc:M_().string.isRequired,prevSrc:M_().string,nextSrc:M_().string,mainSrcThumbnail:M_().string,prevSrcThumbnail:M_().string,nextSrcThumbnail:M_().string,onCloseRequest:M_().func.isRequired,onMovePrevRequest:M_().func,onMoveNextRequest:M_().func,onImageLoadError:M_().func,onImageLoad:M_().func,onAfterOpen:M_().func,discourageDownloads:M_().bool,animationDisabled:M_().bool,animationOnKeyInput:M_().bool,animationDuration:M_().number,keyRepeatLimit:M_().number,keyRepeatKeyupBonus:M_().number,imageTitle:M_().node,imageCaption:M_().node,imageCrossOrigin:M_().string,reactModalStyle:M_().shape({}),imagePadding:M_().number,wrapperClassName:M_().string,toolbarButtons:M_().arrayOf(M_().node),clickOutsideToClose:M_().bool,enableZoom:M_().bool,reactModalProps:M_().shape({}),nextLabel:M_().string,prevLabel:M_().string,zoomInLabel:M_().string,zoomOutLabel:M_().string,closeLabel:M_().string,imageLoadErrorMessage:M_().node,loader:M_().node},Z_.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:function(){},onImageLoadError:function(){},onImageLoad:function(){},onMoveNextRequest:function(){},onMovePrevRequest:function(){},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load",loader:void 0};const J_=Z_,eC=function(e){var t,n,r,o=e.isOpen,i=e.images,a=e.setIsOpen,l=ce((0,pe.useState)(0),2),s=l[0],c=l[1];return he().createElement(he().Fragment,null,o?he().createElement(J_,{enableZoom:!1,reactModalProps:{style:{overlay:{position:"initial",inset:"0px"},content:{position:"absolute",top:"0px",left:"0px",right:"0px",bottom:"0px",border:"none",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"0px",outline:"none",padding:"0px",zIndex:"9999"}},parentSelector:function(){return document.querySelector(".templately-container")}},mainSrc:null===(t=i[s])||void 0===t?void 0:t.url,nextSrc:null===(n=i[(s+1)%i.length])||void 0===n?void 0:n.url,prevSrc:null===(r=i[(s+i.length-1)%i.length])||void 0===r?void 0:r.url,onCloseRequest:function(){return a(!1)},onMovePrevRequest:function(){return c((s+i.length-1)%i.length)},onMoveNextRequest:function(){return c((s+1)%i.length)}}):"")},tC=gn(function(e,t){var n,r,o,i,a,l=null!==(n="blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type)&&void 0!==n?n:"packs",s=1,c=1,u=e.general.platform,d=e.general.plan,p=e.general.filter.doQuery;if("sharedWorkspaces"===l||"workspaces"===l)s=null!==(r=null==e||null===(o=e[l])||void 0===o?void 0:o.currentPage)&&void 0!==r?r:1,c=null!==(i=null==e||null===(a=e[l])||void 0===a?void 0:a.totalPage)&&void 0!==i?i:1;else if("workspaceDetails"===l){var f,h,m=t.slug;s=null==e||null===(f=e[l])||void 0===f||null===(f=f[u])||void 0===f||null===(f=f[m])||void 0===f?void 0:f.currentPage,c=null==e||null===(h=e[l])||void 0===h||null===(h=h[u])||void 0===h||null===(h=h[m])||void 0===h?void 0:h.totalPage}else if("clouds"===l){var g,v,y,b;s=null!==(g=null==e||null===(v=e[l])||void 0===v||null===(v=v.items)||void 0===v||null===(v=v[u])||void 0===v?void 0:v.currentPage)&&void 0!==g?g:1,c=null!==(y=null==e||null===(b=e[l])||void 0===b||null===(b=b.items)||void 0===b||null===(b=b[u])||void 0===b?void 0:b.totalPage)&&void 0!==y?y:1}else if("savedTemplates"===l){var w,E,k,O;s=null!==(w=null==e||null===(E=e[l])||void 0===E||null===(E=E[u])||void 0===E?void 0:E.currentPage)&&void 0!==w?w:1,c=null!==(k=null==e||null===(O=e[l])||void 0===O||null===(O=O[u])||void 0===O?void 0:O.totalPage)&&void 0!==k?k:1}else{var S,x,_,C;s=null==e||null===(S=e[l])||void 0===S||null===(S=S[d])||void 0===S||null===(S=S[u])||void 0===S?void 0:S.currentPage,c=null==e||null===(x=e[l])||void 0===x||null===(x=x[d])||void 0===x||null===(x=x[u])||void 0===x?void 0:x.totalPage,p&&(s=null==e||null===(_=e[l])||void 0===_||null===(_=_[d])||void 0===_||null===(_=_[u])||void 0===_||null===(_=_.filteredResults)||void 0===_?void 0:_.currentPage,c=null==e||null===(C=e[l])||void 0===C||null===(C=C[d])||void 0===C||null===(C=C[u])||void 0===C||null===(C=C.filteredResults)||void 0===C?void 0:C.totalPage)}return t.hasOwnProperty("states")&&(s=La(e,[].concat(Nl(t.states),["currentPage"]),1),c=La(e,[].concat(Nl(t.states),["totalPage"]),1)),{plan:d,platform:u,page:s,totalPage:c,need:c>1,doingQuery:p}},function(e){return{setPage:function(t){return e(function(e){var t=ja(Eo,e.key);return"workspaces"===e.key?t=zo.SET_PAGE:"sharedWorkspaces"===e.key?t=Wo.SET_PAGE:"workspaceDetails"===e.key?t=Uo.SET_PAGE:"clouds"===e.key?t=Bo.SET_PAGE:"savedTemplates"===e.key?t=Lo:"favourites"===e.key?t=Zr:"downloads"===e.key?t=uo:"purchasedItems"===e.key&&(t=go),iv({type:t},e)}(t))}}})(function(e){var t,n=ce((0,pe.useState)(null!==(t=e.total)&&void 0!==t?t:1),2),r=n[0],o=n[1],i=ce((0,pe.useState)(!1),2),a=i[0],l=i[1],s=ce((0,pe.useState)([]),2),c=s[0],u=s[1],d=(0,pe.useCallback)(function(){return e.page>1},[e.page]),p=(0,pe.useCallback)(function(){return e.page<r},[e.page,r]);(0,pe.useEffect)(function(){o(e.total)},[e.type]),(0,pe.useEffect)(function(){if(a){var t={page:a,key:e.type,plan:e.plan,platform:e.platform,search:null};t.key="blocks"===t.key?"sections":t.key,e.slug&&(t.slug=e.slug),"favourites"!==e.type&&"downloads"!==e.type&&"purchasedItems"!==e.type||(t={key:e.type,page:a,states:e.states}),null!=e&&e.isSearch&&(t.search=!0),e.doingQuery&&(t.filtering=!0),e.setPage(t)}},[a]),(0,pe.useEffect)(function(){var t=1,n=r;r>10&&(t=Math.max(1,e.page-3),n=Math.min(e.page+3,r),e.page-1<=3&&(n=7),r-e.page<=3&&(t=r-6));var o=[];o.push(he().createElement("li",{className:1==e.page?"epage-link epage-active":"epage-link",key:1,onClick:function(){return l(1)}},(0,At.__)(1,"templately"))),t>1?o.push(he().createElement("li",{className:"epage-link",key:"dotdotdot"},(0,At.__)("...","templately"))):o.filter(function(e){return"dotdotdot"!=e.key});for(var i=function(t){o.push(he().createElement("li",{className:e.page==t?"epage-link epage-active":"epage-link",key:t,onClick:function(){return l(t)}},(0,At.__)(t,"templately")))},a=t+1;a<n;a+=1)i(a);e.page+3<r&&n!==r&&o.push(he().createElement("li",{className:"epage-link",key:"dotdotdotdot"},(0,At.__)("...","templately"))),o.push(he().createElement("li",{className:e.page==r?"epage-link epage-active":"epage-link",key:r,onClick:function(){return l(r)}},(0,At.__)(r,"templately"))),r>=2&&u(o)},[r,e.page]);var f,h=(0,pe.useCallback)(function(){var t=e.page-1>0?e.page-1:0;l(t)},[r,e.page]),m=(0,pe.useCallback)(function(){var t=e.page+1<r?e.page+1:r;l(t)},[r,e.page]);return he().createElement(he().Fragment,null,!(c.length<2||!e.need)&&he().createElement("div",{className:"templately-pagination"},he().createElement("ul",null,(f=!d(),he().createElement("li",{className:"epage-link pagination-arrow"},he().createElement("button",{onClick:function(){return h()},disabled:f},he().createElement(Yn,null)))),c,function(){var e=!p();return he().createElement("li",{className:"epage-link pagination-arrow"},he().createElement("button",{onClick:function(){return m()},disabled:e},he().createElement(Xn,null)))}())))});var nC=["element","isLoading","error","platform"];const rC=gn(function(e,t){var n,r,o,i,a,l,s,c="isLoading",u=null!==(n=null==t?void 0:t.stateSubKey)&&void 0!==n?n:"",d=e.general.platform;return s=null!=t&&t.stateKey?t.stateKey:"blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type,null!=t&&t.loadingKey&&(c=t.loadingKey),u?(o=La(e,[s,d,u,c],!0),La(e,[s,d,u,"error"],null)):(o=null===(i=null==e||null===(a=e[s])||void 0===a?void 0:a[c])||void 0===i||i,null==e||null===(l=e[s])||void 0===l?void 0:l.error),null!=t&&t.isLoadingKey&&null!=t&&t.isKey&&(o=La(e,t.isLoadingKey[t.isKey],!0),0===t.isLoadingKey[t.isKey].length&&(o=!1)),{isLoading:o,error:null,platform:e.general.platform,isGloballySigned:null===(r=e.profile)||void 0===r?void 0:r.is_globally_signed}},function(e){return{logout:function(t){return e(Ti(t))}}})(function(e){var t=e.element,n=e.isLoading,r=e.error,o=e.platform,i=Wn(e,nC);return he().createElement(he().Fragment,null,n&&he().createElement(El,null),!n&&null!=r&&he().createElement(cl,re({},r,{platform:o,isGloballySigned:i.isGloballySigned,logout:i.logout})),!n&&null==r&&("function"==typeof t?t({isLoading:n}):t))});var oC=function(e){var t=Vn()("tm-message text-center");return React.createElement("div",{className:t},e.icon&&e.icon,e.title&&(Va(e.title)?React.createElement("h3",{dangerouslySetInnerHTML:{__html:e.title}}):React.createElement("h3",null," ",e.title," ")),React.createElement("div",{className:"tm-message-body"},React.isValidElement(e.content)?e.content:"function"==typeof e.content?e.content(e.contentArgs):Ia(e.content)?Object.keys(e.content).map(function(t){return React.createElement("p",null,e.content[t])}):React.createElement("p",{dangerouslySetInnerHTML:{__html:e.content}})))};gn(function(e){return{platform:e.general.platform,sweetalert:e.sweetalert}},function(e){return{closeModal:function(){return e((0,vy.closeModal)())}}})(function(e){return e.sweetalert.show&&xl(e.sweetalert),null});var iC=["is_verified"],aC=window.templately.no_items;const lC=function(e){var t=e.is_verified;return Wn(e,iC),he().createElement(he().Fragment,null,!1===t&&he().createElement("p",{className:"text-danger templately-not-verified-account"},(0,At.__)("Please verify your email to continue.","templately")),he().createElement("div",{className:"templately-no-items"},he().createElement("div",{className:"templately-no-items-inner"},he().createElement("img",{src:aC,alt:""}))))};function sC(e){return(0,Hn.k5)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0m7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-1.646-7.646-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708"},child:[]}]})(e)}function cC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dC=[{to:"../clouds",label:(0,At.__)("My Cloud","templately"),className:"nav-item-clouds",icon:he().createElement(Dn,null),end:!0},{to:"../clouds/workspace",label:(0,At.__)("My WorkSpace","templately"),className:"nav-item-workspace",icon:he().createElement(zn,null)},{to:"../clouds/shared-workspace",label:(0,At.__)("Shared with Me","templately"),className:"nav-item-shared-workspace",icon:he().createElement(Ln,null)},{to:"../favourites",label:(0,At.__)("My Favourites","templately"),className:"nav-item-profile-favourites",icon:he().createElement(rr,null)},{to:"../downloads",label:(0,At.__)("My Downloads","templately"),className:"nav-item-profile-downloads",icon:he().createElement(Jn,null)},{to:"../purchased-items",label:(0,At.__)("Purchased Items","templately"),className:"nav-item-purchased-items",icon:he().createElement(sC,null)}];const pC=gn(function(e){var t,n,r;return{isLoading:null===(t=e.clouds.status)||void 0===t?void 0:t.isLoading,statusError:null===(n=e.clouds.status)||void 0===n?void 0:n.error,percent:100*e.clouds.status.usage/e.clouds.status.limit,usage:null!==(r=e.clouds.status.usage)&&void 0!==r?r:0,limit:-1===e.clouds.status.limit?(0,At.__)("Unlimited","templately"):e.clouds.status.limit}})(function(e){var t,n=ce((0,pe.useState)({}),2),r=n[0],o=n[1],i=ce((0,pe.useState)({}),2),a=i[0],l=i[1];return(0,pe.useEffect)(function(){var t={},n={};e.percent>40&&(n={className:"bg-warning"},t=Pt({href:"https://templately.com/subscription?utm_source=plugin&utm_medium=cloudSidebar",target:"_blank",className:"tt-top tt-warning"},"data-templately-tooltip",(0,At.sprintf)((0,At.__)("You are using %d%% of your storage quota","templately"),e.percent))),e.percent>85&&(n={className:"bg-danger"},t=uC(uC({},t),{},Pt({className:"tt-top tt-danger"},"data-templately-tooltip",(0,At.__)("Your storage quota is runing out. Please upgrade your plan to upload more files.","templately")))),e.percent>99&&(n={className:"bg-danger"},t=uC(uC({},t),{},Pt({className:"tt-top tt-danger"},"data-templately-tooltip",(0,At.__)("You have reached your limit of files. Please upgrade your plan to upload more files.","templately")))),o(t),l(n)},[e.percent]),he().createElement(he().Fragment,null,he().createElement(r_,{className:"templately-clouds-menu",activeItemClassName:"nav-item-active",routes:dC,sidebar:!0}),he().createElement("div",{className:"templately-clouds-size"},e.isLoading?he().createElement(El,{style:"placeholder",template:"clouds_status"}):he().createElement("a",r,he().createElement("p",null,(0,At.__)("My Cloud Status","templately")),(null===(t=e.statusError)||void 0===t?void 0:t.message)&&he().createElement("p",{className:"text-danger"},(0,At.__)("Please verify your email to continue.","templately")),null===e.statusError&&he().createElement(he().Fragment,null,he().createElement("div",null,he().createElement("span",re({},a,{style:{width:"".concat(e.percent,"%")}}))),he().createElement("p",null,(0,At.sprintf)((0,At.__)("%d of %s files","templately"),e.usage,e.limit))))))}),fC=gn(function(e){var t,n,r,o,i,a;return{isLoading:null===(t=null===(n=e.general.templateTypes)||void 0===n?void 0:n.isLoading)||void 0===t||t,types:null!==(r=null===(o=e.general.templateTypes)||void 0===o?void 0:o.lists)&&void 0!==r?r:[],template_type_id:null!==(i=null===(a=e.general.filter)||void 0===a?void 0:a.template_type_id)&&void 0!==i?i:"all"}},function(e){return{getTypes:function(t){return e(function(e){return iv({type:Tr},e)}(t))},setTypes:function(t){return e(lv({key:"template_type_id",data:t}))},doFilter:function(){return e(cv())}}})(function(e){var t=it();ce(Ct(),1)[0],(0,pe.useEffect)(function(){e.getTypes({itemType:t.type})},[t.type]);var n=oO(function(t){e.setTypes(t)});return e.isLoading?he().createElement(El,{style:"placeholder",template:"lists"}):he().createElement("div",{className:"templately-template-types"},he().createElement("ul",{className:"templately-list tl-ul"},he().createElement("li",{key:"templateTypes-all",className:"".concat("all"===e.template_type_id?"templately-list-item-active":"")},he().createElement("input",{onChange:function(){return n("all")},type:"radio",checked:"all"===e.template_type_id,name:"templateTypes",id:"templateTypes-all",value:"all"}),he().createElement("label",{htmlFor:"templateTypes-all"},(0,At.__)("All","templately"))),e.types.map(function(t){var r={className:t.id===e.template_type_id?"templately-list-item-active":""};return he().createElement("li",re({key:"templateTypes-".concat(t.id)},r),he().createElement("input",{onChange:function(){return n(t.id)},type:"radio",checked:e.template_type_id===t.id,name:"templateTypes",id:"templateTypes-".concat(t.id),value:t.id}),he().createElement("label",{htmlFor:"templateTypes-".concat(t.id)},t.name))})))}),hC=gn(function(e){var t,n,r,o,i,a;return{isLoading:null!==(t=null===(n=e.general.categories)||void 0===n?void 0:n.isLoading)&&void 0!==t&&t,categories:null!==(r=null===(o=e.general.categories)||void 0===o?void 0:o.lists)&&void 0!==r?r:[],category_id:null!==(i=null===(a=e.general.filter)||void 0===a?void 0:a.category_id)&&void 0!==i?i:"all"}},function(e){return{getCategories:function(t){return e(function(e){return iv({type:Nr},e)}(t))},setCategory:function(t){return e(lv({key:"category_id",data:t}))},doFilter:function(){return e(cv())}}})(function(e){(0,pe.useEffect)(function(){e.getCategories()},[]);var t=oO(function(t){e.setCategory(t)});return e.isLoading?he().createElement(El,{style:"placeholder",template:"lists"}):he().createElement("div",{className:"templately-template-categories"},he().createElement("ul",{className:"templately-list tl-ul"},he().createElement("li",{key:"tc-category-all",className:"".concat("all"===e.category_id?"templately-list-item-active":"")},he().createElement("input",{onChange:function(){return t("all")},type:"radio",checked:"all"===e.category_id,name:"tcategory",id:"tc-category-all",value:"all"}),he().createElement("label",{htmlFor:"tc-category-all"},(0,At.__)("All","templately"))),e.categories.map(function(n){var r={className:n.id===e.category_id?"templately-list-item-active":""};return he().createElement("li",re({key:"tc-category-".concat(n.id)},r),he().createElement("input",{onChange:function(){return t(n.id)},type:"radio",checked:e.category_id===n.id,name:"tcategory",id:"tc-category-".concat(n.id),value:n.id}),he().createElement("label",{htmlFor:"tc-category-".concat(n.id)},n.name))})))}),mC=gn(function(e){var t,n,r;return{tags:null!==(t=e.general.tags)&&void 0!==t?t:[],isReseted:0===(null===(n=e.general.filter)||void 0===n?void 0:n.tags.length),selectedTags:null===(r=e.general.filter)||void 0===r?void 0:r.tags}},function(e){return{getTags:function(){return e({type:Pr})},setTags:function(t){return e(lv({key:"tags",data:t}))}}})(function(e){var t=(0,pe.useMemo)(function(){return e.tags.filter(function(t){var n;return null===(n=e.selectedTags)||void 0===n?void 0:n.includes(t.value)})},[e.tags,e.selectedTags]);(0,pe.useEffect)(function(){var t;0===(null===(t=e.tags)||void 0===t?void 0:t.length)&&e.getTags()},[]);var n=(0,pe.useCallback)(function(t){null!=t?(t=t.map(function(e){return e.value}),e.setTags(t)):e.setTags([])},[]);return he().createElement("div",{className:"templately-tags ts-single"},he().createElement("label",{htmlFor:"templately_tags"},(0,At.__)("Filter Items by Tags","templately")),he().createElement(Dg,{isMulti:!0,placeholder:(0,At.__)("Write a keyword...","templately"),name:"templately_tags",options:e.tags,classNamePrefix:"templately-tags",onChange:n,maxMenuHeight:200,value:t}))}),gC=gn(function(e){return{filter:e.general.filter,doingQuery:e.general.filter.doQuery}},function(e){return{doFilter:function(){return e(cv())},resetFilter:function(t){return e(sv(t))}}})(function(e){var t=rt(),n=ce(Ct(),1)[0],r=ce((0,pe.useState)(!0),2),o=r[0],i=r[1],a=ce((0,pe.useState)(e.filter),1)[0];(0,pe.useEffect)(function(){var t,n;t=e.filter,n=a,(0,Ea.isEqual)(t,n)?i(!0):i(!1)},[e.filter]);var l="";return n.get("path")&&(l=nb(n.get("path"),null,["category","tag_id","templateType","activeFilter","include","exclude","tags"])),he().createElement("div",{className:"ts-single templately-filter-buttons"},he().createElement("button",{disabled:o,className:"templately-button tf-filter",onClick:function(){return e.doFilter()}},(0,At.__)("Filter","templately")),e.doingQuery&&he().createElement("button",{className:"templately-button tf-reset",onClick:function(){t(l),e.resetFilter({fromButton:!0})}},(0,At.__)("Reset","templately")))});var vC=(0,pe.createContext)({includes:[],excludes:[],setIncludes:function(e){return e},setExcludes:function(e){return e}}),yC=function(e){var t=e.children,n=e.isReseted,r=e.dependencies,o=e.activeFilter,i=e.setActiveFilter,a=e.activeControls,l=e.setActiveControls,s=ce((0,pe.useState)(r.map(function(e){return e.id})),2),c=s[0],u=(s[1],ce((0,pe.useState)("none"),2)),d=u[0],p=u[1];return(0,pe.useEffect)(function(){n&&l(r)},[r]),(0,pe.useEffect)(function(){a.every(function(e){return"none"===e.action})?p("none"):a.every(function(e){return"include"===e.action})?p("include"):a.every(function(e){return"exclude"===e.action})?p("exclude"):p("mixed")},[a]),he().createElement(vC.Provider,{value:{activeFilter:o,setActiveFilter:i,controls:c,activeControls:a,setActiveControls:l,activeState:d,setActiveState:p}},t)};const bC=vC;var wC=["children","className"];function EC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const OC=function(e){e.children;var t=e.className,n=Wn(e,wC),r=(0,pe.useContext)(bC),o=r.activeControls,i=r.setActiveControls,a=r.activeState,l=r.setActiveState,s=r.activeFilter,c=r.setActiveFilter,u=(0,pe.useCallback)(function(){switch(a){case"none":case"mixed":i(o.map(function(e){return kC(kC({},e),{},{action:"include"})})),l("include");break;case"include":i(o.map(function(e){return kC(kC({},e),{},{action:"exclude"})})),l("exclude");break;default:i(o.map(function(e){return kC(kC({},e),{},{action:"none"})})),l("none")}},[o,i,l,a]);return he().createElement("div",{className:"t-dependencies-header"},he().createElement("div",{className:"td-batch-select","aria-checked":a},he().createElement("span",re({role:"checkbox","aria-checked":a,tabIndex:0,onClick:u,onKeyDown:function(e){return 32===e.keyCode&&u()},className:t?"".concat(t," tri-state-all-checkbox"):"tri-state-all-checkbox"},n),n.title),he().createElement("span",{className:"tsdf-actions",onClick:function(){var e="";"pro"===n.filter&&"pro"!==s&&(e="pro"),"free"===n.filter&&"free"!==s&&(e="free"),c(e)}},"free"===s&&"free"===n.filter||"pro"===s&&"pro"===n.filter?he().createElement(Kn,null):he().createElement($n,null))))};var SC=["id","content"];function xC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const CC=function(e){var t=e.id,n=e.content,r=(Wn(e,SC),(0,pe.useContext)(bC)),o=r.activeControls,i=r.setActiveControls,a=(0,pe.useCallback)(function(){var e=Nl(o);e=e.map(function(e){return e.id===t?_C(_C({},e),{},{action:"none"===e.action?"include":"include"===e.action?"exclude":"exclude"===e.action?"none":"include"}):e}),i(e)},[o,t]),l=(0,pe.useCallback)(function(e){var t=o.find(function(t){return t.id===e});return t?t.action:"none"},[o]),s=Vn()("tri-state-checkbox",{"tri-state-include":"include"===l(t),"tri-state-exclude":"exclude"===l(t)});return he().createElement("li",{className:s},he().createElement("input",{checked:"include"===l(t),type:"checkbox",id:"tsdf-".concat(t),onChange:a}),he().createElement("label",{htmlFor:"tsdf-".concat(t)},n.name))};function DC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const AC=gn(function(e){var t,n,r,o,i=e.general.platform,a=null!==(t=null===(n=e.general.dependencies)||void 0===n?void 0:n[i])&&void 0!==t?t:[],l=null!==(r=null===(o=e.general.dependencies)||void 0===o?void 0:o.unknown)&&void 0!==r?r:[];return[].concat(Nl(a),Nl(l)),{dependencies:a,activeFilter:e.general.filter.activeFilter||"free",filterableDeps:e.general.filter.dependencies,isReseted:0==e.general.filter.dependencies.include.length&&0==e.general.filter.dependencies.exclude.length}},function(e){return{getDependencies:function(){return e({type:Cr})},setDependencies:function(t){return e(lv({key:"dependencies",data:t}))},setActiveFilter:function(t){return e(lv({key:"activeFilter",data:t}))}}})(function(e){var t=e.activeFilter,n=e.setActiveFilter,r=ce((0,pe.useState)([]),2),o=r[0],i=r[1],a=ce((0,pe.useState)([]),2),l=a[0],s=a[1],c=e.activeFreeControls,u=e.setActiveFreeControls,d=e.activeProControls,p=e.setActiveProControls;(0,pe.useEffect)(function(){var t;0===(null===(t=e.dependencies)||void 0===t?void 0:t.length)&&e.getDependencies()},[]),(0,pe.useEffect)(function(){var t;0!=(null===(t=e.dependencies)||void 0===t?void 0:t.length)&&(i(e.dependencies.filter(function(e){return e.is_pro})),s(e.dependencies.filter(function(e){return!e.is_pro})))},[e.dependencies]),(0,pe.useEffect)(function(){e.isReseted&&(i(e.dependencies.filter(function(e){return e.is_pro})),s(e.dependencies.filter(function(e){return!e.is_pro})))},[e.isReseted]),(0,pe.useEffect)(function(){var t,n,r=[],o=[];d.map(function(e){"include"===e.action&&r.push(e.id),"exclude"===e.action&&o.push(e.id)}),c.map(function(e){"include"===e.action&&r.push(e.id),"exclude"===e.action&&o.push(e.id)});var i=r.length!==(null===(t=e.filterableDeps.include)||void 0===t?void 0:t.length)||r.some(function(t){return!e.filterableDeps.include.includes(t)}),a=o.length!==(null===(n=e.filterableDeps.exclude)||void 0===n?void 0:n.length)||o.some(function(t){return!e.filterableDeps.exclude.includes(t)});(i||a)&&e.setDependencies({include:r,exclude:o})},[c,d]);var f=(0,pe.useMemo)(function(){return o.map(function(e){return PC(PC({},e),{},{action:"none"})})},[o]),h=(0,pe.useMemo)(function(){return l.map(function(e){return PC(PC({},e),{},{action:"none"})})},[l]),m=Vn()("templately-pro-dependencies td-single",{"tsdf-open":"pro"===t}),g=Vn()("templately-free-dependencies td-single",{"tsdf-open":"free"===t});return 0==h.length&&0==f.length?null:he().createElement("div",{className:"templately-dependencies ts-single"},f.length>0&&he().createElement("div",{className:m},he().createElement(yC,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:f,activeControls:d,setActiveControls:p},he().createElement(OC,{filter:"pro",title:(0,At.__)("Pro Plugins Dependencies","templately")}),he().createElement("ul",{className:"t-dependencies-list"},f.map(function(e){return he().createElement(CC,{key:e.id,id:e.id,content:e})})))),h.length>0&&he().createElement("div",{className:g},he().createElement(yC,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:h,activeControls:c,setActiveControls:u},he().createElement(OC,{filter:"free",title:(0,At.__)("Free Plugins Dependencies","templately")}),he().createElement("ul",{className:"t-dependencies-list"},h.map(function(e){return he().createElement(CC,{key:e.id,id:e.id,content:e})})))))});function TC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}const FC=gn(function(e){var t,n,r,o,i,a,l,s=e.general.platform,c=null!==(t=null===(n=e.general.dependencies)||void 0===n?void 0:n[s])&&void 0!==t?t:[];return{tags:null!==(r=e.general.tags)&&void 0!==r?r:[],types:null!==(o=null===(i=e.general.templateTypes)||void 0===i?void 0:i.lists)&&void 0!==o?o:[],categories:null!==(a=null===(l=e.general.categories)||void 0===l?void 0:l.lists)&&void 0!==a?a:[],dependencies:c}},function(e){return{setTypes:function(t){return e(lv({key:"template_type_id",data:t}))},setActiveFilter:function(t){return e(lv({key:"activeFilter",data:t}))},setDependencies:function(t){return e(lv({key:"dependencies",data:t}))},setTags:function(t){return e(lv({key:"tags",data:t}))},setCategory:function(t){return e(lv({key:"category_id",data:t}))},doFilter:function(){return e(cv())}}})(function(e){var t=it(),n=ce(Ct(),1)[0],r=ce((0,pe.useState)([]),2),o=r[0],i=r[1],a=ce((0,pe.useState)([]),2),l=a[0],s=a[1];return(0,pe.useEffect)(function(){var t,r,o,a,l,c;if((0!=(null===(t=e.types)||void 0===t?void 0:t.length)||0!=(null===(r=e.categories)||void 0===r?void 0:r.length))&&0!=(null===(o=e.dependencies)||void 0===o?void 0:o.length)){var u=n.get("templateType"),d=n.get("category"),p=n.get("activeFilter"),f=(null===(a=n.get("include"))||void 0===a?void 0:a.split(",").map(Number))||[],h=(null===(l=n.get("exclude"))||void 0===l?void 0:l.split(",").map(Number))||[],m=(null===(c=n.get("tags"))||void 0===c?void 0:c.split(",").map(Number))||[],g=m.length||f.length||h.length||p||u||d;if("all"!=u){var v=e.types.find(function(e){return e.slug===u});null!=v&&v.id&&e.setTypes(null==v?void 0:v.id)}else u&&e.setTypes("all");if("all"!=d){var y=e.categories.find(function(e){return e.slug===d});null!=y&&y.id&&e.setCategory(null==y?void 0:y.id)}else d&&e.setCategory("all");if(m&&e.setTags(m),p&&e.setActiveFilter(p),0!==f.length||0!==h.length){var b=function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({action:f.includes(e.id)?"include":h.includes(e.id)?"exclude":"none"},e)};s(e.dependencies.filter(function(e){return e.is_pro}).map(b)),i(e.dependencies.filter(function(e){return!e.is_pro}).map(b))}g&&e.doFilter()}},[e.types,e.categories,e.dependencies]),he().createElement(he().Fragment,null,he().createElement(k_,null,"packs"===(null==t?void 0:t.type)&&he().createElement(x_,{className:"ts-single",isActive:!0,title:(0,At.__)("Categories","templately")},he().createElement(hC,null)),"packs"!==(null==t?void 0:t.type)&&he().createElement(x_,{className:"ts-single",isActive:!0,title:(0,At.__)("Types","templately")},he().createElement(fC,null))),he().createElement(AC,{activeFreeControls:o,setActiveFreeControls:i,activeProControls:l,setActiveProControls:s}),he().createElement(mC,null),he().createElement("div",{className:"templately-sidebar-filter-buttons"},he().createElement(gC,null)))}),MC=function(){var e=ce(Ct(),1)[0];return $g(e.get("path"))?"clouds/save-template"===e.get("path")?null:he().createElement("div",{className:"templately-sidebar templately-clouds-sidebar"},he().createElement(pC,null)):he().createElement("div",{className:"templately-sidebar templately-templates-sidebar"},he().createElement(FC,null))};var IC=["title","platform"],NC=function(e){var t=e.title,n=e.platform,r=Wn(e,IC);return he().createElement("div",{className:"templatey-cloud-header"},Eu(n)?he().createElement("img",{src:Eu(n),alt:t}):"",r.thumbnail&&he().createElement("img",{width:"50px",src:r.thumbnail,alt:t}),he().createElement("p",null,t))},jC=["menus","args","open","setWrapperClass"];function LC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var BC=gn(function(e,t){var n,r,o,i=null===(n=t.redirect)||void 0===n?void 0:n.state,a=void 0;return i&&(a=La(e,i,null)===(null===(r=t.redirect)||void 0===r?void 0:r.if)?null===(o=t.redirect)||void 0===o?void 0:o.then:a),{redirect:a}})(function(e){var t=e.premenu,n=void 0!==t&&t,r=e.name,o=e.action,i=e.args,a=e.isOpen,l=e.icon,s=void 0===l?null:l,c=e.disabled,u=void 0!==c&&c,d=e.redux,p=e.ModalComponent,f=e.className,h=e.href,m=void 0!==h&&h,g=e.hrefKey,v=e.redirect,y=e.error,b=m;if(m){var w,E=null==i||null===(w=i.content)||void 0===w?void 0:w[g];b=null!=E?E:b}var k=rt(),O={disabled:u,className:f,onClick:function(e){a(!1)}};if(null!=y&&y.condition&&y.modalArgs)O.onClick=function(e){e.preventDefault(),xl(RC(RC({showCloseButton:!0},y.sweetArgs),{},{html:he().createElement(Yu,y.modalArgs)}),!0)};else if(!u&&!1===b){var S=RC(RC({},i),{},{ModalComponent:p});O.onClick=function(e){void 0===v?(o(S,d),a(!1)):k(nb(v))}}return he().createElement(he().Fragment,null,n?!1!==b?he().createElement("a",re({},O,{href:b}),null!=s?he().createElement("i",null,s):null,r):he().createElement(he().Fragment,null,he().createElement("button",O,null!=s?he().createElement("i",null,s):null,r)):he().createElement("li",O,!1!==b?he().createElement("a",{href:b},null!=s?he().createElement("i",null,s):null,r):he().createElement(he().Fragment,null,null!=s?he().createElement("i",null,s):null,r)))}),zC=he().forwardRef(function(e,t){var n=e.menus,r=e.args,o=e.open,i=e.setWrapperClass,a=Wn(e,jC),l=ce((0,pe.useState)(o),2),s=l[0],c=l[1],u=(0,pe.useMemo)(function(){return n.filter(function(e){return void 0!==(null==e?void 0:e.include)&&!e.include&&1==!(null!=e&&e.hidden)})},[n]),d=(0,pe.useMemo)(function(){return n.filter(function(e){return(null==(null==e?void 0:e.include)||(null==e?void 0:e.include))&&1==!(null!=e&&e.hidden)})},[n]),p=null!=t?t:(0,pe.useRef)({btn:void 0,menu:void 0}),f=function(e){var t=p.current.btn.contains(e.target),n=p.current.menu&&p.current.menu.contains(e.target);t||n||c(!1)};(0,pe.useEffect)(function(){return document.addEventListener("mousedown",f),function(){return document.removeEventListener("mousedown",f)}},[]),(0,pe.useEffect)(function(){"function"==typeof i&&i(s)},[s]);var h=Vn()("templately-context-menu",{"templately-active":s});return he().createElement(he().Fragment,null,he().createElement("div",{className:h},he().createElement("div",{className:"tcm-pre-menus"},u.map(function(e){return he().createElement(BC,re({premenu:!0,isOpen:c,key:e.name},e,{args:r,redux:a}))})),he().createElement("button",{onClick:function(){return c(!s)},ref:function(e){return p.current.btn=e},className:"templately-context-btn"},he().createElement(er,null)),s&&he().createElement("div",{className:"templately-context-menu-list",ref:function(e){return p.current.menu=e}},he().createElement("ul",null,d.map(function(e){return he().createElement(BC,re({isOpen:c,key:e.name},e,{args:r,redux:a}))})))))});zC.displayName="ContextMenu";const WC=gn(function(e){return{clouds:e.clouds,general:e.general,workspaces:e.workspaces,sharedWorkspaces:e.sharedWorkspaces,workspaceDetails:e.workspaceDetails}},null,null,{forwardRef:!0})(zC),UC=gn(function(e,t){var n;return{view:null==e?void 0:e[null!==(n=null==t?void 0:t.type)&&void 0!==n?n:"clouds"].view}},function(e){return{setView:function(t,n){return e(function(e){var t=e.stateKey;return{type:"clouds"===t?Bo.SET_VIEW:"workspaces"===t?zo.SET_VIEW:"sharedWorkspaces"===t?Wo.SET_VIEW:"workspaceDetails"===t?Uo.SET_VIEW:Bo.SET_VIEW,view:e.view}}({view:t,stateKey:n}))}}})(function(e){var t=(0,pe.useCallback)(function(t,n){return e.view===n?"active "+t:t},[e.view]);return he().createElement("div",{className:"templately-view-buttons"},he().createElement("button",{onClick:function(){return e.setView("grid",e.type)},className:t("templately-grid-view","grid")},he().createElement(lr,null)),he().createElement("button",{onClick:function(){return e.setView("list",e.type)},className:t("templately-list-view","list")},he().createElement(Qn,null)))});function VC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const GC=gn(function(e){var t,n;return{platform:e.general.platform,workspaces:null!==(t=e.workspaces.lists)&&void 0!==t?t:[],sharedWorkspaces:null!==(n=e.sharedWorkspaces.lists)&&void 0!==n?n:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading}},function(e){return{dispatch:e,searchFiles:function(t){return e(Yv(HC(HC({},t),{},{context:"list"})))},resetSearch:function(t){return e(function(e){return Fv({type:$v(null==e?void 0:e.source).RESET_SEARCH},e)}(HC(HC({},t),{},{context:"list"})))}}})(function(e){var t=e.dispatch,n=e.workspaces,r=e.sharedWorkspaces,o=(e.workspacesLoading,e.sharedWorkspacesLoading,rt()),i=ce((0,pe.useState)([]),2),a=i[0],l=i[1],s=ce((0,pe.useState)(null),2),c=s[0],u=s[1],d=ce((0,pe.useState)(""),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!1),2),m=h[0],g=h[1];(0,pe.useEffect)(function(){0==n.length&&t(ey({list_only:!0})),0==r.length&&t(ey({list_only:!0,shared:!0}))},[]),(0,pe.useEffect)(function(){var e=[];n.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:Ua(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Ua(r)}),e.length>0&&l(e)},[n,r]),(0,pe.useEffect)(function(){var t,o;if((null===(t=o=null!=e&&e.shared?r.filter(function(t){return t.slug==(null==e?void 0:e.slug)}):n.filter(function(t){return t.slug==(null==e?void 0:e.slug)}))||void 0===t?void 0:t.length)>0){var i={label:o[0].name,value:o[0].id,slug:o[0].slug};u(i)}},[a]);var v=(0,pe.useCallback)(function(t){u(t);var n=null!=e&&e.shared?"clouds/shared-workspace/".concat(t.slug):"clouds/workspace/".concat(t.slug);n=nb(n),o(n)},[null==e?void 0:e.slug]),y=(0,pe.useMemo)(function(){return{key:"isAdded",error:{title:(0,At.__)("Something went wrong.","templately"),content:""},success:{title:(0,At.__)("Successfully Added!","templately"),content:(0,At.__)("Your file has been added to this workspace.","templately")}}},[]);return(0,pe.useEffect)(function(){if(m){var t={search:p,slug:e.slug,source:"workspace_details",file_type:e.platform,platform:e.platform};if(p.length>0){var n=(0,vi.addQueryArgs)(nb(Jy().pathname),{q:p});o(n),e.searchFiles(t)}else e.resetSearch(t);g(!1)}},[m]),he().createElement("div",{className:"templately-workspace-filter-n-actions"},he().createElement("div",{className:"twfa-header"},he().createElement("button",{onClick:function(){return o(-1)},className:"templately-button tb-back"},he().createElement(Gn,null)),he().createElement("h3",null,(0,At.__)("My Files","templately"))),he().createElement("div",{className:"twfa-actions"},he().createElement("div",{className:"twfa-switcher-n-search"},he().createElement(Dg,{placeholder:(0,At.__)("Current Workspace","templately"),className:"twfa-switcher",classNamePrefix:"templately",options:a,value:c,isLoading:null==c,loadingMessage:function(){return(0,At.__)("Loading workspace and shared workspaces list.","templately")},onChange:function(e){return v(e)}}),he().createElement("div",{className:"twfa-search"},he().createElement(hl,{wrapper:!1,placeholder:"Search...",onChange:function(e){return f(e.target.value)},onKeyDown:function(e){var t=e.keyCode;return g(13===t)}}),he().createElement("button",{onClick:function(){return g(!0)},className:"templately-button tb-wf-search"},he().createElement(ir,{size:14})))),he().createElement("button",{onClick:function(){xl({customClass:{popup:"tp-large"},onConfirm:function(e){return _l(y,e)},html:he().createElement(Ng,{slug:e.slug,id:e.id})},!0)},className:"templately-button tb-add"},he().createElement(or,null)),he().createElement(UC,{type:"workspaceDetails"})))});var qC=a(6614);qC.domToReact,qC.htmlToDOM,qC.attributesToProps,qC.Comment,qC.Element,qC.ProcessingInstruction,qC.Text;const QC=qC;var $C=["name","dispatch"];const YC=gn(function(e){var t;return{is_verified:null===(t=e.profile.data)||void 0===t?void 0:t.is_verified}})(function(e){var t=e.name,n=void 0===t?(0,At.__)("Add New Workspace","templately"):t,r=e.dispatch,o=Wn(e,$C),i=(0,pe.useMemo)(function(){return{key:"isCreated",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately")},success:{title:(0,At.__)("Successfully Created","templately"),content:function(e){var t=e.title;return QC((0,At.sprintf)("%s <strong>%s</strong>",(0,At.__)("You have created a WorkSpace called","templately"),t))}}}},[]);return he().createElement("div",{className:"templately-workspaces-column"},he().createElement("div",{className:"templately-workspace templately-create-workspace",onClick:function(){o.is_verified?xl({dispatch:r,showCloseButton:!0,allowOutsideClick:!1,onConfirm:function(e){return _l(i,e)},html:he().createElement(vd,{dispatch:r})}):xl({showCloseButton:!0,allowOutsideClick:!1,icon:"error",title:"Oops...",html:he().createElement("p",{className:"text-danger text-center"},(0,At.__)("Please verify your email to continue.","templately"))},!1)}},he().createElement("div",{className:"templately-workspace-inner"},he().createElement("span",{className:"tw-icon"}),he().createElement("span",{className:"tw-title"},n))))}),XC=function(e){var t=e.title;return he().createElement("div",{className:"templately-workspaces-column"},he().createElement("div",{className:"templately-workspace templately-create-workspace templately-no-workspaces"},he().createElement("div",{className:"templately-workspace-inner"},he().createElement("span",{className:"tw-icon"}),he().createElement("span",{className:"tw-title"},t))))},KC=function(e){var t=e.profile_photo,n=e.name;return he().createElement(he().Fragment,null,null!==t?he().createElement("span",{id:"tw-shared-image-wrapper"},he().createElement("img",{src:t,alt:n.slice(0,1),onError:function(e){var t;"tw-shared-image-wrapper"==(null===(t=e.target.parentNode)||void 0===t?void 0:t.id)&&(e.target.parentNode.innerHTML="<span>"+e.target.alt+"</span>")}})):he().createElement("span",null,n.slice(0,1)))};var ZC=["name","slug","addNew","sharedWith","view","shared"];function JC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}const eD=function(e){var t=e.name,n=e.slug,r=e.addNew,o=e.sharedWith,i=e.view,a=void 0!==i&&i,l=e.shared,s=void 0!==l&&l,c=(Wn(e,ZC),rt()),u=En();if(r)return he().createElement(YC,{dispatch:u});var d=ce((0,pe.useState)([]),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!1),2),m=h[0],g=h[1],v=ce((0,pe.useState)(!1),2),y=v[0],b=v[1];(0,pe.useEffect)(function(){null!=o&&o.length&&f(o.slice(0,s?5:4))},[]);var w=Vn()("templately-workspaces-column",{"templately-widefat":a}),E=Vn()("templately-workspace",{"templately-active":a||m}),k=xn(function(e){var r,o,i=t,a=null===(r=e.workspaces.lists)||void 0===r?void 0:r.find(function(e){return e.slug===n});return a?i=a.name:null!==(o=e.workspaceDetails[n])&&void 0!==o&&o.name&&(i=e.workspaceDetails[n].name),i}),O=(0,pe.useRef)({btn:void 0,menu:void 0}),S=(0,pe.useRef)(),x=(0,pe.useCallback)(function(e){var t,n,r,o,i=(null===(t=O.current)||void 0===t?void 0:t.btn)&&(null===(n=O.current)||void 0===n?void 0:n.btn.contains(e.target)),a=(null===(r=O.current)||void 0===r?void 0:r.menu)&&O.current.menu.contains(e.target),l=null===(o=S.current)||void 0===o?void 0:o.contains(e.target);(!O.current&&s||!i&&!a&&!l)&&b(!0)},[n,s]);return(0,pe.useEffect)(function(){if(y&&""!==n&&!a){var t="clouds/".concat(s?"shared-workspace":"workspace","/").concat(n),r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);delete r.key,u(cy(r)),c(nb(t),{state:{slug:n}})}},[y]),he().createElement("div",{className:w},he().createElement("div",{className:E,onClick:x},he().createElement("div",{className:"templately-workspace-inner"},!s&&he().createElement(WC,{ref:O,args:{content:e},setWrapperClass:g,menus:xu()}),he().createElement("header",null,he().createElement("span",{className:"tw-icon"}),he().createElement("span",{className:"tw-title"},k)),he().createElement("div",{className:"tw-share-with"},he().createElement("p",null,(0,At.__)("Shared with:","templately")),he().createElement("div",{className:"tw-share-with-list"},(null==p?void 0:p.length)>0&&p.map(function(e){return he().createElement(KC,re({key:e.name.toLowerCase().replaceAll(" ","-")},e))}),!s&&he().createElement("button",{ref:S,onClick:function(){return Ou({content:e,ModalComponent:Rg})}},he().createElement(or,null)))))))};function tD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const rD=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g=t.slug,v=e.general.platform,y=null!==(n=null===(r=e.workspaceDetails)||void 0===r||null===(r=r[v])||void 0===r||null===(r=r[g])||void 0===r?void 0:r.currentPage)&&void 0!==n?n:1,b=null!==(o=null===(i=e.workspaceDetails)||void 0===i||null===(i=i[v])||void 0===i||null===(i=i[g])||void 0===i?void 0:i.totalPage)&&void 0!==o?o:1,w=e.workspaceDetails&&(null===(a=e.workspaceDetails)||void 0===a?void 0:a[v])&&(null===(l=e.workspaceDetails[v])||void 0===l?void 0:l[g])&&(null===(s=e.workspaceDetails[v][g])||void 0===s?void 0:s[y])&&e.workspaceDetails[v][g][y];return{current_screen:e.general.current_screen,details:null===(c=e.workspaceDetails)||void 0===c?void 0:c[g],items:null!=w?w:[],currentPage:y,totalPage:b,pages:{search:{currentPage:null!==(u=null===(d=e.workspaceDetails.data)||void 0===d?void 0:d.currentPage)&&void 0!==u?u:1,totalPage:null!==(p=null===(f=e.workspaceDetails.data)||void 0===f?void 0:f.totalPage)&&void 0!==p?p:1},list:{currentPage:y,totalPage:b}},userID:null!==(h=null===(m=e.profile.data)||void 0===m?void 0:m.id)&&void 0!==h?h:0,platform:e.general.platform,view:e.workspaceDetails.view,search:e.workspaceDetails.search}},function(e){return{getWorkSpaceDetails:function(t){return e(uy(t))},getWorkSpaceFiles:function(t){return e(fy(t))}}})(function(e){var t=e.items,n=e.details,r=e.slug,o=e.pages,i=ce((0,pe.useState)("list"),2),a=i[0],l=i[1],s=ce((0,pe.useState)([]),2),c=s[0],u=s[1],d=ce((0,pe.useState)(1),2),p=d[0],f=d[1],h=ce((0,pe.useState)(1),2),m=h[0],g=h[1];return(0,pe.useEffect)(function(){l("list")},[]),(0,pe.useEffect)(function(){m>=1&&e.getWorkSpaceFiles({slug:r,page:m,platform:e.platform})},[m]),(0,pe.useEffect)(function(){var n="list"===e.search.context&&e.search.keyword.length>0?e.search.data[e.search.data.currentPage]:t;if(n.length>0){var o=n.map(function(t){return[{id:"name",data:he().createElement(NC,{title:t.name,platform:e.platform})},[{id:"last_modified",data:t.last_modified},{id:"action",data:he().createElement(WC,{args:{content:nD(nD({},t),{},{slug:r,origin:"cloud"}),source:null!=e&&e.shared?"sharedWorkspace":"workspace"},menus:Ug(t.owner.id!==e.userID,e.current_screen)})}]]});u(o)}else u([])},[t,e.search]),(0,pe.useEffect)(function(){e.search.isLoading?l("search"):l("list")},[e.search]),(0,pe.useEffect)(function(){f(o[a].totalPage),g(o[a].currentPage)},[o]),he().createElement("div",{className:"templately-workspace-details templately-workspaces"},he().createElement("div",{className:"templately-workspaces-row"},he().createElement(eD,re({shared:e.shared,view:!0,isSinglePage:!0},n)),he().createElement(GC,{id:null==n?void 0:n.id,slug:null==n?void 0:n.slug,shared:null==e?void 0:e.shared}),he().createElement(rC,{stateKey:"workspaceDetails",loadingKey:"isFilesLoading",isKey:a,isLoadingKey:{search:["workspaceDetails","search","isLoading"],list:["workspaceDetails","isFilesLoading"]},element:function(t){return t.isLoading,0==c.length?he().createElement(lC,null):he().createElement("div",{className:"templately-workspaces-files"},he().createElement(o_,{view:e.view,head:he().createElement(l_,null)},he().createElement(c_,{view:e.view,data:c})),p>1&&he().createElement(tC,{slug:r,type:"workspaceDetails",total:p}))}})))});var oD=["user","isLoading","platform"];gn(function(e){var t,n,r,o,i,a,l,s,c;return{platform:e.general.platform,isLoading:e.profile.isLoading,user:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.data)&&void 0!==t?t:null,isLoggedIn:null!==(null===(r=e.profile)||void 0===r?void 0:r.data),canLinkAccount:null!==(o=null===(i=e.profile)||void 0===i?void 0:i.link_account)&&void 0!==o&&o,canUnLinkAccount:null!==(a=null===(l=e.profile)||void 0===l?void 0:l.unlink_account)&&void 0!==a&&a,isGloballySigned:null===(s=e.profile)||void 0===s?void 0:s.is_globally_signed,signedAsGlobal:null===(c=e.profile)||void 0===c?void 0:c.signed_as_global}},function(e){return{loadProfile:function(t){return e(function(e){return Pi({type:Qr},e)}(t))},logout:function(t){return e(Ti(t))},linkAccount:function(){return e(Fi({linking:!0}))}}})(function(e){var t=e.user,n=(e.isLoading,e.platform),r=Wn(e,oD),o=rt();return(0,pe.useEffect)(function(){r.loadProfile()},[]),(0,pe.useEffect)(function(){r.isLoggedIn||o(nb("sign-in",{platform:n}),{replace:!0})},[r.isLoggedIn]),he().createElement("div",{className:"templately-profile"},null!==(null==t?void 0:t.profile_photo)?he().createElement("div",{className:"tp-image-wrap"},he().createElement("img",{className:"tp-image",src:null==t?void 0:t.profile_photo,alt:null==t?void 0:t.name,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}})):he().createElement("div",{className:"tp-image-wrap"},he().createElement(jn,null)),he().createElement("h1",{className:"tp-title"},(null==t?void 0:t.name)||"".concat(null==t?void 0:t.first_name," ").concat(null==t?void 0:t.last_name)),he().createElement("ul",{className:"tp-details"},he().createElement("li",null,he().createElement("strong",null,(0,At.__)("Email","templately")),": ",null==t?void 0:t.email),he().createElement("li",null,he().createElement("strong",null,(0,At.__)("Joining Date","templately")),": ",null==t?void 0:t.joined),!(null!=t&&t.is_verified)&&he().createElement("li",null,he().createElement("p",{className:"text-danger"},(0,At.__)("Please verify your email to continue.","templately")))),he().createElement("div",{className:"tp-managerial-links"},he().createElement("a",{className:"tb-manage-account templately-button",target:"_blank",href:"https://templately.com/profile?utm_source=plugin&utm_medium=profile"},(0,At.__)("Manage Account","templately")),r.canLinkAccount&&he().createElement(Zx,{to:"sign-in",query:{"add-account":!0},className:"tb-link-account templately-button"},(0,At.__)("Link My Account","templately")),r.isLoggedIn&&!r.canLinkAccount&&he().createElement(pl,{className:"tb-logout",onClick:function(){return r.logout({isGloballySigned:!r.signedAsGlobal&&r.canUnLinkAccount?!r.isGloballySigned:r.isGloballySigned})},label:!r.signedAsGlobal&&r.canUnLinkAccount?(0,At.__)("Unlink My Account","templately"):(0,At.__)("Logout","templately")})))});var iD=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Downloaded At",id:"downloaded_at"}]];const aD=gn(function(e){var t,n,r,o,i,a,l,s,c,u=e.general.platform,d=null!==(t=null===(n=e.profile.downloads)||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1;return{currentPage:d,totalPage:null!==(r=null===(o=e.profile.downloads)||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1,platform:u,items:null!==(i=(null===(a=e.profile.downloads)||void 0===a?void 0:a[d])&&e.profile.downloads[d])&&void 0!==i?i:[],isLoading:null===(l=e.profile.downloads)||void 0===l?void 0:l.isLoading,is_verified:null!==(s=null===(c=e.profile.data)||void 0===c?void 0:c.is_verified)&&void 0!==s&&s}},function(e){return{getDownloads:function(t){return e(ea(t))}}})(function(e){var t=ce((0,pe.useState)([]),2),n=t[0],r=t[1];(0,pe.useEffect)(function(){e.currentPage>1&&0==e.items.length&&e.getDownloads({page:e.currentPage})},[e.currentPage]),(0,pe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:he().createElement(Zx,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},he().createElement(NC,{title:t.name,thumbnail:t.thumbnail}))},[{id:"type",data:t.type},{id:"downloaded_at",data:t.downloaded_at}]]});r(t)}},[e.items]);var o=Vn()("templately-my-downloads",{"templately-has-no-items":0==n.length});return he().createElement("div",{className:o},he().createElement("div",{className:"templately-items templately-download-items"},n.length>0&&!e.isLoading&&he().createElement(o_,{view:"list",head:he().createElement(l_,{columns:iD})},he().createElement(c_,{view:"list",data:n})),0===n.length&&!e.isLoading&&he().createElement(lC,{is_verified:e.is_verified})),e.totalPage>1&&he().createElement(tC,{states:["profile","downloads"],type:"downloads",total:e.totalPage}))});function lD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const cD=gn(function(e){var t,n,r,o,i,a,l,s,c,u,d,p,f,h,m=e.general.platform,g=null!==(t=e.profile.favourites.type)&&void 0!==t?t:"all",v=null!==(n=e.profile.favourites.plan)&&void 0!==n?n:"all",y=null!==(r=null===(o=e.profile.favourites)||void 0===o||null===(o=o[v])||void 0===o||null===(o=o[m])||void 0===o||null===(o=o[g])||void 0===o?void 0:o.currentPage)&&void 0!==r?r:1;return{currentPage:y,totalPage:null!==(i=null===(a=e.profile.favourites)||void 0===a||null===(a=a[v])||void 0===a||null===(a=a[m])||void 0===a||null===(a=a[g])||void 0===a?void 0:a.totalPage)&&void 0!==i?i:1,platform:m,type:g,plan:v,items:null!==(l=(null===(s=e.profile.favourites)||void 0===s?void 0:s[v])&&(null===(c=e.profile.favourites[v])||void 0===c?void 0:c[m])&&(null===(u=e.profile.favourites[v][m])||void 0===u?void 0:u[g])&&(null===(d=e.profile.favourites[v][m][g])||void 0===d?void 0:d[y])&&e.profile.favourites[v][m][g][y])&&void 0!==l?l:[],isLoggedIn:null!==(null===(p=e.profile)||void 0===p?void 0:p.data),is_verified:null!==(f=null===(h=e.profile.data)||void 0===h?void 0:h.is_verified)&&void 0!==f&&f}},function(e){return{getFavourites:function(t){return e(zi(t))}}})(function(e){var t=ce((0,pe.useState)(e.plan),2),n=t[0],r=t[1],o=ce((0,pe.useState)(e.type),2),i=o[0],a=o[1],l=ce((0,pe.useState)(e.currentPage),2),s=l[0],c=l[1];(0,pe.useEffect)(function(){e.type===i&&e.plan===n&&e.currentPage==s||(e.getFavourites({platform:e.platform,itemType:e.type,plan:e.plan,page:e.currentPage}),r(n),a(i),c(e.currentPage))},[e.type,e.plan,e.currentPage]);var u=(0,Ea.isArray)(e.items)&&e.items.length>0,d=!(0,Ea.isArray)(e.items)||0===e.items.length||"empty"===e.items,p=Vn()("templately-my-favourites",{"templately-has-no-items":d});return he().createElement("div",{className:p},u?he().createElement(qD,{items:e.items.map(function(e){return sD(sD({},e),{},{id:parseInt(e.id)})}),isLoggedIn:e.isLoggedIn,platform:e.platform,totalPage:e.totalPage,type:"favourites",pagination:{states:["profile","favourites",e.plan,e.platform,e.type]}}):he().createElement(lC,{is_verified:e.is_verified}))}),uD=gn(function(e){var t,n;return{activeType:null!==(t=e.profile.favourites.type)&&void 0!==t?t:"all",activePlan:null!==(n=e.profile.favourites.plan)&&void 0!==n?n:"all"}},function(e){return{setFavouriteFilter:function(t,n){return e(Pi({type:Kr},{filter:t,data:n}))}}})(function(e){var t=function(t){e.setFavouriteFilter("type",t)},n=function(t){e.setFavouriteFilter("plan",t)};return he().createElement("div",{className:"templatley-favourites-filter"},he().createElement("div",{className:"tf-type-filter templately-plan-switcher"},he().createElement("button",{onClick:function(){return t("all")},className:"templately-button components-button tb-all tf-filter-btn ".concat("all"==e.activeType?"templately-plan-active":"")},(0,At.__)("All","templately")),he().createElement("button",{onClick:function(){return t("block")},className:"templately-button components-button tb-blocks tf-filter-btn ".concat("block"==e.activeType?"templately-plan-active":"")},(0,At.__)("Blocks","templately")),he().createElement("button",{onClick:function(){return t("page")},className:"templately-button components-button tb-pages tf-filter-btn ".concat("page"==e.activeType?"templately-plan-active":"")},(0,At.__)("Pages","templately")),he().createElement("button",{onClick:function(){return t("pack")},className:"templately-button components-button tb-packs tf-filter-btn ".concat("pack"==e.activeType?"templately-plan-active":"")},(0,At.__)("Packs","templately"))),he().createElement("div",{className:"tf-plan-filter templately-plan-switcher"},he().createElement("button",{onClick:function(){return n("all")},className:"templately-button components-button tb-all tf-plan-btn ".concat("all"==e.activePlan?"templately-plan-active":"")},(0,At.__)("All","templately")),he().createElement("button",{onClick:function(){return n("starter")},className:"templately-button components-button tb-starter tf-plan-btn ".concat("starter"==e.activePlan?"templately-plan-active":"")},(0,At.__)("Starter","templately")),he().createElement("button",{onClick:function(){return n("pro")},className:"templately-button components-button tb-pro tf-plan-btn ".concat("pro"==e.activePlan?"templately-plan-active":"")},(0,At.__)("Pro","templately"))))});function dD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fD=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Actions",id:"actions"},{name:"Purchasd Date",id:"downloaded_at"}]];const hD=gn(function(e){var t,n,r,o,i,a,l,s,c,u,d=e.general.platform,p=null!==(t=null===(n=e.profile.purchasedItems)||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1;return{currentPage:p,totalPage:null!==(r=null===(o=e.profile.purchasedItems)||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1,platform:d,items:null!==(i=(null===(a=e.profile.purchasedItems)||void 0===a?void 0:a[p])&&e.profile.purchasedItems[p])&&void 0!==i?i:[],isLoggedIn:null!==(null===(l=e.profile)||void 0===l?void 0:l.data),isLoading:null===(s=e.profile.purchasedItems)||void 0===s?void 0:s.isLoading,is_verified:null!==(c=null===(u=e.profile.data)||void 0===u?void 0:u.is_verified)&&void 0!==c&&c}},function(e){return{getPurchasedItems:function(t){return e(Hi(t))}}})(function(e){var t=ce((0,pe.useState)([]),2),n=t[0],r=t[1],o=rt();(0,pe.useEffect)(function(){e.currentPage>1&&0==e.items.length&&e.getPurchasedItems({page:e.currentPage})},[e.currentPage]),(0,pe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:he().createElement(Zx,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},he().createElement(NC,{title:t.name,thumbnail:t.thumbnail}))},[{id:"type",data:Ga(t.type)},{id:"actions",data:he().createElement(he().Fragment,null,"pack"!=t.type&&he().createElement(pl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?fd({ModalComponent:rd,content:pD(pD({},t),{},{origin:"remote",id:t.item_id})}):o(nb("sign-in"))},label:he().createElement(he().Fragment,null,he().createElement(Jn,null),(0,At.__)("Insert","templately"))}),"pack"==t.type&&he().createElement(Zx,{className:"templately-purchased-item-btn tb-import templately-button tb-import-secondary",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},he().createElement(tr,null),(0,At.__)("View","templately")))},{id:"purchased_at",data:t.purchased_at}]]});r(t)}},[e.items]);var i=Vn()("templately-my-downloads",{"templately-has-no-items":0==n.length});return he().createElement("div",{className:i},he().createElement("div",{className:"templately-items templately-download-items"},n.length>0&&!e.isLoading&&he().createElement(o_,{view:"list",head:he().createElement(l_,{columns:fD})},he().createElement(c_,{view:"list",data:n})),0===n.length&&!e.isLoading&&he().createElement(lC,{is_verified:e.is_verified})),e.totalPage>1&&he().createElement(tC,{states:["profile","purchasedItems"],type:"purchasedItems",total:e.totalPage}))}),mD=function(e){var t=[];return"clouds"===e.type&&t.push(he().createElement(ul,{key:"search"})),"favourites"===e.type&&t.push(he().createElement(uD,{key:"favourites"})),["favourites","purchasedItems","downloads","profile"].includes(e.type)||t.push(he().createElement(UC,{key:"view_buttons",type:e.type})),0==t.length?null:he().createElement("div",{className:"templately-cloud-actions tca-".concat(e.type)},t)};function gD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const yD=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p=null==(null==t?void 0:t.q)?"items":"search",f=e.general.platform,h=null!==(n=null===(r=e.clouds[p])||void 0===r||null===(r=r[f])||void 0===r?void 0:r.currentPage)&&void 0!==n?n:1,m=null!==(o=null===(i=e.clouds[p])||void 0===i||null===(i=i[f])||void 0===i?void 0:i.totalPage)&&void 0!==o?o:1;return{items:null!==(a=(null===(l=e.clouds[p])||void 0===l?void 0:l[f])&&(null===(s=e.clouds[p])||void 0===s||null===(s=s[f])||void 0===s?void 0:s[h]))&&void 0!==a?a:[],current_screen:e.general.current_screen,platform:f,currentPage:h,totalPage:m,isLoggedIn:null!==(null===(c=e.profile)||void 0===c?void 0:c.data),view:e.clouds.view,is_verified:null!==(u=null===(d=e.profile.data)||void 0===d?void 0:d.is_verified)&&void 0!==u&&u}},function(e){return{getClouds:function(t){return e(Mv(t))}}})(function(e){var t=ce((0,pe.useState)([]),2),n=t[0],r=t[1],o=rt(),i=ce(Ct(),1)[0],a=(0,pe.useRef)(e.currentPage);(0,pe.useEffect)(function(){e.currentPage>1&&a.current!==e.currentPage&&e.getClouds({page:e.currentPage,search:i.get("q")})},[e.currentPage]),(0,pe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:he().createElement(NC,{title:t.name,platform:e.platform})},[{id:"last_modified",data:he().createElement(he().Fragment,null,he().createElement("p",null,t.last_modified),"templately"!==e.current_screen&&"grid"===e.view&&he().createElement(pl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?fd({ModalComponent:rd,content:vD(vD({},t),{},{origin:"cloud",my_cloud_id:t.id})}):o(nb("sign-in"))},label:he().createElement(he().Fragment,null,he().createElement(Jn,null),(0,At.__)("Insert","templately"))}))},{id:"action",data:he().createElement(WC,{args:{content:vD(vD({},t),{},{my_cloud_id:t.id,origin:"cloud"})},menus:Ug(!1,e.current_screen,e.view)})}]]});r(t)}},[e.items,e.view]);var l=Vn()("templately-my-clouds",{"templately-has-no-items":0==n.length});return he().createElement("div",{className:l},n.length>0?he().createElement(o_,{view:e.view,head:he().createElement(l_,null)},he().createElement(c_,{view:e.view,data:n})):he().createElement(lC,{is_verified:e.is_verified}),e.totalPage>1&&he().createElement(tC,{type:"clouds",total:e.totalPage,isSearch:i.has("q"),states:["clouds",i.has("q")?"search":"items",e.platform]}))}),bD=gn(function(e){var t,n,r,o;return{platform:e.general.platform,cloud_activity:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.cloud_activity)&&void 0!==t?t:null,workspaces:null!==(r=e.workspaces.lists)&&void 0!==r?r:[],sharedWorkspaces:null!==(o=e.sharedWorkspaces.lists)&&void 0!==o?o:[],workspacesLoading:e.workspaces.isLoading,sharedWorkspacesLoading:e.sharedWorkspaces.isLoading,isPushing:e.clouds.push2cloud.isLoading,push2cloud:e.clouds.push2cloud}},function(e){return{getWorkSpaceLists:function(t){return e(ey(t))},pushToCloud:function(t){return e(Vv(t))}}})(function(e){var t,n=e.workspaces,r=e.sharedWorkspaces,o=(e.workspacesLoading,e.sharedWorkspacesLoading,ce((0,pe.useState)(""),2)),i=o[0],a=o[1],l=ce((0,pe.useState)(null),2),s=l[0],c=l[1],u=ce((0,pe.useState)(e.cloud_activity),2),d=u[0],p=u[1],f=ce((0,pe.useState)(!0),2),h=f[0],m=f[1],g=ce((0,pe.useState)(!1),2),v=g[0],y=g[1];(0,pe.useEffect)(function(){0==n.length&&e.getWorkSpaceLists({list_only:!0}),0==r.length&&e.getWorkSpaceLists({list_only:!0,shared:!0})},[]),(0,pe.useEffect)(function(){var e=[{label:(0,At.__)("My Clouds","templately"),value:"clouds"}];n.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:Ua(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Ua(r)}),e.length>0&&c(e)},[n,r]),(0,pe.useEffect)(function(){i.length>0&&null!=(null==d?void 0:d.value)?m(!1):m(!0)},[i,d]);var b=(0,Xu.useSelect)(function(e){return e("core/editor")},[]),w=(0,Xu.useDispatch)("core/editor",[]);if((0,pe.useEffect)(function(){if(v){var t,n=null,r="clouds"===d.value?0:null!==(t=null==d?void 0:d.value)&&void 0!==t?t:0;if("gutenberg"===e.platform&&((n={__file:"wp_block",id:null==b?void 0:b.getCurrentPostId(),type:null==b?void 0:b.getCurrentPostType(),title:null==b?void 0:b.getEditedPostAttribute("title"),content:null==b?void 0:b.getEditedPostContent()}).content.length,null==w||w.savePost()),"elementor"===e.platform){var o,a=e.page,l=null==a||!0===a?null===(o=window)||void 0===o||null===(o=o.elementor)||void 0===o||null===(o=o.previewView)||void 0===o||null===(o=o.el)||void 0===o||null===(o=o.firstElementChild)||void 0===o?void 0:o.firstElementChild:null==e?void 0:e.currentElement;null!=l&&(s=l,p=window.elementor,null!=s&&s.model&&s.model.get("elType"),null!=p&&null!==(c=p.config)&&void 0!==c&&null!==(c=c.document)&&void 0!==c&&c.library&&null!==(u=p.config.document.library)&&void 0!==u&&u.save_as_same_type&&p.config.document.type,n=null!=s&&s.model?[s.model.toJSON({remove:["default"]})]:p.elements.toJSON({remove:["default"]}))}null==n&&xl({icon:"error",html:he().createElement(oC,{title:(0,At.__)("Page is empty","templately"),content:(0,At.__)("Please add some content before saving your template.","templately")})},!1),null!=n&&e.pushToCloud({saveTemplate:!0,workspace_id:r,workspace:r>0?d:null,name:i,file_content:n}),y(!1)}var s,c,u,p},[v]),(0,pe.useEffect)(function(){var t;void 0!==(null===(t=e.push2cloud)||void 0===t?void 0:t.status)&&"success"!==e.push2cloud.status&&xl({icon:"error",html:he().createElement(oC,{title:(0,At.__)("Something must went wrong!","templately"),content:e.push2cloud.message})},!1)},[e.push2cloud]),!0===e.isPushing)return he().createElement("div",{className:"templately-save-templates"},he().createElement(El,{text:(0,At.__)("Uploading...","templately"),description:(0,At.__)("Your template content is being pushed into Templately Cloud. Please do not refresh or close this tab.","templately")}));if(0==e.isPushing&&null!=(null===(t=e.push2cloud)||void 0===t?void 0:t.redirect)){var E;"success"===e.push2cloud.status&&xl({icon:"success",timer:1500,html:he().createElement(oC,{title:(0,At.__)("Successfully Pushed!","templately"),content:(0,At.__)("Your template is successfully pushed to your desire cloud folder. You will be redirected there.","templately")})},!1),"success"!==e.push2cloud.status&&xl({icon:"error",timer:1500,html:he().createElement(oC,{title:(0,At.__)("Something must went wrong!","templately"),content:e.push2cloud.message})},!1);var k=null!==(E=e.push2cloud)&&void 0!==E&&E.refresh?{refresh:!0}:null;return he().createElement(gt,{to:nb(e.push2cloud.redirect,k),replace:!0})}return he().createElement("div",{className:"templately-save-templates"},he().createElement("div",{className:"tst-form-wrapper"},he().createElement("h3",null,(0,At.__)("Save your templates and push to cloud","templately")),he().createElement("div",{className:"tst-form"},he().createElement("div",{className:"tst-form-inputs"},he().createElement(hl,{placeholder:(0,At.__)("Type a name for the template...","templately"),value:i,onChange:function(e){return a(e.target.value)},wrapper:!1}),he().createElement(Dg,{placeholder:(0,At.__)("Select ","templately"),className:"twfa-switcher",classNamePrefix:"templately",options:s,value:d,isLoading:null==s,loadingMessage:function(){return(0,At.__)("Loading workspace and shared workspaces list.","templately")},onChange:function(e){return p(e)}})),he().createElement(pl,{disabled:h,onClick:function(){return y(!0)},label:(0,At.__)("Save & Push","templately"),className:"templately-button tb-save-n-push"}))))}),wD=gn(function(e,t){var n,r,o,i,a=t.shared?"sharedWorkspaces":"workspaces",l=null==e?void 0:e[a].isLoading,s=null==e?void 0:e[a].currentPage,c=null==e?void 0:e[a].totalPage,u=null!==(n=null==e||null===(r=e[a])||void 0===r?void 0:r[s])&&void 0!==n?n:[];return{view:null==e?void 0:e[a].view,isLoading:l,currentPage:s,totalPage:c,items:u,is_verified:null!==(o=null===(i=e.profile.data)||void 0===i?void 0:i.is_verified)&&void 0!==o&&o}},function(e){return{getWorkSpaces:function(t){return e(Jv(t))}}})(function(e){var t=e.shared,n=e.view,r=void 0!==n&&n,o=Vn()("templately-workspaces",{"templately-shared":t||r,"templately-list-view":"list"===e.view});return(0,pe.useEffect)(function(){!e.isLoading&&e.currentPage>1&&e.getWorkSpaces({page:e.currentPage,shared:t})},[e.currentPage]),he().createElement("div",{className:o},!1===e.is_verified&&he().createElement("p",{className:"text-danger templately-not-verified-account"},(0,At.__)("Please verify your email to continue.","templately")),he().createElement("div",{className:"templately-workspaces-row"},!t&&he().createElement(eD,{addNew:!0,name:(0,At.__)("Add New WorkSpace","templately")}),e.items.length>0?e.items.map(function(e){return he().createElement(eD,re({shared:t},e,{key:e.slug}))}):he().createElement(XC,{title:t?(0,At.__)("No shared workspaces yet.","templately"):(0,At.__)("You do not have any workspaces.","templately")})),e.totalPage>1&&he().createElement(tC,{type:e.shared?"sharedWorkspaces":"workspaces",total:e.totalPage}))}),ED=window.wp.element,kD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 14"},he().createElement("path",{d:"M14.58 0H3.42C1.54 0 0 1.522 0 3.4v6.39c0 1.878 1.522 3.4 3.42 3.4h11.16c1.88 0 3.401-1.522 3.42-3.42V3.4C18 1.523 16.46 0 14.58 0zm0 1.202c.376 0 .733.094 1.053.282l-4.698 3.514a3.27 3.27 0 01-3.87 0L2.367 1.484c.32-.169.677-.282 1.053-.282h11.16zm2.217 8.587a2.221 2.221 0 01-2.217 2.217H3.42A2.221 2.221 0 011.203 9.79V3.401c0-.376.112-.752.3-1.09l4.848 3.626a4.454 4.454 0 005.298 0l4.848-3.626c.188.338.3.695.3 1.09v6.388z"}))},OD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 18"},he().createElement("path",{d:"M12.136 6.435h-.856V4.29A4.295 4.295 0 006.99 0a4.295 4.295 0 00-4.291 4.29v2.145h-.856A1.845 1.845 0 000 8.278v7.879C0 17.173.827 18 1.843 18h10.293a1.845 1.845 0 001.843-1.843v-7.88a1.845 1.845 0 00-1.843-1.842zM4.08 4.29a2.912 2.912 0 012.908-2.909 2.912 2.912 0 012.909 2.909v2.144H4.08V4.291zm8.516 11.866c0 .254-.207.46-.461.46H1.843a.461.461 0 01-.46-.46v-7.88c0-.253.206-.46.46-.46h10.293c.254 0 .46.207.46.46v7.88z"}))},SD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},he().createElement("g",{mask:"url(#mask0_39_149)"},he().createElement("path",{d:"M12.888 16.153c1.25 0 2.312-.437 3.187-1.312s1.313-1.938 1.313-3.188c0-1.25-.438-2.312-1.313-3.187s-1.937-1.313-3.187-1.313c-1.25 0-2.313.438-3.188 1.313s-1.312 1.937-1.312 3.187c0 1.25.437 2.313 1.312 3.188s1.938 1.312 3.188 1.312zm0-1.8c-.75 0-1.388-.262-1.913-.787a2.604 2.604 0 01-.787-1.913c0-.75.262-1.387.787-1.912a2.604 2.604 0 011.913-.788c.75 0 1.387.263 1.912.788.525.525.788 1.162.788 1.912s-.263 1.388-.788 1.913a2.604 2.604 0 01-1.912.787zm0 4.8c-2.434 0-4.65-.679-6.65-2.037-2-1.358-3.45-3.18-4.35-5.463.9-2.283 2.35-4.104 4.35-5.462 2-1.358 4.216-2.038 6.65-2.038 2.433 0 4.65.68 6.65 2.038 2 1.358 3.45 3.18 4.35 5.462-.9 2.284-2.35 4.105-4.35 5.463-2 1.358-4.217 2.037-6.65 2.037zm0-2a9.544 9.544 0 005.187-1.487 9.773 9.773 0 003.613-4.013 9.773 9.773 0 00-3.613-4.012 9.545 9.545 0 00-5.187-1.488A9.545 9.545 0 007.7 7.641a9.773 9.773 0 00-3.612 4.012A9.773 9.773 0 007.7 15.666a9.544 9.544 0 005.188 1.487z"})))},xD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},he().createElement("g",{mask:"url(#mask0_39_140)"},he().createElement("path",{d:"M16.988 13.925l-1.45-1.45c.15-.783-.075-1.516-.675-2.2-.6-.683-1.375-.95-2.325-.8l-1.45-1.45c.283-.133.57-.233.862-.3.292-.066.604-.1.938-.1 1.25 0 2.312.438 3.187 1.313s1.313 1.937 1.313 3.187c0 .334-.034.646-.1.938-.067.291-.167.579-.3.862zm3.2 3.15l-1.45-1.4a10.951 10.951 0 001.687-1.587 8.898 8.898 0 001.263-1.963c-.834-1.683-2.03-3.02-3.588-4.012-1.558-.992-3.296-1.488-5.212-1.488-.484 0-.959.034-1.425.1a9.625 9.625 0 00-1.375.3l-1.55-1.55a11.081 11.081 0 014.35-.85c2.516 0 4.758.696 6.725 2.088 1.966 1.391 3.391 3.196 4.275 5.412a11.696 11.696 0 01-1.513 2.738 11.007 11.007 0 01-2.187 2.212zm.5 6.15l-4.2-4.15c-.584.184-1.171.321-1.763.413-.591.091-1.204.137-1.837.137-2.517 0-4.759-.696-6.725-2.087-1.967-1.392-3.392-3.196-4.275-5.413.35-.883.791-1.704 1.325-2.462a11.514 11.514 0 011.825-2.038l-2.75-2.8 1.4-1.4 18.4 18.4-1.4 1.4zm-14.25-14.2c-.484.434-.925.909-1.325 1.425a9.016 9.016 0 00-1.025 1.675c.833 1.684 2.029 3.021 3.587 4.013 1.559.991 3.296 1.487 5.213 1.487.333 0 .658-.02.975-.062.316-.042.641-.088.975-.138l-.9-.95c-.184.05-.359.088-.525.113a3.539 3.539 0 01-.525.037c-1.25 0-2.313-.437-3.188-1.312s-1.312-1.938-1.312-3.188c0-.183.012-.358.037-.525.025-.166.063-.341.113-.525l-2.1-2.05z"})))};var _D=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function CD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const PD=function(e){var t=e.id,n=e.onChange,r=void 0===n?null:n,o=e.onBlur,i=void 0===o?null:o,a=e.name,l=e.placeholder,s=void 0===l?null:l,c=e.type,u=void 0===c?"text":c,d=(e.withP,e.label),p=e.icon,f=e.typeChange,h=void 0===f?void 0:f,m=e.error,g=Wn(e,_D),v=ce((0,pe.useState)(u),2),y=v[0],b=v[1],w=null!=t?t:a,E={type:y,name:a,id:w};return(0,pe.useEffect)(function(){h&&b(u)},[]),null!=s&&(E=DD(DD({},E),{},{placeholder:s})),null!=i&&(E=DD(DD({},E),{},{onBlur:i})),null!=r&&(E=DD(DD({},E),{},{onChange:r})),he().createElement("div",{className:"tf-input tf-input-".concat(null!=u?u:"text")},d&&"checkbox"!==u&&"radio"!==u?he().createElement("label",{htmlFor:w,className:"tf-input-label"},d):"",he().createElement("div",{className:"".concat(h?"has-change-button":""," ").concat(p?"has-icon":""," ").concat(null!=m&&m.hasError?"has-error":"")},null!=p?p:"",he().createElement("input",re({},E,g)),h?he().createElement("button",{onClick:function(){b(y===u?null==h?void 0:h.type:u)}},y===u?null==h?void 0:h.primaryText:null==h?void 0:h.secondaryText):""),!d||"checkbox"!==u&&"radio"!==u?"":he().createElement("label",{htmlFor:w,className:"tf-input-label"},d),(null==m?void 0:m.hasError)&&(null==m?void 0:m.errorMessage)&&he().createElement("div",{className:"tf-error-message"},he().createElement(Bn,null),he().createElement(ED.RawHTML,null,null==m?void 0:m.errorMessage)))};var AD=["isLoading","setTab","getSignedIn"];function TD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const MD=gn(function(e){var t,n,r,o;return{platform:e.general.platform,isLoading:e.profile.isLoading,isLoggedIn:null!=e.profile.data,profileData:e.profile.data,loggedInError:null!==(t=null===(n=e.profile)||void 0===n?void 0:n.error)&&void 0!==t&&t,isGloballySigned:null!==(r=null===(o=e.profile)||void 0===o?void 0:o.is_globally_signed)&&void 0!==r&&r}},function(e){return{logout:function(t){return e(Ti(t))},logoutSuccess:function(t){return e(Fi(t))},getSignedIn:function(t){return e(function(e){return Pi({type:yr},e)}(t))},getSignedInFailed:function(t){return e(Ii(t))},errorCleanUp:function(t){return e(Li(t))}}})(function(e){var t,n,r,o,i,a,l,s,c,u=e.isLoading,d=(e.setTab,e.getSignedIn),p=Wn(e,AD),f=rt(),h=ce(Ct(),1)[0],m=tt(),g=ce((0,pe.useState)(null),2),v=g[0],y=g[1],b=ce((0,pe.useState)(!1),2),w=b[0],E=b[1],k=ce((0,pe.useState)(!1),2),O=k[0],S=k[1],x=ce((0,pe.useState)(!0),2),_=x[0],C=x[1],D=ce((0,pe.useState)(!1),2),P=D[0],A=D[1],T=ce((0,pe.useState)({viaAPI:!1}),2),F=T[0],M=T[1],I=ce((0,pe.useState)(null),2),N=I[0],j=I[1],L=ce((0,pe.useState)({}),2),R=L[0],B=L[1],z=function(e){var t=Ka(e,F),n=t.isValid,r=t.title,o=t.content;B(FD(FD({},R),{},Pt({},e,{isValid:n,title:r,content:o}))),n||C(!0)};return(0,pe.useEffect)(function(){p.errorCleanUp(),j({}),null===v&&y(p.profileData)},[]),(0,pe.useEffect)(function(){if(O){var e,t,n=!(null===(e=null==R||null===(t=R.api_key)||void 0===t?void 0:t.isValid)||void 0===e||e)||void 0===(null==F?void 0:F.api_key)||""===(null==F?void 0:F.api_key);C(n)}else{var r=!1;["email","password"].map(function(e){var t,n;r||(r=void 0===(null==F?void 0:F[e])||""==(null==F?void 0:F[e])),r||(r=!(null===(t=null===(n=R[e])||void 0===n?void 0:n.isValid)||void 0===t||t))}),C(r)}N&&j(null)},[F,R]),(0,pe.useEffect)(function(){M(function(e){return FD(FD({},e),{},{viaAPI:O})})},[O]),(0,pe.useEffect)(function(){var e;P&&(E(!0),d(F),C(!0),A(!1),null!=m&&null!==(e=m.state)&&void 0!==e&&e.redirectTo&&f(nb(m.state.redirectTo),{replace:!0}))},[P]),(0,pe.useEffect)(function(){var e,t,n,r,o,i,a,l,s,c="".concat(p.platform,"/packs");if(null!==v&&(null===(e=p.profileData)||void 0===e?void 0:e.id)!==v.id&&p.isLoggedIn&&h.get("add-account")&&!Ia(null==m||null===(t=m.state)||void 0===t?void 0:t.is_logging_out)&&f(nb(c,{platform:p.platform},["add-account"])),p.isLoggedIn&&!h.get("add-account")&&(null==m||null===(n=m.state)||void 0===n||!n.signed_in_failed)&&!Ia(null==m||null===(r=m.state)||void 0===r?void 0:r.is_logging_out)){var u=(null==h?void 0:h.get("redirect-to"))||c;f(nb(u,{platform:p.platform},["redirect-to"]))}Ia(null===(o=m.state)||void 0===o?void 0:o.is_logging_out)&&(p.logoutSuccess({trying_logout:!0,isGloballySigned:null===(a=m.state)||void 0===a?void 0:a.is_logging_out}),p.logout(null===(l=m.state)||void 0===l?void 0:l.is_logging_out),null!=m&&null!==(s=m.state)&&void 0!==s&&s.is_logging_out&&delete m.state.is_logging_out),null!=m&&null!==(i=m.state)&&void 0!==i&&i.signed_in_failed&&delete m.state.signed_in_failed},[p.isLoggedIn,p.profileData]),(0,pe.useEffect)(function(){if(p.loggedInError)if(E(!1),C(!1),Ia(p.loggedInError.message)){var e,t={},n=(0,At.__)("Oops...!","templately"),r=(null===(e=p.loggedInError.message)||void 0===e?void 0:e.message)||{};"login_error"===p.loggedInError.message.code&&Object.keys(r).map(function(e){var o=r[e];t[e]={isValid:!1,title:n,content:o}}),Object.keys(t).length>0&&B(FD({},t))}else"string"==typeof p.loggedInError.message&&j(p.loggedInError.message);else j({})},[p.loggedInError]),(0,pe.useEffect)(function(){var e=h.get("error_message")||h.get("error");e&&p.getSignedInFailed({code:"login_error",message:e})},[m.search]),he().createElement(he().Fragment,null,he().createElement("div",{className:"tfu-signin tfu-content"},O?he().createElement(he().Fragment,null,he().createElement(PD,{type:"password",name:"api_key",key:"api_key",className:"tf-api-key",label:(0,At.__)("API Key","templately"),placeholder:(0,At.__)("Your API Key","templately"),disabled:w,error:{hasError:!(null===(t=null==R||null===(n=R.api_key)||void 0===n?void 0:n.isValid)||void 0===t||t),errorMessage:null===(r=R.api_key)||void 0===r?void 0:r.content},onBlur:function(){return z("api_key")},onChange:function(e){null==e||e.persist(),M(function(t){var n;return FD(FD({},t),{},{api_key:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}})):he().createElement(he().Fragment,null,he().createElement(PD,{type:"email",name:"email",key:"email",disabled:w,onBlur:function(){return z("email")},error:{hasError:!(null===(o=null==R||null===(i=R.email)||void 0===i?void 0:i.isValid)||void 0===o||o),errorMessage:null===(a=R.email)||void 0===a?void 0:a.content},label:(0,At.__)("Email Address","templately"),placeholder:(0,At.__)("Enter Your Email Address","templately"),icon:he().createElement(kD,null),onChange:function(e){null==e||e.persist(),M(function(t){var n;return FD(FD({},t),{},{email:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}}),he().createElement("div",{className:"tf-input-wrapper"},he().createElement(PD,{type:"password",name:"password",key:"password",disabled:w,label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),icon:he().createElement(OD,null),onBlur:function(){return B(FD(FD({},R),{},{password:{isValid:!0,title:"",content:""}}))},error:{hasError:!(null===(l=null==R||null===(s=R.password)||void 0===s?void 0:s.isValid)||void 0===l||l),errorMessage:null===(c=R.password)||void 0===c?void 0:c.content},typeChange:{type:"text",primaryText:he().createElement(xD,null),secondaryText:he().createElement(SD,null)},onChange:function(e){null==e||e.persist(),M(function(t){var n;return FD(FD({},t),{},{password:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}}),he().createElement("a",{className:"tf-forget-link",href:"https://templately.com/forgot-password?utm_source=plugin&utm_medium=SignIn",target:"_blank"},(0,At.__)("Forgot Password?","templately")))),N&&"string"==typeof N&&he().createElement("div",{className:"tf-global-error-message"},he().createElement(Bn,null),he().createElement(ED.RawHTML,null,N)),!p.isGloballySigned&&he().createElement("div",{className:"tf-global_signin"},he().createElement(PD,{type:"checkbox",name:"global_signin",label:(0,At.__)("Global Sign In","templately"),disabled:w,onChange:function(e){null==e||e.persist(),M(function(t){var n;return FD(FD({},t),{},{global_signin:null==e||null===(n=e.target)||void 0===n?void 0:n.checked})})}}),he().createElement("p",{className:"global_signin-helptext"},(0,At.__)("All the sitewide users will be logged in with this Templately account","templately"))),he().createElement("div",{className:"tfus-footer"},he().createElement("button",{className:"templately-button tb-signin",onClick:function(){return A(!_)},disabled:_},!u&&(0,At.__)("Sign In","templately"),u&&(0,At.__)("Signing In...","templately")),he().createElement("span",null,"or"),he().createElement(pl,{className:"tb-viapi",onClick:function(){return S(!O)}},!O&&(0,At.__)("Connect via API","templately"),O&&(0,At.__)("Connect via Login Credentials","templately")))),O?he().createElement("div",{className:"tfus-link-wrap"},he().createElement("a",{href:"https://templately.com/manage-sites",target:"_blank"},"Manage Site"),he().createElement("a",{href:"https://docs.templately.com/home/how-to-manage-sites-in-templately/",target:"_blank"},"Documentation")):"")}),ID=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 19"},he().createElement("path",{d:"M8.263 10.051a4.777 4.777 0 01-4.77-4.774A4.778 4.778 0 018.262.5a4.783 4.783 0 014.778 4.777 4.782 4.782 0 01-4.778 4.774zm0-7.991a3.217 3.217 0 000 6.432 3.22 3.22 0 003.218-3.215A3.222 3.222 0 008.263 2.06zM15.88 18.5a.78.78 0 01-.78-.78v-1.715a3.41 3.41 0 00-3.407-3.403H4.96a3.404 3.404 0 00-3.4 3.403v1.715a.78.78 0 11-1.56 0v-1.715a4.967 4.967 0 014.96-4.963h6.733a4.972 4.972 0 014.967 4.963v1.715a.78.78 0 01-.78.78z"}))};var ND=["setTab","getSignedUp"];function jD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const RD=gn(function(e){return{platform:e.general.platform,isLoading:e.profile.isLoading,isLoggedIn:null!=e.profile.data,error:e.profile.error}},function(e){return{getSignedUp:function(t){return e(function(e){return Pi({type:Er},e)}(t))},errorCleanUp:function(t){return e(Li(t))}}})(function(e){e.setTab;var t,n,r,o,i,a,l,s,c,u,d,p,f=e.getSignedUp,h=Wn(e,ND),m=rt(),g=ce((0,pe.useState)(!0),2),v=g[0],y=g[1],b=ce((0,pe.useState)(!1),2),w=b[0],E=b[1],k=ce((0,pe.useState)({}),2),O=k[0],S=k[1],x=ce((0,pe.useState)(null),2),_=x[0],C=x[1],D=ce((0,pe.useState)({}),2),P=D[0],A=D[1],T={first_name_error:"first_name",last_name_error:"last_name",email_error:"email"},F=(0,pe.useMemo)(function(){var e,t,n,r,o,i="",a=!0,l=!(null===(e=null===(t=P.first_name)||void 0===t?void 0:t.isValid)||void 0===e||e),s=!(null===(n=null===(r=P.last_name)||void 0===r?void 0:r.isValid)||void 0===n||n);if(l&&s)a=!1,i=(null===(o=P.first_name)||void 0===o?void 0:o.content)||"",i=new RegExp("First Name","i").test(i)?i.replace(/First Name/i,"First Name and Last Name"):(0,At.__)("First name and Last name cannot be empty.","templately");else if(l){var c;a=!1,i=null===(c=P.first_name)||void 0===c?void 0:c.content}else if(s){var u;a=!1,i=null===(u=P.last_name)||void 0===u?void 0:u.content}return{title:(0,At.__)("Oops...!","templately"),isValid:a,content:i}},[O,P]),M=function(e){var t=Ka(e,O),n=t.isValid,r=t.title,o=t.content;A(function(t){return LD(LD({},t),{},Pt({},e,{isValid:n,title:r,content:o}))})};return(0,pe.useEffect)(function(){h.errorCleanUp(),C({})},[]),(0,pe.useEffect)(function(){h.isLoggedIn&&m(nb([h.platform,"packs"]))},[h.isLoggedIn]),(0,pe.useEffect)(function(){if(Object.keys(O).length>=7){var e=!1;Object.keys(O).map(function(t){var n,r;e||(e=null==O[t].length?!O[t]:0==O[t].length),e||(e=!(null===(n=null===(r=P[t])||void 0===r?void 0:r.isValid)||void 0===n||n))}),y(e)}else y(!0);_&&C(null)},[O,P]),(0,pe.useEffect)(function(){w&&(f(O),y(!0),E(!1))},[w]),(0,pe.useEffect)(function(){if(h.error){var e={},t=(0,At.__)("Oops...!","templately");if(T[h.error.code]&&"string"==typeof h.error.message){var n=T[h.error.code],r=h.error.message;e[n]={isValid:!1,title:t,content:r}}else"signup_errors"==h.error.code&&Ia(h.error.message)?Object.keys(h.error.message).map(function(n){var r=h.error.message[n];e[n]={isValid:!1,title:t,content:r}}):"string"==typeof h.error.message&&C(h.error.message);Na(h.error.additional_errors)&&Object.values(h.error.additional_errors).map(function(n){if(T[null==n?void 0:n.code]){var r=T[null==n?void 0:n.code],o=n.message;e[r]={isValid:!1,title:t,content:o}}}),Ia(e)&&Object.keys(e).length>0&&A(LD({},e))}else C({})},[h.error]),he().createElement("div",{className:"tfu-signup tfu-content"},he().createElement("div",{className:"tfu-row tfu-cols-2"},he().createElement(PD,{name:"first_name",label:(0,At.__)("First Name","templately"),placeholder:(0,At.__)("First Name","templately"),onBlur:function(){return M("first_name")},error:{hasError:!(null===(t=null===(n=P.first_name)||void 0===n?void 0:n.isValid)||void 0===t||t)},icon:he().createElement(ID,null),onChange:function(e){return S(function(t){return LD(LD({},t),{},{first_name:e.target.value})})}}),he().createElement(PD,{name:"last_name",label:(0,At.__)("Last Name","templately"),placeholder:(0,At.__)("Last Name","templately"),onBlur:function(){return M("last_name")},error:{hasError:!(null===(r=null===(o=P.last_name)||void 0===o?void 0:o.isValid)||void 0===r||r)},icon:he().createElement(ID,null),onChange:function(e){return S(function(t){return LD(LD({},t),{},{last_name:e.target.value})})}}),he().createElement("div",{className:"tfu-error-wrapper"},!(null===(i=null==F?void 0:F.isValid)||void 0===i||i)&&F.content&&he().createElement("div",{className:"tf-error-message"},he().createElement(Bn,null),he().createElement(ED.RawHTML,null,F.content)))),he().createElement(PD,{type:"text",name:"email",label:(0,At.__)("Email Address","templately"),placeholder:(0,At.__)("Enter Your Email Address","templately"),onBlur:function(){return M("email")},error:{hasError:!(null===(a=null===(l=P.email)||void 0===l?void 0:l.isValid)||void 0===a||a),errorMessage:null===(s=P.email)||void 0===s?void 0:s.content},icon:he().createElement(kD,null),onChange:function(e){return S(function(t){return LD(LD({},t),{},{email:e.target.value})})}}),he().createElement("div",{className:"tfu-row tfu-cols-2"},he().createElement(PD,{type:"password",name:"password",label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),onBlur:function(){M("password"),M("confirm_password")},error:{hasError:!(null===(c=null===(u=P.password)||void 0===u?void 0:u.isValid)||void 0===c||c)},icon:he().createElement(OD,null),onChange:function(e){return S(function(t){return LD(LD({},t),{},{password:e.target.value})})}}),he().createElement(PD,{type:"password",name:"confirm_password",label:(0,At.__)("Confirm Password","templately"),placeholder:(0,At.__)("Confirm Password","templately"),onBlur:function(){return M("confirm_password")},error:{hasError:!(null===(d=null===(p=P.confirm_password)||void 0===p?void 0:p.isValid)||void 0===d||d)},icon:he().createElement(OD,null),onChange:function(e){return S(function(t){return LD(LD({},t),{},{confirm_password:e.target.value})})}}),he().createElement("div",{className:"tfu-error-wrapper"},["password","confirm_password","password_mismatched"].map(function(e){var t,n,r,o;return null!==(t=null===(n=P[e])||void 0===n?void 0:n.isValid)&&void 0!==t&&!t&&null!==(r=P[e])&&void 0!==r&&r.content?he().createElement("div",{className:"tf-error-message"},he().createElement(Bn,null),he().createElement(ED.RawHTML,null,null===(o=P[e])||void 0===o?void 0:o.content)):he().createElement(he().Fragment,null)}))),he().createElement("div",{className:"tfu-consent-wrapper"},he().createElement("div",{className:"tfu-consent"},he().createElement(PD,{withP:!1,type:"checkbox",name:"privacy_consent",id:"tfu-privacy_consent",label:he().createElement(he().Fragment,null,(0,At.__)("I agree to the Templately ","templately")," ",he().createElement("a",{href:"https://templately.com/privacy-policy?utm_source=plugin&utm_medium=SignUp",target:"_blank"},(0,At.__)("Privacy Policy","templately")),"."),onChange:function(e){return S(function(t){return LD(LD({},t),{},{privacy_consent:e.target.checked})})}})),he().createElement("div",{className:"tfu-consent"},he().createElement(PD,{withP:!1,type:"checkbox",name:"terms_consent",id:"tfu-terms_consent",label:he().createElement(he().Fragment,null,(0,At.__)("I agree to the Templately ","templately")," ",he().createElement("a",{href:"https://templately.com/terms-of-services?utm_source=plugin&utm_medium=SignUp",target:"_blank"},(0,At.__)("Terms of Services","templately")),"."),onChange:function(e){return S(function(t){return LD(LD({},t),{},{terms_consent:e.target.checked})})}}))),_&&"string"==typeof _&&he().createElement("div",{className:"tf-global-error-message"},he().createElement(Bn,null),he().createElement(ED.RawHTML,null,_)),he().createElement("div",{className:"tfus-footer"},he().createElement("button",{disabled:v,onClick:function(){return E(!0)},className:"templately-button tb-signin"},(0,At.__)("Sign Up","templately"))))}),BD=function(){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},React.createElement("path",{fill:"#167EE6",d:"M19.856 10.52h-6.934a.554.554 0 0 0-.555.554v2.215c0 .306.248.554.554.554h3.905a5.2 5.2 0 0 1-2.243 2.63l1.665 2.882c2.67-1.544 4.25-4.255 4.25-7.289 0-.432-.032-.74-.096-1.088a.56.56 0 0 0-.546-.458"}),React.createElement("path",{fill:"#12B347",d:"M11.998 17.175a5.17 5.17 0 0 1-4.475-2.59L4.64 16.248a8.49 8.49 0 0 0 11.607 3.116v-.004l-1.665-2.883a5.14 5.14 0 0 1-2.585.7"}),React.createElement("path",{fill:"#0F993E",d:"M16.25 19.363v-.004l-1.665-2.882a5.14 5.14 0 0 1-2.585.698v3.326a8.5 8.5 0 0 0 4.25-1.138"}),React.createElement("path",{fill:"#FFD500",d:"M6.826 12c0-.942.257-1.823.699-2.585L4.643 7.754A8.4 8.4 0 0 0 3.5 12c0 1.546.415 2.997 1.143 4.246l2.882-1.661A5.14 5.14 0 0 1 6.826 12"}),React.createElement("path",{fill:"#FF4B26",d:"M11.998 6.826a5.15 5.15 0 0 1 3.285 1.18c.22.181.541.168.743-.034l1.57-1.57a.56.56 0 0 0-.032-.816A8.47 8.47 0 0 0 11.998 3.5a8.49 8.49 0 0 0-7.357 4.254l2.882 1.661a5.17 5.17 0 0 1 4.475-2.589"}),React.createElement("path",{fill:"#D93F21",d:"M15.285 8.005c.22.182.541.169.743-.033l1.57-1.57a.56.56 0 0 0-.032-.816A8.47 8.47 0 0 0 12 3.5v3.326a5.15 5.15 0 0 1 3.285 1.18"}))},zD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"356",height:"246",fill:"none",viewBox:"0 0 356 246"},he().createElement("g",{clipPath:"url(#clip0_21_2)"},he().createElement("g",{opacity:"0.7"},he().createElement("path",{fill:"url(#paint0_linear_21_2)",d:"M96.12 45.877l.574.92a168.403 168.403 0 015.545-3.305l-.536-.942a156.796 156.796 0 00-5.583 3.328z"}),he().createElement("path",{fill:"url(#paint1_linear_21_2)",d:"M85.376 53.208l.644.866c1.72-1.277 3.49-2.543 5.264-3.75l-.612-.892a158.97 158.97 0 00-5.296 3.776z"}),he().createElement("path",{fill:"url(#paint2_linear_21_2)",d:"M65.84 70.38l.779.752a158.383 158.383 0 014.588-4.556l-.747-.784a167.953 167.953 0 00-4.62 4.588z"}),he().createElement("path",{fill:"url(#paint3_linear_21_2)",d:"M107.422 39.456l.498.963c1.904-.98 3.852-1.937 5.794-2.84l-.455-.98a161.844 161.844 0 00-5.837 2.857z"}),he().createElement("path",{fill:"url(#paint4_linear_21_2)",d:"M75.26 61.393l.713.812a157.06 157.06 0 014.94-4.166l-.682-.839a159.63 159.63 0 00-4.977 4.199l.005-.006z"}),he().createElement("path",{fill:"url(#paint5_linear_21_2)",d:"M119.199 33.98l.417 1.002a157.236 157.236 0 016.021-2.36l-.373-1.016a160.349 160.349 0 00-6.065 2.375z"}),he().createElement("path",{fill:"url(#paint6_linear_21_2)",d:"M156.761 23.577l.157 1.07c2.12-.313 4.279-.589 6.416-.816l-.114-1.077c-2.147.228-4.322.503-6.459.823z"}),he().createElement("path",{fill:"url(#paint7_linear_21_2)",d:"M169.708 22.198l.07 1.082c2.137-.141 4.312-.238 6.46-.293l-.027-1.081a161.94 161.94 0 00-6.503.292z"}),he().createElement("path",{fill:"url(#paint8_linear_21_2)",d:"M57.173 80.1l.838.688a158.449 158.449 0 014.204-4.918l-.806-.72a153.358 153.358 0 00-4.23 4.95h-.006z"}),he().createElement("path",{fill:"url(#paint9_linear_21_2)",d:"M143.972 26.006l.243 1.055a154.67 154.67 0 016.33-1.336l-.2-1.06c-2.126.405-4.269.854-6.373 1.347v-.006z"}),he().createElement("path",{fill:"url(#paint10_linear_21_2)",d:"M131.421 29.485l.33 1.028c2.045-.66 4.128-1.282 6.194-1.856l-.286-1.044a165.428 165.428 0 00-6.238 1.867v.005z"}),he().createElement("path",{fill:"url(#paint11_linear_21_2)",d:"M46.64 96.515l-.915-.579a158.67 158.67 0 00-3.375 5.578l.935.541a153.157 153.157 0 013.355-5.54z"}),he().createElement("path",{fill:"url(#paint12_linear_21_2)",d:"M40.164 107.73l-.958-.503a163.113 163.113 0 00-2.91 5.837l.98.466c.919-1.942 1.887-3.89 2.888-5.8z"}),he().createElement("path",{fill:"url(#paint13_linear_21_2)",d:"M34.63 119.443l-.996-.422a158.523 158.523 0 00-2.418 6.059l1.011.379a156.57 156.57 0 012.403-6.022v.006z"}),he().createElement("path",{fill:"url(#paint14_linear_21_2)",d:"M182.708 22.955c2.153.033 4.328.108 6.465.227l.06-1.082c-2.154-.119-4.339-.195-6.509-.227l-.016 1.082z"}),he().createElement("path",{fill:"url(#paint15_linear_21_2)",d:"M49.33 90.5l.892.616c1.222-1.764 2.5-3.527 3.792-5.248l-.865-.649a165.582 165.582 0 00-3.82 5.28z"}),he().createElement("path",{fill:"url(#paint16_linear_21_2)",d:"M24.048 156.713l-1.072-.162c-.33 2.131-.616 4.301-.86 6.454l1.077.119c.238-2.137.53-4.296.855-6.411z"}),he().createElement("path",{fill:"url(#paint17_linear_21_2)",d:"M26.542 144.021l-1.05-.255a160.784 160.784 0 00-1.385 6.363l1.06.211c.412-2.105.877-4.231 1.38-6.319h-.005z"}),he().createElement("path",{fill:"url(#paint18_linear_21_2)",d:"M30.069 131.583l-1.028-.341a159.776 159.776 0 00-1.904 6.227l1.038.298c.59-2.072 1.223-4.15 1.894-6.184z"}),he().createElement("path",{fill:"url(#paint19_linear_21_2)",d:"M328.725 123.652a165.764 165.764 0 00-2.462-6.006l-.99.433c.85 1.964 1.678 3.971 2.446 5.968l1.011-.39-.005-.005z"}),he().createElement("path",{fill:"url(#paint20_linear_21_2)",d:"M332.912 135.981a164.505 164.505 0 00-1.964-6.21l-1.022.346a157.938 157.938 0 011.953 6.167l1.039-.303h-.006z"}),he().createElement("path",{fill:"url(#paint21_linear_21_2)",d:"M317.418 100.281a174.14 174.14 0 00-3.413-5.535l-.909.59a167.51 167.51 0 013.392 5.497l.93-.552z"}),he().createElement("path",{fill:"url(#paint22_linear_21_2)",d:"M323.553 111.739a161.275 161.275 0 00-2.948-5.789l-.953.509a163.515 163.515 0 012.933 5.751l.973-.471h-.005z"}),he().createElement("path",{fill:"url(#paint23_linear_21_2)",d:"M195.622 23.669c2.137.206 4.301.46 6.422.752l.146-1.071a151.495 151.495 0 00-6.465-.758l-.103 1.077z"}),he().createElement("path",{fill:"url(#paint24_linear_21_2)",d:"M336.072 148.614a161.62 161.62 0 00-1.45-6.346l-1.05.26c.52 2.083 1.007 4.209 1.439 6.302l1.061-.216z"}),he().createElement("path",{fill:"url(#paint25_linear_21_2)",d:"M245.432 36.967a160.69 160.69 0 015.843 2.797l.487-.969a163.088 163.088 0 00-5.886-2.818l-.449.984.005.006z"}),he().createElement("path",{fill:"url(#paint26_linear_21_2)",d:"M257.004 42.799a159.106 159.106 0 015.594 3.267l.563-.925a166.837 166.837 0 00-5.632-3.289l-.525.947z"}),he().createElement("path",{fill:"url(#paint27_linear_21_2)",d:"M233.422 32.103c2.018.72 4.057 1.499 6.059 2.305l.406-1a151.502 151.502 0 00-6.103-2.322l-.362 1.017z"}),he().createElement("path",{fill:"url(#paint28_linear_21_2)",d:"M208.433 25.438c2.115.385 4.252.812 6.34 1.277l.238-1.055c-2.104-.47-4.252-.903-6.384-1.287l-.194 1.065z"}),he().createElement("path",{fill:"url(#paint29_linear_21_2)",d:"M221.054 28.251a159.25 159.25 0 016.216 1.796l.319-1.033a161.378 161.378 0 00-6.254-1.807l-.281 1.044z"}),he().createElement("path",{fill:"url(#paint30_linear_21_2)",d:"M289.031 64.85l-.741.79a164.273 164.273 0 014.631 4.518l.774-.758a161.252 161.252 0 00-4.658-4.55h-.006z"}),he().createElement("path",{fill:"url(#paint31_linear_21_2)",d:"M305.646 84.78a149.235 149.235 0 013.83 5.205l.882-.622a159.55 159.55 0 00-3.857-5.237l-.86.66.005-.005z"}),he().createElement("path",{fill:"url(#paint32_linear_21_2)",d:"M297.363 74.859c1.439 1.59 2.868 3.23 4.247 4.874l.828-.692a154.042 154.042 0 00-4.274-4.907l-.801.725z"}),he().createElement("path",{fill:"url(#paint33_linear_21_2)",d:"M268.046 49.556a161.142 161.142 0 015.307 3.711l.639-.876a158.039 158.039 0 00-5.34-3.733l-.601.898h-.005z"}),he().createElement("path",{fill:"url(#paint34_linear_21_2)",d:"M278.498 57.184a158.015 158.015 0 014.983 4.128l.708-.817a159.06 159.06 0 00-5.015-4.155l-.671.85-.005-.006z"})),he().createElement("path",{stroke:"#9292FF",strokeMiterlimit:"10",strokeWidth:"1.082",d:"M21.613 155.144l156.551 25.578M75.73 59.608l102.433 121.115M179.197 22.1l-1.033 158.623M278.996 58.272L178.164 180.723M333.248 147.38l-155.084 33.342",opacity:"0.7"}),he().createElement("path",{fill:"url(#paint35_linear_21_2)",d:"M330.846 173.707c13.726 0 24.854-11.127 24.854-24.853 0-13.727-11.128-24.854-24.854-24.854-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.853 24.854 24.853z"}),he().createElement("path",{fill:"#fff",d:"M338.019 141.808a3.043 3.043 0 003.037-3.039c-.151-4.026-5.921-4.025-6.074 0a3.046 3.046 0 003.037 3.039z"}),he().createElement("path",{fill:"#fff",d:"M342.985 143.9a5.602 5.602 0 00-2.283-2.285c-1.368 1.405-3.998 1.405-5.365 0-1.412.789-3.256 2.629-2.236 4.37a2.089 2.089 0 001.803 1.02h6.231c1.549.051 2.624-1.768 1.85-3.105zM323.955 141.808a3.043 3.043 0 003.036-3.039c-.151-4.026-5.92-4.025-6.073 0a3.046 3.046 0 003.037 3.039z"}),he().createElement("path",{fill:"#fff",d:"M328.873 145.985c1.018-1.742-.82-3.581-2.236-4.37-1.367 1.405-3.997 1.405-5.364 0-1.413.789-3.256 2.629-2.236 4.37a2.089 2.089 0 001.803 1.02h6.23a2.08 2.08 0 001.803-1.02zM327.951 152.013a3.045 3.045 0 003.037 3.039c4.023-.154 4.021-5.927 0-6.078a3.042 3.042 0 00-3.037 3.039z"}),he().createElement("path",{fill:"#fff",d:"M333.67 154.859c-1.367 1.406-3.997 1.405-5.364 0a5.624 5.624 0 00-2.284 2.286c-.775 1.336.307 3.155 1.851 3.104h6.23c1.549.051 2.625-1.768 1.851-3.105a5.604 5.604 0 00-2.284-2.285zM328.9 142.337a7.596 7.596 0 014.17 0c.219-.249.451-.481.7-.696a8.47 8.47 0 00-5.57 0c.254.21.486.442.7.696zM323.55 149.47c0-.539.057-1.073.171-1.589h-.893a8.29 8.29 0 002.94 8.047c.171-.236.363-.455.565-.665a7.423 7.423 0 01-2.783-5.793zM338.255 147.881a7.44 7.44 0 01-2.608 7.382c.202.21.39.429.565.665a8.292 8.292 0 002.936-8.047h-.893z"}),he().createElement("path",{fill:"url(#paint36_linear_21_2)",d:"M24.846 178.707c13.726 0 24.854-11.127 24.854-24.853C49.7 140.127 38.572 129 24.846 129 11.12 129-.008 140.127-.008 153.854c0 13.726 11.128 24.853 24.854 24.853z"}),he().createElement("path",{fill:"#fff",d:"M31.268 154.252a3.534 3.534 0 00-5.477-3.618c-.997-1.554-2.81-2.592-4.88-2.592-3.146 0-5.695 2.393-5.695 5.346 0 .305.028.603.08.894a4.932 4.932 0 001.53 9.623h13.011a4.932 4.932 0 001.43-9.653z"}),he().createElement("path",{fill:"#fff",d:"M37.931 153.606a4.032 4.032 0 01-2.13 3.553 6.171 6.171 0 00-3.167-3.754 4.836 4.836 0 00-6.477-4.409 6.984 6.984 0 00-3.596-2.064c.795-1.338 2.317-2.243 4.062-2.243 1.691 0 3.17.848 3.983 2.114a2.884 2.884 0 014.47 2.952c.825.25 1.54.759 2.047 1.434.508.671.808 1.509.808 2.417z"}),he().createElement("path",{fill:"url(#paint37_linear_21_2)",d:"M77.846 86.707c13.726 0 24.854-11.127 24.854-24.853C102.7 48.127 91.572 37 77.846 37 64.12 37 52.992 48.127 52.992 61.854c0 13.726 11.128 24.853 24.854 24.853z"}),he().createElement("path",{fill:"url(#paint38_linear_21_2)",d:"M277.846 84.707c13.726 0 24.854-11.127 24.854-24.853C302.7 46.127 291.572 35 277.846 35c-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.853 24.854 24.853z"}),he().createElement("g",{fill:"#fff",clipPath:"url(#clip1_21_2)"},he().createElement("path",{d:"M281.153 68.765c1.421-.072 2.574.44 3.468 1.551.073-.073.136-.136.211-.214-.366-.266-.51-.61-.299-1.027.178-.352.503-.438.888-.371.014-.046.029-.086.039-.13.124-.524.438-.88.957-1.025.272-.076.559-.099.835-.162.483-.109.875-.342 1.036-.849.121-.38.069-.734-.159-1.059-.017-.023-.036-.046-.052-.069-.074-.099-.08-.197.018-.279.105-.086.208-.054.289.044a1.5 1.5 0 01.343 1.153c-.041.4-.207.747-.508 1.02-.025.02-.044.047-.078.085.113.048.216.086.312.134.653.325.917.906 1.03 1.581.036.216.042.439.044.659 0 .06-.05.15-.103.178-.052.027-.167.019-.203-.021-.203-.22-.483-.258-.743-.352-.263-.097-.537-.191-.774-.338-.31-.19-.481-.495-.506-.87-.009-.136.023-.256.177-.268.155-.013.203.094.214.235.029.402.291.622.63.754.285.111.584.18.877.269.1-.69-.488-1.495-1.185-1.606-.508-.08-1.006.004-1.488.161a.903.903 0 00-.592.845c.006.352.28.734.615.858.22.081.433.056.636-.061.051-.03.097-.065.145-.097.1-.065.207-.052.255.046.032.065.023.197-.023.244-.096.094-.228.153-.349.22-.049.027-.103.04-.155.06a6.383 6.383 0 01-.053.072c.065.038.149.06.191.117.184.246.356.5.534.75.169.24.347.466.694.5.005-.063.013-.118.015-.172v-1.185c0-.182.069-.274.201-.262.159.015.184.132.184.264V71.7c0 .228-.06.291-.289.291-1.588 0-3.177 0-4.765.002-.182 0-.266-.077-.318-.25a1.704 1.704 0 00-1.484-1.21c-.708-.055-1.373.316-1.67.936-.015.03-.024.063-.049.126.141 0 .26.013.375-.006.048-.007.098-.07.128-.12.249-.413.611-.63 1.092-.614.484.017.829.262 1.045.694l.008.015c.098.211.077.354-.059.409-.123.05-.203-.015-.295-.235a.803.803 0 00-1.312-.264c-.023.022-.038.052-.071.1.063.008.102.019.146.021.168.002.337-.002.505.004.115.007.205.063.203.193 0 .126-.086.195-.203.195-.603.004-1.206.006-1.809 0-.18-.002-.251-.163-.18-.386a2.05 2.05 0 01.815-1.096 2.095 2.095 0 013.131.958c.021.05.073.126.113.126.339.01.68.006 1.044.006-.021-.071-.031-.12-.048-.166-.739-2.075-3.261-2.933-5.103-1.719-.255.168-.46.415-.506.755-.048.352-.249.629-.473.895a1.637 1.637 0 00-.226.38c-.048.105-.101.21-.218.176-.073-.021-.13-.122-.182-.195-.057-.082-.084-.19-.153-.262-.318-.338-.544-.705-.607-1.185-.023-.178-.199-.375-.358-.488-1.854-1.33-4.497-.47-5.236 1.692-.009.027-.015.054-.027.102.06.007.108.015.157.017.265 0 .533-.004.799.002.109.002.159-.031.203-.136.297-.713.829-1.149 1.587-1.29.994-.186 2 .41 2.331 1.367.021.061.038.124.044.187.017.178-.054.264-.236.266-.4.005-.8 0-1.2 0-.127 0-.236-.035-.247-.184-.01-.149.088-.201.22-.212.021 0 .042-.01.065-.017-.105-.228-.431-.38-.724-.333a.797.797 0 00-.651.514c-.027.067-.065.149-.122.178-.052.03-.177.025-.198-.01-.046-.072-.082-.185-.057-.26a1.18 1.18 0 011.222-.812c.388.034.708.208.905.543.094.161.192.226.368.2.061-.01.123 0 .184 0 .013-.015.025-.032.036-.047-.109-.157-.205-.331-.333-.472-.848-.945-2.434-.62-2.853.58-.113.326-.127.335-.469.335h-4.504c-.33 0-.395-.068-.393-.397v-1.463c0-.115.029-.208.153-.241.138-.038.238.06.238.234v1.42a.613.613 0 00.503-.189c.111-.109.203-.237.295-.365.215-.297.425-.6.646-.912-.031-.008-.087-.014-.136-.037-.144-.07-.293-.139-.429-.225-.098-.063-.136-.167-.06-.27.077-.105.171-.103.288-.038.139.078.289.162.442.182.343.045.584-.152.768-.417.18-.256.22-.536.086-.824-.119-.255-.308-.455-.59-.528-.444-.115-.894-.201-1.356-.138-.501.067-.863.34-1.059.8-.107.252-.164.525-.243.787.021.014.039.03.06.044.358-.126.725-.23 1.068-.388.27-.124.427-.37.441-.681.007-.133.072-.216.203-.208.134.008.183.105.18.233-.01.427-.219.748-.571.956-.22.13-.475.207-.72.291-.255.088-.525.13-.726.346-.105.115-.308.038-.308-.117 0-.736.101-1.45.666-1.986.194-.186.456-.304.722-.476-.042-.031-.107-.067-.157-.12-.538-.547-.584-1.51-.101-2.07.105-.122.226-.147.314-.06.113.116.051.217-.027.324a1.186 1.186 0 00.103 1.547c.284.285.657.377 1.04.432.161.023.322.044.479.084.572.148.917.515 1.04 1.094.005.023.015.044.025.078.398-.057.737.04.905.434.161.381.029.7-.302.956.067.07.124.134.197.213.896-1.107 2.053-1.612 3.481-1.532-2.435-.88-4.301-2.413-5.457-4.739-1.161-2.337-1.237-4.757-.423-7.214-.188 0-.366.008-.544 0-.736-.036-1.304-.56-1.322-1.243-.005-.18.058-.363.09-.545.027-.147.077-.292.077-.436.006-1.047.004-2.09.004-3.137 0-.046-.014-.107.009-.136.052-.067.123-.164.186-.162.065 0 .138.095.19.16.023.029.007.09.007.136v2.895c.272-.065.529-.138.793-.186.169-.032.347-.015.519-.038.412-.059.693-.461.588-.83a.596.596 0 00-.745-.426c-.067.017-.13.05-.195.073-.117.047-.209.01-.261-.098-.055-.111.004-.189.096-.248.379-.24.965-.155 1.258.187.263.304.333.65.19 1.023-.169.436-.502.67-.965.713-.219.021-.439.025-.657.057-.561.081-.816.58-.808.966.011.468.396.85.913.883.226.015.46-.032.686-.07.059-.01.126-.081.153-.142.287-.62.67-1.178 1.072-1.725.397-.541.416-1.156.236-1.78-.148-.516-.427-.963-.768-1.374a6.15 6.15 0 00-.172-.197c-.09-.098-.123-.205-.01-.304.111-.096.209-.046.306.042.205.189.403.384.621.556.471.369.99.643 1.595.725a1.98 1.98 0 001.178-.212 12.19 12.19 0 012.646-1c.326-.077.661-.117.994-.161.113-.015.182-.046.241-.155a1.53 1.53 0 01.286-.388c.176-.164.392-.151.559.019.096.098.184.214.241.337.056.126.138.164.264.176 1.283.13 2.463.575 3.591 1.183.571.308 1.162.268 1.75.044.6-.23 1.101-.614 1.553-1.063.037-.038.069-.099.111-.105.081-.014.199-.03.245.015.046.044.054.174.023.24-.049.102-.147.18-.218.27-.448.557-.787 1.163-.848 1.893-.039.47.094.886.352 1.283.36.553.693 1.123 1.042 1.683a.378.378 0 00.186.153c.342.097.689.12 1.02-.042.341-.165.538-.431.529-.826-.008-.38-.232-.752-.577-.85-.281-.08-.58-.102-.873-.125-.643-.052-1.114-.597-1.03-1.22.082-.608.762-1.088 1.497-.706.106.054.152.148.096.262-.063.123-.166.12-.283.073-.335-.136-.586-.099-.766.105-.341.386-.119.979.406 1.086.063.012.126.017.191.019.443.012.881.046 1.272.352.007-.071.015-.115.015-.157V51.41c0-.059-.017-.132.012-.17.047-.063.122-.136.189-.14.054-.005.132.077.169.138.03.048.013.124.013.189 0 1.144-.002 2.287.002 3.432 0 .19.044.38.054.57.036.69-.414 1.248-1.107 1.363-.236.038-.481.027-.736.04.943 2.442.843 4.855-.319 7.198-1.155 2.325-3.013 3.868-5.456 4.746v-.012zm3.604-8.974c.149.036.249.03.306-.15a.878.878 0 01.533-.563c.105-.042.151-.088.124-.203-.071-.304-.119-.617-.203-.916a7.494 7.494 0 00-1.664-3.024c-.065-.073-.115-.067-.207-.046-.163.038-.343.061-.507.036-.117-.017-.176 0-.247.084-.498.574-1 1.145-1.5 1.717-.042.048-.088.105-.143.121a.258.258 0 01-.19-.02.196.196 0 01-.071-.162c.008-.063.056-.126.1-.176.503-.577 1.007-1.153 1.516-1.728.071-.082.087-.142.056-.258a1.407 1.407 0 01-.025-.505c.01-.096.002-.145-.078-.199a7.511 7.511 0 00-3.168-1.266c-.105-.017-.155.006-.187.115-.092.33-.307.55-.625.675-.051.021-.084.088-.126.132.055.027.107.078.163.082a6.508 6.508 0 013.01.929c.109.065.222.13.316.216.044.042.077.14.059.195-.017.056-.099.115-.162.125-.056.01-.131-.031-.188-.067a6.1 6.1 0 00-2.29-.924c-.198-.036-.401-.055-.646-.086.05.069.067.098.09.121.299.3.598.598.9.898.238.237.481.47.709.717.05.054.071.167.057.245-.009.044-.118.1-.176.096-.065-.004-.134-.06-.186-.113-.344-.337-.683-.679-1.022-1.02-.268-.271-.533-.548-.803-.825-.053.046-.084.072-.111.099l-1.373 1.358c-.17.168-.337.338-.511.5-.084.077-.197.083-.257-.015-.038-.063-.019-.166-.009-.248.004-.031.052-.06.08-.088l1.544-1.532c.042-.042.078-.09.118-.135l-.03-.041c-1.27.102-2.39.58-3.392 1.404.092.105.167.191.242.28.264.301.532.599.789.905a.291.291 0 01.059.218c-.008.05-.098.124-.147.12a.369.369 0 01-.217-.112c-.312-.344-.616-.696-.923-1.044-.03-.033-.063-.06-.103-.098-1.101 1.088-1.72 2.381-1.844 3.918a.49.49 0 00.149-.107l1.969-1.968c.046-.044.09-.114.143-.122.079-.013.19-.01.243.038.039.035.018.153 0 .23-.011.044-.067.078-.103.116l-2.055 2.054c-.08.08-.157.164-.201.21l5.929 5.975c1.97-1.981 3.943-3.967 5.921-5.96-.013-.015-.038-.047-.065-.076l-2.191-2.19c-.052-.053-.122-.103-.149-.168-.025-.06-.031-.162.004-.2.044-.048.139-.069.21-.069.046 0 .098.057.138.097.636.635 1.272 1.27 1.907 1.907.083.084.169.166.278.273.008-.067.017-.094.012-.12-.121-1.172-.527-2.228-1.251-3.161-.101-.128-.207-.25-.31-.378-.071-.088-.079-.184.004-.266.092-.086.191-.067.281.013.025.023.048.05.071.077.858.977 1.367 2.118 1.555 3.403.031.216.046.436.067.659l.004-.009zm-6.306 8.175l.048.012.13-.11a8.273 8.273 0 011.668-1.158c1.358-.696 2.782-.964 4.295-.64.031.007.079.011.096-.006.182-.195.36-.394.54-.593l-.025-.061c-.327-.042-.651-.107-.977-.12-1.149-.046-2.248.202-3.301.648-1.566.667-3.152.755-4.766.216-.46-.155-.908-.352-1.371-.497-1.073-.337-2.168-.496-3.29-.268-.065.013-.127.036-.228.063.18.203.331.384.496.551a.256.256 0 00.205.063 5.902 5.902 0 012.52.01c1.315.282 2.439.928 3.439 1.808.036.031.073.057.134.105v-.298c0-.136.042-.251.199-.25.15 0 .186.114.186.244v.287l.002-.006zm-.781-1.9c-1.804-1.815-3.65-3.673-5.475-5.514.197 3.128 2.991 5.45 5.475 5.514zm1.133.007c.965.172 3.081-.896 4.112-2.12a5.963 5.963 0 001.424-3.45c-1.863 1.873-3.707 3.729-5.536 5.57zm-9.421-6.743c.329-.107.641-.206.948-.317.042-.014.076-.092.088-.144.086-.374.143-.753.249-1.12a7.797 7.797 0 011.681-3.034.433.433 0 00.08-.222c.023-.18.033-.36.041-.543.003-.059.003-.136-.031-.176-.27-.319-.546-.631-.822-.944-.028-.031-.063-.054-.099-.084-.012.021-.019.028-.017.032.009.063.017.126.028.189.098.673-.021 1.293-.446 1.838a7.948 7.948 0 00-1.469 2.992 7.127 7.127 0 00-.231 1.537v-.004zm15.549-6.594c-.034.008-.055.008-.065.019-.287.325-.576.652-.858.983-.023.027-.021.097-.004.134.079.189.109.373.044.577-.017.052.006.14.044.182a7.9 7.9 0 012.007 4.244c.008.052.077.117.132.14.261.103.529.193.797.288.025.008.052.012.1.025-.006-.095-.006-.174-.016-.252-.203-1.587-.833-2.996-1.779-4.27-.402-.544-.538-1.145-.444-1.808l.038-.26.004-.002zm-2.551 12.297c.056.012.073.02.09.019.47-.05.941-.101 1.412-.16a.263.263 0 00.157-.086c.911-1.084 1.457-2.331 1.679-3.728.014-.096-.004-.146-.101-.184a.864.864 0 01-.538-.535c-.062-.178-.152-.207-.324-.147-.098 1.927-.883 3.531-2.373 4.816l-.002.005zm-8.272.019a.8.8 0 01.046-.055c-.04-.021-.086-.036-.119-.065-1.383-1.216-2.135-2.745-2.256-4.587-.004-.053-.046-.128-.09-.15-.094-.04-.122.038-.151.116-.096.262-.266.478-.529.566-.203.067-.214.172-.183.346a7.675 7.675 0 001.48 3.376c.161.21.323.35.601.304.061-.01.128.004.19.012l1.011.134v.002zm3.366-13.893c-.105.01-.201.015-.295.03-.681.098-1.332.304-1.968.557-.446.179-.879.388-1.316.587-.674.304-1.35.27-2.028.02-.038-.015-.08-.024-.134-.038.012.04.014.06.025.073.335.386.667.77 1.009 1.151.025.03.096.04.134.03a.8.8 0 01.558.024c.042.017.116.005.155-.023a7.934 7.934 0 013.558-1.432c.044-.006.111-.054.12-.092.067-.287.121-.574.184-.885l-.002-.002zm1.548-.031c.067.325.128.589.174.857.019.107.061.143.163.158 1.216.165 2.33.6 3.343 1.287.14.094.259.174.431.067a.278.278 0 01.22-.023c.287.109.435-.059.592-.254.22-.27.456-.526.684-.788.026-.03.044-.06.09-.128-.203.063-.366.117-.529.161-.588.154-1.168.133-1.708-.159-.749-.404-1.524-.738-2.346-.95-.356-.092-.722-.148-1.116-.228h.002zm-9.663 9.477c.048.346.08.673.138.995a8.487 8.487 0 001.455 3.414c.027.038.084.088.117.082.316-.063.63-.137.957-.208-.021-.034-.036-.07-.059-.1a7.67 7.67 0 01-1.507-3.496c-.042-.258-.13-.369-.385-.419-.232-.044-.45-.166-.714-.268h-.002zm15.128 4.29c.287.058.557.094.816.171.162.048.233.004.321-.124a8.686 8.686 0 001.385-3.258c.067-.343.101-.694.149-1.03-.346.108-.664.202-.978.31-.039.014-.073.096-.081.15a7.78 7.78 0 01-1.16 3.122c-.14.218-.293.43-.45.658h-.002zM277.26 52.53c-.031-.003-.054-.009-.075-.005a7.372 7.372 0 00-3.288 1.325c-.038.028-.061.12-.046.168.067.2.054.386-.027.577-.019.044-.026.12 0 .153.077.105.171.197.261.295.042-.031.071-.052.096-.073a6.435 6.435 0 012.031-1.111 6.476 6.476 0 011.72-.325c.046 0 .088-.048.132-.076-.036-.044-.063-.098-.107-.128-.067-.044-.148-.06-.218-.102-.263-.158-.406-.405-.479-.696v-.002zm-4.527 2.373l-.048-.042c-.025.046-.04.1-.073.138-.59.68-1.082 1.424-1.375 2.277-.176.514-.287 1.049-.425 1.575-.025.094-.009.16.104.195.321.1.52.329.639.64.019.047.092.077.14.115.029-.047.082-.09.084-.139.102-1.608.709-2.996 1.821-4.162.188-.197.184-.192.008-.413-.084-.102-.157-.123-.293-.1-.151.027-.316-.017-.473-.036-.038-.004-.073-.033-.109-.05v.002zm11.61 11.514c-.097-.02-.136-.03-.176-.037a5.465 5.465 0 00-2.039.065c-1.329.287-2.436.977-3.44 1.872-.272.243-.243.51-.235.799 0 .035.044.088.078.1.029.011.085-.016.111-.041.075-.08.14-.17.215-.252 1.268-1.415 2.815-2.16 4.747-1.988.044.005.102.007.132-.016.192-.154.381-.313.605-.5l.002-.002zm-12.11-.014c.012.04.012.06.023.069.134.117.276.23.406.354.1.097.207.118.345.105a5.153 5.153 0 012.658.451c.877.403 1.591 1.008 2.2 1.749.031.037.088.054.134.08.023-.049.063-.097.069-.15.042-.329-.029-.59-.31-.834-.881-.76-1.835-1.373-2.963-1.692a5.641 5.641 0 00-2.56-.136l-.002.004zm15.325 5.195c-.214-.32-.411-.618-.612-.912a1.436 1.436 0 00-.157-.186c-.525-.554-1.362-.533-1.833.044-.073.088-.094.161-.034.278.107.206.193.422.268.64.038.109.09.14.199.138.436-.006.869-.002 1.304-.002h.867-.002zm-18.488-.03c.04.02.051.028.061.028.676 0 1.354.004 2.03-.002.051 0 .12-.073.147-.128.09-.195.155-.398.245-.593.115-.25.121-.248-.069-.44a.736.736 0 00-.105-.09 1.163 1.163 0 00-1.555.199c-.276.312-.496.675-.751 1.027h-.003zm9.182-21.089c-.065.086-.115.136-.146.197a4.271 4.271 0 00-.459 1.646.605.605 0 00.601.665.596.596 0 00.601-.642 4.124 4.124 0 00-.448-1.663c-.032-.063-.086-.117-.149-.2v-.003zm.829 19.278l.14-.17c.733-.872 1.643-1.465 2.757-1.704.404-.086.745-.27 1.084-.482.031-.019.054-.05.096-.088-.042-.015-.061-.025-.081-.025a4.833 4.833 0 00-1.654.278c-.961.355-1.733.967-2.386 1.745-.178.212-.176.214.044.446zm-1.595-.056c.214-.262.187-.172-.004-.422a3.744 3.744 0 00-.314-.348c-.843-.864-1.833-1.45-3.047-1.604-.243-.031-.488-.031-.731-.046l-.018.065c.299.162.558.403.906.468.751.14 1.456.398 2.063.868.4.31.762.67 1.147 1.019h-.002zm-6.984-9.123c.435.007.71-.253.705-.605-.004-.344-.276-.602-.638-.588-.398.017-.756.16-1.074.392-.184.135-.182.269 0 .405.318.237.681.363 1.007.394v.002zm15.597 0c.295-.025.628-.146.916-.377.201-.161.203-.285-.006-.444-.291-.225-.619-.363-.99-.37-.36-.008-.63.248-.63.592 0 .352.27.608.712.602l-.002-.003zm-7.824 10.689c.145-.195.291-.356.398-.539.295-.507.063-.9-.339-1.174a.16.16 0 00-.128-.013c-.343.135-.569.615-.456.973.09.29.283.512.527.75l-.002.003zm5.421-17.05a.367.367 0 00-.358-.369.363.363 0 00-.356.37.357.357 0 10.714 0zm1.49 15.568a.371.371 0 00.369-.36.366.366 0 00-.369-.36.347.347 0 00-.354.35.352.352 0 00.354.37zm-13.87 0c.186 0 .36-.164.366-.346a.374.374 0 00-.357-.373.366.366 0 00-.373.354c0 .201.161.363.364.365zm2.183-15.507a.348.348 0 00-.36-.363.36.36 0 00-.354.357c0 .201.166.367.367.365a.35.35 0 00.347-.359z"}),he().createElement("path",{d:"M278.242 48.801c.245-.27.505-.455.831-.54.58-.152 1.097-.034 1.526.383.18.176.318.396.475.596.138.178.253.381.418.528.27.239.61.306.942.15.36-.17.542-.486.544-.884 0-.306-.171-.52-.437-.66-.115-.061-.157-.162-.088-.277.063-.107.163-.12.272-.063.021.01.042.02.061.034.519.295.72.91.483 1.48-.408.987-1.609 1.132-2.279.268-.132-.17-.232-.36-.356-.537-.173-.25-.372-.476-.661-.6a1.197 1.197 0 00-1.517.516c-.042.07-.132.154-.199.154-.069 0-.166-.078-.205-.147-.406-.698-1.3-.837-1.884-.27a3.32 3.32 0 00-.442.578c-.209.32-.431.618-.801.767-.517.21-1.109.093-1.476-.3a1.253 1.253 0 01-.196-1.396c.115-.228.288-.405.508-.535.111-.065.214-.067.289.047.075.115.027.21-.08.278-.343.223-.523.527-.437.944.134.648.969.91 1.48.455.161-.143.284-.333.404-.518.219-.342.458-.66.818-.862a1.598 1.598 0 011.894.273c.036.036.067.08.115.136l-.002.002zM282.708 51.319c-.067-.026-.138-.147-.136-.22.002-.055.12-.143.193-.15.4-.041.709-.245 1.015-.488.27-.212.569-.394.875-.551a.75.75 0 01.705.019c.115.06.165.15.103.272-.318.627-1.024 1.332-1.901 1.323-.004.015-.579-.105-.854-.205zm.831-.212c.463.09 1.164-.344 1.432-.879-.607.08-.923.594-1.432.879zM273.047 51.52c-.4.009-.754-.128-1.072-.352a2.66 2.66 0 01-.799-.906c-.101-.182-.059-.289.138-.367.333-.13.644-.033.931.13.214.124.413.28.601.44.289.248.596.435.984.477a.315.315 0 01.213.157c.05.117-.048.2-.153.23-.274.084-.837.204-.841.19l-.002.001zm-.023-.404c-.381-.438-1.091-.885-1.367-.866.201.467.931.941 1.367.866zM268.171 57.638v3.263c0 .052.018.12-.007.153-.05.067-.125.125-.188.125-.065 0-.134-.06-.188-.125-.021-.026-.007-.078-.007-.12 0-1.195-.002-2.39.005-3.583 0-.096.041-.222.11-.28.103-.091.191.035.287.079.197.088.404.16.613.212.13.033.268.041.256.215-.013.168-.145.196-.283.175-.192-.03-.383-.07-.596-.11l-.002-.004zM288.332 57.64c-.232.042-.429.084-.63.111-.138.019-.253-.038-.258-.188-.004-.145.109-.191.239-.198.264-.01.496-.09.703-.262.051-.042.161-.063.218-.035.054.027.107.126.107.193.006 1.243.006 2.486.006 3.727 0 .132-.046.235-.199.229-.148-.006-.188-.107-.186-.241v-3.17-.168.002zM288.284 48.86c-.222.249-.441.5-.663.75-.103.117-.205.235-.312.352-.086.095-.188.126-.291.038-.103-.088-.088-.19-.002-.29.444-.505.883-1.012 1.335-1.511.05-.057.176-.099.237-.073.06.023.121.138.121.216.009.706.004 1.415.006 2.121 0 .134-.05.235-.196.233-.147-.002-.189-.109-.189-.241v-1.409c0-.057-.004-.113-.006-.168l-.042-.017.002-.002zM268.219 48.828c-.004.103-.008.157-.008.214 0 .47-.002.941 0 1.411 0 .136-.046.23-.187.245-.119.015-.205-.09-.207-.245 0-.702-.004-1.405.007-2.107 0-.078.06-.2.119-.218.071-.021.197.019.251.078.444.488.877.987 1.314 1.484.086.099.128.205.017.304-.117.105-.224.052-.314-.053l-.839-.953c-.04-.044-.082-.086-.153-.162v.002zM271.352 48.482h-1.233c-.133 0-.238-.05-.238-.19 0-.141.105-.193.238-.193h2.499c.132 0 .239.05.239.193 0 .144-.107.19-.239.19h-1.266zM285.232 48.482h-1.197c-.143 0-.272-.03-.272-.193 0-.167.134-.193.272-.193h2.43c.142 0 .274.032.274.193 0 .158-.128.195-.274.195-.411-.004-.821 0-1.233 0v-.002zM269.065 56.09a.59.59 0 01-.601-.605.597.597 0 01.596-.596.603.603 0 11.005 1.204v-.002zm.219-.586c-.004-.143-.104-.235-.23-.225-.132.01-.197.097-.205.216-.008.116.115.218.232.208.13-.013.193-.092.203-.2zM287.378 56.091a.6.6 0 11.023-1.201.6.6 0 01.588.606.595.595 0 01-.613.595h.002zm.004-.386a.23.23 0 00.226-.216c0-.113-.105-.213-.226-.211-.132.002-.199.081-.214.203-.012.113.099.222.214.224zM268.578 51.732c0-.46.352-.845.798-.868.071-.004.194.07.211.128.136.478-.004 1.004-.619 1.136-.27.057-.365-.019-.386-.291-.004-.04-.004-.082-.006-.105h.002zm.404-.044c.182-.034.264-.153.243-.352-.178.065-.251.172-.243.352zM287.977 51.713c0 .424-.141.518-.54.371-.473-.174-.601-.641-.471-1.09.016-.06.14-.134.209-.13.45.027.797.407.8.85h.002zm-.658-.388c.005.229.072.325.258.378.014-.19-.057-.298-.258-.378zM271.068 49.151c.004.518-.291.843-.764.887-.164.015-.245-.05-.279-.212-.104-.53.222-.993.758-1.067.132-.019.216.034.247.16.023.09.029.182.036.232h.002zm-.394.067c-.215.099-.289.22-.249.392.176-.065.245-.193.249-.392zM285.456 49.2c0-.452.147-.544.555-.35.399.188.584.565.485.987-.033.146-.113.216-.272.2-.477-.043-.768-.355-.768-.838zm.653.406c0-.22-.067-.319-.253-.373-.013.197.058.306.253.373z"}),he().createElement("path",{d:"M277.655 49.816c-.129-.021-.207-.038-.288-.044-.536-.05-.919.205-1.223.616-.086.116-.159.267-.341.157-.123-.073-.113-.197.032-.39.41-.549.937-.85 1.64-.76.074.008.164.016.214.06.059.053.115.15.107.22-.007.06-.105.11-.141.143v-.002zM279.316 49.749c-.147.02-.245.031-.342.05-.121.023-.228.007-.263-.128-.036-.14.044-.216.173-.25.522-.136.988-.008 1.398.322.174.138.31.325.455.496.083.101.098.216-.028.3-.123.084-.217.025-.293-.084-.169-.245-.366-.467-.648-.582-.157-.065-.329-.093-.455-.126l.003.002zM282.642 49.082a.556.556 0 01-.561.543.552.552 0 01.018-1.103.556.556 0 01.545.562l-.002-.002zm-.547.218c.073-.107.153-.17.151-.23 0-.053-.105-.152-.144-.145a.237.237 0 00-.155.155c-.011.046.073.113.15.218l-.002.002zM274.491 49.625a.555.555 0 01-.549-.558.56.56 0 01.542-.547.558.558 0 01.557.55.56.56 0 01-.55.555zm.014-.789c-.085.111-.165.172-.167.233 0 .052.092.155.136.151.065-.004.159-.078.172-.138.012-.055-.067-.128-.141-.248v.002zM268.633 64.538h.626c.126 0 .226.044.232.18.007.147-.1.2-.23.202-.423.002-.845 0-1.266 0-.132 0-.234-.049-.23-.2.004-.14.104-.18.228-.18h.642l-.002-.002zM287.902 64.53h.626c.128 0 .222.054.222.188 0 .135-.094.19-.222.19h-1.285c-.125 0-.22-.05-.22-.19 0-.142.097-.188.22-.188.22-.002.44 0 .659 0zM269.485 66.104h-.588c-.13 0-.236-.04-.241-.186-.004-.15.103-.193.233-.193h1.195c.132 0 .243.044.243.186 0 .153-.116.197-.254.195-.196-.002-.393 0-.588 0v-.002zM287.026 66.094h-.626c-.132 0-.216-.065-.211-.197.004-.124.09-.178.213-.178h1.235c.128 0 .22.052.222.19 0 .139-.099.187-.222.187h-.609l-.002-.002zM288.032 64.311h-.485c-.126 0-.224-.046-.229-.182-.004-.149.101-.197.233-.2h.99c.127 0 .217.068.211.2-.006.122-.092.178-.213.178h-.505l-.002.004zM270.165 66.706c-.157 0-.311.004-.468 0-.12-.006-.226-.052-.224-.19 0-.148.104-.196.236-.196h.919c.123 0 .222.04.23.18.009.152-.098.202-.224.206-.155.006-.312 0-.469 0zM286.365 66.314h.468c.124 0 .201.063.203.189 0 .117-.073.184-.186.186-.341.005-.682.007-1.023 0-.113-.002-.184-.077-.178-.193.006-.115.081-.176.197-.178.173-.002.347 0 .521 0l-.002-.004zM268.465 64.318h-.502c-.126 0-.201-.063-.203-.187 0-.127.081-.186.203-.186.341 0 .682-.002 1.023 0 .12 0 .203.056.201.186-.002.139-.09.19-.22.19h-.502v-.003zM288.173 63.716h-.347c-.122 0-.201-.059-.207-.184-.007-.12.069-.19.18-.193.259-.009.521-.015.778.006.065.006.157.12.168.193.014.107-.076.174-.193.176-.128.002-.253 0-.381 0l.002.002zM268.32 63.72h-.346c-.121 0-.205-.054-.211-.177-.004-.124.069-.195.192-.197.249-.005.496-.007.746 0 .119.002.203.075.196.197-.006.12-.088.18-.213.178-.122-.002-.243 0-.364 0zM285.47 67.301c-.096-.004-.207.01-.301-.023-.071-.025-.157-.107-.172-.178-.02-.107.059-.187.176-.189.197-.004.396-.017.588.007.067.008.157.098.176.17.03.108-.052.184-.167.197-.099.01-.197.01-.302.016h.002zM271.042 67.297c-.099 0-.197.008-.293-.002-.116-.015-.214-.086-.183-.203.019-.072.122-.16.195-.17.18-.025.366-.01.551-.007.119.003.2.063.205.19.004.127-.084.184-.199.194-.092.009-.184 0-.276 0v-.002zM288.305 63.12c-.088 0-.174.005-.261 0-.116-.008-.201-.079-.18-.188.012-.071.1-.172.165-.182.182-.026.37-.026.552 0 .065.008.172.125.164.178-.013.071-.105.153-.182.186-.074.032-.172.007-.258.007zM268.199 63.123c-.085 0-.182.023-.257-.006-.071-.03-.167-.11-.17-.172-.002-.063.088-.178.149-.187.188-.025.383-.023.569 0 .063.008.157.122.153.185-.002.063-.098.146-.169.172-.082.029-.182.006-.275.006v.002zM286.83 65.49c-.072-.027-.155-.111-.164-.18-.006-.053.088-.166.145-.172.199-.021.395-.02.594.002.055.006.145.12.142.18-.002.06-.087.147-.152.168-.088.029-.486.033-.565 0v.002zM269.41 65.132c.092 0 .194-.026.274.006.071.027.155.113.165.182.009.05-.09.164-.15.17a2.389 2.389 0 01-.586 0c-.061-.006-.145-.117-.149-.186-.004-.055.086-.145.153-.168.088-.03.194-.007.293-.007v.003zM288.391 62.532c-.07-.004-.151.012-.203-.02-.065-.039-.147-.119-.147-.18 0-.06.086-.163.149-.176a1.04 1.04 0 01.41 0c.061.013.144.116.144.179 0 .06-.083.14-.148.178-.053.031-.134.015-.203.019h-.002zM268.114 62.527c-.057 0-.115.005-.172 0-.115-.01-.173-.08-.173-.19 0-.145.098-.16.167-.179.113-.03.239-.014.36-.008.113.006.182.08.18.193 0 .115-.075.176-.188.184-.057.005-.116 0-.172 0h-.002zM270.165 66.886c.023 0 .044.013.059.03.048.06.111.121.121.188.017.122-.081.208-.192.183-.074-.017-.178-.118-.18-.183 0-.063.073-.128.127-.19a.078.078 0 01.065-.028zM278.468 49.77c-.071.05-.134.125-.211.142-.122.025-.201-.063-.203-.178-.002-.12.081-.203.199-.184.077.012.144.09.215.138v.082zM269.083 66.506c-.119.09-.184.177-.261.19-.111.018-.199-.058-.199-.183 0-.124.077-.206.195-.185.077.013.144.095.265.18v-.002zM269.97 50.384c0 .025-.01.05-.031.065-.065.048-.128.11-.199.122-.109.019-.18-.067-.182-.18-.002-.116.069-.2.175-.187.072.008.137.067.201.115a.08.08 0 01.034.065h.002zM268.125 61.8c-.063.092-.186.126-.28.065-.053-.034-.072-.084-.057-.149a.288.288 0 01.182-.176c.115-.021.205.071.184.188a.173.173 0 01-.031.072h.002zM279.303 60.299a.97.97 0 00-.748.396c-.031.042-.062.084-.088.13-.056.103-.129.174-.251.107-.121-.067-.102-.17-.046-.27.214-.374.526-.615.955-.686.175-.03.358-.032.533-.065.312-.059.578-.204.775-.46.071-.092.157-.148.266-.066.11.083.073.18.004.272a1.456 1.456 0 01-.808.539c-.117.031-.155.086-.151.205.006.243-.01.489-.004.732a.993.993 0 01-.523.937 1.753 1.753 0 01-1.589.12c-.613-.246-.91-.745-.952-1.382-.034-.49-.042-.99.006-1.478.119-1.229 1.191-1.709 2.256-1.357.427.14.714.422.798.879.033.182-.034.3-.174.32-.14.022-.224-.066-.249-.26a.688.688 0 00-.454-.588c-.844-.325-1.691.07-1.744 1.06-.025.487-.033.977.007 1.462.088 1.059 1.067 1.32 1.802.97a.637.637 0 00.383-.628c-.004-.29 0-.58 0-.89h-.004zM283.591 55.271c.078.052.143.082.185.13.78.88 1.295 1.889 1.463 3.063.018.134-.021.24-.166.258-.136.017-.194-.071-.211-.2-.155-1.091-.645-2.022-1.352-2.855a.366.366 0 01-.078-.24c.005-.053.095-.097.159-.156zM269.163 48.476a.186.186 0 100-.372.186.186 0 000 .372zM287.427 48.442a.187.187 0 100-.373.187.187 0 000 .373zM286.923 50.407a.186.186 0 11-.373 0 .186.186 0 01.373 0zM288.725 61.733a.186.186 0 11-.371 0 .186.186 0 01.371 0zM286.539 67.102a.187.187 0 01-.187.187.187.187 0 010-.373c.103 0 .187.084.187.186z"})),he().createElement("path",{fill:"url(#paint39_linear_21_2)",d:"M181.846 49.708c13.726 0 24.854-11.128 24.854-24.854C206.7 11.127 195.572 0 181.846 0c-13.726 0-24.854 11.127-24.854 24.854 0 13.726 11.128 24.854 24.854 24.854z"}),he().createElement("path",{fill:"url(#paint40_linear_21_2)",d:"M177.877 245.93c36.091 0 65.348-29.258 65.348-65.348 0-36.091-29.257-65.348-65.348-65.348-36.09 0-65.348 29.257-65.348 65.348 0 36.09 29.258 65.348 65.348 65.348z"}),he().createElement("g",{clipPath:"url(#clip2_21_2)"},he().createElement("path",{fill:"#FFB45A",d:"M155.387 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 10-15.386 0 7.693 7.693 0 007.693 7.693z"}),he().createElement("path",{fill:"#FF7B8E",d:"M177.644 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 00-7.693-7.693 7.693 7.693 0 00-7.693 7.693 7.693 7.693 0 007.693 7.693z"}),he().createElement("path",{fill:"#5AC0FF",d:"M199.896 214.925a7.693 7.693 0 007.693-7.693 7.693 7.693 0 00-7.693-7.693 7.693 7.693 0 00-7.693 7.693 7.693 7.693 0 007.693 7.693z"}),he().createElement("path",{fill:"#5633D1",d:"M191.159 158.779c-.416 0-.822.028-1.222.055-1.672-7.304-8.208-12.763-16.02-12.763-2.055 0-4.019.379-5.837 1.077 0 2.056.011 4.425.027 5.432 2.099.01 6.157.027 7.947.027v7.774h-7.909v13.135h8.137c-.228.579-.579 1.44-.725 1.775-1.477 3.565-5.151 5.556-8.954 4.869-3.619-.66-6.308-3.738-6.508-7.515-.054-1.103-.027-2.218-.027-3.321v-8.997h-2.786c-5.622 2.607-9.533 8.293-9.533 14.899 0 9.078 7.358 16.43 16.43 16.43h27.164c8.997-.092 16.246-7.411 16.246-16.43s-7.357-16.447-16.43-16.447z"})),he().createElement("g",{fill:"#fff",clipPath:"url(#clip3_21_2)"},he().createElement("path",{d:"M181.77 25.565l-3.242 9.42a10.808 10.808 0 006.644-.174.983.983 0 01-.077-.149l-3.321-9.1-.004.003zM170.775 24.62a10.81 10.81 0 006.092 9.727l-5.156-14.126a10.72 10.72 0 00-.936 4.398z"}),he().createElement("path",{d:"M188.877 24.075c0-1.334-.478-2.258-.892-2.98-.547-.892-1.062-1.642-1.062-2.534 0-.994.754-1.919 1.816-1.919.048 0 .095.004.142.008a10.773 10.773 0 00-7.296-2.835 10.79 10.79 0 00-9.029 4.869c.253.007.493.01.696.01 1.131 0 2.879-.137 2.879-.137.584-.036.653.82.069.888 0 0-.587.07-1.237.105l3.935 11.704 2.364-7.092-1.682-4.612a20.787 20.787 0 01-1.135-.105c-.584-.036-.515-.924.069-.888 0 0 1.784.138 2.846.138 1.128 0 2.879-.138 2.879-.138.584-.033.653.82.069.888 0 0-.587.07-1.236.105l3.905 11.617 1.077-3.6c.468-1.494.823-2.57.823-3.495v.003zM191.064 19.434c.047.345.073.714.073 1.113 0 1.095-.203 2.328-.823 3.872l-3.3 9.543a10.804 10.804 0 005.374-9.34c0-1.878-.479-3.647-1.324-5.184v-.004z"}),he().createElement("path",{d:"M181.582 10.555c-7.768 0-14.066 6.298-14.066 14.064s6.298 14.064 14.066 14.064c7.767 0 14.066-6.298 14.066-14.064s-6.299-14.064-14.066-14.064zm0 26.395c-6.799 0-12.329-5.53-12.329-12.331 0-6.802 5.53-12.328 12.329-12.328s12.329 5.53 12.329 12.328c0 6.798-5.53 12.331-12.329 12.331z"})),he().createElement("g",{clipPath:"url(#clip4_21_2)"},he().createElement("path",{fill:"#fff",d:"M87.793 49.902H67.402c-.644 0-1.166.522-1.166 1.165V71.46c0 .643.522 1.165 1.166 1.165h20.391c.644 0 1.165-.522 1.165-1.165V51.067c0-.643-.521-1.165-1.165-1.165zM74.538 66.39h-1.98V56.136h1.98V66.39zm8.098 0h-5.942v-2.127h5.942v2.127zm0-4.064h-5.942V60.2h5.942v2.126zm0-4.063h-5.942v-2.127h5.942v2.127z"}))),he().createElement("defs",null,he().createElement("linearGradient",{id:"paint0_linear_21_2",x1:"98.365",x2:"107.763",y1:"21.3",y2:"290.338",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint1_linear_21_2",x1:"87.284",x2:"96.683",y1:"21.689",y2:"290.727",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint2_linear_21_2",x1:"66.918",x2:"76.316",y1:"22.399",y2:"291.437",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint3_linear_21_2",x1:"109.954",x2:"119.353",y1:"20.898",y2:"289.936",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint4_linear_21_2",x1:"76.777",x2:"86.175",y1:"22.054",y2:"291.092",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint5_linear_21_2",x1:"121.976",x2:"131.374",y1:"20.479",y2:"289.517",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint6_linear_21_2",x1:"159.89",x2:"169.289",y1:"19.152",y2:"288.191",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint7_linear_21_2",x1:"172.849",x2:"182.247",y1:"18.699",y2:"287.737",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint8_linear_21_2",x1:"57.767",x2:"67.166",y1:"22.717",y2:"291.755",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint9_linear_21_2",x1:"147.041",x2:"156.44",y1:"19.6",y2:"288.638",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint10_linear_21_2",x1:"134.371",x2:"143.769",y1:"20.044",y2:"289.082",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint11_linear_21_2",x1:"41.858",x2:"51.256",y1:"23.278",y2:"292.31",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint12_linear_21_2",x1:"35.201",x2:"44.599",y1:"23.507",y2:"292.546",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint13_linear_21_2",x1:"29.484",x2:"38.883",y1:"23.707",y2:"292.745",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint14_linear_21_2",x1:"185.827",x2:"195.226",y1:"18.245",y2:"287.283",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint15_linear_21_2",x1:"49.397",x2:"58.795",y1:"23.015",y2:"292.053",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint16_linear_21_2",x1:"18.35",x2:"27.748",y1:"24.098",y2:"293.136",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint17_linear_21_2",x1:"21.032",x2:"30.431",y1:"24.005",y2:"293.044",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint18_linear_21_2",x1:"24.747",x2:"34.145",y1:"23.872",y2:"292.91",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint19_linear_21_2",x1:"323.253",x2:"332.651",y1:"13.445",y2:"282.483",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint20_linear_21_2",x1:"327.244",x2:"336.642",y1:"13.308",y2:"282.346",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint21_linear_21_2",x1:"312.33",x2:"321.728",y1:"13.827",y2:"282.865",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint22_linear_21_2",x1:"318.272",x2:"327.671",y1:"13.619",y2:"282.657",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint23_linear_21_2",x1:"198.709",x2:"208.108",y1:"17.798",y2:"286.836",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint24_linear_21_2",x1:"330.202",x2:"339.6",y1:"13.201",y2:"282.239",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint25_linear_21_2",x1:"247.84",x2:"257.238",y1:"16.08",y2:"285.119",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint26_linear_21_2",x1:"259.099",x2:"268.497",y1:"15.689",y2:"284.727",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint27_linear_21_2",x1:"236.089",x2:"245.487",y1:"16.49",y2:"285.528",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint28_linear_21_2",x1:"211.439",x2:"220.837",y1:"17.353",y2:"286.391",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint29_linear_21_2",x1:"223.915",x2:"233.313",y1:"16.916",y2:"285.955",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint30_linear_21_2",x1:"289.151",x2:"298.549",y1:"14.636",y2:"283.674",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint31_linear_21_2",x1:"305.461",x2:"314.86",y1:"14.065",y2:"283.103",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint32_linear_21_2",x1:"297.717",x2:"307.116",y1:"14.336",y2:"283.375",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint33_linear_21_2",x1:"269.774",x2:"279.172",y1:"15.316",y2:"284.348",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint34_linear_21_2",x1:"279.817",x2:"289.215",y1:"14.963",y2:"284.001",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#9292FF"}),he().createElement("stop",{offset:"1",stopColor:"#9292FF",stopOpacity:"0.05"})),he().createElement("linearGradient",{id:"paint35_linear_21_2",x1:"325.897",x2:"344.81",y1:"164.814",y2:"103.778",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#019FB4"}),he().createElement("stop",{offset:"1",stopColor:"#68FF61"})),he().createElement("linearGradient",{id:"paint36_linear_21_2",x1:"8.897",x2:"39.054",y1:"173.763",y2:"136.125",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#FFA970"}),he().createElement("stop",{offset:"0.11",stopColor:"#FFAF79"}),he().createElement("stop",{offset:"0.42",stopColor:"#FFBB8F"}),he().createElement("stop",{offset:"0.72",stopColor:"#FFC39B"}),he().createElement("stop",{offset:"1",stopColor:"#FFC6A0"})),he().createElement("linearGradient",{id:"paint37_linear_21_2",x1:"77.114",x2:"78.852",y1:"37.379",y2:"95.798",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#FF7B8E"}),he().createElement("stop",{offset:"0.23",stopColor:"#FA768A"}),he().createElement("stop",{offset:"0.47",stopColor:"#EE6A80"}),he().createElement("stop",{offset:"0.71",stopColor:"#D95470"}),he().createElement("stop",{offset:"0.96",stopColor:"#BC3759"}),he().createElement("stop",{offset:"1",stopColor:"#B73255"})),he().createElement("linearGradient",{id:"paint38_linear_21_2",x1:"257.38",x2:"322.679",y1:"54.177",y2:"72.279",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#AA6AFF"}),he().createElement("stop",{offset:"0.26",stopColor:"#8B56EE"}),he().createElement("stop",{offset:"0.64",stopColor:"#643CD9"}),he().createElement("stop",{offset:"0.84",stopColor:"#5533D1"})),he().createElement("linearGradient",{id:"paint39_linear_21_2",x1:"165.405",x2:"198.41",y1:"6.509",y2:"43.342",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#34C6FF"}),he().createElement("stop",{offset:"0.19",stopColor:"#35C1FE"}),he().createElement("stop",{offset:"0.39",stopColor:"#3BB5FE"}),he().createElement("stop",{offset:"0.59",stopColor:"#449FFE"}),he().createElement("stop",{offset:"0.8",stopColor:"#5082FD"}),he().createElement("stop",{offset:"1",stopColor:"#605EFD"})),he().createElement("linearGradient",{id:"paint40_linear_21_2",x1:"177.877",x2:"177.877",y1:"124.501",y2:"263.274",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{offset:"0.01",stopColor:"#fff"}),he().createElement("stop",{offset:"0.26",stopColor:"#fff",stopOpacity:"0.99"}),he().createElement("stop",{offset:"0.43",stopColor:"#fff",stopOpacity:"0.95"}),he().createElement("stop",{offset:"0.58",stopColor:"#fff",stopOpacity:"0.89"}),he().createElement("stop",{offset:"0.71",stopColor:"#fff",stopOpacity:"0.81"}),he().createElement("stop",{offset:"0.84",stopColor:"#fff",stopOpacity:"0.7"}),he().createElement("stop",{offset:"0.95",stopColor:"#fff",stopOpacity:"0.56"}),he().createElement("stop",{offset:"1",stopColor:"#fff",stopOpacity:"0.5"})),he().createElement("clipPath",{id:"clip0_21_2"},he().createElement("path",{fill:"#fff",d:"M0 0H355.975V246H0z"})),he().createElement("clipPath",{id:"clip1_21_2"},he().createElement("path",{fill:"#fff",d:"M0 0H22.531V24H0z",transform:"translate(266.992 48)"})),he().createElement("clipPath",{id:"clip2_21_2"},he().createElement("path",{fill:"#fff",d:"M0 0H59.895V68.848H0z",transform:"translate(147.694 146.071)"})),he().createElement("clipPath",{id:"clip3_21_2"},he().createElement("path",{fill:"#fff",d:"M0 0H28.132V28.132H0z",transform:"translate(167.516 10.555)"})),he().createElement("clipPath",{id:"clip4_21_2"},he().createElement("path",{fill:"#fff",d:"M0 0H22.722V22.722H0z",transform:"translate(66.236 49.902)"}))))},WD=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 39 39"},he().createElement("path",{fillRule:"evenodd",d:"M39 19.5C39 30.27 30.27 39 19.5 39S0 30.27 0 19.5 8.73 0 19.5 0 39 8.73 39 19.5zm-21.695 3.8l6.582-3.8-6.582-3.8v7.6z",clipRule:"evenodd"}))};function UD(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return VD(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(VD(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,VD(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,VD(d,"constructor",c),VD(c,"constructor",s),s.displayName="GeneratorFunction",VD(c,o,"GeneratorFunction"),VD(d),VD(d,o,"Generator"),VD(d,r,function(){return this}),VD(d,"toString",function(){return"[object Generator]"}),(UD=function(){return{w:i,m:p}})()}function VD(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}VD=function(e,t,n,r){function i(t,n){VD(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},VD(e,t,n,r)}const HD=function(e){var t=ce((0,pe.useState)("signin"),2),n=t[0],r=t[1],o=ce((0,pe.useState)(!1),2),i=o[0],a=o[1],l=ce((0,pe.useState)(!1),2),s=l[0],c=l[1],u=ce(Ct(),1)[0],d=function(){var e=hi(UD().m(function e(){var t,n,r;return UD().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,c(!0),t=u.get("redirect-to")||"elementor/packs",e.n=1,va({path:"/templately/v1/google-auth-url?redirect-to=".concat(encodeURIComponent(t)),method:"GET"});case 1:null!=(n=e.v)&&n.url&&(window.location.href=n.url),e.n=3;break;case 2:e.p=2,r=e.v,console.error("Google auth error:",r),c(!1);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();return(0,pe.useEffect)(function(){i&&xl({showConfirmButton:!1,showDenyButton:!1,icon:!1,type:"warning",title:!1,showCloseButton:!0,customClass:{container:"templately-video-container",popup:"templately-video-popup",closeButton:"templately-video-close-button",htmlContainer:"templately-video-html"},html:React.createElement("iframe",{width:"850",height:"480",src:"https://www.youtube.com/embed/ZhzHWqMD1Zk?autoplay=1&rel=0",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0})},!1).then(function(e){(null!=e&&e.isConfirmed||null!=e&&e.isDismissed)&&a(!1)})},[i]),React.createElement("div",{className:"templately-container-row"},React.createElement("div",{className:"templately-contents templately-frontpage"},React.createElement("div",{className:"tf-content-box"},React.createElement("div",{className:"tf-promo-title"},React.createElement(zD,null),React.createElement("h1",null,(0,At.__)("Ultimate Templates ","templately"),React.createElement("b",null,(0,At.__)("Cloud for WordPress","templately"))),React.createElement("p",null,(0,At.__)("Take Your Favourite Page Builders To A Whole New Level & Manage All Your Designs In One Place With Templately","templately")),React.createElement("button",{onClick:function(){return a(!i)}},React.createElement(WD,null),React.createElement("span",null,"Play Video"))),React.createElement("div",{className:"tf-user-form"},React.createElement("div",{className:"tf-user-form-tab"},React.createElement("ul",{className:"tf-uft-menu"},React.createElement("li",{onClick:function(){return r("signin")},className:"signin"===n?"active":""},(0,At.__)("Sign In","templately")),React.createElement("li",{onClick:function(){return r("signup")},className:"signup"===n?"active":""},(0,At.__)("Free Sign Up","templately"))),React.createElement("button",{className:"templately-button tb-google-login",onClick:d,disabled:s},React.createElement(BD,null),React.createElement("span",null,s?(0,At.__)("Redirecting...","templately"):"signup"===n?(0,At.__)("Sign up with Google","templately"):(0,At.__)("Continue with Google","templately"))),React.createElement("div",{className:"tf-divider"},React.createElement("span",null,(0,At.__)("Or with email","templately"))),React.createElement("div",{className:"tf-uft-content"},"signin"===n?React.createElement(MD,{setTab:r}):React.createElement(RD,{setTab:r})))))))},GD=gn(function(e){return{isLoggedIn:null!=e.profile.data,profileData:e.profile.data}})(function(e){var t,n,r,o;return null!=e&&e.isLoggedIn?null!=e&&e.isLoggedIn&&"free"!==(null==e||null===(t=e.profileData)||void 0===t?void 0:t.plan)?null:void 0===(null==e||null===(n=e.profileData)||void 0===n?void 0:n.show_notice)||null!=e&&null!==(r=e.profileData)&&void 0!==r&&r.show_notice?(null==e||null===(o=e.profileData)||void 0===o?void 0:o.is_company_user)?null:he().createElement("div",{className:"templately-server-notice"},he().createElement("p",null,"Hi there, you can now use ",he().createElement("strong",null,"Templately")," in unlimited local sites & 2 live sites for Free! Manage your preferences"," ",he().createElement("strong",null,he().createElement("a",{target:"_blank",href:"https://templately.com/manage-sites"},"here"))," ","or"," ",he().createElement("a",{target:"_blank",href:"https://docs.templately.com/home/how-to-manage-sites-in-templately/"},he().createElement("strong",null,"learn more")),".")):null:null}),qD=function(e){var t,n,r=0===(null===(t=e.items)||void 0===t?void 0:t.length)||"empty"===e.items,o=Vn()("templately-items",{"templately-has-no-items":r});return he().createElement(he().Fragment,null,he().createElement("div",{className:o},e.items&&Array.isArray(e.items)&&(null===(n=e.items)||void 0===n?void 0:n.length)>0?e.items.map(function(t){return he().createElement(T_,{key:t.id,isLoggedIn:e.isLoggedIn,platform:e.platform,content:t})}):he().createElement(lC,null)),e.totalPage>1&&he().createElement(tC,re({type:e.type,total:e.totalPage},e.pagination)))};var QD=a(7918),$D=a.n(QD),YD=/[A-Z]/g,XD=/^ms-/,KD={};function ZD(e){return"-"+e.toLowerCase()}const JD=function(e){if(KD.hasOwnProperty(e))return KD[e];var t=e.replace(YD,ZD);return KD[e]=XD.test(t)?"-"+t:t};const eP=M_().oneOfType([M_().string,M_().number]),tP={all:M_().bool,grid:M_().bool,aural:M_().bool,braille:M_().bool,handheld:M_().bool,print:M_().bool,projection:M_().bool,screen:M_().bool,tty:M_().bool,tv:M_().bool,embossed:M_().bool},nP={orientation:M_().oneOf(["portrait","landscape"]),scan:M_().oneOf(["progressive","interlace"]),aspectRatio:M_().string,deviceAspectRatio:M_().string,height:eP,deviceHeight:eP,width:eP,deviceWidth:eP,color:M_().bool,colorIndex:M_().bool,monochrome:M_().bool,resolution:eP,type:Object.keys(tP)},{type:rP,...oP}=nP,iP={minAspectRatio:M_().string,maxAspectRatio:M_().string,minDeviceAspectRatio:M_().string,maxDeviceAspectRatio:M_().string,minHeight:eP,maxHeight:eP,minDeviceHeight:eP,maxDeviceHeight:eP,minWidth:eP,maxWidth:eP,minDeviceWidth:eP,maxDeviceWidth:eP,minColor:M_().number,maxColor:M_().number,minColorIndex:M_().number,maxColorIndex:M_().number,minMonochrome:M_().number,maxMonochrome:M_().number,minResolution:eP,maxResolution:eP,...oP};var aP={all:{...tP,...iP},types:tP,matchers:nP,features:iP};const lP=(0,pe.createContext)(void 0),sP=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[JD(n)]=e[n],t),{})},cP=()=>{const e=(0,pe.useRef)(!1);return(0,pe.useEffect)(()=>{e.current=!0},[]),e.current},uP=e=>{const t=()=>(e=>e.query||(e=>{const t=[];return Object.keys(aP.all).forEach(n=>{const r=e[n];null!=r&&t.push(((e,t)=>{const n=JD(e);return"number"==typeof t&&(t=`${t}px`),!0===t?n:!1===t?`not ${n}`:`(${n}: ${t})`})(n,r))}),t.join(" and ")})(e))(e),[n,r]=(0,pe.useState)(t);return(0,pe.useEffect)(()=>{const e=t();n!==e&&r(e)},[e]),n},dP=(e,t,n)=>{const r=(e=>{const t=(0,pe.useContext)(lP),n=()=>sP(e)||sP(t),[r,o]=(0,pe.useState)(n);return(0,pe.useEffect)(()=>{const e=n();(function(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(let r=0;r<o;r++){const o=n[r];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0})(r,e)||o(e)},[e,t]),r})(t),o=uP(e);if(!o)throw new Error("Invalid or missing MediaQuery!");const i=((e,t)=>{const n=()=>$D()(e,t||{},!!t),[r,o]=(0,pe.useState)(n),i=cP();return(0,pe.useEffect)(()=>{if(i){const e=n();return o(e),()=>{e&&e.dispose()}}},[e,t]),r})(o,r),a=(e=>{const[t,n]=(0,pe.useState)(e.matches);return(0,pe.useEffect)(()=>{const t=e=>{n(e.matches)};return e.addListener(t),n(e.matches),()=>{e.removeListener(t)}},[e]),t})(i),l=cP();return(0,pe.useEffect)(()=>{l&&n&&n(a)},[a]),(0,pe.useEffect)(()=>()=>{i&&i.dispose()},[]),a},pP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"173",height:"21",fill:"none",viewBox:"0 0 173 21"},pe.createElement("g",{clipPath:"url(#paint0_angular_15309_5198_clip_path)","data-figma-skip-parse":"true"},pe.createElement("foreignObject",{width:"1274.23",height:"1274.23",x:"-637.117",y:"-637.117",transform:"matrix(.01356 -.02498 .04769 .0259 10.016 10.016)"},pe.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",opacity:"1",style:{background:"conic-gradient(from 90deg,#62c2fc 0deg,#f2d7bc 57.4692deg,#f4e0c4 153.531deg,#5935d0 218.669deg,#5cc1ff 357.335deg,#62c2fc 360deg)",height:"100%",width:"100%"}}))),pe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"stopsVar":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"transform":{"m00":27.126356124877930,"m01":95.376968383789062,"m02":-51.235877990722656,"m10":-49.955394744873047,"m11":51.790794372558594,"m12":9.0981588363647461},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),pe.createElement("path",{fill:"url(#paint1_linear_15309_5198)",d:"M24.668 5.646V3.88h9.284v1.767h-3.597v9.87h-2.09v-9.87zm13.58 10.04q-1.311 0-2.267-.545a3.7 3.7 0 0 1-1.46-1.557q-.51-1.012-.511-2.38 0-1.348.511-2.365a3.87 3.87 0 0 1 1.444-1.59q.925-.574 2.176-.574.807 0 1.522.261.722.255 1.273.796.557.54.875 1.375.318.83.318 1.977v.63h-7.153v-1.386h5.182a2.2 2.2 0 0 0-.256-1.051q-.25-.466-.699-.733a1.96 1.96 0 0 0-1.034-.267q-.63 0-1.108.307-.477.3-.744.795a2.3 2.3 0 0 0-.267 1.074v1.21q0 .762.278 1.307.279.54.778.83.5.284 1.171.284.45 0 .813-.125.363-.13.63-.38.267-.252.404-.62l1.92.216q-.181.76-.693 1.33a3.4 3.4 0 0 1-1.296.874q-.789.307-1.806.307m5.621-.17V6.788h1.966v1.483h.102q.273-.75.904-1.17.63-.426 1.506-.426.886 0 1.494.432.613.426.864 1.164h.09q.291-.727.978-1.159.694-.437 1.642-.437 1.204 0 1.966.761.76.761.761 2.222v5.858H54.08v-5.54q0-.813-.432-1.188a1.54 1.54 0 0 0-1.057-.38q-.744 0-1.165.466-.415.46-.415 1.198v5.444h-2.017V9.89q0-.676-.409-1.08-.403-.403-1.057-.403-.443 0-.806.227a1.6 1.6 0 0 0-.58.63 2 2 0 0 0-.216.944v5.307zm14.36 3.272v-12h2.022v1.444h.12q.159-.319.449-.677.29-.363.784-.619.495-.261 1.261-.261 1.011 0 1.824.517.818.51 1.295 1.517.483 1 .483 2.454 0 1.438-.471 2.444-.472 1.005-1.284 1.534a3.3 3.3 0 0 1-1.841.528q-.75 0-1.245-.25a2.5 2.5 0 0 1-.795-.602 4 4 0 0 1-.46-.676h-.086v4.647zm2.017-7.636q0 .846.238 1.483.244.636.7.994.459.353 1.113.353.681 0 1.142-.364.46-.37.693-1.006.24-.642.239-1.46a4.2 4.2 0 0 0-.233-1.443q-.234-.63-.693-.989-.46-.357-1.148-.358-.66 0-1.12.347-.46.346-.698.971-.233.626-.233 1.472m10.04-7.273v11.637h-2.057V3.879zm4.626 11.813a3.6 3.6 0 0 1-1.494-.296q-.66-.3-1.046-.886-.38-.585-.38-1.443 0-.74.272-1.222.273-.483.745-.773a3.8 3.8 0 0 1 1.062-.437 9 9 0 0 1 1.233-.222q.767-.08 1.244-.142.478-.067.694-.204.22-.142.221-.438v-.034q0-.643-.38-.994-.381-.352-1.097-.352-.756 0-1.2.33-.436.328-.59.778l-1.92-.273q.226-.795.75-1.33.522-.54 1.278-.807a4.9 4.9 0 0 1 1.67-.272q.631 0 1.256.147.625.148 1.142.49.517.334.83.914.318.58.318 1.449v5.84h-1.977v-1.198h-.069a2.5 2.5 0 0 1-.528.682 2.5 2.5 0 0 1-.847.505q-.506.188-1.187.188m.534-1.512q.619 0 1.074-.244.454-.25.699-.659.25-.41.25-.892v-1.028a1 1 0 0 1-.33.147 5 5 0 0 1-.511.12q-.284.051-.563.09l-.483.069q-.46.062-.823.204a1.37 1.37 0 0 0-.574.398q-.21.25-.21.648 0 .568.414.858.415.29 1.057.29m10.5-7.392V8.38h-5.017V6.79zm-3.778-2.09h2.056v8.193q0 .414.125.636.131.216.341.295.21.08.466.08.193 0 .352-.028.166-.029.25-.052l.347 1.608a5 5 0 0 1-.472.125 4 4 0 0 1-.738.08 3.35 3.35 0 0 1-1.392-.233 2.17 2.17 0 0 1-.983-.807q-.358-.546-.352-1.364zm9.268 10.988q-1.312 0-2.267-.545a3.7 3.7 0 0 1-1.46-1.557q-.512-1.012-.512-2.38 0-1.348.512-2.365a3.87 3.87 0 0 1 1.443-1.59q.926-.574 2.176-.574.807 0 1.523.261.72.255 1.273.796.556.54.875 1.375.318.83.318 1.977v.63h-7.154v-1.386h5.182a2.2 2.2 0 0 0-.255-1.051q-.25-.466-.7-.733a1.96 1.96 0 0 0-1.034-.267q-.63 0-1.107.307-.478.3-.745.795a2.3 2.3 0 0 0-.267 1.074v1.21q0 .762.279 1.307.278.54.778.83.5.284 1.17.284.45 0 .813-.125.364-.13.63-.38.268-.252.404-.62l1.92.216q-.18.76-.693 1.33a3.4 3.4 0 0 1-1.295.874q-.79.307-1.807.307M99.114 3.88v11.637h-2.057V3.879zm3.393 14.91q-.42 0-.778-.069a3 3 0 0 1-.563-.148l.477-1.602q.45.13.802.125a1 1 0 0 0 .619-.221q.273-.21.46-.705l.176-.472-3.164-8.909h2.181l2.012 6.591h.091l2.017-6.59h2.187l-3.494 9.783a3.9 3.9 0 0 1-.648 1.188 2.6 2.6 0 0 1-.989.761q-.579.267-1.386.267m8.432-3.273h-2.25l4.097-11.637h2.602l4.102 11.637h-2.25l-3.108-9.25h-.091zm.074-4.563h6.136v1.693h-6.136zm12.118-7.074v11.637h-2.108V3.879z"}),pe.createElement("rect",{width:"43",height:"20",x:"129.031",y:"0.016",fill:"#EFE8FF",rx:"10"}),pe.createElement("path",{fill:"#70628D",d:"M137.99 14.016V5.288h3.196q.929 0 1.538.307.61.303.912.823.303.515.303 1.163 0 .545-.2.92a1.66 1.66 0 0 1-.537.597 2.4 2.4 0 0 1-.733.324v.085q.434.021.848.281.417.256.69.729t.273 1.15q0 .67-.316 1.202-.31.529-.963.84-.651.306-1.666.307zm1.317-1.13h1.9q.947 0 1.355-.366.41-.366.41-.916 0-.414-.209-.759a1.5 1.5 0 0 0-.597-.55 1.9 1.9 0 0 0-.912-.204h-1.947zm0-3.822h1.764q.443 0 .797-.17.358-.17.567-.478.213-.311.213-.733 0-.54-.38-.907-.378-.367-1.163-.367h-1.798zm9.253 5.084q-.967 0-1.666-.414a2.8 2.8 0 0 1-1.074-1.171q-.375-.76-.375-1.777 0-1.006.375-1.773.38-.767 1.057-1.198.682-.43 1.594-.43.553 0 1.074.183.519.183.933.575.414.393.652 1.019.239.622.239 1.513v.451h-5.204v-.954h3.955q0-.503-.205-.89a1.55 1.55 0 0 0-.575-.619 1.6 1.6 0 0 0-.861-.226q-.537 0-.937.265-.396.26-.614.682a2 2 0 0 0-.213.907v.746q0 .656.23 1.116.235.46.652.704.418.238.976.238.363 0 .661-.102.298-.107.515-.315.218-.21.333-.516l1.206.217q-.145.533-.52.934-.37.396-.933.617a3.5 3.5 0 0 1-1.275.218m7.278-6.678v1.023h-3.576V7.47zm-2.617-1.568h1.274v6.192q0 .37.111.558a.58.58 0 0 0 .286.251q.178.064.387.064.154 0 .269-.021l.179-.034.23 1.052a2.504 2.504 0 0 1-.827.136 2.24 2.24 0 0 1-.937-.178 1.6 1.6 0 0 1-.703-.58q-.269-.392-.269-.984zm5.931 8.259q-.622 0-1.125-.23a1.9 1.9 0 0 1-.797-.678q-.29-.444-.29-1.087 0-.554.213-.912a1.57 1.57 0 0 1 .576-.566q.362-.21.809-.316.449-.106.912-.162l.955-.11q.366-.048.533-.15.166-.102.166-.332v-.03q0-.558-.316-.865-.31-.307-.929-.307-.643 0-1.014.286a1.53 1.53 0 0 0-.507.626l-1.197-.273a2.3 2.3 0 0 1 .622-.963q.413-.37.95-.537.537-.17 1.129-.17.393 0 .831.094.443.09.827.332.388.243.635.695.247.447.247 1.163v4.347h-1.244v-.895h-.051a1.8 1.8 0 0 1-.371.486q-.248.238-.635.396a2.5 2.5 0 0 1-.929.158m.277-1.023q.528 0 .903-.209.38-.21.576-.546.2-.34.2-.728v-.844a.7.7 0 0 1-.264.128q-.192.056-.439.098-.247.038-.482.072-.234.03-.392.052a3 3 0 0 0-.677.157 1.16 1.16 0 0 0-.486.32q-.179.204-.179.545 0 .473.349.716.35.24.891.239"}),pe.createElement("defs",null,pe.createElement("linearGradient",{id:"paint1_linear_15309_5198",x1:"24.031",x2:"125.031",y1:"0.516",y2:"0.516",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#7F56D9"}),pe.createElement("stop",{offset:"1",stopColor:"#9E77ED"})),pe.createElement("clipPath",{id:"paint0_angular_15309_5198_clip_path"},pe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956"}))))},fP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"61",height:"66",fill:"none",viewBox:"0 0 61 66"},pe.createElement("path",{fill:"url(#paint0_linear_13916_7701)",d:"M-.004 35.057c0-1.257 1.022-2.264 2.273-2.388 10.757-1.067 19.312-9.621 20.378-20.378.124-1.251 1.131-2.273 2.389-2.273s2.264 1.022 2.388 2.273c1.066 10.757 9.621 19.311 20.378 20.378 1.25.124 2.273 1.131 2.273 2.388s-1.022 2.265-2.273 2.389c-10.757 1.066-19.312 9.62-20.378 20.378-.124 1.25-1.131 2.273-2.388 2.273-1.258 0-2.265-1.022-2.389-2.273-1.066-10.757-9.62-19.312-20.378-20.378-1.25-.124-2.273-1.132-2.273-2.389"}),pe.createElement("path",{fill:"#F6EDFF",d:"M45.066 7.512c0-.377.307-.68.682-.717A6.83 6.83 0 0 0 51.862.682c.037-.375.34-.682.716-.682.377 0 .68.307.717.682a6.83 6.83 0 0 0 6.113 6.113c.375.038.682.34.682.717s-.307.68-.682.716a6.83 6.83 0 0 0-6.113 6.114c-.037.375-.34.682-.717.682s-.68-.307-.716-.682a6.83 6.83 0 0 0-6.114-6.114c-.375-.037-.682-.339-.682-.716M40.066 60.098c0-.503.41-.906.91-.956a9.11 9.11 0 0 0 8.15-8.15c.05-.501.453-.91.956-.91s.906.409.956.91a9.11 9.11 0 0 0 8.15 8.15c.501.05.91.453.91.956s-.409.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.955-.91a9.11 9.11 0 0 0-8.151-8.15c-.5-.05-.91-.453-.91-.956"}),pe.createElement("defs",null,pe.createElement("linearGradient",{id:"paint0_linear_13916_7701",x1:"25.036",x2:"25.036",y1:"10.018",y2:"60.097",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#FAF4FF"}),pe.createElement("stop",{offset:"1",stopColor:"#F4E8FF"}))))};var hP=["fill"];const mP=function(e){var t=e.fill,n=void 0===t?"#949DA8":t;return Wn(e,hP),pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"12",fill:"none",viewBox:"0 0 11 12"},pe.createElement("g",{fill:n,clipPath:"url(#clip0_13907_5910)"},pe.createElement("path",{d:"M.806 11.333a.521.521 0 0 1-.368-.89L10.063.82a.52.52 0 1 1 .736.736L1.174 11.18a.52.52 0 0 1-.368.153"}),pe.createElement("path",{d:"M10.431 11.333a.52.52 0 0 1-.368-.153L.438 1.555A.52.52 0 1 1 1.174.82l9.625 9.625a.52.52 0 0 1-.368.889"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_13907_5910"},pe.createElement("path",{fill:"#fff",d:"M.285.666h10.667v10.667H.285z"}))))},gP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"19",fill:"none",viewBox:"0 0 18 19"},pe.createElement("mask",{id:"mask0_13916_779",width:"19",height:"19",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#D9D9D9",d:"M-.004.016h18v18h-18z"})),pe.createElement("g",{mask:"url(#mask0_13916_779)"},pe.createElement("path",{fill:"#949DA8",d:"M8.996 12.766q.319 0 .534-.216a.73.73 0 0 0 .216-.534.73.73 0 0 0-.216-.535.73.73 0 0 0-.534-.215.73.73 0 0 0-.534.215.73.73 0 0 0-.216.535q0 .318.216.534a.73.73 0 0 0 .534.216m0-3q.319 0 .534-.216a.73.73 0 0 0 .216-.534v-3a.73.73 0 0 0-.216-.535.73.73 0 0 0-.534-.215.73.73 0 0 0-.534.215.73.73 0 0 0-.216.535v3q0 .318.216.534a.73.73 0 0 0 .534.216m0 6.75a7.3 7.3 0 0 1-2.925-.591 7.6 7.6 0 0 1-2.381-1.603 7.6 7.6 0 0 1-1.603-2.381 7.3 7.3 0 0 1-.59-2.925q0-1.557.59-2.925A7.6 7.6 0 0 1 3.69 3.709 7.6 7.6 0 0 1 6.07 2.106a7.3 7.3 0 0 1 2.925-.59q1.557 0 2.925.59a7.6 7.6 0 0 1 2.381 1.603 7.6 7.6 0 0 1 1.604 2.382q.59 1.368.59 2.925a7.3 7.3 0 0 1-.59 2.925 7.6 7.6 0 0 1-1.604 2.38 7.6 7.6 0 0 1-2.38 1.604 7.3 7.3 0 0 1-2.926.59m0-1.5q2.513 0 4.256-1.744t1.744-4.256-1.744-4.257Q11.51 3.016 8.996 3.016q-2.513 0-4.256 1.743-1.744 1.745-1.744 4.257t1.744 4.256q1.743 1.743 4.256 1.744"})))},vP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"92",height:"72",fill:"none",viewBox:"0 0 92 72"},pe.createElement("path",{stroke:"#C3CBD5",strokeLinecap:"round",d:"M1.433 61.41c8.094 8.58 12.48 13.001 21.885 5.545 4.71-3.736 5.573-7.252 3.193-12.157-1.582-3.261-6.133-.148-4.51 3.198 2.12 4.366 5.928 7.779 10.849 8.824C44.342 69.26 54.61 55.17 57.71 46.226c1.232-3.553-1.376-10.59-4.721-5.566-2.362 3.548 2.399 8.26 5.49 9.234 14.007 4.412 20.822-11.01 24.397-21.322 1.2-3.464 3.204-11.054 2.59-14.558-.498-2.84 8.892 2.774 3.768.248-2.965-1.462-8.287-3.1-11.607-1.945-1.602.557 5.901-5.42 6.899-6.602C86.2 3.73 89.888-1.228 89.76 2.39c-.106 2.994.03 7.93 1.275 10.494"}))},yP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},pe.createElement("mask",{id:"mask0_2_32",width:"28",height:"28",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#D9D9D9",d:"M27.328.698v26.667H.661V.698z"})),pe.createElement("g",{mask:"url(#mask0_2_32)"},pe.createElement("path",{fill:"#fff",d:"M17.55 12.922 14.33 9.699a1.05 1.05 0 0 1-.306-.777q0-.472.306-.778.305-.306.777-.306t.778.306l5.111 5.111q.334.333.334.778 0 .444-.334.778l-5.11 5.11a1.05 1.05 0 0 1-.779.306q-.472 0-.777-.305a1.05 1.05 0 0 1-.306-.778q0-.472.306-.778l3.222-3.222H8.44q-.473 0-.792-.32a1.08 1.08 0 0 1-.32-.791q0-.473.32-.792t.792-.32z"})))},bP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},pe.createElement("mask",{id:"mask0_4_47",width:"28",height:"28",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#D9D9D9",d:"M.664.668h26.667v26.667H.664z"})),pe.createElement("g",{mask:"url(#mask0_4_47)"},pe.createElement("path",{fill:"#fff",d:"m12.888 10.446-3.222 3.222a1.05 1.05 0 0 1-.778.306q-.472 0-.778-.306a1.05 1.05 0 0 1-.305-.778q0-.472.305-.778l5.111-5.11q.334-.334.778-.334t.778.333l5.111 5.111q.306.306.306.778t-.306.778a1.05 1.05 0 0 1-.778.306q-.473 0-.777-.306l-3.223-3.222v9.11q0 .474-.32.793-.319.318-.79.319-.474 0-.793-.32a1.08 1.08 0 0 1-.319-.791z"})))},wP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",fill:"none",viewBox:"0 0 17 17"},pe.createElement("mask",{id:"mask0_4_54",width:"17",height:"17",x:"0",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#D9D9D9",d:"M.776.357h16v16h-16z"})),pe.createElement("g",{mask:"url(#mask0_4_54)"},pe.createElement("path",{fill:"#737A85",d:"M3.56 14.358a.61.61 0 0 1-.609-.175.61.61 0 0 1-.175-.609l.667-3.183 3.3 3.3zm3.183-.667-3.3-3.3 7.633-7.633a1.3 1.3 0 0 1 .95-.384q.567 0 .95.384l1.4 1.4q.384.383.383.95 0 .566-.383.95zm5.283-10-6.9 6.9 1.417 1.417 6.9-6.9z"})))},EP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 20 21"},pe.createElement("g",{stroke:"#949DA8",strokeWidth:"1.5",clipPath:"url(#clip0_14513_3614)"},pe.createElement("path",{strokeLinecap:"round",d:"M18.334 9.825v.207c0 3.928 0 5.893-1.22 7.113-1.221 1.22-3.185 1.22-7.114 1.22s-5.892 0-7.113-1.22c-1.22-1.22-1.22-3.184-1.22-7.113 0-3.928 0-5.892 1.22-7.113C4.107 1.7 4.822 1.697 8.75 1.697H10"}),pe.createElement("path",{d:"m13.877 2.91.54-.54a2.294 2.294 0 0 1 3.245 3.243l-.54.54M13.876 2.91s.068 1.149 1.081 2.163c1.014 1.013 2.163 1.08 2.163 1.08M13.877 2.91l-4.97 4.97c-.337.337-.506.506-.65.691q-.258.33-.437.707c-.101.212-.177.438-.327.89l-.482 1.446m10.11-5.46-4.97 4.97c-.337.337-.506.506-.691.65q-.33.258-.707.437c-.212.101-.438.177-.89.327l-1.446.482m0 0-.936.312a.619.619 0 0 1-.782-.782l.312-.936m1.406 1.406-1.406-1.406"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_14513_3614"},pe.createElement("path",{fill:"#fff",d:"M0 .031h20v20H0z"}))))},kP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"33",fill:"none",viewBox:"0 0 32 33"},pe.createElement("g",{clipPath:"url(#paint0_angular_13916_1349_clip_path)","data-figma-skip-parse":"true"},pe.createElement("foreignObject",{width:"974.416",height:"974.416",x:"-487.208",y:"-487.208",transform:"matrix(.02167 -.0399 .09682 .05258 16 16.031)"},pe.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",opacity:"1",style:{background:"conic-gradient(from 90deg,#62c2fc 0deg,#f2d7bc 57.4692deg,#f4e0c4 153.531deg,#5935d0 218.669deg,#5cc1ff 357.335deg,#62c2fc 360deg)",height:"100%",width:"100%"}}))),pe.createElement("rect",{width:"32",height:"32",y:"0.031","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"stopsVar":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"transform":{"m00":43.333770751953125,"m01":193.64140319824219,"m02":-102.48758697509766,"m10":-79.802070617675781,"m11":105.15031433105469,"m12":3.3571283817291260},"opacity":1.0,"blendMode":"NORMAL","visible":true}',rx:"16"}),pe.createElement("path",{fill:"#fff",d:"M9.355 26.272a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M16.016 26.272a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M22.636 26.27a2.276 2.276 0 1 0 0-4.551 2.276 2.276 0 0 0 0 4.55M20.03 9.597h-.373a4.88 4.88 0 0 0-4.758-3.806c-.62 0-1.2.124-1.738.331v1.614h2.358v2.317h-2.358v3.93h2.441c-.083.165-.165.414-.207.538-.455 1.076-1.53 1.655-2.69 1.448-1.075-.207-1.86-1.117-1.944-2.276v-3.682h-.827c-1.655.786-2.855 2.483-2.855 4.427a4.89 4.89 0 0 0 4.882 4.882h8.11c2.689-.041 4.84-2.193 4.84-4.882 0-2.648-2.193-4.84-4.882-4.84"}),pe.createElement("defs",null,pe.createElement("clipPath",{id:"paint0_angular_13916_1349_clip_path"},pe.createElement("rect",{width:"32",height:"32",y:"0.031",rx:"16"}))))};function OP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OP(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xP=["Hospital","Medical Clinic","Dental Clinic","Psychology Practice","Health & Wellness","Spa & Wellness Center","Home Healthcare Services","Mental Health Counseling","Fitness Center","Yoga Studio","Personal Coach","Beauty Salon","Barber Shop","Skincare & Beauty Products","Restaurant","Coffee Shop","Bakery","Catering Service","Food Delivery","Hotel & Resort","Travel Agency","Tourism Platform","Organic Food Shop","Grocery Store","Hotel Booking Platform","Flight Booking Service","Real Estate Agency","Architecture Firm","Construction Company","Interior Design","Plumbing Service","Electrical Service","Landscaping","Cleaning Service","Home Decor Store","Furniture Store","Automobile Repair Shop","Car Dealership","Car Wash","Car Rental Service","Bike Rental","IT Service Provider","Software Development","Web Design Agency","Digital Marketing Agency","SEO Agency","Social Media Management","Advertising Agency","Printing & Branding Agency","Email Marketing Service","Influencer Agency","AI Tools & Automation","AI Startup","NFT Marketplace","Crypto Exchange","Gaming Studio","Streaming Platform","Marketplace Platform","E-commerce Store","Education Center","Online Course Platform","Driving School","Music School","Education Consulting","Photography","Photography Studio","Photography Business","Videography Service","Video Editing Agency","Cinematography Studio","Film Production House","Animation Studio","Post-Production Studio","Recording Studio","Music Production Company","Music Video Production","DJ Service","Dance Academy","Solo Musician","Podcast Recording Studio","Art Gallery","Publishing House","News & Media Agency","Online Magazine","Event Management","Wedding Planner","Music Event Organizer","Live Concert Organizer","Music Festival Organizer","Drone Photography","Law Firm","Accounting Firm","Tax Service","Insurance Agency","Finance & Investment Firm","Consulting Firm","Recruitment Agency","Human Resources Consulting","Recruiting Platform","Job Board","Courier Service","Logistics Company","Coworking Space","Laundry Service","Childcare Center","Senior Care Home","Clothing Brand","Fashion Boutique","Jewelry Store","Shoe Store","Pet Shop","Bookstore","Non-Profit Organization","Charity Foundation","NGO","Freelancer Portfolio","Travel Blogger"],_P=["English","Spanish","French","German","Italian","Portuguese","Dutch","Russian","Ukrainian","Polish","Czech","Slovak","Hungarian","Romanian","Bulgarian","Serbian","Croatian","Bosnian","Slovenian","Greek","Turkish","Arabic","Hebrew","Persian (Farsi)","Urdu","Hindi","Bengali","Punjabi","Gujarati","Tamil","Telugu","Kannada","Malayalam","Marathi","Sinhala","Nepali","Thai","Vietnamese","Indonesian","Malay","Filipino (Tagalog)","Chinese (Simplified)","Chinese (Traditional)","Japanese","Korean","Mongolian","Khmer","Lao","Burmese","Swahili","Zulu","Afrikaans","Hausa","Amharic","Somali","Yoruba","Igbo","French (Canadian)","English (UK)","English (US)","Catalan","Basque","Galician","Icelandic","Norwegian","Swedish","Danish","Finnish","Estonian","Latvian","Lithuanian","Irish","Welsh","Scottish Gaelic","Maltese","Esperanto"],CP=["no","nope","nah","skip","skip this","skip it","next","none","nothing","not now","later","no thanks","don't want","do not want","not interested","na","no answer","leave blank","empty","pass"],DP=function(e,t){try{var n=null==e?void 0:e.find(function(e){return(null==e?void 0:e.key)===t});return!0===(null==n?void 0:n.skip)}catch(e){return console.error("Error in isFieldSkippable:",e),!1}},PP=function(e){try{if(!e||"string"!=typeof e)return!1;var t=e.trim().toLowerCase().replace(/[^\w\s]/g,"");return!(t.length>50)&&(![/\b(road|street|house|plot|flat|apartment|unit|building|floor|suite)\s+(no|number)\s+\d+/i,/\b(no|number)\s+\d+\s+(road|street|house|plot|flat|apartment|unit|building|floor|suite)/i,/\d+\s+(road|street|avenue|lane|drive|way|court|place)/i].some(function(e){return e.test(t)})&&(!!CP.includes(t)||CP.some(function(e){if(1===e.split(/\s+/).length&&e.length<=3)return!1;var n=e.replace(/\s+/g,"\\s+"),r=new RegExp("^".concat(n,"\\b"),"i"),o=new RegExp("\\b".concat(n,"$"),"i");return r.test(t)||o.test(t)})))}catch(e){return console.error("Error in isAutomaticSkipText:",e),!1}},AP=function(e){try{if(!e||"string"!=typeof e)return{isValid:!1,errorMessage:(0,At.__)("Email is required","templately")};var t=e.trim();if(!t)return{isValid:!1,errorMessage:(0,At.__)("Email is required","templately")};if(!/^(?!\.)("[^"\r\\]*(\\.[^"\r\\]*)*"|[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*)@(?!-)[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/.test(t))return{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")};if(t.length>254)return{isValid:!1,errorMessage:(0,At.__)("Email address is too long","templately")};var n=t.split("@");if(2!==n.length)return{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")};var r=ce(n,2),o=r[0],i=r[1];return o.length>64?{isValid:!1,errorMessage:(0,At.__)("Email address is too long","templately")}:i.length<1||i.length>253||t.includes("..")?{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")}:{isValid:!0,errorMessage:""}}catch(e){return console.error("Error in validateEmail:",e),{isValid:!1,errorMessage:(0,At.__)("Please enter a valid email address","templately")}}},TP=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;try{if(!e||"string"!=typeof e)return{isValid:!0,errorMessage:""};var n=e.trim();if(!n)return{isValid:!0,errorMessage:""};var r=n.split(/\s+/).filter(function(e){return e.length>0}).length;return r>t?{isValid:!1,errorMessage:(0,At.__)("Maximum ".concat(t," words allowed. You have ").concat(r," words."),"templately")}:{isValid:!0,errorMessage:""}}catch(e){return console.error("Error in validateWordCount:",e),{isValid:!1,errorMessage:(0,At.__)("Maximum ".concat(t," words allowed"),"templately")}}},FP=function(e){try{if(!e||"string"!=typeof e)return{isValid:!1,errorMessage:(0,At.__)("Phone number is required","templately")};var t=e.trim();if(!t)return{isValid:!1,errorMessage:(0,At.__)("Phone number is required","templately")};var n=t.replace(/[^\d+]/g,"");if(!/^[\d\s\-\(\)\.\+]+$/.test(t))return{isValid:!1,errorMessage:(0,At.__)("Contains invalid characters","templately")};var r=n.replace(/\+/g,"");if(r.length<4)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too short","templately")};if(r.length>15)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too long","templately")};var o=(t.match(/\+/g)||[]).length;if(o>1)return{isValid:!1,errorMessage:(0,At.__)("Only one + allowed","templately")};if(1===o&&!t.startsWith("+"))return{isValid:!1,errorMessage:(0,At.__)("+ must be at the beginning","templately")};if(t.startsWith("+")){if(r.length<5)return{isValid:!1,errorMessage:(0,At.__)("Phone number is too short","templately")};var i=r.match(/^(\d{1,3})/);if(i){var a=parseInt(i[1]);if(a<1||a>999)return{isValid:!1,errorMessage:(0,At.__)("Invalid country code","templately")}}}return/[\s\-\(\)\.]{4,}/.test(t)?{isValid:!1,errorMessage:(0,At.__)("Invalid phone number format","templately")}:(t.match(/\(/g)||[]).length!==(t.match(/\)/g)||[]).length?{isValid:!1,errorMessage:(0,At.__)("Unmatched parentheses","templately")}:[/^\+\d{4,15}$/,/^\+\d{1,3}\s\d{1,4}(\s\d{1,4})*$/,/^\+\d{1,3}-\d{1,4}(-\d{1,4})*$/,/^\+\d{1,3}\s?\(\d{1,4}\)\s?\d{1,4}(-\d{1,4})*$/,/^\d{4,15}$/,/^\(\d{1,4}\)\s?\d{1,4}(-\d{1,4})*$/,/^\d{1,4}(\.\d{1,4})+$/,/^\d{1,4}(\s\d{1,4})+$/,/^\d{1,4}(-\d{1,4})+$/].some(function(e){return e.test(n.replace(/\s/g," "))})?/^(\+?0+|(\+?\d)\1{6,})$/.test(n)?{isValid:!1,errorMessage:(0,At.__)("Invalid phone number pattern","templately")}:{isValid:!0,errorMessage:""}:{isValid:!1,errorMessage:(0,At.__)("Invalid phone number format","templately")}}catch(e){return console.error("Error in validatePhoneNumber:",e),{isValid:!1,errorMessage:(0,At.__)("Enter a valid number","templately")}}},MP=null,IP=null,NP=null,jP=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return IP===t&&NP===n&&MP||(IP=t,NP=n,MP=[{key:"start",question:"<p>".concat((0,At.__)("Hi","templately")," ").concat(t||(0,At.__)("there","templately"),"! 👋 ").concat((0,At.__)("Ready to build your website?","templately"),"</p>"),answer:(0,At.__)("Yes, let’s start!","templately"),result:null,skip:!1,done:!1,editable:!1,tooltip:null},{key:"name",question:"<p>".concat((0,At.__)("Great! What’s your business name?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the name of your business only.","templately"),"<br/>").concat((0,At.__)("Note","templately"),": ").concat((0,At.__)("If your business name is ‘BizRise’, share the name only.","templately")," ").concat((0,At.__)("For example","templately"),": ‘BizRise’")},{key:"language",question:"<p>".concat((0,At.__)("Do you want to change the language for content generation? By default, we generate content in English.","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!1,tooltip:"".concat((0,At.__)("Here you can change your content language or can click skip to keep the default language.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("English, Spanish, French, German, etc.","templately"))},{key:"category",question:"<p>".concat((0,At.__)("Love that!","templately")," 💡 ").concat((0,At.__)("What type of business or industry are you in?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business type. You can either select from the available categories in the dropdown or write down any specific type.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("Agency, Restaurant, Technology","templately"))},{key:"description",question:"<p>".concat((0,At.__)("Sounds great! Tell me more about your business — what you do, who you serve, and what makes you special. Please write at least 50 words.","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business details with us.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("It’s an agency website that offers education consultancy to students who want to study abroad.","templately"))},{key:"email",question:"<p>".concat((0,At.__)("Thank you! What’s the email address you’d like to show on your website?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the email address that you want to show on your website.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("xyz@gmail.com","templately"))},{key:"contactNumber",question:"<p>".concat((0,At.__)("Do you also want to add a contact number? If yes, please share it.","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share the contact number you want to add.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("+02860630","templately"))},{key:"businessAddress",question:"<p>".concat((0,At.__)("Nice! What’s your business address?","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your business address you want to show.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("123 Business Lane, Suite 456 Downtown District, New York, NY 10001 United States","templately"))},{key:"openingHour",question:"<p>".concat((0,At.__)("Awesome","templately")," 👌 ").concat((0,At.__)("Do you have any opening hours you want to display?","templately"),"</p>"),answer:null,result:null,skip:!0,done:!1,editable:!0,tooltip:"".concat((0,At.__)("Share your opening hours.","templately"),"<br/>").concat((0,At.__)("For example","templately"),": ").concat((0,At.__)("We stay open from 08:00 AM to 06:00 PM (GMT+6)","templately"))},{key:"imageReplace",question:"<p>".concat((0,At.__)("Thank you! Do you want to replace the default images with new ones?","templately"),"</p>"),answer:null,result:null,skip:!1,done:!1,editable:!1,tooltip:"".concat((0,At.__)("To replace default images, select an image from the left column, then upload your own or choose one from the image library on the right.","templately"))},{key:"finalize",question:"<p>".concat((0,At.__)("Thank you! That’s all we need for now. Should we go ahead and generate your website content?","templately")," 🚀</p>"),answer:(0,At.__)("Yes, Generate and Proceed.","templately"),result:null,skip:!1,done:!1,editable:!1,tooltip:null}],null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.ai_language_show_mode||(MP=MP.filter(function(e){return"language"!==e.key}))),MP},LP=function(){try{var e;return null===(e=window.templatelyDeveloper)||void 0===e?void 0:e.ai_animate_ignore_mode}catch(e){return!1}};"undefined"!=typeof window&&(window.shouldBypassAnimations=LP);var RP=he().memo(function(e){var t=e.currentStep,n=e.isCatchFetching,r=e.conversation,o=e.onTypingComplete,i=e.intervalRefs,a=ce((0,pe.useState)(""),2),l=a[0],s=a[1];(0,pe.useEffect)(function(){null!=t&&t.isTyping&&(null==t?void 0:t.key)===(null==r?void 0:r.key)||s("")},[null==t?void 0:t.isTyping,null==t?void 0:t.key,null==r?void 0:r.key]);var c=(0,pe.useCallback)(function(e){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;try{if(!e||"string"!=typeof e)return console.warn("startTypingEffect: Invalid content provided:",e),null==n||n(""),void(null==r||r());if(!n||"function"!=typeof n)return void console.warn("startTypingEffect: Invalid setTypingContent function provided");var i=function(e){try{if(!e)return"";var t=document.createElement("div");t.innerHTML=e,t.textContent||t.innerText;var n=e.replace(/<br\s*\/?>/gi,"\n");return t.innerHTML=n,(t.textContent||t.innerText||"").trim()}catch(t){return console.error("Error in stripHtmlTags:",t),e}}(e);if(!i.trim())return console.warn("startTypingEffect: No content after HTML stripping"),null==n||n(""),void(null==r||r());if(LP())return n(i),void("function"==typeof r&&r());var a=Math.max(10,Math.min(1e3,Number(t)||30)),l=Array.from(i);n("");var s=0,c=setInterval(function(){try{s<l.length?(n(function(e){return e+l[s]}),s+=1):(clearInterval(c),null!=o&&o.current&&Array.isArray(o.current)&&(o.current=o.current.filter(function(e){return e!==c})),"function"==typeof r&&r())}catch(e){console.error("Error in typing interval:",e),clearInterval(c),null!=o&&o.current&&Array.isArray(o.current)&&(o.current=o.current.filter(function(e){return e!==c})),"function"==typeof r&&r()}},a);null!=o&&o.current&&Array.isArray(o.current)&&o.current.push(c)}catch(e){console.error("Error in startTypingEffect:",e),null==n||n(""),"function"==typeof r&&r()}}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,s,o,i)},[i,o]),u=(0,pe.useMemo)(function(){try{return l?l.split("\n"):[]}catch(e){return console.error("Error splitting typing content:",e),[]}},[l]);if((0,pe.useEffect)(function(){null!=t&&t.isTyping&&null!=t&&t.key&&null!=r&&r.question&&(LP()?(s(r.question),o&&o()):c(r.question))},[null==t?void 0:t.isTyping,null==t?void 0:t.key,null==r?void 0:r.question,c,o]),(0,pe.useEffect)(function(){return function(){s("")}},[]),null!=t&&t.isThinking||n)return he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-thinking-wrapper"},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-thinking"}));if(null!=t&&t.isTyping)return he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},he().createElement("div",{style:{minHeight:"1.6em"}},u.map(function(e,t){return he().createElement(he().Fragment,{key:t},e,t<u.length-1&&he().createElement("br",null))}),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-text-cursor"},"|")));try{var d;return he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text",dangerouslySetInnerHTML:{__html:null!==(d=null==r?void 0:r.question)&&void 0!==d?d:""}})}catch(e){var p;return console.error("Error rendering conversation content:",e),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},null!==(p=null==r?void 0:r.question)&&void 0!==p?p:"")}},function(e,t){var n,r,o,i,a,l,s,c,u,d;return(null===(n=e.currentStep)||void 0===n?void 0:n.isThinking)===(null===(r=t.currentStep)||void 0===r?void 0:r.isThinking)&&(null===(o=e.currentStep)||void 0===o?void 0:o.isTyping)===(null===(i=t.currentStep)||void 0===i?void 0:i.isTyping)&&(null===(a=e.currentStep)||void 0===a?void 0:a.key)===(null===(l=t.currentStep)||void 0===l?void 0:l.key)&&e.isCatchFetching===t.isCatchFetching&&(null===(s=e.conversation)||void 0===s?void 0:s.key)===(null===(c=t.conversation)||void 0===c?void 0:c.key)&&(null===(u=e.conversation)||void 0===u?void 0:u.question)===(null===(d=t.conversation)||void 0===d?void 0:d.question)});RP.displayName="ConversationTypingEffect";const BP=RP;function zP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zP(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var UP=function(e){var t=e.timeoutRefs,n=e.onStepStatusUpdate,r=e.onProgressUpdate,o=e.onUtilityFunctionsReady,i=e.onNoPendingSteps,a=e.isVisible,l=void 0!==a&&a,s=ce((0,pe.useState)({start:!1,complete:!1,errorMessage:null,steps:[{key:"downloading",message:(0,At.__)("Downloading template pack","templately"),status:"waiting"},{key:"analyzing",message:(0,At.__)("Analyzing the details you provided","templately"),status:"waiting"},{key:"generating",message:(0,At.__)("Generating website content","templately"),status:"waiting"},{key:"updating",message:(0,At.__)("Updating content in the template","templately"),status:"waiting"},{key:"preparing",message:(0,At.__)("Preparing live preview","templately"),status:"waiting"}]}),2),c=s[0],u=s[1],d=ce((0,pe.useState)([]),2),p=d[0],f=d[1],h=(0,pe.useRef)(!1);(0,pe.useEffect)(function(){var e=function(){if(!document.hidden&&p.length>0){var e=setTimeout(function(){f(function(e){return 0===e.length?e:Nl(e)})},100);t&&t.current&&t.current.push(e)}};return document.addEventListener("visibilitychange",e),function(){document.removeEventListener("visibilitychange",e)}},[p,t]);var m=(0,pe.useCallback)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(r&&r.delayUntil){var o=Date.now();if(o<r.delayUntil)return{allowed:!1,scheduleAfter:r.delayUntil-o};delete r.delayUntil}var i=e[t],a=Date.now();if("active"===n){if(0===t)return{allowed:!0,scheduleAfter:0};if(!e.slice(0,t).every(function(e){return"done"===e.status}))return{allowed:!1,scheduleAfter:0};var l=e[t-1];if("done"===l.status&&l.completedAt){var s=a-l.completedAt;if(s<3e3)return{allowed:!1,scheduleAfter:3e3-s}}return{allowed:!0,scheduleAfter:0}}if("done"===n){if("active"!==i.status)return{allowed:!1,scheduleAfter:0};if(!e.slice(0,t).every(function(e){return"done"===e.status}))return{allowed:!1,scheduleAfter:0};if(t>0){var c=e[t-1];if("done"===c.status&&c.completedAt){var u=a-c.completedAt;if(u<3e3)return{allowed:!1,scheduleAfter:3e3-u}}}return{allowed:!0,scheduleAfter:0}}if("has-error"===n){if("active"!==i.status)return{allowed:!1,scheduleAfter:0};if(i.activatedAt){var d=a-i.activatedAt;if(d<3e3)return{allowed:!1,scheduleAfter:3e3-d}}return{allowed:!0,scheduleAfter:0}}return"waiting"===n?{allowed:!0,scheduleAfter:0}:{allowed:!1,scheduleAfter:0}},[]),g=(0,pe.useCallback)(function(e,t){try{if(!e||"string"!=typeof e)return void console.warn("setGeneratingContentStepStatus: Invalid key provided:",e);if(!t||"string"!=typeof t)return void console.warn("setGeneratingContentStepStatus: Invalid status provided:",t);if(!["waiting","active","done","has-error"].includes(t))return void console.warn("setGeneratingContentStepStatus: Invalid status value:",t);f(function(n){return-1===n.findIndex(function(n){return n.key===e&&n.status===t})?[].concat(Nl(n),[{key:e,status:t,timestamp:Date.now()}]):n})}catch(e){console.error("Error in setGeneratingContentStepStatus:",e)}},[]);(0,pe.useEffect)(function(){p.length>0&&function(){try{f(function(e){for(var n=Nl(e),r=!1,o=function(e){var o=n[e];if(!o||!o.key||!o.status)return console.warn("Invalid pending step:",o),n.splice(e,1),r=!0,e--,i=e,0;var a=c.steps.findIndex(function(e){return e.key===o.key});if(-1===a)return console.warn("Step not found:",o.key),n.splice(e,1),r=!0,e--,i=e,0;var l=m(c.steps,a,o.status,o);if(l.allowed)n.splice(e,1),r=!0,e--,u(function(e){return WP(WP({},e),{},{steps:e.steps.map(function(e,t){if(e.key===o.key){var n=WP(WP({},e),{},{status:o.status});return"active"===o.status?n.activatedAt=Date.now():"done"===o.status&&(n.completedAt=Date.now()),n}return"done"===o.status&&t===a+1&&"waiting"===e.status?WP(WP({},e),{},{status:"active",activatedAt:Date.now()}):e})})});else if(l.scheduleAfter>0){o.delayUntil=Date.now()+l.scheduleAfter;var s=setTimeout(function(){f(function(e){return Nl(e)})},l.scheduleAfter);t&&t.current&&t.current.push(s)}i=e},i=0;i<n.length;i++)o(i);return r?n:e})}catch(e){console.error("Error processing pending steps:",e)}}()},[c.steps,p,m,t]),(0,pe.useEffect)(function(){if(i&&!h.current){var e=c.steps.every(function(e){return"done"===e.status});if(0===p.length&&e||e&&c.start&&!c.complete){h.current=!0;var n=setTimeout(function(){i()},900);t&&t.current&&t.current.push(n)}}},[p,c.steps,c.start,c.complete,i,t]);var v=(0,pe.useCallback)(function(){u(function(e){return WP(WP({},e),{},{start:!1,complete:!1,errorMessage:null,steps:e.steps.map(function(e){return WP(WP({},e),{},{status:"waiting",completedAt:void 0,activatedAt:void 0})})})}),f([]),h.current=!1},[]),y=(0,pe.useCallback)(function(){f([]),h.current=!1,u(function(e){return WP(WP({},e),{},{start:!0,complete:!1,errorMessage:null,steps:e.steps.map(function(e,t){return WP(WP({},e),{},{status:0===t?"active":"waiting",completedAt:void 0,activatedAt:0===t?Date.now():void 0})})})})},[]),b=(0,pe.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{u(function(t){return WP(WP({},t),{},{start:!1,complete:!0,errorMessage:e})})}catch(e){console.error("Error completing progress:",e)}},[]),w=(0,pe.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{f([]),u(function(n){var r="string"==typeof e?e:"An unknown error occurred",o=n.steps.findIndex(function(e){return"active"===e.status});null!==t&&"number"==typeof t||(t=-1!==o?o:0),t=Math.max(0,Math.min(t,n.steps.length-1));var i=n.steps.map(function(e,n){return n<t&&["waiting","active"].includes(e.status)||n===t?WP(WP({},e),{},{status:"has-error",completedAt:void 0,activatedAt:void 0}):n===t+1?WP(WP({},e),{},{status:"waiting",completedAt:void 0,activatedAt:void 0}):e});return WP(WP({},n),{},{start:!1,complete:!0,errorMessage:r,steps:i})})}catch(e){console.error("Error setting progress error:",e)}},[]);if((0,pe.useEffect)(function(){r&&r({start:c.start,complete:c.complete,errorMessage:c.errorMessage,steps:c.steps})},[c.start,c.complete,c.errorMessage,c.steps,r]),(0,pe.useEffect)(function(){n&&n(g)},[g,n]),(0,pe.useEffect)(function(){o&&o({resetProgress:v,startProgress:y,completeProgress:b,setProgressError:w})},[o,v,y,b,w]),(0,pe.useEffect)(function(){r&&r({start:c.start,complete:c.complete,errorMessage:c.errorMessage,steps:c.steps})},[]),!l)return null;if(!c||!Array.isArray(c.steps))return console.warn("GeneratingContentProgress: Invalid progress state"),null;try{return he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation current-question"},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(kP,null)),he().createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},he().createElement("div",{className:"templately-fsi-ai-sidebar-generating-content-wrapper"},c.steps.map(function(e){return e&&e.key&&e.message?he().createElement("div",{key:e.key,className:"templately-fsi-ai-sidebar-generating-content-step templately-fsi-ai-sidebar-generating-content-step-".concat(e.status||"waiting")},he().createElement("span",{className:"templately-fsi-ai-sidebar-generating-content-step-icon"}),he().createElement("span",{className:"templately-fsi-ai-sidebar-generating-content-step-message"},e.message)):(console.warn("GeneratingContentProgress: Invalid step data",e),null)})),null==c||!c.start||null!=c&&c.complete?null!=c&&c.complete&&null!=c&&c.errorMessage?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-error"},"".concat(c.errorMessage," ").concat((0,At.__)("Please try again or","templately")," "),he().createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("contact support.","templately"))):null:he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-placeholder"},(0,At.__)("Generating your website content… This may take a moment. Thanks for waiting!","templately"))))}catch(e){return console.error("GeneratingContentProgress render error:",e),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-processing-error"},"".concat((0,At.__)("An error occurred while displaying progress. Please try again or","templately")," "),he().createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("contact support.","templately")))}};UP.resetProgress=function(e){return e&&e()},UP.startProgress=function(e){return e&&e()},UP.completeProgress=function(e,t){return e&&e(t)},UP.setProgressError=function(e,t,n){return e&&e(t,n)};const VP=UP,HP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"15",fill:"none",viewBox:"0 0 14 15"},pe.createElement("mask",{id:"mask0_13963_9821",width:"15",height:"15",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#7F7F7F",d:"M-.005.532h14v14h-14z"})),pe.createElement("g",{mask:"url(#mask0_13963_9821)"},pe.createElement("path",{fill:"#7F7F7F",d:"M6.995 9.253a.7.7 0 0 1-.219-.037.5.5 0 0 1-.19-.124L3.904 6.41a.57.57 0 0 1-.167-.401.54.54 0 0 1 .167-.416.55.55 0 0 1 .409-.16q.247 0 .408.16l2.275 2.26 2.275-2.26a.57.57 0 0 1 .401-.168.54.54 0 0 1 .416.168q.16.16.16.409a.55.55 0 0 1-.16.408L7.403 9.092a.5.5 0 0 1-.19.124.7.7 0 0 1-.218.037"})))},GP=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"15",fill:"none",viewBox:"0 0 14 15"},pe.createElement("mask",{id:"mask0_13963_9816",width:"15",height:"15",x:"-1",y:"0",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},pe.createElement("path",{fill:"#7F7F7F",d:"M-.005.532h14v14h-14z"})),pe.createElement("g",{mask:"url(#mask0_13963_9816)"},pe.createElement("path",{fill:"#7F7F7F",d:"M6.995 13.365q-.48 0-.824-.343a1.12 1.12 0 0 1-.343-.824h2.334q0 .482-.343.824a1.12 1.12 0 0 1-.824.343m-1.75-1.75a.56.56 0 0 1-.416-.168.56.56 0 0 1-.167-.415q0-.248.167-.416a.56.56 0 0 1 .416-.168h3.5q.248 0 .416.168t.167.416a.56.56 0 0 1-.167.415.56.56 0 0 1-.416.168zm-.437-1.75A4.47 4.47 0 0 1 3.21 8.261q-.59-1.006-.59-2.188 0-1.823 1.275-3.099 1.275-1.275 3.1-1.276 1.821 0 3.098 1.276 1.275 1.276 1.276 3.1 0 1.18-.59 2.187a4.47 4.47 0 0 1-1.597 1.604zm.35-1.167h3.675a3.24 3.24 0 0 0 1.013-1.152 3.14 3.14 0 0 0 .357-1.473q0-1.34-.933-2.275-.933-.933-2.275-.933t-2.275.933-.933 2.275q0 .788.357 1.473.357.686 1.014 1.152"})))},qP=function(e){var t=e.currentStepTooltip,n=e.isVisible,r=void 0!==n&&n,o=e.isThinkingOrTyping,i=void 0!==o&&o,a=e.timeoutRefs,l=ce((0,pe.useState)(!1),2),s=l[0],c=l[1],u=ce((0,pe.useState)(null),2),d=u[0],p=u[1],f=ce((0,pe.useState)(!1),2),h=f[0],m=f[1],g=Boolean(t||d)&&r&&!i,v=(0,pe.useCallback)(function(){h||c(function(e){return!e})},[h]),y=(0,pe.useMemo)(function(){return(0,Ea.throttle)(function(e,t){if(t){m(!0),c(!1);var n=setTimeout(function(){p(e),m(!1),null!=a&&a.current&&(a.current=a.current.filter(function(e){return e!==n}))},300);null!=a&&a.current&&a.current.push(n)}else{m(!0);var r=setTimeout(function(){p(e),m(!1),null!=a&&a.current&&(a.current=a.current.filter(function(e){return e!==r}))},100);null!=a&&a.current&&a.current.push(r)}},50)},[a]);(0,pe.useEffect)(function(){try{t&&t!==d&&g?y(t,s):t&&!d?p(t):!t&&d&&(p(null),c(!1))}catch(e){console.warn("HelpPanel: Error during content transition:",e),m(!1),p(t||null)}},[t,d,s,g,y]),(0,pe.useEffect)(function(){return function(){y.cancel()}},[y]),(0,pe.useEffect)(function(){!g&&s&&c(!1)},[g,s]);var b=d||"";return g&&b?he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel ".concat(g?"templately-fsi-ai-sidebar-footer-info-panel--visible":"templately-fsi-ai-sidebar-footer-info-panel--hidden"," ").concat(s?"templately-fsi-ai-sidebar-footer-info-panel--open":""," ").concat(h?"templately-fsi-ai-sidebar-footer-info-panel--transitioning":""),role:"complementary","aria-label":(0,At.__)("Help information","templately")},he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-head"},he().createElement("button",{className:"templately-fsi-ai-sidebar-footer-info-button",onClick:v,disabled:h,"aria-expanded":s,"aria-controls":"help-panel-content",type:"button"},he().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-icon"},he().createElement(GP,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-text"},(0,At.__)("How should I pick?","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-footer-info-button-icon ".concat(s?"templately-fsi-ai-sidebar-footer-info-button-icon--rotated":"")},he().createElement(HP,null)))),he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-body"},he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-info-panel-body-inner"},he().createElement("div",{id:"help-panel-content",className:"templately-fsi-ai-sidebar-footer-info-panel-content ".concat(h?"templately-fsi-ai-sidebar-footer-info-panel-content--transitioning":""),dangerouslySetInnerHTML:{__html:b},role:"region","aria-live":"polite"})))):null};function QP(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function $P(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function YP(...e){return t=>{let n=!1;const r=e.map(e=>{const r=$P(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():$P(e[t],null)}}}}function XP(...e){return pe.useCallback(YP(...e),e)}"undefined"==typeof window||!window.document||window.document.createElement;const KP=window.ReactJSXRuntime;function ZP(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>pe.createContext(e));return function(n){const r=n?.[e]||t;return pe.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=pe.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,s=pe.useMemo(()=>a,Object.values(a));return(0,KP.jsx)(l.Provider,{value:s,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const l=a?.[e]?.[i]||o,s=pe.useContext(l);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},JP(r,...t)]}function JP(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return pe.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function eA(e){const t=tA(e),n=pe.forwardRef((e,n)=>{const{children:r,...o}=e,i=pe.Children.toArray(r),a=i.find(rA);if(a){const e=a.props.children,r=i.map(t=>t===a?pe.Children.count(e)>1?pe.Children.only(null):pe.isValidElement(e)?e.props.children:null:t);return(0,KP.jsx)(t,{...o,ref:n,children:pe.isValidElement(e)?pe.cloneElement(e,void 0,r):null})}return(0,KP.jsx)(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function tA(e){const t=pe.forwardRef((e,t)=>{const{children:n,...r}=e;if(pe.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==pe.Fragment&&(o.ref=t?YP(t,e):e),pe.cloneElement(n,o)}return pe.Children.count(n)>1?pe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nA=Symbol("radix.slottable");function rA(e){return pe.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===nA}var oA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=eA(`Primitive.${t}`),r=pe.forwardRef((e,r)=>{const{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,KP.jsx)(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iA(e){const t=pe.useRef(e);return pe.useEffect(()=>{t.current=e}),pe.useMemo(()=>(...e)=>t.current?.(...e),[])}var aA,lA="dismissableLayer.update",sA=pe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cA=pe.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...s}=e,c=pe.useContext(sA),[u,d]=pe.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=pe.useState({}),h=XP(t,e=>d(e)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(g),y=u?m.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=v,E=function(e,t=globalThis?.document){const n=iA(e),r=pe.useRef(!1),o=pe.useRef(()=>{});return pe.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){pA("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...c.branches].some(e=>e.contains(t));w&&!n&&(o?.(e),a?.(e),e.defaultPrevented||l?.())},p),k=function(e,t=globalThis?.document){const n=iA(e),r=pe.useRef(!1);return pe.useEffect(()=>{const e=e=>{e.target&&!r.current&&pA("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...c.branches].some(e=>e.contains(t))||(i?.(e),a?.(e),e.defaultPrevented||l?.())},p);return function(e,t=globalThis?.document){const n=iA(e);pe.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===c.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),pe.useEffect(()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(aA=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),dA(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=aA)}},[u,p,n,c]),pe.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),dA())},[u,c]),pe.useEffect(()=>{const e=()=>f({});return document.addEventListener(lA,e),()=>document.removeEventListener(lA,e)},[]),(0,KP.jsx)(oA.div,{...s,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:QP(e.onFocusCapture,k.onFocusCapture),onBlurCapture:QP(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:QP(e.onPointerDownCapture,E.onPointerDownCapture)})});cA.displayName="DismissableLayer";var uA=pe.forwardRef((e,t)=>{const n=pe.useContext(sA),r=pe.useRef(null),o=XP(t,r);return pe.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,KP.jsx)(oA.div,{...e,ref:o})});function dA(){const e=new CustomEvent(lA);document.dispatchEvent(e)}function pA(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&oe.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}uA.displayName="DismissableLayerBranch";var fA=0;function hA(){pe.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mA()),document.body.insertAdjacentElement("beforeend",e[1]??mA()),fA++,()=>{1===fA&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),fA--}},[])}function mA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gA="focusScope.autoFocusOnMount",vA="focusScope.autoFocusOnUnmount",yA={bubbles:!1,cancelable:!0},bA=pe.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=pe.useState(null),c=iA(o),u=iA(i),d=pe.useRef(null),p=XP(t,e=>s(e)),f=pe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;pe.useEffect(()=>{if(r){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?d.current=t:OA(d.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||OA(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&OA(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,f.paused]),pe.useEffect(()=>{if(l){SA.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(gA,yA);l.addEventListener(gA,c),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(OA(r,{select:t}),document.activeElement!==n)return}(wA(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&OA(l))}return()=>{l.removeEventListener(gA,c),setTimeout(()=>{const t=new CustomEvent(vA,yA);l.addEventListener(vA,u),l.dispatchEvent(t),t.defaultPrevented||OA(e??document.body,{select:!0}),l.removeEventListener(vA,u),SA.remove(f)},0)}}},[l,c,u,f]);const h=pe.useCallback(e=>{if(!n&&!r)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=wA(e);return[EA(t,e),EA(t.reverse(),e)]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&OA(i,{select:!0})):(e.preventDefault(),n&&OA(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,f.paused]);return(0,KP.jsx)(oA.div,{tabIndex:-1,...a,ref:p,onKeyDown:h})});function wA(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function EA(e,t){for(const n of e)if(!kA(n,{upTo:t}))return n}function kA(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function OA(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}bA.displayName="FocusScope";var SA=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xA(e,t),e.unshift(t)},remove(t){e=xA(e,t),e[0]?.resume()}}}();function xA(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var _A=globalThis?.document?pe.useLayoutEffect:()=>{},CA=fe[" useId ".trim().toString()]||(()=>{}),DA=0;function PA(e){const[t,n]=pe.useState(CA());return _A(()=>{e||n(e=>e??String(DA++))},[e]),e||(t?`radix-${t}`:"")}var AA="undefined"!=typeof document?pe.useLayoutEffect:function(){};function TA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!TA(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||TA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function FA(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function MA(e,t){const n=FA(e);return Math.round(t*n)/n}function IA(e){const t=pe.useRef(e);return AA(()=>{t.current=e}),t}const NA=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?Th({element:n.current,padding:r}).fn(t):{}:n?Th({element:n,padding:r}).fn(t):{}}}),jA=(e,t)=>({..._h(e),options:[e,t]}),LA=(e,t)=>({...Ch(e),options:[e,t]}),RA=(e,t)=>({...Fh(e),options:[e,t]}),BA=(e,t)=>({...Dh(e),options:[e,t]}),zA=(e,t)=>({...Ph(e),options:[e,t]}),WA=(e,t)=>({...Ah(e),options:[e,t]}),UA=(e,t)=>({...NA(e),options:[e,t]});var VA=pe.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return(0,KP.jsx)(oA.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,KP.jsx)("polygon",{points:"0,0 30,0 15,10"})})});VA.displayName="Arrow";var HA=VA,GA="Popper",[qA,QA]=ZP(GA),[$A,YA]=qA(GA),XA=e=>{const{__scopePopper:t,children:n}=e,[r,o]=pe.useState(null);return(0,KP.jsx)($A,{scope:t,anchor:r,onAnchorChange:o,children:n})};XA.displayName=GA;var KA="PopperAnchor",ZA=pe.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=YA(KA,n),a=pe.useRef(null),l=XP(t,a),s=pe.useRef(null);return pe.useEffect(()=>{const e=s.current;s.current=r?.current||a.current,e!==s.current&&i.onAnchorChange(s.current)}),r?null:(0,KP.jsx)(oA.div,{...o,ref:l})});ZA.displayName=KA;var JA="PopperContent",[eT,tT]=qA(JA),nT=pe.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:h,...m}=e,g=YA(JA,n),[v,y]=pe.useState(null),b=XP(t,e=>y(e)),[w,E]=pe.useState(null),k=function(e){const[t,n]=pe.useState(void 0);return _A(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(w),O=k?.width??0,S=k?.height??0,x=r+("center"!==i?"-"+i:""),_="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},C=Array.isArray(c)?c:[c],D=C.length>0,P={padding:_,boundary:C.filter(aT),altBoundary:D},{refs:A,floatingStyles:T,placement:F,isPositioned:M,middlewareData:I}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=pe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=pe.useState(r);TA(p,r)||f(r);const[h,m]=pe.useState(null),[g,v]=pe.useState(null),y=pe.useCallback(e=>{e!==k.current&&(k.current=e,m(e))},[]),b=pe.useCallback(e=>{e!==O.current&&(O.current=e,v(e))},[]),w=i||h,E=a||g,k=pe.useRef(null),O=pe.useRef(null),S=pe.useRef(u),x=null!=s,_=IA(s),C=IA(o),D=IA(c),P=pe.useCallback(()=>{if(!k.current||!O.current)return;const e={placement:t,strategy:n,middleware:p};C.current&&(e.platform=C.current),Mh(k.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};A.current&&!TA(S.current,t)&&(S.current=t,oe.flushSync(()=>{d(t)}))})},[p,t,n,C,D]);AA(()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const A=pe.useRef(!1);AA(()=>(A.current=!0,()=>{A.current=!1}),[]),AA(()=>{if(w&&(k.current=w),E&&(O.current=E),w&&E){if(_.current)return _.current(w,E,P);P()}},[w,E,P,_,x]);const T=pe.useMemo(()=>({reference:k,floating:O,setReference:y,setFloating:b}),[y,b]),F=pe.useMemo(()=>({reference:w,floating:E}),[w,E]),M=pe.useMemo(()=>{const e={position:n,left:0,top:0};if(!F.floating)return e;const t=MA(F.floating,u.x),r=MA(F.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...FA(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,F.floating,u.x,u.y]);return pe.useMemo(()=>({...u,update:P,refs:T,elements:F,floatingStyles:M}),[u,P,T,F,M])}({strategy:"fixed",placement:x,whileElementsMounted:(...e)=>xh(...e,{animationFrame:"always"===f}),elements:{reference:g.anchor},middleware:[jA({mainAxis:o+S,alignmentAxis:a}),s&&LA({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?RA():void 0,...P}),s&&BA({...P}),zA({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),w&&UA({element:w,padding:l}),lT({arrowWidth:O,arrowHeight:S}),p&&WA({strategy:"referenceHidden",...P})]}),[N,j]=sT(F),L=iA(h);_A(()=>{M&&L?.()},[M,L]);const R=I.arrow?.x,B=I.arrow?.y,z=0!==I.arrow?.centerOffset,[W,U]=pe.useState();return _A(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]),(0,KP.jsx)("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:M?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,KP.jsx)(eT,{scope:n,placedSide:N,onArrowChange:E,arrowX:R,arrowY:B,shouldHideArrow:z,children:(0,KP.jsx)(oA.div,{"data-side":N,"data-align":j,...m,ref:b,style:{...m.style,animation:M?void 0:"none"}})})})});nT.displayName=JA;var rT="PopperArrow",oT={top:"bottom",right:"left",bottom:"top",left:"right"},iT=pe.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=tT(rT,n),i=oT[o.placedSide];return(0,KP.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,KP.jsx)(HA,{...r,ref:t,style:{...r.style,display:"block"}})})});function aT(e){return null!==e}iT.displayName=rT;var lT=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,c]=sT(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let f="",h="";return"bottom"===s?(f=i?u:`${d}px`,h=-l+"px"):"top"===s?(f=i?u:`${d}px`,h=`${r.floating.height+l}px`):"right"===s?(f=-l+"px",h=i?u:`${p}px`):"left"===s&&(f=`${r.floating.width+l}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function sT(e){const[t,n="center"]=e.split("-");return[t,n]}var cT=XA,uT=ZA,dT=nT,pT=iT,fT=pe.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=pe.useState(!1);_A(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?oe.createPortal((0,KP.jsx)(oA.div,{...r,ref:t}),a):null});fT.displayName="Portal";var hT=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=pe.useState(),r=pe.useRef(null),o=pe.useRef(e),i=pe.useRef("none"),a=e?"mounted":"unmounted",[l,s]=function(e,t){return pe.useReducer((e,n)=>t[e][n]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return pe.useEffect(()=>{const e=mT(r.current);i.current="mounted"===l?e:"none"},[l]),_A(()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=mT(t);s(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&r!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),_A(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=mT(r.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(s("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},l=e=>{e.target===t&&(i.current=mT(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:pe.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):pe.Children.only(n),i=XP(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof n||r.isPresent?pe.cloneElement(o,{ref:i}):null};function mT(e){return e?.animationName||"none"}hT.displayName="Presence";var gT=fe[" useInsertionEffect ".trim().toString()]||_A;function vT({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=function({defaultProp:e,onChange:t}){const[n,r]=pe.useState(e),o=pe.useRef(n),i=pe.useRef(t);return gT(()=>{i.current=t},[t]),pe.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:o;{const t=pe.useRef(void 0!==e);pe.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,r])}const c=pe.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[l,e,i,a]);return[s,c]}Symbol("RADIX:SYNC_STATE");var yT=new WeakMap,bT=new WeakMap,wT={},ET=0,kT=function(e){return e&&(e.host||kT(e.parentNode))},OT=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=kT(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);wT[n]||(wT[n]=new WeakMap);var i=wT[n],a=[],l=new Set,s=new Set(o),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!s.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(yT.get(e)||0)+1,c=(i.get(e)||0)+1;yT.set(e,s),i.set(e,c),a.push(e),1===s&&o&&bT.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),ET++,function(){a.forEach(function(e){var t=yT.get(e)-1,o=i.get(e)-1;yT.set(e,t),i.set(e,o),t||(bT.has(e)||e.removeAttribute(r),bT.delete(e)),o||e.removeAttribute(n)}),--ET||(yT=new WeakMap,yT=new WeakMap,bT=new WeakMap,wT={})}}(r,o,n,"aria-hidden")):function(){return null}},ST=a(1635),xT="right-scroll-bar-position",_T="width-before-scroll-bar";function CT(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var DT="undefined"!=typeof window?pe.useLayoutEffect:pe.useEffect,PT=new WeakMap;function AT(e){return e}var TT=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=AT);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=(0,ST.__assign)({async:!0,ssr:!1},e),t}(),FT=function(){},MT=pe.forwardRef(function(e,t){var n,r,o,i=pe.useRef(null),a=pe.useState({onScrollCapture:FT,onWheelCapture:FT,onTouchMoveCapture:FT}),l=a[0],s=a[1],c=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,w=e.as,E=void 0===w?"div":w,k=e.gapMode,O=(0,ST.__rest)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,x=(n=[i,t],o=function(e,t){var n=(0,pe.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}(r||null,function(e){return n.forEach(function(t){return CT(t,e)})}),DT(function(){var e=PT.get(o);if(e){var t=new Set(e),r=new Set(n),i=o.current;t.forEach(function(e){r.has(e)||CT(e,null)}),r.forEach(function(e){t.has(e)||CT(e,i)})}PT.set(o,n)},[n]),o),_=(0,ST.__assign)((0,ST.__assign)({},O),l);return pe.createElement(pe.Fragment,null,f&&pe.createElement(S,{sideCar:TT,removeScrollBar:p,shards:h,noRelative:g,noIsolation:v,inert:y,setCallbacks:s,allowPinchZoom:!!b,lockRef:i,gapMode:k}),c?pe.cloneElement(pe.Children.only(u),(0,ST.__assign)((0,ST.__assign)({},_),{ref:x})):pe.createElement(E,(0,ST.__assign)({},_,{className:d,ref:x}),u))});MT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},MT.classNames={fullWidth:_T,zeroRight:xT};var IT=function(e){var t=e.sideCar,n=(0,ST.__rest)(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return pe.createElement(r,(0,ST.__assign)({},n))};IT.isSideCarExport=!0;var NT=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a.nc;return t&&e.setAttribute("nonce",t),e}())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jT=function(){var e,t=(e=NT(),function(t,n){pe.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},LT={left:0,top:0,right:0,gap:0},RT=function(e){return parseInt(e||"",10)||0},BT=jT(),zT="data-scroll-locked",WT=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(zT,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(xT," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(_T," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(xT," .").concat(xT," {\n right: 0 ").concat(r,";\n }\n \n .").concat(_T," .").concat(_T," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(zT,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},UT=function(){var e=parseInt(document.body.getAttribute(zT)||"0",10);return isFinite(e)?e:0},VT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;pe.useEffect(function(){return document.body.setAttribute(zT,(UT()+1).toString()),function(){var e=UT()-1;e<=0?document.body.removeAttribute(zT):document.body.setAttribute(zT,e.toString())}},[]);var i=pe.useMemo(function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return LT;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[RT(n),RT(r),RT(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(o)},[o]);return pe.createElement(BT,{styles:WT(i,!t,o,n?"":"!important")})},HT=!1;if("undefined"!=typeof window)try{var GT=Object.defineProperty({},"passive",{get:function(){return HT=!0,!0}});window.addEventListener("test",GT,GT),window.removeEventListener("test",GT,GT)}catch(e){HT=!1}var qT=!!HT&&{passive:!1},QT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},$T=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),YT(e,r)){var o=XT(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},YT=function(e,t){return"v"===e?function(e){return QT(e,"overflowY")}(t):function(e){return QT(e,"overflowX")}(t)},XT=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},KT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZT=function(e){return[e.deltaX,e.deltaY]},JT=function(e){return e&&"current"in e?e.current:e},eF=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},tF=0,nF=[];function rF(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oF=(iF=function(e){var t=pe.useRef([]),n=pe.useRef([0,0]),r=pe.useRef(),o=pe.useState(tF++)[0],i=pe.useState(jT)[0],a=pe.useRef(e);pe.useEffect(function(){a.current=e},[e]),pe.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,ST.__spreadArray)([e.lockRef.current],(e.shards||[]).map(JT),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=pe.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=KT(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),f=p&&p.anchorNode;if(f&&(f===u||f.contains(u)))return!1;var h=$T(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=$T(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),s=!1,c=i>0,u=0,d=0;do{if(!a)break;var p=XT(e,a),f=p[0],h=p[1]-p[2]-o*f;(f||h)&&YT(e,a)&&(u+=h,d+=f);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(c&&(Math.abs(u)<1||!1)||!c&&(Math.abs(d)<1||!1))&&(s=!0),s}(m,t,e,"h"===m?s:c)},[]),s=pe.useCallback(function(e){var n=e;if(nF.length&&nF[nF.length-1]===i){var r="deltaY"in n?ZT(n):KT(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var s=(a.current.shards||[]).map(JT).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?l(n,s[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),c=pe.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:rF(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=pe.useCallback(function(e){n.current=KT(e),r.current=void 0},[]),d=pe.useCallback(function(t){c(t.type,ZT(t),t.target,l(t,e.lockRef.current))},[]),p=pe.useCallback(function(t){c(t.type,KT(t),t.target,l(t,e.lockRef.current))},[]);pe.useEffect(function(){return nF.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",s,qT),document.addEventListener("touchmove",s,qT),document.addEventListener("touchstart",u,qT),function(){nF=nF.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,qT),document.removeEventListener("touchmove",s,qT),document.removeEventListener("touchstart",u,qT)}},[]);var f=e.removeScrollBar,h=e.inert;return pe.createElement(pe.Fragment,null,h?pe.createElement(i,{styles:eF(o)}):null,f?pe.createElement(VT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},TT.useMedium(iF),IT);var iF,aF=pe.forwardRef(function(e,t){return pe.createElement(MT,(0,ST.__assign)({},e,{ref:t,sideCar:oF}))});aF.classNames=MT.classNames;const lF=aF;var sF="Popover",[cF,uF]=ZP(sF,[QA]),dF=QA(),[pF,fF]=cF(sF),hF=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=dF(t),s=pe.useRef(null),[c,u]=pe.useState(!1),[d,p]=vT({prop:r,defaultProp:o??!1,onChange:i,caller:sF});return(0,KP.jsx)(cT,{...l,children:(0,KP.jsx)(pF,{scope:t,contentId:PA(),triggerRef:s,open:d,onOpenChange:p,onOpenToggle:pe.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:c,onCustomAnchorAdd:pe.useCallback(()=>u(!0),[]),onCustomAnchorRemove:pe.useCallback(()=>u(!1),[]),modal:a,children:n})})};hF.displayName=sF;var mF="PopoverAnchor";pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fF(mF,n),i=dF(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=o;return pe.useEffect(()=>(a(),()=>l()),[a,l]),(0,KP.jsx)(uT,{...i,...r,ref:t})}).displayName=mF;var gF="PopoverTrigger",vF=pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fF(gF,n),i=dF(n),a=XP(t,o.triggerRef),l=(0,KP.jsx)(oA.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":PF(o.open),...r,ref:a,onClick:QP(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,KP.jsx)(uT,{asChild:!0,...i,children:l})});vF.displayName=gF;var yF="PopoverPortal",[bF,wF]=cF(yF,{forceMount:void 0}),EF=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=fF(yF,t);return(0,KP.jsx)(bF,{scope:t,forceMount:n,children:(0,KP.jsx)(hT,{present:n||i.open,children:(0,KP.jsx)(fT,{asChild:!0,container:o,children:r})})})};EF.displayName=yF;var kF="PopoverContent",OF=pe.forwardRef((e,t)=>{const n=wF(kF,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=fF(kF,e.__scopePopover);return(0,KP.jsx)(hT,{present:r||i.open,children:i.modal?(0,KP.jsx)(xF,{...o,ref:t}):(0,KP.jsx)(_F,{...o,ref:t})})});OF.displayName=kF;var SF=eA("PopoverContent.RemoveScroll"),xF=pe.forwardRef((e,t)=>{const n=fF(kF,e.__scopePopover),r=pe.useRef(null),o=XP(t,r),i=pe.useRef(!1);return pe.useEffect(()=>{const e=r.current;if(e)return OT(e)},[]),(0,KP.jsx)(lF,{as:SF,allowPinchZoom:!0,children:(0,KP.jsx)(CF,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:QP(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:QP(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:QP(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),_F=pe.forwardRef((e,t)=>{const n=fF(kF,e.__scopePopover),r=pe.useRef(!1),o=pe.useRef(!1);return(0,KP.jsx)(CF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),CF=pe.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,p=fF(kF,n),f=dF(n);return hA(),(0,KP.jsx)(bA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,KP.jsx)(cA,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:(0,KP.jsx)(dT,{"data-state":PF(p.open),role:"dialog",id:p.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),DF="PopoverClose";function PF(e){return e?"open":"closed"}pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fF(DF,n);return(0,KP.jsx)(oA.button,{type:"button",...r,ref:t,onClick:QP(e.onClick,()=>o.onOpenChange(!1))})}).displayName=DF,pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=dF(n);return(0,KP.jsx)(pT,{...o,...r,ref:t})}).displayName="PopoverArrow";var AF=hF,TF=vF,FF=EF,MF=OF;const IF=function(e){var t=e.open,n=e.onOpenChange,r=e.children,o=e.content;return React.createElement(AF,{open:t,onOpenChange:n},React.createElement(TF,{asChild:!0},r),React.createElement(FF,null,React.createElement(MF,{className:"templately-fsi-ai-sidebar-conversation-categories-panel",sideOffset:12,side:"top",align:"end"},o)))},NF=function(e){var t=e.open,n=e.onOpenChange,r=e.children,o=e.content;return React.createElement(AF,{open:t,onOpenChange:n},React.createElement(TF,{asChild:!0},r),React.createElement(FF,null,React.createElement(MF,{className:"templately-fsi-ai-sidebar-conversation-languages-panel",sideOffset:12,side:"top",align:"end"},o)))};function jF(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return LF(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(LF(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,LF(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,LF(d,"constructor",c),LF(c,"constructor",s),s.displayName="GeneratorFunction",LF(c,o,"GeneratorFunction"),LF(d),LF(d,o,"Generator"),LF(d,r,function(){return this}),LF(d,"toString",function(){return"[object Generator]"}),(jF=function(){return{w:i,m:p}})()}function LF(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}LF=function(e,t,n,r){function i(t,n){LF(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},LF(e,t,n,r)}function RF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RF(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var zF=function(){return Sd(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};kd(this,e),this.callbacks=t,this.state="idle",this.data={},this.errors=[]},[{key:"setState",value:function(e){var t,n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,y=this.state;switch(this.state=e,v&&(this.data=BF(BF({},this.data),v)),$a("AI Workflow: ".concat(y," → ").concat(e),v),e){case"session_created":null===(t=(n=this.callbacks).onSessionCreated)||void 0===t||t.call(n,v);break;case"ai_content_started":null===(r=(o=this.callbacks).onAIContentStarted)||void 0===r||r.call(o,v);break;case"both_completed":null===(i=(a=this.callbacks).onBothCompleted)||void 0===i||i.call(a,this.data);break;case"polling_complete":null===(l=(s=this.callbacks).onPollingComplete)||void 0===l||l.call(s,v);break;case"updating":null===(c=(u=this.callbacks).onUpdating)||void 0===c||c.call(u,v);break;case"preparing":null===(d=(p=this.callbacks).onPreparing)||void 0===d||d.call(p,v);break;case"workflow_complete":null===(f=(h=this.callbacks).onWorkflowComplete)||void 0===f||f.call(h,v);break;case"error":this.errors.push(v),null===(m=(g=this.callbacks).onError)||void 0===m||m.call(g,v)}}},{key:"getState",value:function(){return this.state}},{key:"getData",value:function(){return this.data}},{key:"getErrors",value:function(){return this.errors}}])}(),WF=function(){var e=hi(jF().m(function e(t,n,r){var o,i,a,l,s,c,u,d,p,f;return jF().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,s=Object.values(t.ai_page_ids||{}).flat(),(null===(o=t.preview_pages)||void 0===o?void 0:o.length)>0&&(s=s.filter(function(e){return!t.preview_pages.includes(e)})),(c=new FormData).append("id",n),c.append("session_id",t.session_id),c.append("ai_page_ids",JSON.stringify(t.ai_page_ids)),c.append("content_ids",JSON.stringify(s)),c.append("platform",t.platform),t.requested_platform&&c.append("requested_platform",t.requested_platform),u=(0,vi.addQueryArgs)(window.ajaxurl,{action:"templately_pack_create_session_and_download",is_lightspeed:!0,nonce:window.templately.nonce}),e.n=1,wa(u,c,{signal:r});case 1:if("error"!==(null==(d=e.v)?void 0:d.status)&&null!=d&&d.success){e.n=2;break}throw new Error((null==d?void 0:d.message)||(null==d||null===(p=d.data)||void 0===p?void 0:p.message)||(0,At.__)("Failed to create session and download pack","templately"));case 2:if(null!==(i=d.data)&&void 0!==i&&i.session_id){e.n=3;break}throw new Error((0,At.__)("Session creation failed","templately"));case 3:return e.a(2,BF({session_id:null===(a=d.data)||void 0===a?void 0:a.session_id,pack_downloaded:(null===(l=d.data)||void 0===l?void 0:l.pack_downloaded)||!1},d.data));case 4:throw e.p=4,f=e.v,console.error("Error in createSessionAndDownloadPack:",f),f;case 5:return e.a(2)}},e,null,[[0,4]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),UF=function(){var e=hi(jF().m(function e(t,n){var r,o,i;return jF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=Object.values(t.ai_page_ids||{}).flat(),(null===(r=t.preview_pages)||void 0===r?void 0:r.length)>0&&(o=o.filter(function(e){return!t.preview_pages.includes(e)})),!(0,Ea.isEmpty)(t.preview_pages)){e.n=1;break}throw{message:(0,At.__)("Please select at least one page to modify.","templately"),type:"error",errorType:"EMPTY_PAGE_SELECTION"};case 1:if(t.description){e.n=2;break}throw{message:(0,At.__)("Please enter a prompt describing your business and content needs.","templately"),type:"error",errorType:"MISSING_PROMPT"};case 2:if(t.pack_id){e.n=3;break}throw{message:(0,At.__)("Template pack ID is missing.","templately"),type:"error",errorType:"MISSING_PACK_ID"};case 3:if(t.platform){e.n=4;break}throw{message:(0,At.__)("Platform selection is required.","templately"),type:"error",errorType:"MISSING_PLATFORM"};case 4:return e.p=4,e.n=5,ha("/templately/v1/ai-content/modify-content/",BF(BF({},t),{},{content_ids:o,preview_pages:t.preview_pages||[]}),{signal:n},!0);case 5:if(i=e.v,$a(i),"success"===i.status){e.n=6;break}throw new Error((null==i?void 0:i.message)||(0,At.__)("Failed to start AI content modification","templately"));case 6:if(null!=i&&i.process_id){e.n=7;break}throw new Error((0,At.__)("Failed to start AI content modification","templately"));case 7:return e.a(2,i);case 8:throw e.p=8,e.v;case 9:return e.a(2)}},e,null,[[4,8]])}));return function(t,n){return e.apply(this,arguments)}}(),VF=function(){var e=hi(jF().m(function e(t){var n,r,o,i,a,l,s=arguments;return jF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"pack",r=s.length>2&&void 0!==s[2]?s[2]:null,e.p=1,t){e.n=2;break}throw new Error((0,At.__)("Pack ID is required to fetch attachments data","templately"));case 2:return $a("Fetching attachments data from API...",{packId:t,type:n}),o={type:n,pack_id:t},e.n=3,fa("/templately/v1/ai-content/attachments",o,{signal:r});case 3:if(i=e.v,$a("Attachments API response:",i),!i.error){e.n=4;break}throw i.error;case 4:if((a=i.response)&&"success"===a.status){e.n=5;break}throw new Error((null==a?void 0:a.message)||(0,At.__)("Failed to fetch attachments data","templately"));case 5:if(Array.isArray(a.data)){e.n=6;break}throw new Error((0,At.__)("Invalid attachments data format","templately"));case 6:return e.a(2,{attachments:a.data,count:a.data.length,message:a.message,status:a.status});case 7:if(e.p=7,!("AbortError"===(l=e.v).name||null!=r&&r.aborted)){e.n=8;break}throw $a("Attachments fetch was cancelled"),new Error((0,At.__)("Attachments fetch was cancelled","templately"));case 8:throw console.error("Error fetching attachments data:",l),new Error(l.message||(0,At.__)("Failed to fetch attachments data","templately"));case 9:return e.a(2)}},e,null,[[1,7]])}));return function(t){return e.apply(this,arguments)}}(),HF=function(){var e=hi(jF().m(function e(t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O,S,x,_,C,D,P,A,T,F,M,I,N,j=arguments;return jF().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=j.length>2&&void 0!==j[2]?j[2]:null,r=new zF(j.length>1&&void 0!==j[1]?j[1]:{}),o=new AbortController,i=setTimeout(function(){o.abort("Workflow timeout")},QF.OVERALL_TIMEOUT),e.p=1,r.setState("validating"),null!=t&&t.pack_id){e.n=2;break}throw new Error((0,At.__)("Template pack ID is missing","templately"));case 2:if(null!=t&&t.description){e.n=3;break}throw new Error((0,At.__)("AI prompt is missing","templately"));case 3:if(a=t.session_id||OO(),l=BF(BF({},t),{},{session_id:a}),s=[new AbortController,new AbortController],c=[],u=function(e){s.forEach(function(t){t.signal.aborted||t.abort(e)}),c.forEach(function(e){try{e()}catch(e){console.warn("Cleanup task failed:",e)}})},!n){e.n=5;break}if(!n.signal.aborted){e.n=4;break}throw new Error((0,At.__)("AI content workflow was cancelled","templately"));case 4:d=function(){return u("External abort signal received")},n.signal.addEventListener("abort",d),c.push(function(){n.signal.removeEventListener("abort",d)});case 5:return r.setState("executing_parallel_operations"),e.n=6,Promise.allSettled([WF(l,t.pack_id,s[0].signal).then(function(e){return r.setState("session_created",e),{success:!0,data:e}}),UF(l,s[1].signal).then(function(e){return r.setState("ai_content_started",e),{success:!0,data:e}})]);case 6:if(p=e.v,f=ce(p,2),h=f[0],m=f[1],g=[],"rejected"===h.status&&((y=new Error((null===(v=h.reason)||void 0===v?void 0:v.message)||(0,At.__)("Session creation and pack download failed","templately"))).cause="createSessionAndDownloadPack",y.originalError=h.reason,g.push(y)),"rejected"===m.status&&((w=new Error((null===(b=m.reason)||void 0===b?void 0:b.message)||(0,At.__)("AI content modification failed to start","templately"))).cause="startModifyAiContent",w.originalError=m.reason,g.push(w)),!(g.length>0)){e.n=7;break}throw u("Critical operation failed"),g[0];case 7:if(E=h.value.data,k=m.value.data,O=k.is_local_site,!k.process_id){e.n=11;break}return e.p=8,S=(0,vi.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_settings",nonce:window.templately.nonce}),(x=new FormData).append("session_id",l.session_id),x.append("process_id",k.process_id),e.n=9,wa(S,x);case 9:e.n=11;break;case 10:e.p=10,M=e.v,$a("Failed to update session data with process_id:",M);case 11:if(r.setState("both_completed",{sessionResult:E,aiContentResult:k}),r.setState("fetching_preview_content"),(_=null==k?void 0:k.templates)&&0!==Object.keys(_).length){e.n=15;break}return e.p=12,e.n=13,new Promise(function(e,r){var o=setTimeout(function(){var e=null,t=function(){if(e&&(document.removeEventListener("visibilitychange",e),e=null),window.confirm((0,At.__)("AI content generation is taking longer than expected. Click OK to cancel or Cancel to keep waiting. Credits will still apply.","templately")))return l.cleanup(),void r(new Error((0,At.__)("Polling timeout: AI content generation took too long","templately")))};try{!document.hidden&&l.isActive?t():(e=function(){!document.hidden&&l.isActive&&t()},document.addEventListener("visibilitychange",e))}catch(t){return $a("Error showing confirmation dialog:",t),void(e&&(document.removeEventListener("visibilitychange",e),e=null))}},QF.POLLING_TIMEOUT),i=t.preview_pages||[],a={};Object.entries(t.ai_page_ids||{}).forEach(function(e){var t=ce(e,2),n=t[0],r=(t[1]||[]).filter(function(e){return i.includes(e)});r.length>0&&(a[n]=r)});var l=$F(E.session_id,k.process_id,a,[],function(){},function(t){clearTimeout(o),$a("Workflow polling completed successfully"),e(t)},function(e){clearTimeout(o),$a("Workflow polling failed:",e.message),r(new Error(e.message||(0,At.__)("Polling for AI content failed","templately")))},null==n?void 0:n.signal,O);if(null!=n&&n.signal){var s=function(){clearTimeout(o),null!=l&&l.cleanup&&l.cleanup(),r(new Error((0,At.__)("AI content workflow was cancelled","templately")))};if(n.signal.aborted)return void s();n.signal.addEventListener("abort",s)}});case 13:_=e.v,e.n=15;break;case 14:throw e.p=14,I=e.v,new Error(I.message||(0,At.__)("Polling for AI content failed","templately"));case 15:if(_&&0!==Object.keys(_).length){e.n=16;break}throw new Error((0,At.__)("No AI templates were generated","templately"));case 16:return r.setState("polling_complete",{templates:_}),C={isLocalSite:O,session_id:E.session_id,process_id:k.process_id,templates:_||{},pack_downloaded:E.pack_downloaded,ai_page_ids:Object.values(t.AIPageIDs||{}).flat().filter(function(e){return(t.preview_pages||[]).includes(e)})},u("Workflow completed successfully"),clearTimeout(i),r.setState("updating"),r.setState("preparing"),r.setState("workflow_complete",C),e.a(2,C);case 17:if(e.p=17,N=e.v,clearTimeout(i),!(null!==(D=N.message)&&void 0!==D&&D.includes("timeout")||o.signal.aborted)){e.n=18;break}throw $a("AI Content Workflow timed out"),(T=new Error((0,At.__)("AI content workflow timed out","templately"))).cause="timeout",r.setState("error",T),T;case 18:if(!("AbortError"===N.name||null!==(P=N.message)&&void 0!==P&&P.includes("cancelled")||null!==(A=N.message)&&void 0!==A&&A.includes("abort"))){e.n=19;break}throw $a("AI Content Workflow was cancelled"),(F=new Error((0,At.__)("AI content workflow was cancelled","templately"))).cause="cancelled",r.setState("error",F),F;case 19:throw console.error("AI Content Workflow Error:",N),N.cause||(N.cause="workflowGeneral"),r.setState("error",N),N;case 20:return e.a(2)}},e,null,[[12,14],[8,10],[1,17]])}));return function(t){return e.apply(this,arguments)}}(),GF=1e4,qF=2e4,QF={OVERALL_TIMEOUT:3e5,POLLING_TIMEOUT:3e5,PARALLEL_OPERATIONS_TIMEOUT:12e4},$F=function(e,t,n,r,o,i,a){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,s=arguments.length>8?arguments[8]:void 0;if(!t||!e||(0,Ea.isEmpty)(n))return null==a||a(new Error((0,At.__)("Process ID or page IDs missing","templately"))),null;if(null!=l&&l.aborted)return null==a||a(new Error((0,At.__)("Polling was cancelled","templately"))),null;var c=Date.now(),u=(Date.now(),s?qF:2e3),d=0,p=null,f={},h=!1,m=function(e){var t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return n>0?"".concat(n,"m ").concat(r,"s"):"".concat(t,"s")},g=Object.values(n||{}).flat(),v=g,y={isActive:!0,cleanup:function(){y.isActive=!1,p&&(clearTimeout(p),p=null)}},b=function(){if(s)return $a("calculateNextInterval: local site, returning ".concat(qF,"ms")),qF;var e=2*(Math.random()-.5)*.05,t=Math.min(u*(1+e),GF);u=Math.min(1.2*u,GF);var n=Math.max(Math.round(t),5e3);return $a("calculateNextInterval: currentInterval=".concat(u,", jitter=").concat(e.toFixed(3),", interval=").concat(t.toFixed(0),", final=").concat(n,"ms")),n},w=function(){var r=hi(jF().m(function r(){var E,k,O,S,x,_,C,D,P,A,T,F,M,I,N,j,L;return jF().w(function(r){for(;;)switch(r.p=r.n){case 0:if(!(!y.isActive||null!=l&&l.aborted||h)){r.n=1;break}return r.a(2);case 1:if(h=!0,!(++d>100)){r.n=2;break}return y.cleanup(),E=Date.now()-c,null==a||a(new Error((0,At.__)("Polling timeout: Maximum attempts (".concat(100,") exceeded after ").concat(m(E)),"templately"))),r.a(2);case 2:return $a("Starting poll attempt ".concat(d)),r.p=3,O=Date.now(),S=Date.now()-c,$a("AI polling attempt ".concat(d,", elapsed time: ").concat(m(S))),x=s?"templately_pack_ai_poll_template":"templately_pack_ai_get_json",_=(0,vi.addQueryArgs)(window.ajaxurl,{action:x,session_id:e,is_lightspeed:!0,nonce:window.templately.nonce}),C={process_id:t,ai_page_ids:n},r.n=4,ha(_,C,{signal:l},!0);case 4:if(D=r.v,P=Date.now()-O,null==D||!D.success||null===(k=D.data)||void 0===k||!k.templates){r.n=8;break}if(T=BF({},D.data.templates),Object.assign(f,T),v=g.filter(function(e){return!f[e]}),$a("missing pages: ".concat(v.length," of ").concat(g.length)),$a("receivedData",f),Object.keys(f).forEach(function(e){(0,Ea.isEmpty)(f[e])&&delete f[e]}),null==o||o(f,v),F=null===(A=D.data)||void 0===A?void 0:A.is_last_part,!s||!F){r.n=6;break}if(y.cleanup(),M=Date.now()-c,$a("AI polling completed (is_last_part=true) after ".concat(d," attempts in ").concat(m(M))),!(v.length>0)){r.n=5;break}return null==a||a(new Error((0,At.__)("AI content generation incomplete: ".concat(v.length," pages still missing when process marked as complete"),"templately"))),r.a(2);case 5:return null==i||i(f,v),r.a(2);case 6:if(0!==v.length){r.n=7;break}return y.cleanup(),I=Date.now()-c,$a("AI polling completed after ".concat(d," attempts in ").concat(m(I))),null==i||i(f,v),r.a(2);case 7:Object.keys(T).length>0&&(Date.now(),s||(u=2e3)),!s&&P>3e3&&(u=Math.min(1.5*u,GF)),r.n=9;break;case 8:if(null!=D&&D.success){r.n=9;break}return y.cleanup(),null==a||a(new Error((null==D?void 0:D.data)||(0,At.__)("Polling failed","templately"))),r.a(2);case 9:r.n=12;break;case 10:if(r.p=10,!("AbortError"===(L=r.v).name||null!=l&&l.aborted)){r.n=11;break}return $a("AI polling was cancelled"),y.cleanup(),null==a||a(new Error((0,At.__)("Polling was cancelled","templately"))),r.a(2);case 11:N=Date.now()-c,$a("AI polling attempt ".concat(d," failed after ").concat(m(N),":"),L.message),!s&&L.status>=500&&(u=Math.min(2*u,GF));case 12:h=!1,!y.isActive||null!=l&&l.aborted?$a("Polling stopped: active=".concat(y.isActive,", aborted=").concat(null==l?void 0:l.aborted)):(j=b(),$a("Scheduling next poll in ".concat(j,"ms (attempt ").concat(d+1,")")),p=setTimeout(w,j));case 13:return r.a(2)}},r,null,[[3,10]])}));return function(){return r.apply(this,arguments)}}();if(l){var E=function(){var e=l.reason,t=e&&(e.includes("Starting new polling session")||e.includes("Component unmounting")||e.includes("Data reset"));y.cleanup(),t||null==a||a(new Error(e||(0,At.__)("Polling was cancelled","templately")))};l.addEventListener("abort",E);var k=y.cleanup;y.cleanup=function(){k(),l.removeEventListener("abort",E)}}return w(),y},YF=function(e){return function(e){var t={};return e&&(0,Ea.isArray)(e)?(e.forEach(function(e){var n,r=e.id,o=e.source,i=e.original,a=e.replace;t[r]={originalUrl:i.url,newUrl:null!==(n=a.src.large2x)&&void 0!==n?n:a.src.large,source:o,newData:{id:a.id,alt:a.alt,provider:a.provider,photographer:a.photographer,width:a.width,height:a.height,original:a.src.original,medium:a.src.medium}}}),t):t}(e)};function XF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function KF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XF(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const ZF=window.wp.mediaUtils,JF=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"13",fill:"none",viewBox:"0 0 12 13"},pe.createElement("g",{stroke:"#949DA8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"0.8",clipPath:"url(#clip0_15476_9513)"},pe.createElement("path",{d:"M1.8 5.363a3.5 3.5 0 1 0 7 0 3.5 3.5 0 0 0-7 0M10.2 10.263l-2.4-2.4"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_9513"},pe.createElement("path",{fill:"#fff",d:"M0 .064h12v12H0z"}))))},eM=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},pe.createElement("g",{fill:"#4488C2",clipPath:"url(#clip0_16188_9300)"},pe.createElement("path",{d:"M12.153 8.906a2.448 2.448 0 1 0 0 4.897 2.448 2.448 0 0 0 0-4.897m0 3.73a1.282 1.282 0 1 1 0-2.564 1.282 1.282 0 0 1 0 2.565"}),pe.createElement("path",{d:"M21.917 3.31 6.005 1.501a2.19 2.19 0 0 0-1.72.496c-.476.369-.781.916-.845 1.515l-.292 2.39h-.903C.963 5.903 0 7.04 0 8.322v11.92a2.215 2.215 0 0 0 2.244 2.273h16c1.282 0 2.448-.99 2.448-2.273v-.466a2.9 2.9 0 0 0 1.108-.467 2.42 2.42 0 0 0 .845-1.573l1.34-11.833a2.36 2.36 0 0 0-2.069-2.594m-2.39 16.932c0 .641-.64 1.107-1.282 1.107h-16a1.05 1.05 0 0 1-1.078-1.107v-2.157l4.517-3.322a1.4 1.4 0 0 1 1.807.087l3.177 2.798a2.74 2.74 0 0 0 1.72.641c.492.006.976-.125 1.398-.379l5.742-3.322zm0-7.024-6.353 3.702a1.49 1.49 0 0 1-1.72-.146L8.25 13.947a2.594 2.594 0 0 0-3.235-.117l-3.847 2.798V8.322c0-.641.437-1.253 1.078-1.253h16a1.34 1.34 0 0 1 1.282 1.253zm3.295-7.472-.001.011-1.37 11.833a.99.99 0 0 1-.379.787c-.116.116-.379.175-.379.233V8.322a2.506 2.506 0 0 0-2.448-2.419H4.315l.261-2.273a1.34 1.34 0 0 1 .438-.758 1.34 1.34 0 0 1 .874-.233l15.884 1.836c.64.06 1.11.63 1.05 1.27"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_16188_9300"},pe.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z"}))))},tM=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),pe.createElement("g",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",clipPath:"url(#clip0_15476_9537)"},pe.createElement("path",{d:"M2 4.665a1.333 1.333 0 0 1 1.333-1.333h9.334A1.333 1.333 0 0 1 14 4.665v6.667a1.333 1.333 0 0 1-1.333 1.333H3.333A1.333 1.333 0 0 1 2 11.332z"}),pe.createElement("path",{d:"M4.666 8V6h2M11.334 8v2h-2"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_9537"},pe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},nM=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),pe.createElement("g",{clipPath:"url(#clip0_15476_9545)"},pe.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",d:"M8.002 11.331h-2v-2m2-4.666h2v2m-5.335 7.333a1.333 1.333 0 0 1-1.333-1.333V3.33a1.333 1.333 0 0 1 1.333-1.333h6.667a1.333 1.333 0 0 1 1.333 1.333v9.334a1.333 1.333 0 0 1-1.333 1.333z"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_9545"},pe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},rM=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),pe.createElement("g",{clipPath:"url(#clip0_15476_9551)"},pe.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",d:"M8.001 10.778H5.86V9.11M8 5.222h2.143V6.89M4.43 13c-.38 0-.743-.117-1.01-.325-.268-.209-.419-.491-.419-.786V4.11c0-.295.15-.577.418-.786A1.66 1.66 0 0 1 4.428 3h7.143c.38 0 .743.117 1.01.325.269.209.419.491.419.786v7.778c0 .295-.15.577-.418.786a1.66 1.66 0 0 1-1.01.325z"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_9551"},pe.createElement("path",{fill:"#fff",d:"M0 0h16v16H0z"}))))},oM=a.p+"images/image-placeholder.png",iM=a.p+"images/arrow-no-selected-image.png",aM=a.p+"images/ai-generated-image-placeholder.png";var lM=he().memo(function(e){var t=e.children,n=e.content,r=e.disabled;return void 0!==r&&r?t:he().createElement(AF,null,he().createElement(TF,{asChild:!0},t),he().createElement(FF,null,he().createElement(MF,{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover",sideOffset:3,align:"end"},n)))});const sM=lM;var cM={low:0,max:0,high:0,C:2,P:void 0,R:void 0,L:void 0,list:void 0};function uM(e){var t=e.high;e.L===cM&&e.R===cM?e.max=t:e.L===cM?e.max=Math.max(e.R.max,t):e.R===cM?e.max=Math.max(e.L.max,t):e.max=Math.max(Math.max(e.L.max,e.R.max),t)}function dM(e){for(var t=e;t.P!==cM;)uM(t.P),t=t.P}function pM(e,t){if(t.R!==cM){var n=t.R;t.R=n.L,n.L!==cM&&(n.L.P=t),n.P=t.P,t.P===cM?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,uM(t),uM(n)}}function fM(e,t){if(t.L!==cM){var n=t.L;t.L=n.R,n.R!==cM&&(n.R.P=t),n.P=t.P,t.P===cM?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,uM(t),uM(n)}}function hM(e,t,n){t.P===cM?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}cM.P=cM,cM.L=cM,cM.R=cM;const mM=e=>{const t=pe.useRef(e);return pe.useEffect(()=>{t.current=e}),t},gM=(e,t=100,n=!1)=>{const r=mM(e),o=pe.useRef(),i=[t,n,r];function a(){o.current&&clearTimeout(o.current),o.current=void 0}function l(){o.current=void 0}return pe.useEffect(()=>a,i),pe.useCallback(function(){const e=arguments,{current:i}=o;if(void 0===i&&n)return o.current=setTimeout(l,t),r.current.apply(null,e);i&&clearTimeout(i),o.current=setTimeout(()=>{o.current=void 0,r.current.apply(null,e)},t)},i)},vM=function(e,t,n,r){const o=pe.useRef(n),i=pe.useRef(r);pe.useEffect(()=>{o.current=n,i.current=r}),pe.useEffect(()=>{const n=e&&"current"in e?e.current:e;if(!n)return;let r=0;function a(...e){r||o.current.apply(this,e)}n.addEventListener(t,a);const l=i.current;return()=>{r=1,n.removeEventListener(t,a),l&&l()}},[e,t])},yM={},bM="undefined"==typeof window?null:window,wM=bM&&void 0!==bM.visualViewport?bM.visualViewport:null,EM=()=>[document.documentElement.clientWidth,document.documentElement.clientHeight],kM=(e,t)=>{const n=t||OM;let r,o;return function(){return r&&n(arguments,r)?o:o=e.apply(null,r=arguments)}},OM=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3],SM=class{constructor(){let e,t;this.set=void 0,this.get=void 0,this.get=n=>n===e?t:void 0,this.set=(n,r)=>{e=n,t=r}}},xM=e=>{try{return new e}catch(e){const t={};return{set(e,n){t[e]=n},get:e=>t[e]}}},_M=(e,t)=>{let n;const{g:r,s:o}=(e=>{const t=e.length,n=xM(e[0]);let r,o,i,a;const l=1===t;return t<3?{g:e=>void 0===(r=n.get(e[0]))||l?r:r.get(e[1]),s:(t,i)=>(l?n.set(t[0],i):void 0===(r=n.get(t[0]))?(o=xM(e[1]),o.set(t[1],i),n.set(t[0],o)):r.set(t[1],i),i)}:{g:e=>{for(a=n,i=0;i<t;i++)if(void 0===(a=a.get(e[i])))return;return a},s:(r,l)=>{for(a=n,i=0;i<t-1;i++)void 0===(o=a.get(r[i]))?(o=xM(e[i+1]),a.set(r[i],o),a=o):a=o;return a.set(r[t-1],l),l}}})(e);return function(){return void 0===(n=r(arguments))?o(arguments,t.apply(null,arguments)):n}};var CM=new WeakMap;function DM(){var e=pe.useState(PM)[1];return pe.useRef(function(){return e({})}).current}var PM={},AM="0",TM=_M([SM,{},WeakMap,SM],function(e,t,n,r){return pe.createElement(e,{index:t,data:n,width:r})}),FM=kM(function(e){return{position:"relative",width:"100%",maxWidth:"100%",height:Math.ceil(e),maxHeight:Math.ceil(e)}}),MM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},IM=kM(function(e,t){return Object.assign({},e,t)},MM);function NM(e,t){return t}var jM=kM(function(e){return{width:e,zIndex:-1e3,visibility:"hidden",position:"absolute",writingMode:"horizontal-tb"}},function(e,t){return e[0]===t[0]}),LM=kM(function(e,t){return function(n){return function(r){null!==r&&(t&&(t.observe(r),CM.set(r,n)),void 0===e.get(n)&&e.set(n,r.offsetHeight))}}},MM);let RM="undefined",BM=typeof window!==RM?window:{},zM=typeof performance!==RM?performance:Date,WM=()=>zM.now(),UM="AnimationFrame",VM="cancel"+UM,HM="request"+UM,GM=BM[HM]&&BM[HM].bind(BM),qM=BM[VM]&&BM[VM].bind(BM);if(!GM||!qM){let e=0;GM=t=>{let n=WM(),r=Math.max(e+1e3/60,n);return setTimeout(()=>{t(e=r)},r-n)},qM=function(e){return clearTimeout(e)}}const QM="undefined"!=typeof performance?performance:Date;function $M(e,t=30,n=!1){const r=mM(e),o=1e3/t,i=pe.useRef(0),a=pe.useRef(),l=()=>a.current&&clearTimeout(a.current),s=[t,n,r];function c(){i.current=0,l()}return pe.useEffect(()=>c,s),pe.useCallback(function(){const e=arguments,t=QM.now(),s=()=>{i.current=t,l(),r.current.apply(null,e)},c=i.current;if(n&&0===c)return s();if(t-c>o){if(c>0)return s();i.current=t}l(),a.current=setTimeout(()=>{s(),i.current=0},o)},s)}const YM="undefined"==typeof window?null:window,XM=()=>void 0!==YM.scrollY?YM.scrollY:void 0===YM.pageYOffset?0:YM.pageYOffset;function KM(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2?arguments[2]:void 0,r=((e=30)=>{const t=function(e,t){const n=pe.useState(e);return[n[0],$M(n[1],t,!0)]}("undefined"==typeof window?0:XM,e);return vM(YM,"scroll",()=>t[1](XM())),t[0]})(t),o=ce(pe.useState(0),2),i=o[0],a=o[1],l=ce(pe.useState(!1),2),s=l[0],c=l[1],u=pe.useRef(0),d=n&&"current"in n,p=d?i:r;return pe.useEffect(function(){if(d){var e=n.current;if(e){var t,r=function(){t||(t=requestAnimationFrame(function(){a(e.scrollTop),t=0}))};return a(e.scrollTop),e.addEventListener("scroll",r,{passive:!0}),function(){e.removeEventListener("scroll",r),t&&cancelAnimationFrame(t)}}}},[n,t,d]),pe.useEffect(function(){1===u.current&&c(!0);var e=!1,n=((e,t)=>{const n=WM(),r={},o=()=>{WM()-n>=t?e.call(null):r.v=GM(o)};return r.v=GM(o),r})(function(){e||c(!1)},40+1e3/t);return u.current=1,function(){e=!0,qM(n.v||-1)}},[t,p]),{scrollTop:Math.max(0,p-e),isScrolling:s}}function ZM(e){var t=KM(0,12,e.containerRef);return function(e){var t,n=e.positioner,r=e.resizeObserver,o=e.items,i=e.as,a=void 0===i?"div":i,l=e.id,s=e.className,c=e.style,u=e.role,d=void 0===u?"grid":u,p=e.tabIndex,f=void 0===p?0:p,h=e.containerRef,m=e.itemAs,g=void 0===m?"div":m,v=e.itemStyle,y=e.itemHeightEstimate,b=void 0===y?300:y,w=e.itemKey,E=void 0===w?NM:w,k=e.scrollTop,O=e.height,S=void 0===O?600:O,x=e.overscanBy,_=void 0===x?2:x,C=e.render,D=e.onRender,P=DM(),A=LM(n,r),T=o.length,F=n.columnWidth,M=n.estimateHeight,I=[],N="list"===d?"listitem":"grid"===d?"gridcell":void 0,j=mM(D),L=0,R=S*_,B=Math.max(0,k-R/2),z=k+S+R;n.range(B,z,function(e){void 0===t?(L=e,t=e):(L=Math.min(L,e),t=Math.max(t,e))});for(var W=0;W<T;W++){var U=o[W],V=E(U,W),H=n.get(W);if(H){var G={top:H.top,left:H.left,width:F,writingMode:"horizontal-tb",position:"absolute"};I.push(pe.createElement(g,{key:V,ref:A(W),role:N,style:"object"===ne(v)&&null!==v?Object.assign({},G,v):G},TM(C,W,U,F)))}else{var q=jM(F);I.push(pe.createElement(g,{key:V,ref:A(W),role:N,style:"object"===ne(v)?Object.assign({},q,v):q},TM(C,W,U,F)))}}pe.useEffect(function(){"function"==typeof j.current&&void 0!==t&&j.current(L,t,o),AM="1"},[L,t,o,j]),pe.useEffect(function(){P()},[n]);var Q=FM(M(T,b));return pe.createElement(a,{ref:h,key:AM,id:l,role:d,className:s,tabIndex:f,style:"object"===ne(c)?IM(Q,c):Q,children:I})}({scrollTop:t.scrollTop,isScrolling:t.isScrolling,positioner:e.positioner,resizeObserver:e.resizeObserver,items:e.items,onRender:e.onRender,as:e.as,id:e.id,className:e.className,style:e.style,role:e.role,tabIndex:e.tabIndex,containerRef:e.containerRef,itemAs:e.itemAs,itemStyle:e.itemStyle,itemHeightEstimate:e.itemHeightEstimate,itemKey:e.itemKey,render:e.render})}const JM=he()["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"];var eI=[],tI=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,o=function(){var e={root:cM,size:0},t={};return{insert:function(n,r,o){for(var i=e.root,a=cM;i!==cM&&n!==(a=i).low;)i=n<i.low?i.L:i.R;if(n===a.low&&a!==cM){if(!function(e,t,n){for(var r,o=e.list;o;){if(o.index===n)return!1;if(t>o.high)break;r=o,o=o.next}return r||(e.list={index:n,high:t,next:o}),r&&(r.next={index:n,high:t,next:r.next}),!0}(a,r,o))return;return a.high=Math.max(a.high,r),uM(a),dM(a),t[o]=a,void e.size++}var l={low:n,high:r,max:r,C:0,P:a,L:cM,R:cM,list:{index:o,high:r,next:null}};a===cM?e.root=l:(l.low<a.low?a.L=l:a.R=l,dM(l)),function(e,t){for(var n;0===t.P.C;)t.P===t.P.P.L?0===(n=t.P.P.R).C?(t.P.C=1,n.C=1,t.P.P.C=0,t=t.P.P):(t===t.P.R&&pM(e,t=t.P),t.P.C=1,t.P.P.C=0,fM(e,t.P.P)):0===(n=t.P.P.L).C?(t.P.C=1,n.C=1,t.P.P.C=0,t=t.P.P):(t===t.P.L&&fM(e,t=t.P),t.P.C=1,t.P.P.C=0,pM(e,t.P.P));e.root.C=1}(e,l),t[o]=l,e.size++},remove:function(n){var r=t[n];if(void 0!==r){delete t[n];var o=function(e,t){var n=e.list;if(n.index===t)return null===n.next?0:(e.list=n.next,1);var r=n;for(n=n.next;null!==n;){if(n.index===t)return r.next=n.next,1;r=n,n=n.next}}(r,n);if(void 0!==o){if(1===o)return r.high=r.list.high,uM(r),dM(r),void e.size--;var i,a=r,l=a.C;r.L===cM?(i=r.R,hM(e,r,r.R)):r.R===cM?(i=r.L,hM(e,r,r.L)):(a=function(e){for(;e.L!==cM;)e=e.L;return e}(r.R),l=a.C,i=a.R,a.P===r?i.P=a:(hM(e,a,a.R),a.R=r.R,a.R.P=a),hM(e,r,a),a.L=r.L,a.L.P=a,a.C=r.C),uM(i),dM(i),1===l&&function(e,t){for(var n;t!==cM&&1===t.C;)t===t.P.L?(0===(n=t.P.R).C&&(n.C=1,t.P.C=0,pM(e,t.P),n=t.P.R),1===n.L.C&&1===n.R.C?(n.C=0,t=t.P):(1===n.R.C&&(n.L.C=1,n.C=0,fM(e,n),n=t.P.R),n.C=t.P.C,t.P.C=1,n.R.C=1,pM(e,t.P),t=e.root)):(0===(n=t.P.L).C&&(n.C=1,t.P.C=0,fM(e,t.P),n=t.P.L),1===n.R.C&&1===n.L.C?(n.C=0,t=t.P):(1===n.L.C&&(n.R.C=1,n.C=0,pM(e,n),n=t.P.L),n.C=t.P.C,t.P.C=1,n.L.C=1,fM(e,t.P),t=e.root));t.C=1}(e,i),e.size--}}},search:function(t,n,r){for(var o=[e.root];0!==o.length;){var i=o.pop();if(!(i===cM||t>i.max)&&(i.L!==cM&&o.push(i.L),i.R!==cM&&o.push(i.R),i.low<=n&&i.high>=t))for(var a=i.list;null!==a;)a.high>=t&&r(a.index,i.low),a=a.next}},get size(){return e.size}}}(),i=new Array(e),a=[],l=new Array(e),s=0;s<e;s++)i[s]=0,l[s]=[];return{columnCount:e,columnWidth:t,set:function(e){for(var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=0,u=1;u<i.length;u++)i[u]<i[c]&&(c=u);var d=i[c]||0;i[c]=d+s+r,l[c].push(e),a[e]={left:c*(t+n),top:d,height:s,column:c},o.insert(d,d+s,e)},get:function(e){return a[e]},update:function(t){for(var n=new Array(e),s=0,c=0;s<t.length-1;s++){var u=t[s],d=a[u];d.height=t[++s],o.remove(u),o.insert(d.top,d.top+d.height,u),n[d.column]=void 0===n[d.column]?u:Math.min(u,n[d.column])}for(s=0;s<n.length;s++)if(void 0!==n[s]){var p=l[s],f=nI(p,n[s]),h=l[s][f],m=a[h];for(i[s]=m.top+m.height+r,c=f+1;c<p.length;c++){var g=p[c],v=a[g];v.top=i[s],i[s]=v.top+v.height+r,o.remove(g),o.insert(v.top,v.top+v.height,g)}}},range:function(e,t,n){return o.search(e,t,function(e,t){return n(e,a[e].left,t)})},estimateHeight:function(t,n){var r=Math.max(0,Math.max.apply(null,i));return t===o.size?r:r+Math.ceil((t-o.size)/e)*n},shortestColumn:function(){return i.length>1?Math.min.apply(null,i):i[0]||0},size:function(){return o.size},all:function(){return a}}},nI=function(e,t){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>>1,i=e[o];if(i===t)return o;i<=t?n=o+1:r=o-1}return-1},rI=[];const oI=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};oI(function(e){});var iI=_M([WeakMap],function(e,t){var n=[],r=oI(function(){n.length>0&&(e.update(n),t(n)),n.length=0}),o=function(t){var o=t.offsetHeight;if(o>0){var i=CM.get(t);if(void 0!==i){var a=e.get(i);void 0!==a&&o!==a.height&&n.push(i,o)}}r()},i=new Map,a=new ResizeObserver(function(e){for(var t=0;t<e.length;t++){var n=e[t],r=CM.get(n.target);if(void 0!==r){var a=i.get(r);a||(a=oI(o),i.set(r,a)),a(n.target)}}}),l=a.disconnect.bind(a);return a.disconnect=function(){l(),i.forEach(function(e){e.cancel()})},a}),aI={index:void 0,position:void 0,prevTop:void 0};function lI(e){var t,n,r,o=pe.useRef(null),i=e.containerRef||o,a=function(e){void 0===e&&(e=yM);const{wait:t,leading:n,initialWidth:r=0,initialHeight:o=0}=e,[i,a]=((e,t,n)=>{const r=pe.useState(e);return[r[0],gM(r[1],t,n)]})("undefined"==typeof document?[r,o]:EM,t,n),l=()=>a(EM);return vM(bM,"resize",l),vM(wM,"resize",l),vM(bM,"orientationchange",l),i}({initialWidth:e.ssrWidth,initialHeight:e.ssrHeight}),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eI,n=ce(pe.useState({offset:0,width:0}),2),r=n[0],o=n[1];return JM(function(){var t=e.current;if(null!==t){var n=0,i=t;do{n+=i.offsetTop||0,i=i.offsetParent}while(i);n===r.offset&&t.offsetWidth===r.width||o({offset:n,width:t.offsetWidth})}},t),r}(i,a),s=Object.assign({width:l.width||a[0],height:a[1],containerRef:i},e);s.positioner=function(e){var t=e.width,n=e.columnWidth,r=void 0===n?200:n,o=e.columnGutter,i=void 0===o?0:o,a=e.rowGutter,l=e.columnCount,s=e.maxColumnCount,c=e.maxColumnWidth,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rI,d=function(){var e=ce(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;r=r||Math.min(Math.floor((e+n)/(t+n)),o||1/0)||1;var a=Math.floor((e-n*(r-1))/r);return void 0!==i&&a>i&&(a=i),[a,r]}(t,r,i,l,s,c),2),n=e[0],o=e[1];return tI(o,n,i,null!=a?a:i)},p=pe.useRef();void 0===p.current&&(p.current=d());var f=pe.useRef(u),h=[t,r,i,a,l,s,c],m=pe.useRef(h),g=!h.every(function(e,t){return m.current[t]===e});if(g||!u.every(function(e,t){return f.current[t]===e})){var v=p.current,y=d();if(f.current=u,m.current=h,g)for(var b=v.size(),w=0;w<b;w++){var E=v.get(w);y.set(w,void 0!==E?E.height:0)}p.current=y}return p.current}(s),s.resizeObserver=(t=s.positioner,n=DM(),r=iI(t,n),pe.useEffect(function(){return function(){return r.disconnect()}},[r]),r);var c=function(e,t){var n,r=t.align,o=void 0===r?"top":r,i=t.element,a=void 0===i?"undefined"!=typeof window&&window:i,l=t.offset,s=void 0===l?0:l,c=t.height,u=void 0===c?"undefined"!=typeof window?window.innerHeight:0:c,d=pe.useCallback(function(){if(u&&u>0)return u;var e=a&&"current"in a?a.current:a;return e&&e!==window&&"clientHeight"in e?e.clientHeight:"undefined"!=typeof window?window.innerHeight:0},[u,a]),p=mM({positioner:e,element:a,align:o,offset:s,height:u}),f=pe.useRef(function(){var e=p.current.element;return e&&"current"in e?e.current:e}).current,h=ce(pe.useReducer(function(e,t){var n,r={position:e.position,index:e.index,prevTop:e.prevTop};if("scrollToIndex"===t.type)return{position:p.current.positioner.get(null!==(n=t.value)&&void 0!==n?n:-1),index:t.value,prevTop:void 0};if("setPosition"===t.type)r.position=t.value;else if("setPrevTop"===t.type)r.prevTop=t.value;else if("reset"===t.type)return aI;return r},aI),2),m=h[0],g=h[1],v=$M(g,15),y=f();vM(y,"scroll",function(){if(!m.position&&m.index){var e=p.current.positioner.get(m.index);e&&g({type:"setPosition",value:e})}});var b=void 0!==m.index&&(null===(n=p.current.positioner.get(m.index))||void 0===n?void 0:n.top);return pe.useEffect(function(){var e=f();if(e){var t=p.current,n=t.align,r=t.offset,o=t.positioner,i=d();if(m.position){var a=m.position.top;"bottom"===n?a=a-i+m.position.height:"center"===n&&(a-=(i-m.position.height)/2),e.scrollTo(0,Math.max(0,a+=r));var l=!1,s=setTimeout(function(){return!l&&g({type:"reset"})},400);return function(){l=!0,clearTimeout(s)}}if(void 0!==m.index){var c=o.shortestColumn()/o.size()*m.index;m.prevTop&&(c=Math.max(c,m.prevTop+i)),e.scrollTo(0,c),v({type:"setPrevTop",value:c})}}},[b,m,p,f,v,d]),pe.useRef(function(e){g({type:"scrollToIndex",value:e})}).current}(s.positioner,{offset:l.offset,align:"object"===ne(e.scrollToIndex)?e.scrollToIndex.align:void 0,element:i}),u=e.scrollToIndex&&("number"==typeof e.scrollToIndex?e.scrollToIndex:e.scrollToIndex.index);return pe.useEffect(function(){void 0!==u&&c(u)},[u,c]),pe.createElement(ZM,s)}var sI=function(e,t){return void 0!==t[e]},cI={};const uI=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},pe.createElement("path",{stroke:"#737A85",d:"M1.91 8.923c-.495-.644-.743-.966-.743-1.922 0-.957.248-1.279.744-1.923C2.9 3.792 4.56 2.334 7 2.334S11.1 3.792 12.09 5.078c.496.644.744.966.744 1.923 0 .956-.248 1.278-.744 1.922-.99 1.286-2.65 2.744-5.09 2.744S2.9 10.21 1.91 8.923Z"}),pe.createElement("path",{stroke:"#737A85",d:"M8.75 7a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0Z"}))},dI=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},pe.createElement("g",{stroke:"#737A85",strokeLinecap:"round",strokeLinejoin:"round",clipPath:"url(#clip0_15476_12003)"},pe.createElement("path",{d:"M11.666 6.416A4.724 4.724 0 0 0 2.625 5.25m-.292-2.334V5.25h2.333M2.333 7.584a4.725 4.725 0 0 0 9.042 1.167m.291 2.333V8.751H9.333"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_12003"},pe.createElement("path",{fill:"#fff",d:"M0 0h14v14H0z"}))))},pI=function(e){var t=e.isOpen,n=e.image,r=e.setIsOpen;return he().createElement(he().Fragment,null,t?he().createElement(J_,{enableZoom:!1,wrapperClassName:"templately-ai-lightbox-wrapper",reactModalProps:{style:{overlay:{position:"initial",inset:"0px"},content:{position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px",border:"none",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"0px",outline:"none",padding:"0px",zIndex:"100002"}},parentSelector:function(){return document.querySelector(".templately-container")}},mainSrc:null==n?void 0:n.url,onCloseRequest:function(){return r(!1)}}):"")};function fI(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return hI(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(hI(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,hI(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,hI(d,"constructor",c),hI(c,"constructor",s),s.displayName="GeneratorFunction",hI(c,o,"GeneratorFunction"),hI(d),hI(d,o,"Generator"),hI(d,r,function(){return this}),hI(d,"toString",function(){return"[object Generator]"}),(fI=function(){return{w:i,m:p}})()}function hI(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}hI=function(e,t,n,r){function i(t,n){hI(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},hI(e,t,n,r)}const mI=function(e){var t=e.searchResults,n=e.isSearchLoading,r=e.searchError,o=e.onImageSelect,i=e.selectedImageId,a=e.perPage,l=e.totalPages,s=e.onLoadMore,c=he().useRef(null),u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1],f=ce((0,pe.useState)([]),2),h=f[0],m=f[1],g=he().memo(function(e){var t,n,r,i,a=e.data,l=e.width,s=he().useMemo(function(){var e=a.width,t=a.height;if(e&&t&&l){var n=l/(e/t);if(n)return{width:l,height:n}}return{}},[a.width,a.height,l]),c=he().useMemo(function(){var e,t,n,r;return null!==(e=null!==(t=null==a||null===(n=a.src)||void 0===n?void 0:n.medium)&&void 0!==t?t:null==a||null===(r=a.src)||void 0===r?void 0:r.original)&&void 0!==e?e:null==a?void 0:a.url},[null==a||null===(t=a.src)||void 0===t?void 0:t.medium,null==a||null===(n=a.src)||void 0===n?void 0:n.original,null==a?void 0:a.url]);return he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-outer-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-wrapper"},he().createElement("img",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-image",src:c,alt:null!==(r=null!==(i=null==a?void 0:a.title)&&void 0!==i?i:null==a?void 0:a.alt)&&void 0!==r?r:"",style:s}),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay"},he().createElement("button",{type:"button",onClick:function(e){var t,n,r,o,i,l,s,c,u;return s=e,c=null!==(t=null!==(n=null==a||null===(r=a.src)||void 0===r?void 0:r.original)&&void 0!==n?n:null==a?void 0:a.url)&&void 0!==t?t:null==a||null===(o=a.src)||void 0===o?void 0:o.medium,u=null!==(i=null!==(l=null==a?void 0:a.title)&&void 0!==l?l:null==a?void 0:a.alt)&&void 0!==i?i:"",s.preventDefault(),s.stopPropagation(),void(c&&(m({url:c,alt:u||"Original Image"}),p(!0)))},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button-eye"},he().createElement(uI,null)),he().createElement("button",{type:"button",onClick:function(e){var t=0;e.metaKey&&e.shiftKey?t=1:e.altKey&&e.shiftKey?t=2:e.metaKey&&(t=3),o(a,"stock",void 0,t)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-image-overlay-button"},he().createElement(dI,null),(0,At.__)("Use This Image","templately")))),(null==a?void 0:a.provider)&&he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-image-provider"},"by ",he().createElement("a",{href:a.url,target:"_blank"},null==a?void 0:a.provider)))},function(e,t){var n,r,o,i;return e.data.id===t.data.id&&(null===(n=e.data.src)||void 0===n?void 0:n.medium)===(null===(r=t.data.src)||void 0===r?void 0:r.medium)&&(null===(o=e.data.src)||void 0===o?void 0:o.original)===(null===(i=t.data.src)||void 0===i?void 0:i.original)&&e.data.url===t.data.url&&e.width===t.width}),v=(0,pe.useCallback)((0,Ea.debounce)(function(){var e=hi(fI().m(function e(t,r,o){var c;return fI().w(function(e){for(;;)switch(e.n){case 0:if(i&&!n){e.n=1;break}return e.a(2);case 1:if(void 0===o[r]){e.n=2;break}return e.a(2);case 2:if(c=Math.floor(r/a)+1,!(l>0&&c>l)){e.n=3;break}return e.a(2);case 3:if(!s){e.n=4;break}return e.n=4,s(c);case 4:return e.a(2)}},e)}));return function(_x,t,n){return e.apply(this,arguments)}}(),300),[i,n,a,l,s]);(0,pe.useEffect)(function(){return function(){v.cancel()}},[v]);var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cI,n=t.isItemLoaded,r=t.minimumBatchSize,o=void 0===r?16:r,i=t.threshold,a=void 0===i?16:i,l=t.totalItems,s=void 0===l?9e9:l,c=mM(e),u=mM(n);return pe.useCallback(function(e,t,n){for(var r=function(){for(var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sI,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:9e9,a=arguments.length>5?arguments[5]:void 0,l=[],s=arguments.length>4?arguments[4]:void 0;s<=a;s++)n(s,o)?void 0!==e&&void 0!==t&&(l.push(e,t),e=t=void 0):(t=s,void 0===e&&(e=s));if(void 0!==e&&void 0!==t){var c=Math.min(Math.max(t,e+r-1),i-1);for(s=t+1;s<=c&&!n(s,o);s++)t=s;l.push(e,t)}if(l.length)for(var u=l[0],d=l[1];d-u+1<r&&u>0;){var p=u-1;if(n(p,o))break;l[0]=u=p}return l}(u.current,o,n,s,Math.max(0,e-a),Math.min(s-1,(t||0)+a)),i=0;i<r.length-1;++i)c.current(r[i],r[++i],n)},[s,o,a,c,u])}(v,{isItemLoaded:function(e,t){return!!t[e]},minimumBatchSize:a,threshold:a});return n&&0===t.length?he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-loading"},he().createElement("p",null,(0,At.__)("Searching for images...","templately"))):r?he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-error"},he().createElement("p",null,r)):0===t.length?he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-error"},he().createElement("p",null,(0,At.__)("No image found","templately"))):he().createElement(he().Fragment,null,he().createElement(lI,{containerRef:c,className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-stock-images-grid",items:t,columnGutter:12,columnCount:2,columnWidth:150,render:g,onRender:y,shouldUpdateItem:function(e,t){var n,r,o,i;return e.id!==t.id||(null===(n=e.src)||void 0===n?void 0:n.medium)!==(null===(r=t.src)||void 0===r?void 0:r.medium)||(null===(o=e.src)||void 0===o?void 0:o.original)!==(null===(i=t.src)||void 0===i?void 0:i.original)||e.url!==t.url}}),d&&he().createElement(pI,{isOpen:d,image:h,setIsOpen:p}))},gI=function(e){return pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 14 14"},pe.createElement("g",{clipPath:"url(#clip0_15476_12009)"},pe.createElement("path",{stroke:"#737A85",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.167",d:"M5.25 6.417 2.917 8.751m0 0 2.333 2.333M2.917 8.751h6.417a2.333 2.333 0 0 0 0-4.667H8.75"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_15476_12009"},pe.createElement("path",{fill:"#fff",d:"M0 0h14v14H0z"}))))};var vI=he().memo(function(e){var t=e.defaultImages,n=e.modifiedImages,r=e.selectedImageId,o=e.onImageReplace,i=e.onImageUndo,a=e.aiSidebarContext,l=(0,pe.useRef)(null),s=ce((0,pe.useState)(0),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!1),2),p=d[0],f=d[1],h=ce((0,pe.useState)({}),2),m=h[0],g=h[1],v=(0,pe.useMemo)(function(){var e=new Map;return n.forEach(function(t){e.set(t.id,t)}),e},[n]);(0,pe.useEffect)(function(){var e=document.querySelector(".templately-fsi-ai-sidebar");if(e){var t=function(t){t.target===e&&"max-width"===t.propertyName&&u(function(e){return e+1})};return e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionend",t)}}},[]),(0,pe.useEffect)(function(){var e=setTimeout(function(){u(function(e){return e+1})},120);return function(){return clearTimeout(e)}},[null==a?void 0:a.expanded]);var y=he().memo(function(e){var t,n=e.data,r=e.width,o=e.index,i=e.selectedImageId,a=e.modifiedImagesMap,l=e.onImageReplace,s=e.onImageUndo,c=(0,pe.useMemo)(function(){var e,t,r,o,i,l,s,c,u,d,p,f=null!==(e=null==n?void 0:n.medium_url)&&void 0!==e?e:null==n?void 0:n.url,h=a.get(n.id),m=null==h?void 0:h.replace,g=!!h,v=null!==(t=null!==(r=null==m||null===(o=m.src)||void 0===o?void 0:o.medium)&&void 0!==r?r:null==m||null===(i=m.src)||void 0===i?void 0:i.original)&&void 0!==t?t:null==m?void 0:m.url,y=null!==(l=null!==(s=null==m||null===(c=m.src)||void 0===c?void 0:c.original)&&void 0!==s?s:null==m?void 0:m.url)&&void 0!==l?l:null==m||null===(u=m.src)||void 0===u?void 0:u.medium,b=g?v:f,w=g?y:null!==(d=n.url)&&void 0!==d?d:n.medium_url;return{finalImageSrc:b,finalImageAlt:g?null==m?void 0:m.alt:null!==(p=null==n?void 0:n.title)&&void 0!==p?p:null==n?void 0:n.alt,isImageReplaced:g,finalImageOriginalSrc:w}},[n,a]),u=(0,pe.useMemo)(function(){if(!r)return{};var e=a.get(n.id),t=null==e?void 0:e.replace;if(e&&t){var o,i,l=t.width||(null===(o=t.dimensions)||void 0===o?void 0:o.width),s=t.height||(null===(i=t.dimensions)||void 0===i?void 0:i.height);if(l&&s){var c=l/s;return{width:r,height:r/c>=80?r/c:80}}}if(n.width&&n.height){var u=n.width/n.height;return{width:r,height:r/u>=80?r/u:80}}return{width:r,height:80}},[r,n.width,n.height,a,n.id]),d=(0,pe.useCallback)(function(e,t){e.preventDefault(),e.stopPropagation(),s&&s(t)},[s]),p=(0,pe.useCallback)(function(e,t,n){e.preventDefault(),e.stopPropagation(),t&&(g({url:t,alt:n||"Original Image"}),f(!0))},[g,f]),h=c.finalImageSrc,m=c.finalImageAlt,v=c.isImageReplaced,y=c.finalImageOriginalSrc;return he().createElement("div",{key:"image-".concat(null!==(t=null==n?void 0:n.id)&&void 0!==t?t:o),className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-wrapper ".concat((null==n?void 0:n.id)===i?"selected":""," ").concat(null!=n&&n.type&&"photo"!==(null==n?void 0:n.type)?"show-border":""),"data-type":null==n?void 0:n.type},he().createElement("img",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image",src:h,style:u,alt:m}),he().createElement("div",{onClick:function(){return l(null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay"},he().createElement("button",{type:"button",onClick:function(e){return p(e,y,m)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button-eye"},he().createElement(uI,null)),v&&he().createElement("button",{type:"button",onClick:function(e){return d(e,null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button"},he().createElement(gI,null),(0,At.__)("Undo","templately")),he().createElement("button",{type:"button",onClick:function(){l(null==n?void 0:n.id)},className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-overlay-button"},he().createElement(dI,null),(0,At.__)("Replace","templately"))))},function(e,t){var n=e.data.id!==t.data.id||e.data.url!==t.data.url||e.width!==t.width,r=e.data.id===e.selectedImageId!=(t.data.id===t.selectedImageId),o=e.modifiedImagesMap.get(e.data.id)!==t.modifiedImagesMap.get(t.data.id);return!n&&!r&&!o}),b=(0,pe.useRef)(o),w=(0,pe.useRef)(i);b.current=o,w.current=i;var E=(0,pe.useCallback)(function(e){b.current(e)},[]),k=(0,pe.useCallback)(function(e){w.current(e)},[]),O=(0,pe.useCallback)(function(e){return he().createElement(y,re({},e,{selectedImageId:r,modifiedImagesMap:v,onImageReplace:E,onImageUndo:k}))},[r,v,E,k]);return he().createElement(he().Fragment,null,he().createElement(lI,{key:c,containerRef:l,items:t,columnGutter:12,columnCount:2,columnWidth:150,render:O,shouldUpdateItem:function(e,t){var n=v.get(e.id),o=v.get(t.id);return e.id!==t.id||e.url!==t.url||n!==o||e.id===r!=(t.id===r)}}),p&&he().createElement(pI,{isOpen:p,image:m,setIsOpen:f}))});const yI=vI;var bI=function(e){e.imagesAlreadyReplaced;var t,n=e.defaultImages,r=e.handleSkip,o=e.handleSaveChange,i=e.setShowImageReplacePanel,a=(e.selectedCategory,e.imagePanelData),l=e.aiSidebarContext,s=e.onExpandAiSidebar,c=e.onCollapseAiSidebar;if(!a)return console.error("ImageReplacePanelIsolated: imagePanelData prop is missing"),he().createElement("div",null,"Error: Image panel data not available");var u=a.searchString,d=a.modifiedImages,p=a.selectedImageId,f=a.isResetClicked,h=a.setIsResetClicked,m=a.selectedTab,g=a.setSelectedTab,v=a.selectedImageRatio,y=a.setSelectedImageRatio,b=a.searchResults,w=a.isSearchLoading,E=a.searchError,k=a.totalPages,O=a.perPage,S=a.handleImageSearchById,x=a.handleSearchInputChange,_=a.handleSearchSubmit,C=a.replaceSelectedImage,D=a.handleImageReplace,P=a.handleImageUndo,A=a.handleLoadMore,T=a.onReset,F=[{label:(0,At.__)("All","templately"),value:"all"},{label:(0,At.__)("Landscape","templately"),value:"landscape",icon:he().createElement(tM,null)},{label:(0,At.__)("Portrait","templately"),value:"portrait",icon:he().createElement(nM,null)},{label:(0,At.__)("Square","templately"),value:"square",icon:he().createElement(rM,null)}];(0,pe.useEffect)(function(){return s&&s(),function(){c&&c()}},[s,c]);var M=function(){d.length?o(d):(o([]),h(!1)),i(!1)},I=(0,pe.useCallback)(function(){try{return he().createElement(he().Fragment,null,F.map(function(e,t){var n;return he().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover-item ".concat(v===e.value?"active":""),onClick:function(t){t.stopPropagation(),y(e.value),S(u,p,e.value,1)},key:t},null!==(n=e.icon)&&void 0!==n?n:null,e.label)}))}catch(e){return console.error("Error in ImageRatioPopoverPanel:",e),he().createElement(he().Fragment,null)}},[u,p,v,y,S]);return he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel"},he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-header"},he().createElement("h3",{className:"templately-fsi-ai-sidebar-image-replace-panel-title"},(0,At.__)("Great! Choose visuals that fit your web content or upload your own.","templately"))),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body"},he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion"},he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-header"},he().createElement("h4",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-title"},(0,At.__)("Images used in your template","templately")),he().createElement("button",{onClick:T,disabled:0===d.length,className:"templately-fsi-ai-sidebar-image-replace-panel-reset-button",type:"button",title:(0,At.__)("Reset","templately")},(0,At.__)("Reset","templately"))),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-left-portion-image-grid"},he().createElement(yI,{defaultImages:n,modifiedImages:d,selectedImageId:p,onImageReplace:D,onImageUndo:P,aiSidebarContext:l}))),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion"},he().createElement("h4",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-title"},(0,At.__)("Select image","templately")),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab-wrapper"},he().createElement("button",{type:"button",onClick:function(){return g("stock")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("stock"===m?"active":"")},(0,At.__)("Stock Images","templately")),he().createElement("button",{type:"button",onClick:function(){return g("upload")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("upload"===m?"active":"")},(0,At.__)("Upload","templately")),he().createElement("button",{type:"button",onClick:function(){return g("aiGenerated")},className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-tab ".concat("aiGenerated"===m?"active":"")},(0,At.__)("AI Generated","templately"))),"stock"===m?he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-filter"},he().createElement("form",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-wrapper ".concat(p?"":"disabled"),onSubmit:p?_:function(e){return e.preventDefault()}},he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-icon"},he().createElement(JF,null)),he().createElement("input",{type:"text",name:"search",id:"search",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search",placeholder:(0,At.__)("Search","templately"),value:u,onChange:p?x:function(){},disabled:!p}),he().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-search-button",type:"submit",onClick:p?_:function(e){return e.preventDefault()},disabled:!p},(0,At.__)("Search","templately"))),he().createElement(sM,{content:he().createElement(I,null),disabled:!p},he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover-button ".concat(p?"":"disabled")},function(){var e,t,n=F.find(function(e){return e.value===v});return null!==(e=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:null==n?void 0:n.label)&&void 0!==e?e:""}()))):null,"aiGenerated"===m||p?null:he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-wrapper"},he().createElement("img",{src:iM,alt:"image-arrow",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-image-arrow"}),he().createElement("img",{src:oM,alt:"image-placeholder",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-image"}),he().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-title"},(0,At.__)("No image selected","templately")),he().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-text"},(0,At.__)("Please choose an image to replace the current one.","templately"))),p&&"stock"===m?he().createElement(mI,{searchResults:b,isSearchLoading:w,searchError:E,onImageSelect:C,selectedImageId:p,perPage:O,totalPages:k,onLoadMore:A}):null,"aiGenerated"===m?he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-wrapper"},he().createElement("p",{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-title"},(0,At.__)("Coming Soon","templately")),he().createElement("img",{src:aM,alt:"ai-generated-image-placeholder",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ai-generated-tab-content-image"})):null,p&&"upload"===m?he().createElement(he().Fragment,null,he().createElement(ZF.MediaUpload,{onSelect:function(e){var t,n,r,o;C({alt:null!==(t=e.alt)&&void 0!==t?t:e.title,height:e.height,id:e.id,photographer:e.authorName,photographer_url:e.authorLink,provider:e.authorName,src:{large2x:null===(n=e.sizes.full)||void 0===n?void 0:n.url,medium:null===(r=e.sizes.medium)||void 0===r?void 0:r.url,original:null===(o=e.sizes.full)||void 0===o?void 0:o.url},url:e.url,width:e.width},"upload")},allowedTypes:["image"],value:null===(t=d.find(function(e){return e.id===p}))||void 0===t||null===(t=t.replace)||void 0===t?void 0:t.id,render:function(e){var t=e.open;return he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader",onClick:t},he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-icon"},he().createElement(eM,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-text"},(0,At.__)("Select or upload from Media Library.","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-image-upload-uploader-button"},(0,At.__)("Browse media library","templately")))}})):null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-image-replace-panel-footer"},he().createElement("button",{onClick:function(){i(!1),r()},disabled:!1,className:"templately-fsi-ai-sidebar-image-replace-panel-skip-button",type:"button",title:(0,At.__)("Skip","templately")},(0,At.__)("Skip","templately")),he().createElement("button",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button",onClick:function(){return M()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),document.activeElement===e.target&&M())},disabled:!(null!=d&&d.length||f),title:(0,At.__)("Save Changes","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button-text"},(0,At.__)("Save Changes","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-image-replace-panel-submit-button-icon"},he().createElement(yP,null)))))};const wI=he().memo(bI);function EI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OI(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return SI(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(SI(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,SI(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,SI(d,"constructor",c),SI(c,"constructor",s),s.displayName="GeneratorFunction",SI(c,o,"GeneratorFunction"),SI(d),SI(d,o,"Generator"),SI(d,r,function(){return this}),SI(d,"toString",function(){return"[object Generator]"}),(OI=function(){return{w:i,m:p}})()}function SI(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}SI=function(e,t,n,r){function i(t,n){SI(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},SI(e,t,n,r)}var xI=function(){var e=hi(OI().m(function e(t,n,r,o){var i,a,l,s,c,u=arguments;return OI().w(function(e){for(;;)switch(e.n){case 0:return i=u.length>4&&void 0!==u[4]?u[4]:null,a={query:t.trim(),orientation:"all"===n?void 0:n,page:r,per_page:o},Object.keys(a).forEach(function(e){void 0===a[e]&&delete a[e]}),e.n=1,fa("/templately/v1/ai-content/images",a,{signal:i});case 1:if(l=e.v,s=l.response,!(c=l.error)){e.n=2;break}throw c;case 2:return e.a(2,s)}},e)}));return function(_x,t,n,r){return e.apply(this,arguments)}}(),_I=function(e,t,n){return"".concat(t||"all","-").concat(n||1,"-").concat(e||"")},CI=function(e,t,n){if(null==e||!e.searchParams)return!1;var r=e.searchParams,o=r.query,i=r.orientation;return o===t&&i===n},DI=function(e,t,n,r){var o=e[_I(t,n,r)];return o&&CI(o,t,n)?o.data:null},PI=function(e,t,n,r,o){var i=_I(t,n,r);return kI(kI({},e),{},Pt({},i,{data:o,searchParams:{query:t,orientation:n},timestamp:Date.now()}))},AI=function(e,t,n){if(!e||0===Object.keys(e).length)return{};var r={};for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];CI(i,t,n)&&(r[o]=i)}return r};function TI(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return FI(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(FI(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,FI(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,FI(d,"constructor",c),FI(c,"constructor",s),s.displayName="GeneratorFunction",FI(c,o,"GeneratorFunction"),FI(d),FI(d,o,"Generator"),FI(d,r,function(){return this}),FI(d,"toString",function(){return"[object Generator]"}),(TI=function(){return{w:i,m:p}})()}function FI(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}FI=function(e,t,n,r){function i(t,n){FI(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},FI(e,t,n,r)}const MI=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=ce((0,pe.useState)(""),2),o=r[0],i=r[1],a=ce((0,pe.useState)(e||[]),2),l=a[0],s=a[1],c=ce((0,pe.useState)(null),2),u=c[0],d=c[1],p=ce((0,pe.useState)(!1),2),f=p[0],h=p[1],m=ce((0,pe.useState)("stock"),2),g=m[0],v=m[1],y=ce((0,pe.useState)("all"),2),b=y[0],w=y[1],E=ce((0,pe.useState)({}),2),k=E[0],O=E[1],S=ce((0,pe.useState)([]),2),x=S[0],_=S[1],C=ce((0,pe.useState)(!1),2),D=C[0],P=C[1],A=ce((0,pe.useState)(null),2),T=A[0],F=A[1],M=ce((0,pe.useState)(0),2),I=M[0],N=M[1],j=ce((0,pe.useState)({}),2),L=j[0],R=j[1],B=ce((0,pe.useState)(null),2),z=B[0],W=B[1],U=ce((0,pe.useState)(null),2),V=U[0],H=U[1],G=ce((0,pe.useState)(50),1)[0],q=ce((0,pe.useState)({query:"",orientation:"all"}),2),Q=q[0],$=q[1],Y=ce((0,pe.useState)(new Set),2),X=Y[0],K=Y[1];(0,pe.useEffect)(function(){s(e||[])},[e]),(0,pe.useEffect)(function(){return function(){z&&z.abort("Component unmounted")}},[z]),(0,pe.useEffect)(function(){return function(){V&&V.abort("Component unmounting")}},[V]);var Z=[{label:(0,At.__)("All","templately"),value:"all"},{label:(0,At.__)("Landscape","templately"),value:"landscape"},{label:(0,At.__)("Portrait","templately"),value:"portrait"},{label:(0,At.__)("Square","templately"),value:"square"}],J=(0,pe.useCallback)(function(){var e=hi(TI().m(function e(t,r,o){var i,a,l,s,c,u,d,p,f,h,m=arguments;return TI().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=m.length>3&&void 0!==m[3]?m[3]:1,r){e.n=1;break}return _([]),F(null),e.a(2);case 1:if(t||(t=n),a="".concat(t||"default","-").concat(o||"all","-").concat(i||1),!X.has(a)){e.n=2;break}return e.a(2);case 2:if(V&&V.abort("New search initiated"),l={query:t,orientation:o},(s=Q.query!==t||Q.orientation!==o)&&(P(!0),_([]),K(new Set),O(function(e){return AI(e,t,o)}),$(l),i=1),!(c=DI(k,t,o,i))){e.n=3;break}return _(1===i||s?c.images:function(e){return[].concat(Nl(e),Nl(c.images))}),N(c.total_pages||0),F(null),e.a(2);case 3:return u=new AbortController,H(u),K(function(e){var t=new Set(e);return t.add(a),t}),P(!0),F(null),e.p=4,e.n=5,xI(t,o,i,G,u.signal);case 5:(d=e.v)&&d.images?(_(1===i||s?d.images:function(e){return[].concat(Nl(e),Nl(d.images))}),N(d.total_pages||0),O(function(e){return PI(e,t,o,i,d)})):(_([]),F((0,At.__)("No image found","templately"))),e.n=8;break;case 6:if(e.p=6,!("AbortError"===(null==(h=e.v)?void 0:h.name)||null!=h&&null!==(p=h.message)&&void 0!==p&&p.includes("abort")||null!=h&&null!==(f=h.message)&&void 0!==f&&f.includes("cancelled")||u.signal.aborted)){e.n=7;break}return e.a(2);case 7:console.error("Image search error:",h),F(h.message||(0,At.__)("Failed to search images. Please try again.","templately")),_([]);case 8:return e.p=8,H(function(e){return e===u?null:e}),K(function(e){var t=new Set(e);return t.delete(a),t}),P(!1),e.f(8);case 9:return e.a(2)}},e,null,[[4,6,8,9]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),[G,n,k,Q,X,V]),ee=(0,pe.useCallback)(function(e){var t=e.target.value;i(t)},[]),te=(0,pe.useCallback)(function(e){e&&e.preventDefault(),u&&J(o,u,b,1)},[o,u,b,J]),ne=(0,pe.useCallback)(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=null!=r?r:u;if(i){var a={id:i,source:n,original:t.find(function(e){return e.id===i}),replace:e};3!==o?1!==o&&2!==o?l.some(function(e){return e.id===i})?s(function(e){return e.map(function(e){return e.id===i?a:e})}):s(function(e){return[].concat(Nl(e),[a])}):s(function(){return t.map(function(t,r){var i=1===o?e:x[r%x.length];return{id:t.id,source:n,original:t,replace:i}})}):s(function(){for(var e=t.map(function(e){return e.width/e.height}),r=x.map(function(e){return e.width/e.height}),o=new Set,i=[],a=0;a<t.length;a++){for(var l=e[a],s=null,c=-1,u=1/0,d=0;d<x.length;d++)if(!o.has(d)){var p=Math.abs(l-r[d]);p<u&&(u=p,s=x[d],c=d)}if(null===s&&x.length>0){for(var f=x[0],h=Math.abs(l-r[0]),m=1;m<x.length;m++){var g=Math.abs(l-r[m]);g<h&&(h=g,f=x[m])}s=f}else c>=0&&o.add(c);s&&i.push(s)}return t.map(function(e,t){return{id:e.id,source:n,original:e,replace:i[t]}})})}},[u,t,x,l]),re=(0,pe.useCallback)(function(e){d(e),((0,Ea.isEmpty)(x)||0===x.length)&&J(o,e,b,1);var t=l.find(function(t){return t.id===e});t&&v((null==t?void 0:t.source)||"stock")},[l,o,b,J,x]),oe=(0,pe.useCallback)(function(e){s(function(t){return t.filter(function(t){return t.id!==e})})},[]),ie=(0,pe.useCallback)(function(){var e=hi(TI().m(function e(t){var r;return TI().w(function(e){for(;;)switch(e.n){case 0:return r=o||n,e.n=1,J(r,u,b,t);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),[o,n,u,b,J]),ae=(0,pe.useCallback)(function(){var e,t,n=Z.find(function(e){return e.value===b});return null!==(e=null!==(t=null==n?void 0:n.icon)&&void 0!==t?t:null==n?void 0:n.label)&&void 0!==e?e:""},[b,Z]),le=(0,pe.useCallback)(function(){s([]),h(!0)},[]);return{searchString:o,setSearchString:i,modifiedImages:l,setModifiedImages:s,selectedImageId:u,setSelectedImageId:d,isResetClicked:f,setIsResetClicked:h,selectedTab:g,setSelectedTab:v,selectedImageRatio:b,setSelectedImageRatio:w,apiCache:k,setApiCache:O,searchResults:x,setSearchResults:_,isSearchLoading:D,setIsSearchLoading:P,searchError:T,setSearchError:F,totalPages:I,setTotalPages:N,imageUploadingProgress:L,setImageUploadingProgress:R,uploadAbortController:z,setUploadAbortController:W,searchAbortController:V,setSearchAbortController:H,perPage:G,lastSearchParams:Q,setLastSearchParams:$,loadingPages:X,setLoadingPages:K,imageRatioOptions:Z,handleImageSearchById:J,handleSearchInputChange:ee,handleSearchSubmit:te,replaceSelectedImage:ne,handleImageReplace:re,handleImageUndo:oe,handleLoadMore:ie,getSelectedRatio:ae,onReset:le}},II=function(e){var t=e.imagesAlreadyReplaced,n=void 0===t?[]:t,r=e.defaultImages,o=e.handleSkip,i=e.handleSaveChange,a=e.setShowImageReplacePanel,l=e.selectedCategory,s=En(),c=xn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.aiSidebarContext)&&void 0!==t?t:{id:null,show:!1,content:{},expanded:!1}}),u=MI(n,r,l),d=(0,pe.useCallback)(function(){s(function(){return{type:ei,payload:_y({expanded:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]),p=(0,pe.useCallback)(function(){s(function(){return{type:ti,payload:_y({expanded:!1},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]);return he().createElement(wI,{imagesAlreadyReplaced:n,defaultImages:r,handleSkip:o,handleSaveChange:i,setShowImageReplacePanel:a,selectedCategory:l,imagePanelData:u,aiSidebarContext:c,onExpandAiSidebar:d,onCollapseAiSidebar:p})};function NI(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return jI(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(jI(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,jI(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,jI(d,"constructor",c),jI(c,"constructor",s),s.displayName="GeneratorFunction",jI(c,o,"GeneratorFunction"),jI(d),jI(d,o,"Generator"),jI(d,r,function(){return this}),jI(d,"toString",function(){return"[object Generator]"}),(NI=function(){return{w:i,m:p}})()}function jI(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}jI=function(e,t,n,r){function i(t,n){jI(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},jI(e,t,n,r)}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const BI=gn(function(e){var t,n;return{profile:null!==(t=null==e||null===(n=e.profile)||void 0===n?void 0:n.data)&&void 0!==t?t:{}}})(function(e){var t,n,r,o,i=e.setSidebarShowState,a=e.hideAiSidebar,l=e.packId,s=e.creditDataLoading,c=e.creditData,u=e.creditLimitPopoverOpen,d=e.setCreditLimitPopoverOpen,p=e.setCreditLimitWarningPopover,f=e.profile,h=void 0===f?{}:f,m=e.onGeneratingProgressVisibilityChange,g=e.handleSidebarClose,v=e.showErrorAlert,y=En(),b=xn(function(e){return e.general.platform}),w=xn(function(e){var t;return(null==e||null===(t=e.general)||void 0===t||null===(t=t.fullSiteImport)||void 0===t?void 0:t.packInfo)||{data:null}},Jt),E=ce((0,pe.useState)(!1),2),k=E[0],O=E[1],S=ce((0,pe.useState)(null),2),x=S[0],_=S[1],C=ce((0,pe.useState)([]),2),D=C[0],P=C[1],A=ce((0,pe.useState)(!1),2),T=A[0],F=A[1],M=ce((0,pe.useState)([]),2),I=M[0],N=M[1],j=(0,pe.useCallback)(function(e){try{ct.current&&(clearTimeout(ct.current),ct.current=null),De(!0),ct.current=setTimeout(function(){G(function(t){return RI(RI({},t),{},{key:e})}),ct.current=null;var t=setTimeout(function(){De(!1)},150);lt.current.push(t)},100)}catch(t){console.error("Error in changeStepWithDelay:",t),G(function(t){return RI(RI({},t),{},{key:e})}),De(!1)}},[]),L=(0,pe.useCallback)(function(){try{var e;return(null===(e=window)||void 0===e||null===(e=e.templately)||void 0===e?void 0:e.wp_user_avatar)||(null!=h&&h.profile_photo?h.profile_photo:null)}catch(e){return console.error("Error getting profile image source:",e),(null==h?void 0:h.profile_photo)||null}},[null==h?void 0:h.profile_photo]),R=(0,pe.useMemo)(function(){try{var e=Array.isArray(I)?I.filter(function(e){return!xP.includes(e)}):[];return[].concat(Nl(xP),Nl(e))}catch(e){return console.error("Error creating categories:",e),[]}},[I]),B=ce((0,pe.useState)(function(){return jP(null==h?void 0:h.first_name,D.length>0)}),2),z=B[0],W=B[1],U=(0,pe.useMemo)(function(){return jP(null==h?void 0:h.first_name,D.length>0)},[null==h?void 0:h.first_name,D.length]);(0,pe.useEffect)(function(){W(function(e){var t,n,r=jP(null==h?void 0:h.first_name,D.length>0);return(null===(t=e[0])||void 0===t?void 0:t.question)!==(null===(n=r[0])||void 0===n?void 0:n.question)?r.map(function(t,n){var r,o,i;return RI(RI({},t),{},{done:(null===(r=e[n])||void 0===r?void 0:r.done)||!1,result:(null===(o=e[n])||void 0===o?void 0:o.result)||null,editMode:(null===(i=e[n])||void 0===i?void 0:i.editMode)||!1})}):e})},[null==h?void 0:h.first_name,D.length]);var V=ce((0,pe.useState)({key:"start",isThinking:!1,isTyping:!1}),2),H=V[0],G=V[1],q=ce((0,pe.useState)(""),2),Q=q[0],$=q[1],Y=ce((0,pe.useState)(""),2),X=Y[0],K=Y[1],Z=ce((0,pe.useState)(""),2),J=Z[0],ee=Z[1],te=ce((0,pe.useState)([]),2),re=te[0],oe=te[1],ie=ce((0,pe.useState)(Nl(_P)),2),ae=ie[0],le=ie[1],se=ce((0,pe.useState)({}),2),ue=se[0],de=se[1],fe=ce((0,pe.useState)({}),2),me=fe[0],ge=fe[1],ve=ce((0,pe.useState)(!1),2),ye=ve[0],be=ve[1],we=ce((0,pe.useState)(!1),2),Ee=we[0],ke=we[1],Oe=ce((0,pe.useState)(!1),2),Se=Oe[0],xe=Oe[1],_e=ce((0,pe.useState)(!1),2),Ce=_e[0],De=_e[1],Pe=ce((0,pe.useState)(!0),2),Ae=Pe[0],Te=Pe[1],Fe=ce((0,pe.useState)(new Set),2),Me=Fe[0],Ie=Fe[1],Ne=ce((0,pe.useState)(!1),2),je=Ne[0],Le=Ne[1],Re=ce((0,pe.useState)(!1),2),Be=Re[0],ze=Re[1],We=(0,pe.useRef)(null),Ue=ce((0,pe.useState)({isValid:!0,errorMessage:""}),2),Ve=Ue[0],He=Ue[1],Ge=ce((0,pe.useState)({isValid:!0,errorMessage:""}),2),qe=Ge[0],Qe=Ge[1],$e=ce((0,pe.useState)({isValid:!0,errorMessage:""}),2),Ye=$e[0],Xe=$e[1],Ke=ce((0,pe.useState)({start:!1,complete:!1,errorMessage:null}),2),Ze=Ke[0],Je=Ke[1],et=(0,pe.useMemo)(function(){return(0,Ea.throttle)(function(e,t,n){!function(e,t,n){var r=(null!=t?t:[]).map(function(t){if(!t||"string"!=typeof t)return null;var n=e.toLowerCase(),r=t.toLowerCase(),o=n.split(/\s+/).filter(function(e){return e.length>0}),i=r.split(/\s+/).filter(function(e){return e.length>0}),a=0,l=!1;r===n&&(a+=1e3,l=!0),r.startsWith(n)&&(a+=500,l=!0),n.startsWith(r)&&(a+=400,l=!0),r.includes(n)?(a+=300,l=!0):n.includes(r)&&(a+=250,l=!0);var s=o.length,c=0;return o.forEach(function(e,t){i.forEach(function(n){var r=0,o=!1;if(n===e?(r=100,o=!0):n.startsWith(e)?(r=80,o=!0):e.startsWith(n)?(r=70,o=!0):n.includes(e)?(r=50,o=!0):e.includes(n)&&(r=40,o=!0),o)if(l=!0,t<s)s=t,c=r+(1e4-1e3*t);else if(t===s){var i=r+(1e4-1e3*t);c=Math.max(c,i)}})}),a+=c,i.forEach(function(e){n.includes(e)?(a+=30,l=!0):e.includes(n)&&(a+=25,l=!0)}),l?{language:t,relevanceScore:a}:null}).filter(Boolean).sort(function(e,t){return t.relevanceScore-e.relevanceScore}).map(function(e){return e.language});n(r.length>0?r:[])}(e,t,n)},150)},[]),tt=(0,pe.useRef)(null),nt=(0,pe.useRef)({stepStatusSetter:null,resetProgress:null,startProgress:null,completeProgress:null,setProgressError:null}),rt=(0,pe.useCallback)(function(e){Je(e)},[]),ot=(0,pe.useCallback)(function(e){nt.current.stepStatusSetter=e},[]),it=(0,pe.useCallback)(function(e){nt.current.resetProgress=e.resetProgress,nt.current.startProgress=e.startProgress,nt.current.completeProgress=e.completeProgress,nt.current.setProgressError=e.setProgressError},[]),at=(0,pe.useCallback)(function(){tt.current&&($a("No pending steps detected, submitting immediately with AI templates:",tt.current),Nt(tt.current),tt.current=null,nt.current.completeProgress&&nt.current.completeProgress(),ct.current=null)},[Nt]);(0,pe.useEffect)(function(){var e=(null==Ze?void 0:Ze.start)&&!Ze.complete;m&&m(e)},[Ze,m]);var lt=(0,pe.useRef)([]),st=(0,pe.useRef)([]),ct=(0,pe.useRef)(null),ut=(0,pe.useRef)(null);(0,pe.useEffect)(function(){return function(){if(lt.current.forEach(function(e){e&&clearTimeout(e)}),lt.current=[],st.current.forEach(function(e){e&&clearInterval(e)}),st.current=[],ct.current&&(clearTimeout(ct.current),ct.current=null),ht.cancel(),ut.current)try{ut.current.abort("Component unmounted"),ut.current=null}catch(e){console.warn("Error aborting AI workflow:",e)}}},[ht]),(0,pe.useEffect)(function(){var e=function(e){if("Enter"===e.key&&"start"===(null==H?void 0:H.key)){var t=document.activeElement;t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"true"===t.contentEditable)||(e.preventDefault(),e.stopPropagation())}};return document.addEventListener("keydown",e,!0),function(){document.removeEventListener("keydown",e,!0)}},[null==H?void 0:H.key]),(0,pe.useEffect)(function(){(null==R?void 0:R.length)>0&&oe(R)},[R]),(0,pe.useEffect)(function(){if(null!=w&&w.error)return g(),void v(w.error);if(w.data){var e=function(e){var t,n,r,o,i,a,l,s={businessNiches:null,aiProcess:null,creditInfo:null,aiPageIDs:null,previewPages:null,ai_preview_content:null};if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.business_niches&&(s.businessNiches=e.data.business_niches),null!=e&&null!==(n=e.data)&&void 0!==n&&n.ai_preview_content&&(s.ai_preview_content=e.data.ai_preview_content),null!=e&&null!==(r=e.data)&&void 0!==r&&r.ai_process){var c=e.data.ai_process;s.aiProcess={pack_id:null==c?void 0:c.pack_id,processId:null==c?void 0:c.process_id,name:null==c?void 0:c.name,category:null==c?void 0:c.category,description:null==c?void 0:c.description,email:null==c?void 0:c.email,contactNumber:null==c?void 0:c.contactNumber,businessAddress:null==c?void 0:c.businessAddress,openingHour:null==c?void 0:c.openingHour,imageReplace:null==c?void 0:c.imageReplace}}if(null!=e&&null!==(o=e.data)&&void 0!==o&&o.credit_balance||null!=e&&null!==(i=e.data)&&void 0!==i&&i.estimated_cost){var u,d,p=null!==(u=e.data.credit_balance)&&void 0!==u?u:{},f=null!==(d=e.data.estimated_cost)&&void 0!==d?d:0;s.creditInfo=KF(KF({},p),{},{estimated_cost:f})}if(null!=e&&null!==(a=e.data)&&void 0!==a&&null!==(a=a.manifest)&&void 0!==a&&null!==(a=a.content)&&void 0!==a&&a.page||null!=e&&null!==(l=e.data)&&void 0!==l&&null!==(l=l.manifest)&&void 0!==l&&l.templates){var h,m,g,v,y=null!==(h=null==e||null===(m=e.data)||void 0===m||null===(m=m.manifest)||void 0===m||null===(m=m.content)||void 0===m?void 0:m.page)&&void 0!==h?h:{},b=null!==(g=null==e||null===(v=e.data)||void 0===v||null===(v=v.manifest)||void 0===v?void 0:v.templates)&&void 0!==g?g:{},w=Object.values(b),E=Object.values(y).filter(function(e){var t;return!0!==(null===(t=e.page_settings)||void 0===t?void 0:t.page_for_posts)}),k=Object.values(y).filter(function(e){var t;return!0===(null===(t=e.page_settings)||void 0===t?void 0:t.page_on_front)}).map(function(e){return e.post_id}),O=E.map(function(e){return e.post_id}),S=w.filter(function(e){return!O.includes(e.post_id)}).map(function(e){return e.post_id}),x=w.filter(function(e){return"header"===e.type||"footer"===e.type}).map(function(e){return e.post_id}),_=Nl(x);x.length>0&&(s.headerFooterIDs=x),(k.length>0||_.length>0)&&(s.previewPages=[].concat(Nl(k),Nl(_))),(O.length>0||S.length>0)&&(s.aiPageIDs={"content/page":O,templates:S})}return s}(w);if(w.data.business_niches&&N(w.data.business_niches),e.aiProcess){var t=e.aiProcess,n=Number(t.pack_id)===Number(l);W(function(){var e,n=U;return null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.ai_language_show_mode||(n=U.filter(function(e){return"language"!==e.key})),n.map(function(e){var n=e.editable;return"start"===e.key?RI(RI({},e),{},{editable:!1,done:!0}):"finalize"===e.key?RI(RI({},e),{},{editable:!1,question:"<p>".concat("Welcome back,"," ",(null==h?void 0:h.first_name)||(0,At.__)("there","templately"),"! 👋 ").concat((0,At.__)("Would you like us to generate your website content based on your previous conversation?","templately"),"</p>")}):"imageReplace"===e.key&&Object.hasOwn(t,e.key)&&t[e.key]?RI(RI({},e),{},{done:!0,answer:(0,At.__)("Yes, I would like to change images","templately"),result:t[e.key],editable:n}):Object.hasOwn(t,e.key)&&t[e.key]?RI(RI({},kt(t[e.key],{key:e.key},e)),{},{editable:n}):Object.hasOwn(t,e.key)&&!t[e.key]?RI(RI({},e),{},{done:!0,editable:n,answer:(0,At.__)("I want to skip the question","templately")}):RI(RI({},e),{},{editable:!1})})}),n?G({key:"finalize",isThinking:!1,isTyping:!1}):function(e,t){try{if(!e||"function"!=typeof e)return void console.warn("handlePackChange: Invalid setCurrentStep function provided");if(!t||"function"!=typeof t)return void console.warn("handlePackChange: Invalid setConversationSteps function provided");e({key:"imageReplace",isThinking:!1,isTyping:!1}),t(function(e){return e&&Array.isArray(e)?e.map(function(t){if(!t||"object"!==ne(t))return t;if("imageReplace"===t.key)return SP(SP({},t),{},{answer:null,result:null,done:!1});var n=e.findIndex(function(e){return"imageReplace"===(null==e?void 0:e.key)}),r=e.findIndex(function(e){return(null==e?void 0:e.key)===t.key});return-1!==n&&r>n?SP(SP({},t),{},{done:!1}):t}):(console.warn("handlePackChange: Invalid conversations array"),e)})}catch(e){console.error("Error in handlePackChange:",e)}}(G,W)}_(e)}},[w]),(0,pe.useEffect)(function(){x&&Te(!1)},[x]);var dt=(0,pe.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;try{if(!e||!Array.isArray(e))return console.warn("getNextStep: Invalid conversationSteps provided"),null;var r=null!=n?n:t,o=e.findIndex(function(e){return(null==e?void 0:e.key)===r});return-1!==o&&o<e.length-1?e[o+1]:null}catch(e){return console.error("Error in getNextStep:",e),null}}(z,null==H?void 0:H.key,e)},[z,null==H?void 0:H.key]);(0,pe.useEffect)(function(){Ee||xe(!1)},[Ee]);var pt=he().useMemo(function(){return function(e){try{return e&&Array.isArray(e)?e.some(function(e){return!0===(null==e?void 0:e.editMode)}):(console.warn("checkAnyConversationInEditMode: Invalid conversationSteps provided"),!1)}catch(e){return console.error("Error in checkAnyConversationInEditMode:",e),!1}}(z)},[z]),ft=(0,pe.useCallback)(function(e){if(e.preventDefault(),!ct.current&&!pt)if("category"===(null==H?void 0:H.key))try{if(null==Q||!Q.trim())return void console.warn("Category submission blocked: Invalid category data");var t=TP(Q,4);if(Xe(t),!t.isValid)return void console.warn("Category submission blocked: Too many words");be(!1),Ot(Q)}catch(e){return void console.error("Error submitting category:",e)}else if("email"===(null==H?void 0:H.key)){var n=AP(J);if(He(n),!n.isValid)return void console.warn("Email submission blocked: Invalid email");be(!1),Ot(J.trim())}else if("contactNumber"===(null==H?void 0:H.key)){if(PP(J))return Et();var r=FP(J);if(Qe(r),!r.isValid)return void console.warn("Phone submission blocked: Invalid phone number");be(!1),Ot(J.trim())}else{if(null==J||!J.trim())return;if(DP(z,null==H?void 0:H.key)&&PP(J))return Et();be(!1),Ot(J)}},[null==H?void 0:H.key,Q,J,pt,Ot]),ht=(0,pe.useMemo)(function(){return(0,Ea.throttle)(function(e,t,n){!function(e,t,n){try{var r=(null!=t?t:[]).map(function(t){try{if(!t||"string"!=typeof t)return null;var n=e.toLowerCase(),r=t.toLowerCase(),o=n.split(/\s+/).filter(function(e){return e.length>0}),i=r.split(/\s+/).filter(function(e){return e.length>0}),a=0,l=!1;r===n&&(a+=1e3,l=!0),r.startsWith(n)&&(a+=500,l=!0),n.startsWith(r)&&(a+=400,l=!0),r.includes(n)?(a+=300,l=!0):n.includes(r)&&(a+=250,l=!0);var s=o.length,c=0;return o.forEach(function(e,t){i.forEach(function(n){var r=0,o=!1;if(n===e?(r=100,o=!0):n.startsWith(e)?(r=80,o=!0):e.startsWith(n)?(r=70,o=!0):n.includes(e)?(r=50,o=!0):e.includes(n)&&(r=40,o=!0),o)if(l=!0,t<s)s=t,c=r+(1e4-1e3*t);else if(t===s){var i=r+(1e4-1e3*t);c=Math.max(c,i)}})}),a+=c,i.forEach(function(e){n.includes(e)?(a+=30,l=!0):e.includes(n)&&(a+=25,l=!0)}),l?{category:t,relevanceScore:a}:null}catch(e){return console.warn("Error scoring category:",t,e),null}}).filter(Boolean).sort(function(e,t){return t.relevanceScore-e.relevanceScore}).map(function(e){return e.category});n(r.length>0?r:[])}catch(e){console.error("Error in performCategorySearch:",e),n(t)}}(e,t,n)},150)},[]),mt=(0,pe.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{var n="string"==typeof e?e:"";K(n);var r=n.trim(),o=TP(n,4);if(Xe(o),!r)return $(""),oe(R),ht.cancel(),void Xe({isValid:!0,errorMessage:""});if($(r),t&&Le(!1),t){var i=setTimeout(function(){try{if(!(null==z?void 0:z.some(function(e){return null==e?void 0:e.editMode}))&&null!=We&&We.current)try{We.current.focus();var e=r.length;We.current.setSelectionRange(e,e)}catch(e){console.warn("Could not focus category input:",e)}lt.current=lt.current.filter(function(e){return e!==i})}catch(e){console.warn("Error in focus timeout:",e)}},50);lt.current.push(i)}ht(r,R,oe)}catch(e){console.error("Error in handleCategoryInputChange:",e),K(""),$(""),oe(R),Xe({isValid:!0,errorMessage:""})}},[R,z,ht]),gt=(0,pe.useCallback)(function(e){try{if(ee(null!=e?e:""),"email"===(null==H?void 0:H.key)){var t=AP(e);He(t),Qe({isValid:!0,errorMessage:""})}else if("contactNumber"===(null==H?void 0:H.key)){var n=FP(e),r=PP(e);Qe(r?{isValid:!0,errorMessage:""}:n),He({isValid:!0,errorMessage:""})}else He({isValid:!0,errorMessage:""}),Qe({isValid:!0,errorMessage:""});"language"===(null==H?void 0:H.key)&&et(e||"",_P,le),"category"!==(null==H?void 0:H.key)&&Xe({isValid:!0,errorMessage:""})}catch(e){console.error("Error in handleTextInputChange:",e),ee(""),He({isValid:!0,errorMessage:""}),Qe({isValid:!0,errorMessage:""}),Xe({isValid:!0,errorMessage:""})}},[null==H?void 0:H.key,et]),vt=(0,pe.useCallback)(function(){be(!1),De(!0),W(function(e){return e.map(function(e){return"start"===(null==e?void 0:e.key)?RI(RI({},e),{},{done:!0}):e})});var e=setTimeout(function(){var t,n;j(null!==(t=null===(n=dt())||void 0===n?void 0:n.key)&&void 0!==t?t:"name"),lt.current=lt.current.filter(function(t){return t!==e})},30);lt.current.push(e)},[j]),yt=(0,pe.useCallback)(function(e){if(e)W(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==H?void 0:H.key)?RI(RI({},e),{},{done:!0,answer:(0,At.__)("Yes, I would like to change images","templately")}):e}))&&void 0!==t?t:[]}),xe(!1),ke(!0);else{W(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==H?void 0:H.key)?RI(RI({},e),{},{done:!0,answer:(0,At.__)("No, I will keep the default images.","templately")}):e}))&&void 0!==t?t:[]});var t=dt();null!=t&&t.key&&j(t.key)}},[null==H?void 0:H.key,dt,j]),bt=(0,pe.useCallback)(function(){var e,t,n=jP(null==h?void 0:h.first_name,D.length>0).filter(function(e){return"start"!==e.key});W(n),G({key:null!==(e=null===(t=n[0])||void 0===t?void 0:t.key)&&void 0!==e?e:"name",isThinking:!1,isTyping:!1}),be(!1),ee(""),K(""),$(""),oe(R),He({isValid:!0,errorMessage:""}),Qe({isValid:!0,errorMessage:""}),Xe({isValid:!0,errorMessage:""}),de({}),ge({}),_(function(e){return RI(RI({},e),{},{aiProcess:null})}),ct.current&&(clearTimeout(ct.current),ct.current=null),Je({start:!1,complete:!1,errorMessage:null})},[null==h?void 0:h.first_name,D.length,R]),wt=(0,pe.useMemo)(function(){var e;return(null==z||null===(e=z.find(function(e){return(null==e?void 0:e.key)===(null==H?void 0:H.key)}))||void 0===e?void 0:e.tooltip)||null},[z,null==H?void 0:H.key]);(0,pe.useEffect)(function(){var e;return(null==H?void 0:H.isThinking)||(null==H?void 0:H.isTyping)||Ae?ze(!1):wt?(e=setTimeout(function(){ze(!0),null!=lt&<.current&&(lt.current=lt.current.filter(function(t){return t!==e}))},120),null!=lt&<.current&<.current.push(e)):ze(!1),function(){e&&(clearTimeout(e),null!=lt&<.current&&(lt.current=lt.current.filter(function(t){return t!==e})))}},[wt,null==H?void 0:H.isThinking,null==H?void 0:H.isTyping,Ae,lt]),(0,pe.useEffect)(function(){var e=(null==z?void 0:z.filter(function(e){return null==e?void 0:e.done}))||[],t=[];return e.forEach(function(e){if(null!=e&&e.key){var n=setTimeout(function(){Ie(function(t){return new Set([].concat(Nl(t),[e.key]))})},200);t.push(n)}}),function(){t.forEach(function(e){return clearTimeout(e)})}},[z]),(0,pe.useEffect)(function(){if(!(null!=H&&H.isThinking||null!=H&&H.isTyping)){De(!0),G(function(e){return RI(RI({},e),{},{isThinking:!0})});var e=setTimeout(function(){De(!1),lt.current=lt.current.filter(function(t){return t!==e})},100);lt.current.push(e)}},[null==H?void 0:H.key]),(0,pe.useEffect)(function(){if(null!=H&&H.isThinking){if(LP())return void G(function(e){return RI(RI({},e),{},{isThinking:!1,isTyping:!0})});var e=setTimeout(function(){De(!0),G(function(e){return RI(RI({},e),{},{isThinking:!1,isTyping:!0})}),De(!1)},1800);return lt.current.push(e),function(){clearTimeout(e),lt.current=lt.current.filter(function(t){return t!==e})}}},[null==H?void 0:H.isThinking]),(0,pe.useEffect)(function(){var e;return(null==H?void 0:H.isThinking)||(null==H?void 0:H.isTyping)?be(!1):(e=setTimeout(function(){be(function(e){return e||!0})},120),lt.current.push(e)),function(){e&&(clearTimeout(e),lt.current=lt.current.filter(function(t){return t!==e}))}},[null==H?void 0:H.isThinking,null==H?void 0:H.isTyping,null==H?void 0:H.key]);var Et=(0,pe.useCallback)(function(){try{W(function(e){var t;return null!==(t=null==e?void 0:e.map(function(e){return(null==e?void 0:e.key)===(null==H?void 0:H.key)?RI(RI({},e),{},{done:!0,answer:"language"===(null==H?void 0:H.key)?(0,At.__)("I want to keep English","templately"):(0,At.__)("I want to skip the question","templately")}):e}))&&void 0!==t?t:[]}),ee("");var e=dt();null!=e&&e.key&&j(e.key)}catch(e){console.error("Error in handleAnswerSkip:",e)}},[null==H?void 0:H.key,dt,j]),kt=function(e,t,n){if((null==n?void 0:n.key)===(null==t?void 0:t.key)){var r=null!=e?e:"",o=null!=e?e:"";return RI(RI({},n),{},{done:!0,answer:r,result:o})}return n},Ot=(0,pe.useCallback)(function(e){try{if("category"===(null==H?void 0:H.key))try{var t=null!=e?e:"",n=(null!=R?R:[]).some(function(e){try{return e===t}catch(t){return console.warn("Error checking category:",e,t),!1}});F(!n)}catch(e){console.error("Error detecting category type:",e),F(!0)}if("language"===(null==H?void 0:H.key)&&!_P.some(function(t){return t.toLowerCase()===e.toLowerCase()}))return;W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return kt(e,H,t)}))&&void 0!==n?n:[]}),"category"!==(null==H?void 0:H.key)&&ee("");var r=dt();null!=r&&r.key&&j(r.key)}catch(e){console.error("Error in handleAnswerSubmit:",e)}},[null==H?void 0:H.key,dt,R,j]),St=(0,pe.useCallback)(function(e){try{if(!e)return void console.warn("handleEdit: No key provided");var t=null==z?void 0:z.find(function(t){return(null==t?void 0:t.key)===e});if(!t)return void console.warn("handleEdit: No conversation found for key: ".concat(e));if("category"===e)try{if(null!=t&&t.result){var n=(null!=R?R:[]).find(function(e){try{return e===t.result}catch(t){return console.warn("Error checking category in edit:",e,t),!1}});n?(K(n||""),$(n||""),oe(R),F(!1),ge(function(n){return RI(RI({},n),{},Pt({},e,t.result))})):(K(t.result),$(t.result),oe([]),F(!0),ge(function(n){return RI(RI({},n),{},Pt({},e,t.result))}))}else K(""),$(""),oe(R),F(!1)}catch(e){console.error("Error in category edit setup:",e),K(""),$(""),oe(R),F(!1)}else null!=t&&t.result&&(de(function(n){return RI(RI({},n),{},Pt({},e,t.result))}),ge(function(n){return RI(RI({},n),{},Pt({},e,t.result))}));W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return(null==t?void 0:t.key)===e?RI(RI({},t),{},{editMode:!0}):t}))&&void 0!==n?n:[]})}catch(e){console.error("Error in handleEdit:",e)}},[z,R]),xt=(0,pe.useCallback)(function(e){if("category"===e){var t=Q||X||"",n=(null==me?void 0:me[e])||"";return t.trim()!==n.trim()}var r=(null==ue?void 0:ue[e])||"",o=(null==me?void 0:me[e])||"";return r.trim()!==o.trim()},[Q,X,ue,me]),_t=(0,pe.useCallback)(function(e){try{var t,n;if("category"===e)return!(null!=X&&X.trim()&&xt(e)&&Ye.isValid);var r=null!==(t=null==ue||null===(n=ue[e])||void 0===n?void 0:n.trim())&&void 0!==t?t:"";if(!r)return!0;if(!xt(e))return!0;var o=DP(z,e),i=PP(r);return!(o&&i||("email"===e?Ve.isValid:"contactNumber"!==e||qe.isValid))}catch(e){return console.error("Error in isEditSubmitDisabled:",e),!0}},[X,xt,Ye,ue,z,Ve,qe]),Ct=(0,pe.useCallback)(function(e,t){try{if(!e)return void console.warn("handleEditInputChange: No key provided");if(de(function(n){return RI(RI({},n),{},Pt({},e,null!=t?t:""))}),"email"===e){var n=AP(t);He(n)}else if("contactNumber"===e)if(PP(t))Qe({isValid:!0,errorMessage:""});else{var r=FP(t);Qe(r)}}catch(e){console.error("Error in handleEditInputChange:",e)}},[]),Dt=(0,pe.useCallback)(function(e){try{var t,n;if(!e)return void console.warn("handleEditSubmit: No key provided");if(!xt(e))return void $a("handleEditSubmit: No changes detected, skipping submission");var r=null!==(t=null==ue||null===(n=ue[e])||void 0===n?void 0:n.trim())&&void 0!==t?t:"";if("category"!==e&&!r)return void console.warn("handleEditSubmit: No value provided");var o=DP(z,e),i=PP(r);if(o&&i)return W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return(null==t?void 0:t.key)===e?RI(RI({},t),{},{editMode:!1,done:!0,answer:(0,At.__)("I want to skip the question","templately"),result:null}):t}))&&void 0!==n?n:[]}),de(function(t){var n=RI({},t);return delete n[e],n}),ge(function(t){var n=RI({},t);return delete n[e],n}),He({isValid:!0,errorMessage:""}),Qe({isValid:!0,errorMessage:""}),void _(function(e){return RI(RI({},e),{},{ai_preview_content:null})});if("email"===e){var a=AP(r);if(He(a),!a.isValid)return void console.warn("Email edit submission blocked: Invalid email")}else if("contactNumber"===e){var l=FP(r);if(Qe(l),!l.isValid)return void console.warn("Phone edit submission blocked: Invalid phone number")}if("category"===e){var s=TP(Q,4);if(Xe(s),!s.isValid)return void console.warn("".concat(e," edit submission blocked: Too many words"))}W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){if((null==t?void 0:t.key)===e){var n="category"===e?Q:r,o="category"===e?Q:r;return RI(RI({},t),{},{editMode:!1,answer:n,result:o})}return t}))&&void 0!==n?n:[]}),"category"===e?(K(""),$(""),oe(R),F(!1)):de(function(t){var n=RI({},t);return delete n[e],n}),ge(function(t){var n=RI({},t);return delete n[e],n}),_(function(e){return RI(RI({},e),{},{ai_preview_content:null})})}catch(e){console.error("Error in handleEditSubmit:",e)}},[ue,z,dt,Q,R,xt]),Tt=(0,pe.useCallback)(function(e){try{if(!e)return void console.warn("handleEditCancel: No key provided");W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return(null==t?void 0:t.key)===e?RI(RI({},t),{},{editMode:!1}):t}))&&void 0!==n?n:[]}),"category"===e?(K(""),$(""),oe(R),F(!1)):de(function(t){var n=RI({},t);return delete n[e],n}),ge(function(t){var n=RI({},t);return delete n[e],n})}catch(e){console.error("Error in handleEditCancel:",e)}},[R]),Ft=(0,pe.useCallback)(function(){try{G(function(e){return RI(RI({},e),{},{isTyping:!1})})}catch(e){console.error("Error in handleTypingComplete:",e)}},[]),Mt=(0,pe.useCallback)(hi(NI().m(function e(){var t,n,r,o,i,a,u,f,h,m,g,v;return NI().w(function(e){for(;;)switch(e.p=e.n){case 0:if("AI_GENERATION_IN_PROGRESS"!==ct.current){e.n=1;break}return console.warn("AI generation already in progress"),e.a(2);case 1:if(!s&&c){e.n=2;break}return console.warn("Credit data is still loading"),e.a(2);case 2:if(c.is_first_generation){e.n=3;break}if(c.available_credit&&!(c.available_credit<c.estimated_cost)){e.n=3;break}return d(!0),p(!0),e.a(2);case 3:if(e.p=3,t=new AbortController,ut.current=t,ct.current="AI_GENERATION_IN_PROGRESS",W(function(e){return e.map(function(e){return"finalize"===(null==e?void 0:e.key)?RI(RI({},e),{},{done:!0}):e})}),n={},z.forEach(function(e){e.done&&e.result&&(n[e.key]=e.result)}),l){e.n=4;break}return console.error("Pack ID not found in AI sidebar context"),ct.current=null,be(!0),e.a(2);case 4:if((r={pack_id:l,platform:b,isBusinessNichesNew:T,ai_page_ids:(null==x?void 0:x.aiPageIDs)||{},preview_pages:(null==x?void 0:x.previewPages)||[],name:n.name||"",category:n.category||"",description:n.description||"",email:n.email||"",contactNumber:n.contactNumber||"",businessAddress:n.businessAddress||"",openingHour:n.openingHour||"",language:n.language||null,imageReplace:(null==n?void 0:n.imageReplace)||[]}).description){e.n=5;break}return console.error("AI prompt is missing from conversation results"),ct.current=null,be(!0),e.a(2);case 5:return nt.current.startProgress?nt.current.startProgress():console.warn("Progress start function not available"),o=Date.now(),e.n=6,HF(r,{onSessionCreated:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("downloading","done"),$a("Session created:",e.session_id)},onAIContentStarted:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("analyzing","done"),$a("AI content generation started:",e.process_id)},onBothCompleted:function(e){var t=e.sessionResult,n=e.aiContentResult;$a("Both AJAX calls completed:",{sessionId:t.session_id,processId:n.process_id})},onPollingComplete:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("generating","done"),$a("AI content polling completed:",e)},onUpdating:function(){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("updating","done")},onPreparing:function(){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("preparing","done")},onWorkflowComplete:function(e){$a("AI workflow completed successfully:",e),ut.current=null}},t);case 6:i=e.v,a=Date.now(),u=((a-o)/1e3).toFixed(2),$a("AI workflow took ".concat(u," seconds")),f={isLocalSite:i.isLocalSite,templates:i.templates,session_id:i.session_id,process_id:i.process_id,ai_page_ids:r.ai_page_ids,preview_pages:r.preview_pages,headerFooterIDs:x.headerFooterIDs,imageMappings:YF(r.imageReplace||[]),originalAttachments:D,name:r.name,description:r.description},tt.current=f,$a("AI content generation workflow completed, templates stored for submission:",i),e.n=14;break;case 7:e.p=7,g=e.v,console.error("Error in startAIGeneration:",g),h=g.message||(0,At.__)("Oops! An unexpected error occurred.","templately"),m=null,v=g.cause,e.n="cancelled"===v?8:"timeout"===v?9:"createSessionAndDownloadPack"===v?10:"startModifyAiContent"===v?11:12;break;case 8:return $a("AI generation was cancelled"),ct.current=null,ut.current=null,be(!0),nt.current.resetProgress&&nt.current.resetProgress(),e.a(2);case 9:return h=(0,At.__)("Oops! It's taking a bit longer than usual.","templately"),m=null,e.a(3,13);case 10:return h=(0,At.__)("Sorry, something went wrong.","templately"),m=0,console.error("Session/Download Error:",g.originalError),e.a(3,13);case 11:return h=(0,At.__)("Oops! Something went wrong while updating your content.","templately"),m=2,console.error("AI Content Error:",g.originalError),e.a(3,13);case 12:return h=(0,At.__)("Sorry, something went wrong.","templately"),m=3,e.a(3,13);case 13:ct.current=null,ut.current=null,be(!0),nt.current.setProgressError&&nt.current.setProgressError(h,m);case 14:return e.a(2)}},e,null,[[3,7]])})),[l,z,b,x,T,c,d,p,Nt,Ze]),It=(0,pe.useCallback)(function(){var e;if(null!=w&&null!==(e=w.data)&&void 0!==e&&null!==(e=e.ai_process)&&void 0!==e&&e.process_id){var t,n=w.data.ai_process,r=null==z?void 0:z.find(function(e){return"imageReplace"===e.key}),o={isCacheData:!0,templates:w.data.ai_preview_content,session_id:n.session_id,process_id:n.process_id,ai_page_ids:n.ai_page_ids,preview_pages:n.ai_preview_ids,headerFooterIDs:x.headerFooterIDs,isLocalSite:!0,imageMappings:YF(null!==(t=r.result)&&void 0!==t?t:[]),originalAttachments:D,name:n.name,description:n.description};Nt(o)}},[w,x,Nt,D,z]),Nt=(0,pe.useCallback)(function(e){null==i||i(function(e){return RI(RI({},e),{},{finishAnimation:!0})});var t=setTimeout(function(){var n=document.querySelector("body");n&&n.classList.remove("templately-fsi-ai-sidebar-open"),null==a||a(),null==i||i(function(e){return RI(RI({},e),{},{show:!1,finishAnimation:!1})}),$a("AI templates submitted:",e),y(Iy({aiTemplates:e})),lt.current=lt.current.filter(function(e){return e!==t})},500);return lt.current.push(t),t},[i,a,y]),jt=(0,pe.useCallback)(function(){var e,t=null!==(e=null==ae?void 0:ae.slice(2))&&void 0!==e?e:[];return he().createElement(he().Fragment,null,t.map(function(e,t){if(!e)return null;var n="language-more-".concat(t),r="language-radio-more-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-language"},he().createElement("input",{id:r,type:"radio",name:"language-more",value:n,checked:J.trim()===e.trim(),onChange:function(){gt(e),Ot(e)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Language","templately")))}))},[ae,gt,Ot,J]),Lt=(0,pe.useCallback)(function(){try{var e,t=null!==(e=null==re?void 0:re.slice(2))&&void 0!==e?e:[];return he().createElement(he().Fragment,null,t.map(function(e,t){try{if(!e)return null;var n="category-more-".concat(t),r="category-radio-more-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},he().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:Q===e,onChange:function(){return mt(e,!0)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}catch(t){return console.warn("Error rendering category in MoreCategoryPanel:",e,t),null}}))}catch(e){return console.error("Error in MoreCategoryPanel:",e),he().createElement(he().Fragment,null)}},[re,Q,mt]);return(0,pe.useEffect)(function(){var e=function(){var e=hi(NI().m(function e(){var t,n,r,o;return NI().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,l){e.n=1;break}return console.error("Pack ID is required to fetch attachments data"),e.a(2);case 1:return e.n=2,VF(l,"pack");case 2:n=e.v,r=n.attachments.filter(function(e){return"photo"===e.type||!e.type}),null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_ai_all_images&&(r=n.attachments),P(r),$a("attachments:",r),e.n=4;break;case 3:e.p=3,o=e.v,console.error("Error fetching attachments data:",o);case 4:return e.a(2)}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}();e()},[l]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-fsi-ai-sidebar-body ".concat(u?"credit-limit-popover-open":"")},"start"===(null==H?void 0:H.key)&&he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info"},(0,At.__)("You can check your AI Credits here!","templately"),he().createElement("br",null),(0,At.__)("Buy credits if you needed!","templately")),he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-info-icon"},he().createElement(vP,null))),he().createElement("div",{className:"templately-fsi-ai-sidebar-body-inner"},null==z?void 0:z.map(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,f;return null!=e&&e.done?he().createElement(he().Fragment,{key:"conversation-".concat(null==e?void 0:e.key,"-").concat(t)},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation ai-conversation ".concat(Me.has(null==e?void 0:e.key)?"animate-in":"")},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(kP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text",dangerouslySetInnerHTML:{__html:null!==(n=null==e?void 0:e.question)&&void 0!==n?n:""}}))),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation client-conversation ".concat(Me.has(null==e?void 0:e.key)?"animate-in":"")},L()?he().createElement("img",{src:L(),className:"templately-fsi-ai-sidebar-conversation-image",alt:null!==(r=null==h?void 0:h.name)&&void 0!==r?r:(0,At.__)("Profile","templately"),onError:function(e){var t,n;null!=e&&e.target&&(null!=h&&h.profile_photo&&e.target.src!==h.profile_photo?e.target.src=h.profile_photo:e.target.src=null!==(t=null===(n=window)||void 0===n||null===(n=n.templately)||void 0===n||null===(n=n.icons)||void 0===n?void 0:n.profile)&&void 0!==t?t:"")}}):he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement("span",null,null!=h&&h.first_name&&null!=h&&h.last_name?"".concat(null==h||null===(o=h.first_name)||void 0===o||null===(o=o.slice(0,1))||void 0===o?void 0:o.toUpperCase()).concat(null==h||null===(i=h.last_name)||void 0===i||null===(i=i.slice(0,1))||void 0===i?void 0:i.toUpperCase()):null!=h&&h.first_name?"".concat(null==h||null===(a=h.first_name)||void 0===a||null===(a=a.slice(0,2))||void 0===a?void 0:a.toUpperCase()):"".concat(null==h||null===(l=h.name)||void 0===l||null===(l=l.slice(0,2))||void 0===l?void 0:l.toUpperCase()))),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},null!=e&&e.editable&&null!=e&&e.editMode?he().createElement("form",{onSubmit:function(t){t.preventDefault(),Dt(null==e?void 0:e.key)},className:"templately-fsi-ai-sidebar-conversation-text ".concat(null!=e&&e.editable&&null!=e&&e.editMode?"templately-fsi-ai-sidebar-conversation-text-editing":"")},"description"===(null==e?void 0:e.key)?he().createElement("textarea",{className:"templately-fsi-ai-sidebar-conversation-edit-textarea",placeholder:(0,At.__)("Type your answer...","templately"),value:null!==(s=null==ue?void 0:ue[null==e?void 0:e.key])&&void 0!==s?s:"",onChange:function(t){var n,r;return Ct(null==e?void 0:e.key,null!==(n=null==t||null===(r=t.target)||void 0===r?void 0:r.value)&&void 0!==n?n:"")},onKeyDown:function(t){"Enter"===t.key&&(t.preventDefault(),Dt(null==e?void 0:e.key))},autoFocus:!0}):he().createElement("input",{type:"contactNumber"===(null==e?void 0:e.key)?"tel":"email"===(null==e?void 0:e.key)?"email":"text",className:"templately-fsi-ai-sidebar-conversation-edit-input ".concat("email"===(null==e?void 0:e.key)&&!Ve.isValid||"contactNumber"===(null==e?void 0:e.key)&&!qe.isValid?"templately-fsi-ai-sidebar-conversation-edit-input-has-error":""),placeholder:"email"===(null==e?void 0:e.key)?(0,At.__)("Enter your email address...","templately"):"contactNumber"===(null==e?void 0:e.key)?(0,At.__)("Enter your phone number...","templately"):(0,At.__)("Type your answer...","templately"),value:"category"===(null==e?void 0:e.key)?null!=X?X:"":null!==(c=null==ue?void 0:ue[null==e?void 0:e.key])&&void 0!==c?c:"",onChange:function(t){var n,r,o,i;"category"===(null==e?void 0:e.key)?mt(null!==(n=null==t||null===(r=t.target)||void 0===r?void 0:r.value)&&void 0!==n?n:""):Ct(null==e?void 0:e.key,null!==(o=null==t||null===(i=t.target)||void 0===i?void 0:i.value)&&void 0!==o?o:"")},autoFocus:!0}),"category"===(null==e?void 0:e.key)&&(null==re?void 0:re.length)>0&&Ye.isValid?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-categories-wrapper"},re.map(function(e,t){var n="category-edit-".concat(t),r="category-radio-edit-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},he().createElement("input",{id:r,type:"radio",name:"edit-category",value:n,checked:Q===e,onChange:function(){return mt(e,!0)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))})):null,he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-edit-footer"},"email"===(null==e?void 0:e.key)&&!Ve.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ve.errorMessage),"contactNumber"===(null==e?void 0:e.key)&&!qe.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},qe.errorMessage),"category"===(null==e?void 0:e.key)&&!Ye.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ye.errorMessage),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-edit-buttons"},he().createElement("button",{type:"button",onClick:function(){return Tt(null==e?void 0:e.key)},className:"templately-fsi-ai-sidebar-conversation-edit-cancel","aria-label":(0,At.__)("Cancel editing","templately")},(0,At.__)("Cancel","templately")),he().createElement("button",{type:"submit",className:"templately-fsi-ai-sidebar-conversation-edit-submit",disabled:_t(null==e?void 0:e.key),"aria-label":(0,At.__)("Save changes","templately")},(0,At.__)("Save","templately"))))):he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},he().createElement("p",null,null!==(u=null==e?void 0:e.answer)&&void 0!==u?u:"")),(null==e?void 0:e.editable)&&"AI_GENERATION_IN_PROGRESS"!==ct.current&&he().createElement("button",{onClick:function(){return St(null==e?void 0:e.key)},disabled:pt,className:"templately-fsi-ai-sidebar-conversation-text-edit","aria-label":(0,At.__)("Edit answer","templately"),title:"AI_GENERATION_IN_PROGRESS"===ct.current?(0,At.__)("Cannot edit while AI generation is in progress","templately"):pt?(0,At.__)("Please finish editing the current conversation first","templately"):(0,At.__)("Edit","templately")},he().createElement(wP,null)))),"imageReplace"===(null==e?void 0:e.key)?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation image-replace-conversation ".concat(Me.has(null==e?void 0:e.key)?"animate-in":"")},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(kP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text"},null!=e&&null!==(d=e.result)&&void 0!==d&&d.length?he().createElement("p",null,(0,At.sprintf)((0,At._n)("%d image replaced successfully.","%d images replaced successfully.",null==e||null===(p=e.result)||void 0===p?void 0:p.length,"templately"),null==e||null===(f=e.result)||void 0===f?void 0:f.length)):he().createElement("p",null,(0,At.__)("No image has been replaced yet.","templately")),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button-wrapper"},he().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-edit-button",onClick:function(){xe(!0),ke(!0)},disabled:"AI_GENERATION_IN_PROGRESS"===ct.current||pt,title:"AI_GENERATION_IN_PROGRESS"===ct.current||pt?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("View and Edit","templately")},(0,At.__)("View & Edit","templately")))))):he().createElement(he().Fragment,null)):(null==e?void 0:e.key)!==(null==H?void 0:H.key)||Ee?null:he().createElement("div",{key:"current-".concat(null==e?void 0:e.key),className:"templately-fsi-ai-sidebar-conversation current-question ".concat(Ce?"transitioning":""," ").concat("finalize"===(null==H?void 0:H.key)&&null!=Ze&&Ze.start?"finalize-completed":"")},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(kP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},he().createElement(BP,{currentStep:H,isCatchFetching:Ae,conversation:e,onTypingComplete:Ft,intervalRefs:st})))}),"finalize"===(null==H?void 0:H.key)?he().createElement(VP,{timeoutRefs:lt,onStepStatusUpdate:ot,onProgressUpdate:rt,onUtilityFunctionsReady:it,onNoPendingSteps:at,isVisible:(null==Ze?void 0:Ze.start)&&!Ze.complete||Ze.complete&&Ze.errorMessage}):null,Ee&&he().createElement(II,{imagesAlreadyReplaced:null===(t=z.find(function(e){return"imageReplace"===e.key}))||void 0===t?void 0:t.result,defaultImages:D,setShowImageReplacePanel:ke,selectedCategory:Q||(null===(n=z.find(function(e){return"category"===e.key}))||void 0===n?void 0:n.result),handleSkip:function(){if(!Se){var e=dt();null!=e&&e.key&&j(e.key)}},handleSaveChange:function(e){var t,n=(null===(t=z.find(function(e){return"imageReplace"===e.key}))||void 0===t||null===(t=t.result)||void 0===t?void 0:t.length)>0;if(W(function(t){var n;return null!==(n=null==t?void 0:t.map(function(t){return"imageReplace"===(null==t?void 0:t.key)?RI(RI({},t),{},{result:e,done:!0,answer:(0,At.__)("Yes, I would like to change images","templately")}):t}))&&void 0!==n?n:[]}),!Se&&!n){var r=dt();null!=r&&r.key&&j(r.key)}}}))),null==Ze||!Ze.start||null!=Ze&&Ze.complete?Ee?he().createElement(he().Fragment,null):he().createElement("div",{className:"templately-fsi-ai-sidebar-footer"},he().createElement(qP,{currentStepTooltip:wt,isVisible:Be,isThinkingOrTyping:(null==H?void 0:H.isThinking)||(null==H?void 0:H.isTyping)||Ae,timeoutRefs:lt}),he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel"},he().createElement("div",{className:"templately-fsi-ai-sidebar-footer-panel-content ".concat(!ye||s||Ae?"templately-fsi-ai-sidebar-footer-panel-content--no-animation":"templately-fsi-ai-sidebar-footer-panel-content--animate-in")},ye&&!s&&!Ae&&he().createElement(he().Fragment,null,"start"===(null==H?void 0:H.key)?he().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-start-button",onClick:function(){return vt()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),document.activeElement===e.target&&vt())},disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("Yes, let’s start","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-start-button-text"},(0,At.__)("Yes, let’s start","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-start-button-icon"},he().createElement(yP,null))):"imageReplace"===(null==H?void 0:H.key)?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button-wrapper"},he().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button",onClick:function(){return yt(!0)},disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("Yes","templately")},(0,At.__)("Yes","templately")),he().createElement("button",{className:"templately-fsi-ai-sidebar-conversation-image-replace-button",onClick:function(){return yt(!1)},disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting","templately"):(0,At.__)("No","templately")},(0,At.__)("No","templately"))):"finalize"===(null==H?void 0:H.key)?null==x||!x.aiProcess||null!=Ze&&Ze.start||null!=Ze&&Ze.complete||null!=Ze&&Ze.errorMessage?null!=Ze&&Ze.complete&&null!=Ze&&Ze.errorMessage?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},he().createElement("button",{onClick:function(){return bt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button-with-tooltip",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("New Chat","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},he().createElement(EP,null))),he().createElement("button",{onClick:function(){return Mt()},disabled:pt||"AI_GENERATION_IN_PROGRESS"===ct.current,className:"templately-fsi-ai-sidebar-conversation-finish-button",title:(0,At.__)("Generate Again","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Generate Again","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},he().createElement(yP,null)))):he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},he().createElement("button",{onClick:function(){return bt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},he().createElement(EP,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),he().createElement("button",{onClick:function(){return Mt()},disabled:pt||"AI_GENERATION_IN_PROGRESS"===ct.current,className:"templately-fsi-ai-sidebar-conversation-finish-button",title:"AI_GENERATION_IN_PROGRESS"===ct.current?(0,At.__)("AI generation in progress...","templately"):pt?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},he().createElement(yP,null)))):null!=x&&x.ai_preview_content?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},he().createElement("button",{onClick:function(){return bt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},he().createElement(EP,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),he().createElement("button",{onClick:function(e){(e.metaKey||e.ctrlKey)&&e.shiftKey?It():Mt()},className:"templately-fsi-ai-sidebar-conversation-finish-button",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed...","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},he().createElement(yP,null)))):he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},he().createElement("button",{onClick:function(){return bt()},className:"templately-fsi-ai-sidebar-conversation-new-chat-button",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before starting new chat","templately"):(0,At.__)("New Chat","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-icon"},he().createElement(EP,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-new-chat-button-text"},(0,At.__)("No, Let’s Start Fresh","templately"))),he().createElement("button",{onClick:Mt,className:"templately-fsi-ai-sidebar-conversation-finish-button",disabled:pt,title:pt?(0,At.__)("Please finish editing conversations before proceeding","templately"):(0,At.__)("Generate and Proceed...","templately")},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-text"},(0,At.__)("Yes, Let’s Do It!","templately")),he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-finish-button-icon"},he().createElement(yP,null)))):he().createElement(he().Fragment,null,"category"===(null==H?void 0:H.key)?he().createElement("form",{onSubmit:ft},he().createElement("input",{ref:We,type:"text",className:"templately-fsi-ai-sidebar-conversation-category-input",placeholder:(0,At.__)("Type your business category...","templately"),value:X,onChange:function(e){var t,n;return mt(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},autoFocus:!0}),!Ye.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ye.errorMessage),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-categories-wrapper"},(null==re?void 0:re.length)>0&&Ye.isValid?he().createElement(he().Fragment,null,re.length<=2?re.map(function(e,t){var n="category-".concat(t),r="category-radio-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},he().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:Q===e,onChange:function(){return mt(e,!0)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}):he().createElement(he().Fragment,null,null==re||null===(r=re.slice(0,2))||void 0===r?void 0:r.map(function(e,t){var n="category-main-".concat(t),r="category-radio-main-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-category"},he().createElement("input",{id:r,type:"radio",name:"category",value:n,checked:Q===e,onChange:function(){return mt(e,!0)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}),he().createElement(IF,{open:je,onOpenChange:Le,content:he().createElement(Lt,null)},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-category-more-button"},re.length-2,"+")))):null)):"language"===(null==H?void 0:H.key)?he().createElement("form",{onSubmit:ft},he().createElement("input",{type:"text",className:"templately-fsi-ai-sidebar-conversation-category-input",placeholder:(0,At.__)("Search or select a language...","templately"),value:J,onChange:function(e){var t,n;return gt(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},autoFocus:!0}),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-languages-wrapper"},(null==ae?void 0:ae.length)>0?he().createElement(he().Fragment,null,ae.length<=2?ae.map(function(e,t){var n="language-".concat(t),r="language-radio-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-language"},he().createElement("input",{id:r,type:"radio",name:"language",value:n,checked:J.trim()===e.trim(),onChange:function(){gt(e),Ot(e)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown language","templately")))}):he().createElement(he().Fragment,null,null==ae||null===(o=ae.slice(0,2))||void 0===o?void 0:o.map(function(e,t){var n="language-main-".concat(t),r="language-radio-main-".concat(n);return he().createElement("label",{key:n,htmlFor:r,className:"templately-fsi-ai-sidebar-conversation-language"},he().createElement("input",{id:r,type:"radio",name:"language",value:n,checked:J.trim()===e.trim(),onChange:function(){gt(e),Ot(e)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown language","templately")))}),he().createElement(NF,{open:k,onOpenChange:O,content:he().createElement(jt,null)},he().createElement("span",{className:"templately-fsi-ai-sidebar-conversation-language-more-button"},ae.length-2,"+")))):null)):he().createElement("form",{className:"templately-fsi-ai-sidebar-conversation-form",onSubmit:ft},"description"===(null==H?void 0:H.key)?he().createElement("textarea",{className:"templately-fsi-ai-sidebar-conversation-input",placeholder:(0,At.__)("Type your answer...","templately"),value:J,onChange:function(e){var t,n;return gt(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),ft(e))},autoFocus:!0}):he().createElement("input",{type:"contactNumber"===(null==H?void 0:H.key)?"tel":"email"===(null==H?void 0:H.key)?"email":"text",className:"templately-fsi-ai-sidebar-conversation-input",placeholder:"email"===(null==H?void 0:H.key)?(0,At.__)("Enter your email address...","templately"):"contactNumber"===(null==H?void 0:H.key)?(0,At.__)("Enter your phone number...","templately"):(0,At.__)("Type your answer...","templately"),value:J,onChange:function(e){var t,n;return gt(null!==(t=null==e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"")},autoFocus:!0}),"email"===(null==H?void 0:H.key)&&!Ve.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Ve.errorMessage),"contactNumber"===(null==H?void 0:H.key)&&!qe.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},qe.errorMessage)),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-button-wrapper"},DP(z,null==H?void 0:H.key)&&he().createElement("button",{onClick:Et,disabled:pt,className:"templately-fsi-ai-sidebar-conversation-skip-button",type:"button",title:pt?(0,At.__)("Please finish editing conversations before skipping","templately"):(0,At.__)("Skip this question","templately")},(0,At.__)("Skip","templately")),"language"!==(null==H?void 0:H.key)&&he().createElement("button",{onClick:function(){return DP(z,null==H?void 0:H.key)&&PP(J)?Et():Ot("category"===(null==H?void 0:H.key)?Q:J)},disabled:pt||("category"===(null==H?void 0:H.key)?!(null!=Q&&Q.trim()&&Ye.isValid):"email"===(null==H?void 0:H.key)?!(null!=J&&J.trim()&&Ve.isValid):"contactNumber"===(null==H?void 0:H.key)?!(null!=J&&J.trim())||!qe.isValid&&!PP(J):!(null!=J&&J.trim())),className:"templately-fsi-ai-sidebar-conversation-submit-button",type:"button","aria-label":(0,At.__)("Submit answer","templately"),title:pt?(0,At.__)("Please finish editing conversations before submitting","templately"):(0,At.__)("Submit answer","templately")},he().createElement(bP,null))))))))):he().createElement(he().Fragment,null))});var zI=he().memo(function(e){var t=e.isOpenWarningPopover,n=e.open,r=e.onOpenChange,o=e.children,i=e.content;return he().createElement(AF,{open:n,onOpenChange:r},he().createElement(TF,{asChild:!0},o),he().createElement(FF,null,he().createElement(MF,{style:t?WI:{},className:"templately-fsi-ai-sidebar-credit-limit-panel",sideOffset:12,align:"end"},i)))});zI.displayName="CreditLimitPopover";var WI={backgroundColor:"#fbf3f3",border:"1px solid #ff7a8e"};const UI=zI;function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const GI=gn(function(e){var t,n;return{aiSidebarContext:null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.aiSidebarContext)&&void 0!==t?t:{id:null,show:!1,content:{},expanded:!1}}},function(e){return{hideAiSidebar:function(){try{return e(function(){return{type:Jo,payload:_y({id:null,show:!1},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())}catch(e){return console.error("Error dispatching hideAiSidebar:",e),null}}}})(function(e){var t=e.className,n=void 0===t?"":t,r=e.aiSidebarContext,o=void 0===r?{id:null,show:!1,content:{},expanded:!1}:r,i=e.hideAiSidebar,a=e.packId,l=ce((0,pe.useState)(function(){return{show:!1,showAnimation:!1,hideAnimation:!1,finishAnimation:!1}}),2),s=l[0],c=l[1],u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1],f=ce((0,pe.useState)(!1),2),h=f[0],m=f[1],g=ce((0,pe.useState)(!1),2),v=g[0],y=g[1],b=xn(function(e){return e.general.fullSiteImport.availableCredit},Jt),w=(0,pe.useMemo)(function(){var e=null!=b?b:{is_first_generation:null,available_credit:0,purchased_credit:0,subscription_credit:0,subscription_plan:{billing_interval:"",type:""},total_credit:0,total_used_credit:0,estimated_cost:0};return{is_first_generation:e.is_first_generation,available_credit:Number(e.available_credit)||0,purchased_credit:Number(e.purchased_credit)||0,subscription_credit:Number(e.subscription_credit)||0,subscription_plan:e.subscription_plan||{billing_interval:"",type:""},total_credit:Number(e.total_credit)||0,total_used_credit:Number(e.total_used_credit)||0,estimated_cost:Number(e.estimated_cost)||0}},[b]),E=xn(function(e){var t,n;return null===(t=null===(n=e.general.fullSiteImport.packInfo)||void 0===n?void 0:n.loading)||void 0===t||t},Jt);(0,pe.useEffect)(function(){!E&&null!==w.is_first_generation&&s.show&&(w.is_first_generation||(!w.available_credit||w.available_credit<w.estimated_cost)&&(m(function(e){return e||!0}),y(function(e){return e||!0})))},[w,E,s.show]);var k=(0,pe.useRef)(null);(0,pe.useEffect)(function(){if(k.current&&(clearTimeout(k.current),k.current=null),null!=o&&o.show){c(function(e){return HI(HI({},e),{},{show:!0,showAnimation:!0})});var e=document.querySelector("body");e&&e.classList.add("templately-fsi-ai-sidebar-open"),k.current=setTimeout(function(){c(function(e){return HI(HI({},e),{},{showAnimation:!1})})},300)}return function(){k.current&&(clearTimeout(k.current),k.current=null)}},[null==o?void 0:o.show]);var O=(0,pe.useCallback)(function(e){p(e)},[]),S=(0,pe.useCallback)(function(){if(d)try{if(!window.confirm((0,At.__)("Are you sure you want to cancel the template building process? Note: Credits will be deducted based on usage.","templately")))return}catch(e){return void console.error("Error showing confirmation dialog:",e)}k.current&&(clearTimeout(k.current),k.current=null),m(!1),y(!1),p(!1);var e=document.querySelector("body");e&&e.classList.remove("templately-fsi-ai-sidebar-open"),c(function(e){return HI(HI({},e),{},{hideAnimation:!0})}),k.current=setTimeout(function(){null==i||i(),c(function(e){return HI(HI({},e),{},{show:!1,hideAnimation:!1})})},300)},[i,d]),x=(0,pe.useMemo)(function(){return["templately-fsi-ai-sidebar",n,null!=o&&o.expanded?"expanded":"",null!=s&&s.showAnimation?"show-animation":"",null!=s&&s.hideAnimation?"hide-animation":"",null!=s&&s.finishAnimation?"finish-animation":""].filter(Boolean).join(" ")},[n,s,null==o?void 0:o.expanded]),_=(0,pe.useMemo)(function(){return["templately-fsi-ai-sidebar-overlay",null!=s&&s.showAnimation?"show-animation":"",null!=s&&s.hideAnimation?"hide-animation":"",null!=s&&s.finishAnimation?"finish-animation":""].filter(Boolean).join(" ")},[s]),C=(0,pe.useCallback)(function(){var e,t,n="recurring",r=w.total_used_credit,o=w.total_credit,i=w.available_credit,a=w.subscription_credit,l=w.purchased_credit,s=w.estimated_cost,c=(null===(e=w.subscription_plan)||void 0===e?void 0:e.type)||"one_time",u=o>0?Math.min(Math.round(r/o*100),100):0;return he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-header"},he().createElement("h3",{className:"templately-fsi-ai-sidebar-credit-limit-panel-title"},(0,At.__)("Your AI Credits","templately")),he().createElement("a",{href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",target:"_blank",className:"templately-fsi-ai-sidebar-credit-limit-panel-increase-limit-btn"},!i||i<s?(0,At.__)("Buy Credits","templately"):(0,At.__)("Increase Limit","templately"))),c===n&&a?he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-credits-info"},"(".concat(a," ").concat((0,At.__)("AI Credits","templately"),"/").concat((0,At.__)("Month","templately")," + ").concat(l," ").concat((0,At.__)("AI Credits","templately"),")")):he().createElement(he().Fragment,null),he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-usage-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-usage-text"},"".concat(null==r?void 0:r.toLocaleString(),"/").concat(null==o?void 0:o.toLocaleString()," ").concat((0,At.__)("Credits","templately"))),he().createElement("span",{className:"templately-fsi-ai-sidebar-credit-limit-panel-credits-reset-info"},i?c===n&&a?"".concat((0,At.__)("Monthly reset in","templately")," ").concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n+1,0);if(e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){var o=24-e.getHours();return"".concat(o," hour").concat(1!==o?"s":"")}var i=r.getDate()-e.getDate();return"".concat(i," day").concat(1!==i?"s":"")}()):(0,At.__)("AI credits validity: Lifetime – use anytime.","templately"):(0,At.__)("To generate AI content - buy credits now!","templately"))),he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-progress-wrapper"},he().createElement("div",{className:"templately-fsi-ai-sidebar-credit-limit-panel-progress-bar",style:{width:"".concat(u,"%")}})),!w.is_first_generation&&s>0&&he().createElement("p",{className:"templately-fsi-ai-sidebar-credit-limit-panel-estimated-credit"},(0,At.__)("Estimated AI Credits for this generation:","templately")," ",he().createElement("strong",null,s)))},[w]);return he().createElement(he().Fragment,null,(null==s?void 0:s.show)&&he().createElement(he().Fragment,null,he().createElement("div",{className:_}),he().createElement("div",{className:x},he().createElement("button",{className:"templately-fixed-sidebar-close",onClick:S,"aria-label":(0,At.__)("Close AI Sidebar","templately")},he().createElement(mP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-content"},he().createElement("div",{className:"templately-fsi-ai-sidebar-header"},he().createElement("div",{className:"templately-fsi-ai-sidebar-header-left"},he().createElement(pP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-header-right"},he().createElement("div",{className:"templately-fsi-ai-sidebar-header-right-bg"},he().createElement(fP,null)),!E&&he().createElement(UI,{isOpenWarningPopover:v,open:h,onOpenChange:m,content:he().createElement(C,null)},he().createElement("button",{className:"templately-fsi-ai-sidebar-header-right-button"},he().createElement("span",{className:"templately-fsi-ai-sidebar-header-right-icon"},he().createElement(gP,null)),he().createElement("span",{className:"templately-fsi-ai-sidebar-header-right-content"},"".concat(w.available_credit>0?"".concat(w.available_credit.toLocaleString()," ").concat((0,At.__)("Credits Left","templately")):(0,At.__)("No Credit Remaining","templately"))))))),he().createElement(BI,{setSidebarShowState:c,creditDataLoading:E,creditData:w,packId:a,hideAiSidebar:i,creditLimitPopoverOpen:h,setCreditLimitPopoverOpen:m,setCreditLimitWarningPopover:y,onGeneratingProgressVisibilityChange:O,handleSidebarClose:S,showErrorAlert:function(e){xl({icon:"info",showCloseButton:!0,html:he().createElement(oC,{title:(0,At.__)("Oops!","templately"),content:e})},!1)}})))))}),qI=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"38.4",height:"38.4",fill:"none",viewBox:"0 0 48 48"},e),pe.createElement("g",{clipPath:"url(#clip0_20086_7974)"},pe.createElement("path",{fill:"currentColor",d:"M17.626 23.224c.914-.76 1.836-.76 2.772.022l.216.196 9.972 9.972.188.166a2 2 0 0 0 2.806-2.806l-.166-.188L30.83 28l.584-.586.212-.19c.914-.76 1.836-.76 2.772.022l.216.196 9.348 9.35a8 8 0 0 1-7.55 7.198L36 44H12a8 8 0 0 1-7.96-7.206l13.374-13.38zM36 4a8 8 0 0 1 7.99 7.6l.01.4v19.17l-6.586-6.584-.3-.274c-2.512-2.19-5.7-2.194-8.192-.034l-.308.28-.614.612-4.586-4.584-.3-.274c-2.512-2.19-5.7-2.194-8.192-.034l-.308.28L4 31.17V12a8 8 0 0 1 7.6-7.99L12 4zm-5.98 10-.254.014a2 2 0 0 0 0 3.972L30 18l.254-.014a2 2 0 0 0 0-3.972z"})))},QI=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"38.4",height:"38.4",fill:"none",viewBox:"0 0 48 48"},e),pe.createElement("g",{clipPath:"url(#clip0_20086_7969)"},pe.createElement("path",{fill:"currentColor",d:"M24 8c8.58 0 15.726 4.858 21.33 14.308l.44.758.09.2.06.166.028.11.028.164.022.2v.22l-.028.222q-.02.112-.052.22l-.078.216-.072.15-.032.06c-5.528 9.672-12.6 14.76-21.11 14.998L24 40c-8.792 0-16.074-5.098-21.736-15.008a2 2 0 0 1 0-1.984C7.926 13.098 15.208 8 24 8m0 10a6 6 0 1 0 0 12 6 6 0 0 0 0-12"})))},$I=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14"},e,{style:{fill:"currentColor",height:"14px",width:"14px"}}),pe.createElement("path",{d:"M3.5 11.666a.56.56 0 0 1-.416-.168.56.56 0 0 1-.168-.415q0-.248.168-.416a.56.56 0 0 1 .415-.168h7q.248 0 .416.168t.168.416a.56.56 0 0 1-.168.415.56.56 0 0 1-.416.168zm.408-2.042q-.423 0-.751-.277a1.14 1.14 0 0 1-.401-.7l-.584-3.704a.3.3 0 0 0-.065.007.3.3 0 0 1-.066.008.84.84 0 0 1-.62-.256.84.84 0 0 1-.255-.62q0-.363.255-.62a.84.84 0 0 1 .62-.254q.365 0 .62.255t.255.62a.8.8 0 0 1-.022.19 1 1 0 0 1-.05.16l1.822.816 1.823-2.493a.9.9 0 0 1-.365-.715q0-.365.256-.62A.84.84 0 0 1 7 1.166q.363 0 .62.255.255.255.254.62a.898.898 0 0 1-.365.715l1.824 2.493 1.823-.816a1 1 0 0 1-.051-.16.8.8 0 0 1-.022-.19q0-.365.255-.62a.84.84 0 0 1 .62-.255q.365 0 .62.255t.255.62-.255.62a.84.84 0 0 1-.62.255.3.3 0 0 1-.066-.008.3.3 0 0 0-.066-.007l-.583 3.704a1.14 1.14 0 0 1-.4.7q-.33.277-.752.277z"}))},YI=function(e){var t=e.isPro,n=e.className,r=e.showTitle,o=void 0===r||r,i=Vn()({"templately-pro":t,"templately-free":!t},n),a=t?(0,At.__)("Pro","templately"):(0,At.__)("Starter","templately");return React.createElement("div",{className:i},t&&React.createElement($I,null),o&&React.createElement("span",{className:"templately-badge-title"},a))};var XI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),KI=pe.forwardRef((e,t)=>(0,KP.jsx)(oA.span,{...e,ref:t,style:{...XI,...e.style}}));KI.displayName="VisuallyHidden";var ZI=KI,[JI,eN]=ZP("Tooltip",[QA]),tN=QA(),nN="TooltipProvider",rN=700,oN="tooltip.open",[iN,aN]=JI(nN),lN=e=>{const{__scopeTooltip:t,delayDuration:n=rN,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=pe.useRef(!0),l=pe.useRef(!1),s=pe.useRef(0);return pe.useEffect(()=>{const e=s.current;return()=>window.clearTimeout(e)},[]),(0,KP.jsx)(iN,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:pe.useCallback(()=>{window.clearTimeout(s.current),a.current=!1},[]),onClose:pe.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:pe.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:i})};lN.displayName=nN;var sN="Tooltip",[cN,uN]=JI(sN),dN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,s=aN(sN,e.__scopeTooltip),c=tN(t),[u,d]=pe.useState(null),p=PA(),f=pe.useRef(0),h=a??s.disableHoverableContent,m=l??s.delayDuration,g=pe.useRef(!1),[v,y]=vT({prop:r,defaultProp:o??!1,onChange:e=>{e?(s.onOpen(),document.dispatchEvent(new CustomEvent(oN))):s.onClose(),i?.(e)},caller:sN}),b=pe.useMemo(()=>v?g.current?"delayed-open":"instant-open":"closed",[v]),w=pe.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,y(!0)},[y]),E=pe.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y(!1)},[y]),k=pe.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,y(!0),f.current=0},m)},[m,y]);return pe.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,KP.jsx)(cT,{...c,children:(0,KP.jsx)(cN,{scope:t,contentId:p,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:pe.useCallback(()=>{s.isOpenDelayedRef.current?k():w()},[s.isOpenDelayedRef,k,w]),onTriggerLeave:pe.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:w,onClose:E,disableHoverableContent:h,children:n})})};dN.displayName=sN;var pN="TooltipTrigger",fN=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=uN(pN,n),i=aN(pN,n),a=tN(n),l=XP(t,pe.useRef(null),o.onTriggerChange),s=pe.useRef(!1),c=pe.useRef(!1),u=pe.useCallback(()=>s.current=!1,[]);return pe.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,KP.jsx)(uT,{asChild:!0,...a,children:(0,KP.jsx)(oA.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:QP(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),c.current=!0))}),onPointerLeave:QP(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:QP(e.onPointerDown,()=>{o.open&&o.onClose(),s.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:QP(e.onFocus,()=>{s.current||o.onOpen()}),onBlur:QP(e.onBlur,o.onClose),onClick:QP(e.onClick,o.onClose)})})});fN.displayName=pN;var hN="TooltipPortal",[mN,gN]=JI(hN,{forceMount:void 0}),vN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=uN(hN,t);return(0,KP.jsx)(mN,{scope:t,forceMount:n,children:(0,KP.jsx)(hT,{present:n||i.open,children:(0,KP.jsx)(fT,{asChild:!0,container:o,children:r})})})};vN.displayName=hN;var yN="TooltipContent",bN=pe.forwardRef((e,t)=>{const n=gN(yN,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=uN(yN,e.__scopeTooltip);return(0,KP.jsx)(hT,{present:r||a.open,children:a.disableHoverableContent?(0,KP.jsx)(SN,{side:o,...i,ref:t}):(0,KP.jsx)(wN,{side:o,...i,ref:t})})}),wN=pe.forwardRef((e,t)=>{const n=uN(yN,e.__scopeTooltip),r=aN(yN,e.__scopeTooltip),o=pe.useRef(null),i=XP(t,o),[a,l]=pe.useState(null),{trigger:s,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=pe.useCallback(()=>{l(null),d(!1)},[d]),f=pe.useCallback((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...o,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);l(i),d(!0)},[d]);return pe.useEffect(()=>()=>p(),[p]),pe.useEffect(()=>{if(s&&u){const e=e=>f(e,u),t=e=>f(e,s);return s.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{s.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[s,u,f,p]),pe.useEffect(()=>{if(a){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=s?.contains(t)||u?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e],l=t[i],s=a.x,c=a.y,u=l.x,d=l.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(o=!o)}return o}(n,a);r?p():o&&(p(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[s,u,a,c,p]),(0,KP.jsx)(SN,{...e,ref:i})}),[EN,kN]=JI(sN,{isInside:!1}),ON=function(e){const t=({children:e})=>(0,KP.jsx)(KP.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=nA,t}("TooltipContent"),SN=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,s=uN(yN,n),c=tN(n),{onClose:u}=s;return pe.useEffect(()=>(document.addEventListener(oN,u),()=>document.removeEventListener(oN,u)),[u]),pe.useEffect(()=>{if(s.trigger){const e=e=>{const t=e.target;t?.contains(s.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[s.trigger,u]),(0,KP.jsx)(cA,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,KP.jsxs)(dT,{"data-state":s.stateAttribute,...c,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,KP.jsx)(ON,{children:r}),(0,KP.jsx)(EN,{scope:n,isInside:!0,children:(0,KP.jsx)(ZI,{id:s.contentId,role:"tooltip",children:o||r})})]})})});bN.displayName=yN;var xN="TooltipArrow",_N=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=tN(n);return kN(xN,n).isInside?null:(0,KP.jsx)(pT,{...o,...r,ref:t})});_N.displayName=xN;var CN=lN,DN=dN,PN=fN,AN=vN,TN=bN,FN=_N,MN=["children","content","side","align","sideOffset","alignOffset","open","onOpenChange","className","disabled","enableClick"],IN={content:{backgroundColor:"#1F2128",color:"#fff",padding:"5px 10px",fontSize:"12px",borderRadius:"6px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",zIndex:1e4,maxWidth:"300px",wordWrap:"break-word"},arrow:{fill:"#1F2128"}};const NN=function(e){var t=e.children,n=e.content,r=e.side,o=void 0===r?"top":r,i=e.align,a=void 0===i?"center":i,l=e.sideOffset,s=void 0===l?5:l,c=e.alignOffset,u=void 0===c?0:c,d=e.open,p=e.onOpenChange,f=e.className,h=void 0===f?"":f,m=e.disabled,g=void 0!==m&&m,v=e.enableClick,y=void 0!==v&&v,b=Wn(e,MN),w=ce((0,pe.useState)(!1),2),E=w[0],k=w[1],O=ce((0,pe.useState)(!1),2),S=O[0],x=O[1],_=y?E||S:d;return(0,pe.useEffect)(function(){if(y){var e=function(e){if(E){var t=e.target,n=document.querySelectorAll('[data-slot="tooltip"], [data-slot="tooltip-trigger"], [data-slot="tooltip-content"]');Array.from(n).some(function(e){return e.contains(t)})||k(!1)}};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[E,y]),g||!n?t:he().createElement(CN,{delayDuration:0},he().createElement(DN,re({open:_,onOpenChange:function(e){y?E||x(e):p&&p(e)}},b),he().createElement(PN,{asChild:!0,onClick:function(){y&&(k(!E),x(!1))}},t),he().createElement(AN,null,he().createElement(TN,{side:o,align:a,sideOffset:s,alignOffset:u,className:"templately-custom-tooltip ".concat(h),style:IN.content,"data-slot":"tooltip-content"},n,he().createElement(FN,{className:"templately-custom-tooltip-arrow",style:IN.arrow})))))};function jN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jN(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const RN=function(e){var t=e.url,n=e.name,r=void 0===n?"":n,o=e.thumbnail,i=e.alt,a=e.screenshotsEnabled,l=e.price,s=e.isPack,c=void 0!==s&&s,u=e.urlProps,d=(a.hasShots,a.setIsOpen),p=function(){var e=u||{},t=e.isPurchased,n=e.isSubscribed;return 0===parseInt(l)?(0,At.sprintf)("Starter %s",c?"pack":"item"):t||n?(0,At.sprintf)("You own this %s",c?"pack":"item"):(0,At.sprintf)("Buy Now")},f=ce((0,pe.useState)(!1),2),h=f[0],m=f[1],g=ce((0,pe.useState)("95%"),2),v=g[0],y=g[1],b=dP({query:"(max-width: 480px)"}),w=dP({query:"(max-width: 768px)"}),E=ce((0,pe.useState)(b?"phone":w?"tablet":"desktop"),2),k=E[0],O=E[1],S={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(3, 6, 60, 0.8)",zIndex:3},content:{position:"absolute",top:"50%",left:"50%",right:0,bottom:"auto",border:"none",background:"white",borderRadius:"2.5rem",outline:"none",padding:0,transform:"translate(-50%, -50%)",width:v,maxWidth:"96%",height:"90vh"}},x=Vn()("templately-item-details-banner-wrapper",{"is-pack":c}),_=ce((0,pe.useState)("liveDemo"),2),C=(_[0],_[1],ce(null==r?void 0:r.split(" - ",2),2)),D=C[0],P=void 0===D?"":D,A=C[1],T=void 0===A?"":A,F=function(){var e=u||{},t=e.isPurchased,n=e.isSubscribed,r=parseInt(l);return!t&&!n&&0!==r},M=function(){if(F())return I((null==u?void 0:u.name)||"Pack",null==u?void 0:u.id,null==u?void 0:u.slug,null==u?void 0:u.coupon,(null==u?void 0:u.type)||"pack",null==u?void 0:u.sites)},I=function(e,t,n,r,o,i){var a,l="https://templately.com/".concat(o,"/").concat(n);null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.dev_api&&(l="https://templately.dev/".concat(o,"/").concat(n));var s={action:"payment",type:o,item_id:t,utm_source:"plugin",utm_medium:"purchaseButton"};return r&&(s.coupon=r),i&&(s.sites=i),(0,vi.addQueryArgs)(l,s)};return React.createElement(React.Fragment,null,React.createElement("div",{className:x},React.createElement("div",{className:"templately-item-details-header"},React.createElement("div",{className:"templately-item-details-header-left"},React.createElement("h3",{className:"templately-item-details-title"},React.createElement("span",{className:"templately-item-details-title-primary ".concat(T?" has-secondary":"")},"".concat(P).concat(T?" - ":"")),T?React.createElement("span",{className:"templately-item-details-title-secondary"},T):""),React.createElement(YI,{className:"templately-item-details-badge",isPro:+l>0})),React.createElement("div",{className:"templately-item-details-header-right"},0===+l?React.createElement(React.Fragment,null):React.createElement("span",{className:"templately-item-details-price"},"$",l),React.createElement("a",{href:F()?(0,vi.addQueryArgs)(t,{live_demo:1,buy_url:M(),buy_text:p()}):(0,vi.addQueryArgs)(t,{live_demo:1,buy_text:p()}),onClick:function(e){e.stopPropagation()},target:"_blank",className:"templately-item-details-title-live-demo-button"},(0,At.__)("Live Demo","templately")))),o&&React.createElement("div",{className:"templately-item-details-banner"},React.createElement("div",{className:"templately-item-details-banner-inner"},React.createElement("img",{src:o,alt:i,className:"templately-item-details-banner-image"}),React.createElement("div",{className:"templately-item-details-banner-overlay"},React.createElement("a",{href:F()?(0,vi.addQueryArgs)(t,{live_demo:1,buy_url:M(),buy_text:p()}):(0,vi.addQueryArgs)(t,{live_demo:1,buy_text:p()}),onClick:function(e){e.stopPropagation()},target:"_blank",className:"templately-item-details-banner-overlay-button"},React.createElement(QI,null)),React.createElement("button",{type:"button",onClick:function(){d(!0)},className:"templately-item-details-banner-overlay-button"},React.createElement(qI,null)))))),React.createElement(N_(),{isOpen:h,onRequestClose:function(){return m(!1)},onAfterClose:function(){return y("95%")},contentLabel:"LiveDemoModal ".concat("tablet"===k?"tablet":"phone"===k?"phone":"desktop"),style:{overlay:S.overlay,content:LN({},S.content)},appElement:document.getElementById("wpbody")||document.body},React.createElement("div",{className:"tly__preview__head ".concat("tablet"===k?"tly__tablet__active":"phone"===k?"tly__mobile__active":"")},React.createElement("h5",{className:"tly__preview__product__name"},"Live Demo"),React.createElement("div",{className:"tly__preview__controller__group tly__preview__controller__group"},React.createElement("button",{className:"tly__preview__control ".concat("desktop"===k?"tly__active":""," "),onClick:function(){return O("desktop")}},React.createElement("i",{className:"dashicons dashicons-desktop"})),React.createElement("button",{className:"tly__preview__control ".concat("tablet"===k?"tly__active":""),onClick:function(){return O("tablet")}},React.createElement("i",{className:"dashicons dashicons-tablet"})),React.createElement("button",{className:"tly__preview__control ".concat("phone"===k?"tly__active":"","\n"),onClick:function(){return O("phone")}},React.createElement("i",{className:"dashicons dashicons-smartphone"}))),React.createElement("div",{className:"tly__live__link"},t&&React.createElement("a",{className:"tly__danger__button",href:t,target:"_blank",rel:"noreferrer"},"Go Live"))),React.createElement("div",{className:"tly__preview__body"},React.createElement("iframe",{src:t,width:"100%",height:"100%"})),React.createElement("div",{className:"tly__modal__closer",onClick:function(){return m(!1)}})))},BN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 25"},e,{style:{fill:"currentColor",height:"24px",width:"24px"}}),pe.createElement("path",{d:"m18 20.971-1.45-1.45a.48.48 0 0 0-.7 0 .48.48 0 0 0 0 .7l1.95 1.95q.15.15.325.213.175.062.375.062t.375-.062a.9.9 0 0 0 .325-.213l1.95-1.95a.48.48 0 0 0 0-.7.48.48 0 0 0-.7 0L19 20.971v-3.6a.48.48 0 0 0-.15-.35.48.48 0 0 0-.7 0 .48.48 0 0 0-.15.35zm-5.5-7.25q.274 0 .525-.075.25-.075.475-.2l5.075-2.925a.92.92 0 0 0 .45-.612q.1-.413-.1-.763a.92.92 0 0 0-.6-.45.98.98 0 0 0-.75.1L12.5 11.721 7.425 8.796a.98.98 0 0 0-.75-.1.92.92 0 0 0-.6.45.97.97 0 0 0-.088.763q.113.412.463.612l5.05 2.925q.225.125.475.2t.525.075m-9 3.125v-7.95a1.95 1.95 0 0 1 1-1.725l7-4.025q.25-.125.488-.2.237-.075.512-.075.274 0 .525.075.25.075.475.2l7 4.025q.475.275.738.725.262.45.262 1v3.4q0 .45-.375.7a.91.91 0 0 1-.8.125 6 6 0 0 0-.887-.187 7 7 0 0 0-.938-.063q-2.9 0-4.95 2.05t-2.05 4.95v.513q0 .237.05.437.1.626-.363.975-.462.35-.962.075l-5.725-3.3a1.948 1.948 0 0 1-1-1.725m15 8.025q-2.075 0-3.537-1.462Q13.5 21.946 13.5 19.87t1.463-3.537T18.5 14.87t3.538 1.463T23.5 19.87t-1.462 3.538Q20.574 24.87 18.5 24.87"}))},zN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),pe.createElement("path",{d:"M42.666 256c0-117.821 95.513-213.333 213.334-213.333v64c-82.475 0-149.333 66.859-149.333 149.333h-64z"}))},WN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),pe.createElement("path",{d:"M250.389 73.441a18.9 18.9 0 0 1 19.979-.011z"}),pe.createElement("path",{d:"M260.387 70.579a18.9 18.9 0 0 0-9.998 2.861 18.9 18.9 0 0 0-5.928 5.857l-.724 1.132-52.532 119.306-122.318 8.147-3.098.63-1.63.698a18.9 18.9 0 0 0-5.949 4.033 18.96 18.96 0 0 0-4.901 8.564 18.9 18.9 0 0 0 2.676 15.44l1.389 2.035 99.172 81.757-31.343 124.293-.364 3.053.153 1.771a18.91 18.91 0 0 0 8.59 14.268 18.94 18.94 0 0 0 9.309 2.995l.185.007c1.478.058 2.867-.06 4.133-.291l3.697-.673 109.613-76.106 109.382 76.146 3.765.663c1.978.347 4.084.394 6.228.051a18.9 18.9 0 0 0 8.921-3.961 19 19 0 0 0 5.802-8.001 18.8 18.8 0 0 0 1.226-6.465l.031-2.246-31.377-125.505 97.878-80.916 2.169-2.373.926-1.579a18.9 18.9 0 0 0 2.346-6.494l.033-.214a18.91 18.91 0 0 0-6.875-17.61l-.077-.062a19 19 0 0 0-5.555-3.045l-2.192-.758-123.313-8.253-52.755-119.196-.633-1.02a18.9 18.9 0 0 0-16.062-8.938z"}))},UN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 512 512"},e),pe.createElement("path",{d:"m245.913 449.478-29.461-26.412q-51.301-46.223-84.826-79.745-33.524-33.524-53.334-60.192-19.81-26.666-27.683-49.015c-7.873-22.349-7.873-30.137-7.873-45.714q0-47.746 32-79.746c32-32 47.916-32 79.746-32q26.412 0 50.286 11.175c23.874 11.175 29.63 17.947 41.144 31.492q17.268-20.318 41.143-31.492 23.87-11.175 50.286-11.175 47.745 0 79.745 32c32 32 32 47.915 32 79.746q.001 23.365-7.873 45.714c-7.874 22.349-14.478 31.239-27.682 49.015q-19.811 26.667-53.334 60.192-33.525 33.522-84.826 79.745l-29.459 26.412z"}))},VN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 512 512"},e),pe.createElement("path",{d:"m245.913 449.478-29.461-26.412q-51.301-46.223-84.826-79.745-33.524-33.524-53.334-60.192-19.81-26.666-27.683-49.015c-7.873-22.349-7.873-30.137-7.873-45.714q0-47.746 32-79.746c32-32 47.916-32 79.746-32q26.412 0 50.286 11.175c23.874 11.175 29.63 17.947 41.144 31.492q17.268-20.318 41.143-31.492 23.87-11.175 50.286-11.175 47.745 0 79.745 32c32 32 32 47.915 32 79.746q.001 23.365-7.873 45.714c-7.874 22.349-14.478 31.239-27.682 49.015q-19.811 26.667-53.334 60.192-33.525 33.522-84.826 79.745l-29.459 26.412zm0-54.858q48.76-43.68 80.252-74.92 31.493-31.238 49.779-54.348 18.285-23.113 25.397-41.144 7.11-18.032 7.11-35.81.001-30.476-20.317-50.793c-20.318-20.317-30.476-20.317-50.793-20.317q-23.875 0-44.19 13.46-20.318 13.46-27.938 34.285h-38.602q-7.62-20.825-27.936-34.286c-20.316-13.461-28.275-13.46-44.19-13.46q-30.476 0-50.793 20.317c-20.317 20.317-20.317 30.476-20.317 50.793q0 17.778 7.111 35.81c7.111 18.032 13.207 25.735 25.397 41.143q18.286 23.11 49.778 54.348 31.491 31.24 80.255 74.92z"}))},HN=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 512 512"},e),pe.createElement("path",{d:"M250.392 73.441a18.9 18.9 0 0 1 9.998-2.861c3.51 0 6.989.989 10 2.861z"}),pe.createElement("path",{d:"M126.972 457.092a19 19 0 0 1-1.977-6.938l-.153-1.771.364-3.053 31.343-124.293-99.172-81.757-1.389-2.035a18.9 18.9 0 0 1-2.592-5.566 18.91 18.91 0 0 1 10.764-22.47l1.632-.699 3.099-.63 122.316-8.147L243.74 80.427l.724-1.132a18.902 18.902 0 0 1 15.926-8.718c3.51 0 6.989.989 10 2.861a18.953 18.953 0 0 1 5.879 5.784l.184.292.633 1.02 52.755 119.198 123.31 8.251 2.192.758a18.9 18.9 0 0 1 5.555 3.045l.079.062a18.92 18.92 0 0 1 6.875 17.61l-.035.217a18.9 18.9 0 0 1-2.346 6.49l-.928 1.587-2.171 2.37-97.873 80.911 31.377 125.505-.028 2.246a18.9 18.9 0 0 1-1.229 6.465 19 19 0 0 1-5.8 8.001 18.9 18.9 0 0 1-8.921 3.961c-2.144.342-4.25.296-6.23-.051l-3.765-.663-109.377-76.146-109.617 76.106-3.696.673a19 19 0 0 1-4.134.291l-.183-.007a18.92 18.92 0 0 1-15.922-10.327zm179.653-224.175-46.199-104.384-45.963 104.387-102.07 6.798 83.124 68.529-25.999 103.101 91.031-63.204 90.803 63.216-25.779-103.112 82.881-68.517-101.83-6.814z"}))};var GN=["classNamePrefix"];const qN=function(e){var t=e.classNamePrefix;return Wn(e,GN),pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"25",fill:"none",viewBox:"0 0 22 25"},pe.createElement("path",{fill:"url(#temp_paint0_".concat(t,")"),d:"M.603 12.87c0-.43.35-.775.778-.817a7.795 7.795 0 0 0 6.976-6.975c.042-.429.387-.778.817-.778s.775.35.818.778a7.795 7.795 0 0 0 6.976 6.975c.428.042.778.387.778.817s-.35.776-.778.818a7.795 7.795 0 0 0-6.976 6.975c-.043.429-.387.778-.818.778s-.775-.35-.817-.778a7.795 7.795 0 0 0-6.976-6.975c-.429-.042-.778-.387-.778-.818"}),pe.createElement("path",{fill:"url(#temp_paint1_".concat(t,")"),d:"M16.035 3.442c0-.13.105-.233.234-.245a2.34 2.34 0 0 0 2.092-2.093.253.253 0 0 1 .246-.233c.129 0 .232.105.245.233a2.34 2.34 0 0 0 2.093 2.093.253.253 0 0 1 .233.245c0 .129-.105.232-.233.245a2.34 2.34 0 0 0-2.093 2.093.253.253 0 0 1-.245.233.253.253 0 0 1-.246-.233 2.34 2.34 0 0 0-2.092-2.093.253.253 0 0 1-.234-.245"}),pe.createElement("path",{fill:"url(#temp_paint2_".concat(t,")"),d:"M14.32 21.442c0-.172.14-.31.31-.327a3.12 3.12 0 0 0 2.79-2.79.337.337 0 0 1 .328-.311c.172 0 .31.14.327.311a3.12 3.12 0 0 0 2.79 2.79.337.337 0 0 1 .312.327c0 .172-.14.31-.312.327a3.12 3.12 0 0 0-2.79 2.79.337.337 0 0 1-.327.312.337.337 0 0 1-.327-.312 3.12 3.12 0 0 0-2.79-2.79.337.337 0 0 1-.312-.327"}),pe.createElement("defs",null,pe.createElement("linearGradient",{id:"temp_paint0_".concat(t),x1:"9.174",x2:"9.174",y1:"4.3",y2:"21.441",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#E5C8FF"}),pe.createElement("stop",{offset:"1",stopColor:"#BA6DFC"})),pe.createElement("linearGradient",{id:"temp_paint1_".concat(t),x1:"18.607",x2:"18.607",y1:"0.871",y2:"6.013",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#E7CBFF"}),pe.createElement("stop",{offset:"1",stopColor:"#F5E9FF"})),pe.createElement("linearGradient",{id:"temp_paint2_".concat(t),x1:"17.748",x2:"17.748",y1:"18.014",y2:"24.871",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#E7CBFF"}),pe.createElement("stop",{offset:"1",stopColor:"#F5E9FF"}))))},QN=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 25 24"},he().createElement("mask",{id:"mask0_1187_1618",style:{maskType:"alpha"},width:"25",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},he().createElement("path",{fill:"#D9D9D9",d:"M24.81 24H48.81V48H24.81z",transform:"rotate(-180 24.81 24)"})),he().createElement("g",{mask:"url(#mask0_1187_1618)"},he().createElement("path",{fill:"#667085",d:"M9.81 5l1.425 1.4-4.6 4.6H22.81v2H6.635l4.575 4.6-1.4 1.4-7-7 7-7z"})))},$N=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 25 24"},he().createElement("mask",{id:"mask0_1187_1613",style:{maskType:"alpha"},width:"25",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},he().createElement("path",{fill:"#D9D9D9",d:"M0.191 0H24.191V24H0.191z"})),he().createElement("g",{mask:"url(#mask0_1187_1613)"},he().createElement("path",{fill:"#fff",d:"M15.191 19l-1.425-1.4 4.6-4.6H2.191v-2h16.175l-4.575-4.6 1.4-1.4 7 7-7 7z"})))},YN=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"17",fill:"none",viewBox:"0 0 17 17"},he().createElement("path",{fill:"#B7B9BD",d:"M8.258 15.465c-1.79 0-3.348-.593-4.677-1.78-1.328-1.185-2.09-2.667-2.284-4.442H2.89c.182 1.348.781 2.463 1.799 3.344 1.017.882 2.207 1.322 3.568 1.322 1.516 0 2.803-.528 3.86-1.584 1.056-1.057 1.584-2.343 1.584-3.86s-.528-2.803-1.585-3.86C11.061 3.55 9.774 3.02 8.258 3.02a5.25 5.25 0 00-2.508.623 5.78 5.78 0 00-1.963 1.71h2.138V6.91H1.258V2.243h1.555V4.07a6.791 6.791 0 012.421-1.925 6.946 6.946 0 013.024-.68c.972 0 1.883.185 2.732.554.849.37 1.588.869 2.216 1.497a7.115 7.115 0 011.498 2.217c.37.849.554 1.76.554 2.732 0 .972-.185 1.883-.554 2.732a7.114 7.114 0 01-1.498 2.217 7.117 7.117 0 01-2.216 1.497c-.85.37-1.76.554-2.732.554zm2.178-3.733L7.48 8.776v-4.2h1.556v3.578l2.489 2.489-1.09 1.088z"}))};var XN=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function KN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KN(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var JN=function(e,t){var n=e.id,r=e.onChange,o=void 0===r?null:r,i=e.onBlur,a=void 0===i?null:i,l=e.name,s=e.placeholder,c=void 0===s?null:s,u=e.type,d=void 0===u?"text":u,p=(e.withP,e.label),f=e.icon,h=e.typeChange,m=void 0===h?void 0:h,g=e.error,v=Wn(e,XN),y=ce((0,pe.useState)(d),2),b=y[0],w=y[1],E=null!=n?n:l,k={type:b,name:l,id:E},O=null==v?void 0:v.additionalButtons;return(0,pe.useEffect)(function(){m&&w(d)},[]),null!=c&&(k=ZN(ZN({},k),{},{placeholder:c})),null!=a&&(k=ZN(ZN({},k),{},{onBlur:a})),null!=o&&(k=ZN(ZN({},k),{},{onChange:o})),he().createElement("div",{className:"templately-dmc-input templately-dmc-input-".concat(null!=d?d:"text")},he().createElement("div",{className:"templately-dmc-input-label-wrapper"},p&&"checkbox"!==d&&"radio"!==d?he().createElement("label",{htmlFor:E,className:"templately-dmc-input-label"},p):"",O&&O.length>0&&he().createElement("div",{className:"templately-dmc-input-additional-buttons"},O.map(function(e,t){return he().createElement(he().Fragment,{key:t},e)}))),he().createElement("div",{className:"".concat(m?"has-change-button":""," ").concat(f?"has-icon":""," ").concat(null!=g&&g.hasError?"has-error":"")},null!=f?f:"",he().createElement("input",re({ref:t},k,v)),m?he().createElement("button",{onClick:function(){w(b===d?null==m?void 0:m.type:d)}},b===d?null==m?void 0:m.primaryText:null==m?void 0:m.secondaryText):""),!p||"checkbox"!==d&&"radio"!==d?"":he().createElement("label",{htmlFor:E,className:"templately-dmc-input-label"},p),(null==g?void 0:g.hasError)&&he().createElement("div",{className:"templately-dmc-error-message"},he().createElement(Bn,null),null==g?void 0:g.errorMessage))};const ej=he().forwardRef(JN),tj=window.wp.components,nj=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 22"},he().createElement("path",{d:"M12.778 11L5 3.222 7.222 1l10 10-10 10L5 18.778 12.778 11z"}))},rj=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",fill:"none",viewBox:"0 0 11 11"},he().createElement("path",{fill:"#475467",d:"M1.658 10.465l-1.4-1.4 3.6-3.6-3.6-3.575 1.4-1.4 3.6 3.6L8.833.49l1.4 1.4-3.6 3.575 3.6 3.6-1.4 1.4-3.575-3.6-3.6 3.6z"}))},oj=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"51",height:"52",fill:"none",viewBox:"0 0 51 52"},he().createElement("rect",{width:"44",height:"44",x:"3.5",y:"4.142",fill:"#F2F4F7",rx:"22"}),he().createElement("g",{clipPath:"url(#clip0_397_310)"},he().createElement("path",{fill:"#475467",d:"M14.5 28.642a6.495 6.495 0 013.064-5.52 8.001 8.001 0 0115.872 0 6.5 6.5 0 01-2.936 12l-10 .02c-3.356-.274-6-3.078-6-6.5zm15.848 4.487a4.5 4.5 0 002.03-8.31l-.807-.502-.12-.942a6.001 6.001 0 00-11.903 0l-.12.942-.805.503a4.5 4.5 0 002.029 8.309l.173.013h9.35l.173-.013zM26.5 27.142v4h-2v-4h-3l4-5 4 5h-3z"})),he().createElement("rect",{width:"44",height:"44",x:"3.5",y:"4.142",stroke:"#F9FAFB",strokeWidth:"7",rx:"22"}),he().createElement("defs",null,he().createElement("clipPath",{id:"clip0_397_310"},he().createElement("path",{fill:"#fff",d:"M0 0H24V24H0z",transform:"translate(13.5 14.142)"}))))};var ij=function(e){var t=e.name,n=e.color,r=e.setColor,o=e.defaultColor,i=e.setColorPickerOpen,a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=(0,pe.useRef)(null);return(0,pe.useEffect)(function(){i(l)},[l]),function(e){(0,pe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&s(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(c),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-colorpicker-wrap",ref:c},he().createElement("span",{"data-templately-tooltip":(0,At.__)("".concat(t),"templately"),className:"templately-colorpicker-screen tt-top tt-black",onClick:function(){return s(!l)}},he().createElement("span",{className:"templately-picker-display",style:{backgroundColor:n}})),l&&he().createElement("div",{className:"templately-colorpicker"},he().createElement("span",{className:"templately-title"},t),he().createElement(tj.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o}))))};const aj=function(e){var t,n=e.title,r=e.children,o=e.current,i=e.setCurrent,a=e.id,l=ce((0,pe.useState)(null!==(t=e.initialCollapsed)&&void 0!==t&&t),2),s=l[0],c=l[1];return(0,pe.useEffect)(function(){null!=o&&null!=a&&c(o!=a)},[o]),he().createElement("div",{className:"templately-new-collapser"},he().createElement("div",{className:"templately-new-collapser-header ".concat(s?"collapsed":"show"),onClick:function(){null!=o&&null!=a?i(s?a:-1):c(!s)}},he().createElement("h4",{className:"templately-title"},n),he().createElement("div",{className:"templately-icon"},he().createElement(Cn,null))),he().createElement("div",{className:"templately-new-collapser-body ".concat(s?"collapsed":"show")},he().createElement("div",{className:"templately-new-collapser-body-inner"},r)))};var lj=a(124);function sj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uj=function(e,t){var n=En(),r=xn(function(e){var t;return null!==(t=e.general.fullSiteImport.cache_data)&&void 0!==t?t:{}}),o=ce((0,pe.useState)(function(){var n;return null!==(n=r[e])&&void 0!==n?n:t}),2),i=o[0],a=o[1];return(0,pe.useEffect)(function(){void 0!==r[e]&&a(r[e])},[r]),[i,function(t){t=(0,Ea.isFunction)(t)?t(i):t,a(t),n({type:$o,payload:{type:e,value:t}})},function(e){return i}]},dj=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],pj=function(e,t){if(e&&"Default"!==e&&!dj.includes(e)){var n={ru_RU:"cyrillic",uk:"cyrillic",bg_BG:"cyrillic",vi:"vietnamese",el:"greek",he_IL:"hebrew"},r="https://fonts.googleapis.com/css?family="+e+":100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic";n[t]&&(r+="&subset="+n[t]);var o='link[href="'+r+'"]',i=document.createElement("link");if(i.href=r,i.rel="stylesheet",i.type="text/css",i.crossOrigin="anonymous",!document.querySelector(o)){var a=document.querySelectorAll("link"),l=a[a.length-1];l?l.after(i):document.body.appendChild(i)}}};function fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const mj=function(e){var t,n,r=e.label,o=e.title,i=void 0===o?"":o,a=e.screen,l=e.setScreen,s=e.field,c=e.typography,u=e.setTypography,d=null!==(t=c[s][a].value)&&void 0!==t?t:"",p=null!==(n=c[s][a].unit)&&void 0!==n?n:"px",f=function(e,t){var n=t[e]||{};return cj(cj({},{px:{min:0,max:100,step:1},em:{min:.1,max:10,step:.1},rem:{min:.1,max:10,step:.1},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1}}[e]),n)}(p,{selectedSize:{px:{min:1,max:200},em:{max:20},rem:{max:20},vw:{min:.1,max:10,step:.1}},selectedLetterSpacing:{px:{min:-5,max:10,step:.1},em:{min:0,max:1,step:.01},rem:{min:0,max:1,step:.01}},selectedLineHeight:{px:{min:1}}}[s]),h=f.min,m=f.max,g=f.step,v=Math.max(h,Math.min(m,d)),y=function(e){u("".concat(s,".").concat(a,".value"),e),c[s][a].unit||u("".concat(s,".").concat(a,".unit"),p)},b=function(e){l(e)};return(0,pe.useEffect)(function(){c[s][a].unit||u("".concat(s,".").concat(a,".unit"),"px")},[]),he().createElement("div",{className:"templately-typography-picker-field"},he().createElement("label",{className:"templately-typography-picker-field-label"},he().createElement("span",{title:i},r),he().createElement("div",{className:"templately-device-dropdown"},he().createElement("button",{className:"templately-device-dropdown-selected"},"desktop"===a?he().createElement("span",{className:"dashicons dashicons-desktop"}):"tablet"===a?he().createElement("span",{className:"dashicons dashicons-tablet"}):he().createElement("span",{className:"dashicons dashicons-smartphone"})),he().createElement("ul",{className:"templately-device-dropdown-menu"},he().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("desktop"===a?"active":""),onClick:function(){return b("desktop")}},he().createElement("span",{className:"dashicons dashicons-desktop"})),he().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("tablet"===a?"active":""),onClick:function(){return b("tablet")}},he().createElement("span",{className:"dashicons dashicons-tablet"})),he().createElement("li",{className:"templately-device-dropdown-menu-item ".concat("mobile"===a?"active":""),onClick:function(){return b("mobile")}},he().createElement("span",{className:"dashicons dashicons-smartphone"}))))),he().createElement("div",{className:"templately-typography-picker-field-inner"},he().createElement(tj.TextControl,{min:h,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(tj.SelectControl,{value:p||defaultUnit,onChange:function(e){u("".concat(s,".").concat(a),{unit:e,value:null})},options:[{label:"PX",value:"px"},{label:"EM",value:"em"},{label:"REM",value:"rem"},{label:"VW",value:"vw"},{label:"VH",value:"vh"}],label:"Select Option",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(lj.Range,{values:[v],step:g,min:h,max:m,onChange:function(e){return y(e[0])},renderTrack:function(e){var t=e.props,n=e.children;return he().createElement("div",{onMouseDown:t.onMouseDown,onTouchStart:t.onTouchStart,style:hj(hj({},t.style),{},{height:"12px",display:"flex",width:"100%"})},he().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,lj.getTrackBackground)({values:[v],colors:["#798294","#798294"],min:h,max:m}),alignSelf:"center"}},n))},renderThumb:function(e){var t=e.props,n=e.isDragged;return he().createElement("div",re({},t,{key:t.key,style:hj(hj({},t.style),{},{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:"#D0D5DD",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px rgba(16, 24, 40, 0.059)"})}),he().createElement("div",{style:{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:n?"#548BF4":"#D0D5DD"}}))}})))};function gj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xd(e,t)}var vj=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function yj(e,t){return e===t||!(!vj(e)||!vj(t))}function bj(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!yj(e[n],t[n]))return!1;return!0}const wj=function(e,t){var n;void 0===t&&(t=bj);var r,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}};var Ej="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function kj(e){cancelAnimationFrame(e.id)}function Oj(e,t){var n=Ej(),r={id:requestAnimationFrame(function o(){Ej()-n>=t?e.call(null):r.id=requestAnimationFrame(o)})};return r}var Sj=-1;function xj(e){if(void 0===e&&(e=!1),-1===Sj||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Sj=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Sj}var _j=null;function Cj(e){if(void 0===e&&(e=!1),null===_j||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?_j="positive-descending":(t.scrollLeft=1,_j=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),_j}return _j}var Dj=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function Pj(e){var t,n=e.getColumnOffset,r=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,i=e.getColumnWidth,a=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,s=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,u=e.getRowHeight,d=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,h=e.initInstanceProps,m=e.shouldResetStyleCacheOnItemSizeChange,g=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=h(r.props,Dd(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:Dd(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wj(function(e,t,n,o,i,a,l,s){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:l,visibleRowStopIndex:s})}),r._callOnScroll=void 0,r._callOnScroll=wj(function(e,t,n,o,i){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})}),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var o,a=r.props,l=a.columnWidth,s=a.direction,c=a.rowHeight,p=r._getItemStyleCache(m&&l,m&&s,m&&c),f=e+":"+t;if(p.hasOwnProperty(f))o=p[f];else{var h=n(r.props,t,r._instanceProps),g="rtl"===s;p[f]=o={position:"absolute",left:g?void 0:h,right:g?h:void 0,top:d(r.props,e,r._instanceProps),height:u(r.props,e,r._instanceProps),width:i(r.props,t,r._instanceProps)}}return o},r._getItemStyleCache=void 0,r._getItemStyleCache=wj(function(e,__,t){return{}}),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,l=t.scrollHeight,s=t.scrollWidth;r.setState(function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=r.props.direction,c=i;if("rtl"===t)switch(Cj()){case"negative":c=-i;break;case"positive-descending":c=s-o-i}c=Math.max(0,Math.min(c,s-o));var u=Math.max(0,Math.min(a,l-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&kj(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Oj(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}gj(t,e),t.getDerivedStateFromProps=function(e,t){return Aj(e,t),g(e),null};var v=t.prototype;return v.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},v.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,o=e.rowIndex,i=this.props,u=i.columnCount,d=i.height,p=i.rowCount,f=i.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,v=xj();void 0!==r&&(r=Math.max(0,Math.min(r,u-1))),void 0!==o&&(o=Math.max(0,Math.min(o,p-1)));var y=a(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,w=y>d?v:0;this.scrollTo({scrollLeft:void 0!==r?s(this.props,r,n,m,this._instanceProps,w):m,scrollTop:void 0!==o?c(this.props,o,n,g,this._instanceProps,b):g})},v.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},v.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(Cj()){case"negative":o.scrollLeft=-n;break;case"positive-ascending":o.scrollLeft=n;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-n}else o.scrollLeft=Math.max(0,n);o.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},v.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&kj(this._resetIsScrollingTimeoutId)},v.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,o=e.direction,i=e.height,s=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,p=e.itemKey,f=void 0===p?Dj:p,h=e.outerElementType,m=e.outerTagName,g=e.rowCount,v=e.style,y=e.useIsScrolling,b=e.width,w=this.state.isScrolling,E=this._getHorizontalRangeToRender(),k=E[0],O=E[1],S=this._getVerticalRangeToRender(),x=S[0],_=S[1],C=[];if(r>0&&g)for(var D=x;D<=_;D++)for(var P=k;P<=O;P++)C.push((0,pe.createElement)(t,{columnIndex:P,data:d,isScrolling:y?w:void 0,key:f({columnIndex:P,data:d,rowIndex:D}),rowIndex:D,style:this._getItemStyle(D,P)}));var A=a(this.props,this._instanceProps),T=l(this.props,this._instanceProps);return(0,pe.createElement)(h||m||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:re({position:"relative",height:i,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},(0,pe.createElement)(c||u||"div",{children:C,ref:s,style:{height:A,pointerEvents:w?"none":void 0,width:T}}))},v._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,o=e.rowCount;if("function"==typeof n&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],l=i[1],s=i[2],c=i[3],u=this._getVerticalRangeToRender(),d=u[0],p=u[1],f=u[2],h=u[3];this._callOnItemsRendered(a,l,d,p,s,c,f,h)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,v=m.scrollLeft,y=m.scrollTop,b=m.scrollUpdateWasRequested,w=m.verticalScrollDirection;this._callOnScroll(v,y,g,w,b)}},v._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,i=e.overscanColumnsCount,a=e.overscanCount,l=e.rowCount,s=this.state,c=s.horizontalScrollDirection,u=s.isScrolling,d=s.scrollLeft,p=n||i||a||1;if(0===t||0===l)return[0,0,0,0];var f=r(this.props,d,this._instanceProps),h=o(this.props,f,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,p),g=u&&"forward"!==c?1:Math.max(1,p);return[Math.max(0,f-m),Math.max(0,Math.min(t-1,h+g)),f,h]},v._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,l=a.isScrolling,s=a.verticalScrollDirection,c=a.scrollTop,u=r||o||n||1;if(0===t||0===i)return[0,0,0,0];var d=p(this.props,c,this._instanceProps),h=f(this.props,d,c,this._instanceProps),m=l&&"backward"!==s?1:Math.max(1,u),g=l&&"forward"!==s?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(i-1,h+g)),d,h]},t}(pe.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var Aj=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},Tj=function(e,t){return e};function Fj(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,s=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=s(r.props,Dd(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Dd(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wj(function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})}),r._callOnScroll=void 0,r._callOnScroll=wj(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,i=r.props,a=i.direction,l=i.itemSize,s=i.layout,u=r._getItemStyleCache(c&&l,c&&s,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=o(r.props,e,r._instanceProps),f="horizontal"===a||"horizontal"===s,h="rtl"===a,m=f?d:0;u[e]=t={position:"absolute",left:h?void 0:m,right:h?m:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},r._getItemStyleCache=void 0,r._getItemStyleCache=wj(function(e,__,t){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===o)return null;var t=r.props.direction,a=o;if("rtl"===t)switch(Cj()){case"negative":a=-o;break;case"positive-descending":a=i-n-o}return a=Math.max(0,Math.min(a,i-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;r.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&kj(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Oj(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}gj(t,e),t.getDerivedStateFromProps=function(e,t){return Mj(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,o=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var l=0;if(this._outerRef){var s=this._outerRef;l="vertical"===o?s.scrollWidth>s.clientWidth?xj():0:s.scrollHeight>s.clientHeight?xj():0}this.scrollTo(i(this.props,e,t,a,this._instanceProps,l))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===r?o.scrollLeft=n:o.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,o=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(Cj()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&kj(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?Tj:d,f=e.layout,h=e.outerElementType,m=e.outerTagName,g=e.style,v=e.useIsScrolling,y=e.width,b=this.state.isScrolling,w="horizontal"===o||"horizontal"===f,E=w?this._onScrollHorizontal:this._onScrollVertical,k=this._getRangeToRender(),O=k[0],S=k[1],x=[];if(c>0)for(var _=O;_<=S;_++)x.push((0,pe.createElement)(t,{data:u,key:p(_,u),index:_,isScrolling:v?b:void 0,style:this._getItemStyle(_)}));var C=r(this.props,this._instanceProps);return(0,pe.createElement)(h||m||"div",{className:n,onScroll:E,ref:this._outerRefSetter,style:re({position:"relative",height:i,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},g)},(0,pe.createElement)(l||s||"div",{children:x,ref:a,style:{height:w?"100%":C,pointerEvents:b?"none":void 0,width:w?C:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],o=e[3];this._callOnItemsRendered(t,n,r,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,o=r.isScrolling,i=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,s,this._instanceProps),u=l(this.props,c,s,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,n),p=o&&"forward"!==i?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},t}(pe.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Mj=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Ij=function(e,t,n){var r=e.itemSize,o=n.itemMetadataMap,i=n.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var c=r(s);o[s]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return o[t]},Nj=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),a=Ij(e,i,t).offset;if(a===o)return i;a<o?r=i+1:a>o&&(n=i-1)}return r>0?r-1:0},jj=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=n&&(i=n-1),i>=0){var l=r[i];a=l.offset+l.size}return a+(n-i-1)*o},Lj=Fj({getItemOffset:function(e,t,n){return Ij(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:jj,getOffsetForIndexAndAlignment:function(e,t,n,r,o,i){var a=e.direction,l=e.height,s=e.layout,c=e.width,u="horizontal"===a||"horizontal"===s?c:l,d=Ij(e,t,o),p=jj(e,o),f=Math.max(0,Math.min(p-u,d.offset)),h=Math.max(0,d.offset-u+d.size+i);switch("smart"===n&&(n=r>=h-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return r>=h&&r<=f?r:r<h?h:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?r[o].offset:0)>=n?Nj(e,t,o,0,n):function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&Ij(e,n,t).offset<r;)n+=i,i*=2;return Nj(e,t,Math.min(n,o-1),Math.floor(n/2),r)}(e,t,Math.max(0,o),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,c="horizontal"===o||"horizontal"===l?s:i,u=Ij(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=Ij(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),Rj=Pj({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,n,r,o,i){var a=e.columnCount,l=e.columnWidth,s=e.width,c=Math.max(0,a*l-s),u=Math.min(c,t*l),d=Math.max(0,t*l-s+i+l);switch("smart"===n&&(n=r>=d-s&&r<=u+s?"auto":"center"),n){case"start":return u;case"end":return d;case"center":var p=Math.round(d+(u-d)/2);return p<Math.ceil(s/2)?0:p>c+Math.floor(s/2)?c:p;default:return r>=d&&r<=u?r:d>u||r<d?d:u}},getOffsetForRowAndAlignment:function(e,t,n,r,o,i){var a=e.rowHeight,l=e.height,s=e.rowCount,c=Math.max(0,s*a-l),u=Math.min(c,t*a),d=Math.max(0,t*a-l+i+a);switch("smart"===n&&(n=r>=d-l&&r<=u+l?"auto":"center"),n){case"start":return u;case"end":return d;case"center":var p=Math.round(d+(u-d)/2);return p<Math.ceil(l/2)?0:p>c+Math.floor(l/2)?c:p;default:return r>=d&&r<=u?r:d>u||r<d?d:u}},getColumnStartIndexForOffset:function(e,t){var n=e.columnWidth,r=e.columnCount;return Math.max(0,Math.min(r-1,Math.floor(t/n)))},getColumnStopIndexForStartIndex:function(e,t,n){var r=e.columnWidth,o=e.columnCount,i=e.width,a=t*r,l=Math.ceil((i+n-a)/r);return Math.max(0,Math.min(o-1,t+l-1))},getRowStartIndexForOffset:function(e,t){var n=e.rowHeight,r=e.rowCount;return Math.max(0,Math.min(r-1,Math.floor(t/n)))},getRowStopIndexForStartIndex:function(e,t,n){var r=e.rowHeight,o=e.rowCount,i=e.height,a=t*r,l=Math.ceil((i+n-a)/r);return Math.max(0,Math.min(o-1,t+l-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.columnWidth,e.rowHeight}}),Bj=["options","children","maxHeight","getValue","loadedFonts"];function zj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Uj=he().createContext({}),Vj=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=he().useContext(Uj),i=o.setSize,a=o.windowWidth,l=o.loadedFonts,s=o.options,c=he().useRef(),u=s[n];return(0,pe.useEffect)(function(){r||!u.value||l.current.includes(u.value)||(pj(u.value,window.templately.locale),l.current=[].concat(Nl(l.current),[u.value]))},[]),(0,pe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),he().createElement("div",{ref:c},t)};function Hj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const qj=function(e){e.normalizedTypography;var t=e.setShowPicker,n=e.typography,r=e.setTypography,o=e.fontList,i=e.reset,a=e.screen,l=e.setScreen,s=[{label:"Default",value:""},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Capitalize",value:"capitalize"},{label:"Normal",value:"none"}],c=[{label:"Default",value:""},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"},{label:"Underline",value:"underline"},{label:"Underline Overline",value:"underline overline"},{label:"Initial",value:"initial"},{label:"None",value:"none"}],u=[{value:"100",label:"100 (Thin)"},{value:"200",label:"200 (Extra Light)"},{value:"300",label:"300 (Light)"},{value:"400",label:"400 (Normal)"},{value:"500",label:"500 (Medium)"},{value:"600",label:"600 (Semi Bold)"},{value:"700",label:"700 (Bold)"},{value:"800",label:"800 (Extra Bold)"},{value:"900",label:"900 (Black)"},{value:"",label:"Default"},{value:"normal",label:"Normal"},{value:"bold",label:"Bold"}];return(0,pe.useEffect)(function(){pj(n.selectedFont,window.templately.locale)},[n.selectedFont]),he().createElement("td",{className:"templately-typography-picker"},he().createElement("div",{className:"templately-typography-picker-title-wrapper"},he().createElement("div",{className:"templately-typography-picker-title-inner"},he().createElement("h4",{className:"templately-typography-picker-title"},null==n?void 0:n.title),he().createElement("button",{className:"templately-color-picker-reset-button",onClick:i},he().createElement(YN,null))),he().createElement("button",{className:"templately-color-picker-close-button",onClick:function(){return t(!1)}},he().createElement(rj,null))),he().createElement("div",{className:"templately-typography-picker-preview",style:{fontFamily:n.selectedFont,fontSize:"40px",lineHeight:"1.5"}},"Ag"),he().createElement("div",{className:"templately-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Family"),he().createElement("div",{className:"templately-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",value:o.find(function(e){return e.value===n.selectedFont}),options:o,onChange:function(e){return r("selectedFont",e.value)},components:{MenuList:function(t){return function(e){var t,n=e.options,r=e.children,o=e.maxHeight,i=e.getValue,a=e.loadedFonts,l=(Wn(e,Bj),ce(i(),1)[0]),s=null!==(t=n.indexOf(l))&&void 0!==t?t:0,c=he().useRef(),u=he().useRef({}),d=he().useCallback(function(e,t){var n;u.current=Wj(Wj({},u.current),{},Pt({},e,t)),null===(n=c.current)||void 0===n||n.resetAfterIndex(e)},[]),p=function(){var e=ce((0,pe.useState)([0,0]),2),t=e[0],n=e[1];return(0,pe.useLayoutEffect)(function(){function e(){n([window.innerWidth,window.innerHeight])}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}},[]),t}(),f=ce(p,1)[0];return(0,pe.useEffect)(function(){var e;null===(e=c.current)||void 0===e||e.scrollToItem(s,"center")},[]),he().createElement(Uj.Provider,{value:{setSize:d,windowWidth:f,loadedFonts:a,options:n,listRef:c}},he().createElement("div",null,he().createElement(Lj,{useIsScrolling:!0,height:o,itemSize:function(e){return u.current[e]||35},itemCount:r.length,ref:c},function(e){var t=e.index,o=e.style,i=(e.data,e.isScrolling);return he().createElement("div",{style:Wj(Wj({},o),{},{fontFamily:n[t].value})},he().createElement(Vj,{index:t,style:o,isScrolling:i},r[t]))})))}(Gj(Gj({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),he().createElement(mj,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),he().createElement(mj,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),he().createElement(mj,{label:"Letter",title:"Letter Spacing",screen:a,setScreen:l,field:"selectedLetterSpacing",typography:n,setTypography:r}),he().createElement("div",{className:"templately-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Weight"),he().createElement("div",{className:"templately-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",value:u.find(function(e){return e.value===n.selectedFontWeight}),options:u,onChange:function(e){return r("selectedFontWeight",e.value)},className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),he().createElement("div",{className:"templately-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Transform"),he().createElement("div",{className:"templately-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",defaultValue:s.find(function(e){return e.value==n.transform}),onChange:function(e){return r("transform",e.value)},options:s,className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),he().createElement("div",{className:"templately-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-typography-picker-field-label"},"Decoration"),he().createElement("div",{className:"templately-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",defaultValue:c.find(function(e){return e.value==n.decoration}),onChange:function(e){return r("decoration",e.value)},options:c,className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))))};var Qj=function(e){var t=e.setTypographyPickerOpen,n=e.normalizedTypography,r=e.typography,o=e.setTypography,i=e.fontList,a=e.reset,l=e.screen,s=e.setScreen,c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1],p=(0,pe.useRef)(null);return(0,pe.useEffect)(function(){t(u)},[u]),function(e){(0,pe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&d(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(p),(0,pe.useEffect)(function(){null!=r&&r.selectedFont&&pj(r.selectedFont,window.templately.locale)},[r,null==r?void 0:r.selectedFont]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-typography-panel-item",ref:p,key:null==r?void 0:r._id},he().createElement("div",{className:"templately-typography-mini-preview",style:{fontFamily:null==r?void 0:r.selectedFont}},"Ag"),he().createElement("div",{className:"templately-typography-title"},null==r?void 0:r.title),he().createElement("div",{className:"templately-typography-popup-button",onClick:function(){return d(!u)}},he().createElement(Nn,null)),u&&he().createElement(qj,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts})))};function $j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$j(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Xj=function(e){var t=e.normalizedTypography,n=e.selectedTypography,r=e.setSelectedTypography,o=e.groupedData,i=e.setTypographyPickerOpen,a=e.fontList,l=e.screen,s=e.setScreen,c=(0,pe.useRef)([]);if((0,Ea.isEmpty)(t))return React.createElement(React.Fragment,null);var u=(0,pe.useMemo)(function(){var e=dj.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Nl(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Nl(a))},[a]),d=ce((0,pe.useState)(-1),2),p=d[0],f=d[1];return React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-color-picker-section"},React.createElement("div",{className:"templately-color-picker-section-label-wrapper"},React.createElement("div",{style:{display:"flex",alignItems:"center",gap:10}},React.createElement("label",{className:"templately-color-picker-section-label"},"Typography"),React.createElement("div",{className:"templately-device-tab"},React.createElement("button",{className:"templately-device-tab-button ".concat("desktop"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("desktop")}},React.createElement("span",{className:"dashicons dashicons-desktop"})),React.createElement("button",{className:"templately-device-tab-button ".concat("tablet"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("tablet")}},React.createElement("span",{className:"dashicons dashicons-tablet"})),React.createElement("button",{className:"templately-device-tab-button ".concat("mobile"===l?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return s("mobile")}},React.createElement("span",{className:"dashicons dashicons-smartphone"})))),React.createElement("button",{className:"templately-color-picker-reset-button",onClick:function(){r(t)}},React.createElement(YN,null))),React.createElement("div",{className:"templately-typography-panel-wrapper"},o.map(function(e,o){var a=e.key,d=e.items;return React.createElement(aj,{title:a,key:a,initialCollapsed:!0,current:p,setCurrent:f,id:o},React.createElement("div",{className:"templately-typography-panel"},d&&d.map(function(e){var o=e._id;return React.createElement(Qj,{key:o,setTypographyPickerOpen:i,reset:function(){return function(e){r(Yj(Yj({},n),{},Pt({},e,t[e])))}(o)},normalizedTypography:t,typography:n[o],setTypography:function(e,t){return function(e,t,n){r(function(r){var o=Ra(r[e],t,n);return Yj(Yj({},r),{},Pt({},e,o))})}(o,e,t)},fontList:u,screen:l,setScreen:s,loadedFonts:c})})))}))))},Kj="Dialog",[Zj,Jj]=ZP(Kj),[eL,tL]=Zj(Kj),nL=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=pe.useRef(null),s=pe.useRef(null),[c,u]=vT({prop:r,defaultProp:o??!1,onChange:i,caller:Kj});return(0,KP.jsx)(eL,{scope:t,triggerRef:l,contentRef:s,contentId:PA(),titleId:PA(),descriptionId:PA(),open:c,onOpenChange:u,onOpenToggle:pe.useCallback(()=>u(e=>!e),[u]),modal:a,children:n})};nL.displayName=Kj;var rL="DialogTrigger",oL=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tL(rL,n),i=XP(t,o.triggerRef);return(0,KP.jsx)(oA.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":OL(o.open),...r,ref:i,onClick:QP(e.onClick,o.onOpenToggle)})});oL.displayName=rL;var iL="DialogPortal",[aL,lL]=Zj(iL,{forceMount:void 0}),sL=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=tL(iL,t);return(0,KP.jsx)(aL,{scope:t,forceMount:n,children:pe.Children.map(r,e=>(0,KP.jsx)(hT,{present:n||i.open,children:(0,KP.jsx)(fT,{asChild:!0,container:o,children:e})}))})};sL.displayName=iL;var cL="DialogOverlay",uL=pe.forwardRef((e,t)=>{const n=lL(cL,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=tL(cL,e.__scopeDialog);return i.modal?(0,KP.jsx)(hT,{present:r||i.open,children:(0,KP.jsx)(pL,{...o,ref:t})}):null});uL.displayName=cL;var dL=eA("DialogOverlay.RemoveScroll"),pL=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tL(cL,n);return(0,KP.jsx)(lF,{as:dL,allowPinchZoom:!0,shards:[o.contentRef],children:(0,KP.jsx)(oA.div,{"data-state":OL(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fL="DialogContent",hL=pe.forwardRef((e,t)=>{const n=lL(fL,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=tL(fL,e.__scopeDialog);return(0,KP.jsx)(hT,{present:r||i.open,children:i.modal?(0,KP.jsx)(mL,{...o,ref:t}):(0,KP.jsx)(gL,{...o,ref:t})})});hL.displayName=fL;var mL=pe.forwardRef((e,t)=>{const n=tL(fL,e.__scopeDialog),r=pe.useRef(null),o=XP(t,n.contentRef,r);return pe.useEffect(()=>{const e=r.current;if(e)return OT(e)},[]),(0,KP.jsx)(vL,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:QP(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:QP(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:QP(e.onFocusOutside,e=>e.preventDefault())})}),gL=pe.forwardRef((e,t)=>{const n=tL(fL,e.__scopeDialog),r=pe.useRef(!1),o=pe.useRef(!1);return(0,KP.jsx)(vL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),vL=pe.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=tL(fL,n),s=pe.useRef(null),c=XP(t,s);return hA(),(0,KP.jsxs)(KP.Fragment,{children:[(0,KP.jsx)(bA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,KP.jsx)(cA,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":OL(l.open),...a,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),(0,KP.jsxs)(KP.Fragment,{children:[(0,KP.jsx)(CL,{titleId:l.titleId}),(0,KP.jsx)(DL,{contentRef:s,descriptionId:l.descriptionId})]})]})}),yL="DialogTitle",bL=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tL(yL,n);return(0,KP.jsx)(oA.h2,{id:o.titleId,...r,ref:t})});bL.displayName=yL;var wL="DialogDescription";pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tL(wL,n);return(0,KP.jsx)(oA.p,{id:o.descriptionId,...r,ref:t})}).displayName=wL;var EL="DialogClose",kL=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=tL(EL,n);return(0,KP.jsx)(oA.button,{type:"button",...r,ref:t,onClick:QP(e.onClick,()=>o.onOpenChange(!1))})});function OL(e){return e?"open":"closed"}kL.displayName=EL;var SL="DialogTitleWarning",[xL,_L]=function(e,t){const n=pe.createContext(t),r=e=>{const{children:t,...r}=e,o=pe.useMemo(()=>r,Object.values(r));return(0,KP.jsx)(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=pe.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(SL,{contentName:fL,titleName:yL,docsSlug:"dialog"}),CL=({titleId:e})=>{const t=_L(SL),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return pe.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},DL=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_L("DialogDescriptionWarning").contentName}}.`;return pe.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},PL=nL,AL=oL,TL=sL,FL=uL,ML=hL,IL=kL;const NL=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 21 21",className:"ai-builder-onboarding-ai-chat-header-logo"},e),pe.createElement("g",{clipPath:"url(#paint0_angular_50_10_clip_path)","data-figma-skip-parse":"true"},pe.createElement("foreignObject",{width:"1274.23",height:"1274.23",x:"-637.117",y:"-637.117",transform:"matrix(.01356 -.02498 .04769 .0259 10.016 10.016)"},pe.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",opacity:"1",style:{background:"conic-gradient(from 90deg,#62c2fc 0deg,#f2d7bc 57.4692deg,#f4e0c4 153.531deg,#5935d0 218.669deg,#5cc1ff 357.335deg,#62c2fc 360deg)",height:"100%",width:"100%"}}))),pe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956","data-figma-gradient-fill":'{"type":"GRADIENT_ANGULAR","stops":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"stopsVar":[{"color":{"r":0.95190250873565674,"g":0.84607875347137451,"b":0.74025493860244751,"a":1.0},"position":0.15963670611381531},{"color":{"r":0.95686274766921997,"g":0.87843137979507446,"b":0.76862746477127075,"a":1.0},"position":0.42647594213485718},{"color":{"r":0.34901961684226990,"g":0.20784313976764679,"b":0.81568628549575806,"a":1.0},"position":0.60741454362869263},{"color":{"r":0.36078432202339172,"g":0.75686275959014893,"b":1.0,"a":1.0},"position":0.99259722232818604}],"transform":{"m00":27.126356124877930,"m01":95.376968383789062,"m02":-51.235877990722656,"m10":-49.955394744873047,"m11":51.790794372558594,"m12":9.0981588363647461},"opacity":1.0,"blendMode":"NORMAL","visible":true}'}),pe.createElement("defs",null,pe.createElement("clipPath",{id:"paint0_angular_50_10_clip_path"},pe.createElement("path",{d:"M0 10.016c0-.503.409-.906.91-.956A9.11 9.11 0 0 0 9.06.91c.05-.501.453-.91.956-.91s.906.409.955.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.955a9.11 9.11 0 0 0-8.15 8.151c-.05.5-.453.91-.956.91s-.906-.41-.956-.91a9.11 9.11 0 0 0-8.15-8.15c-.501-.05-.91-.453-.91-.956"}))))},jL=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),pe.createElement("path",{fill:"currentColor",d:"M.469 3.57c.259 0 .469-.21.469-.469V.938H3.1a.469.469 0 0 0 0-.938H.47A.47.47 0 0 0 0 .469V3.1c0 .259.21.469.469.469M15.531 0H12.9a.469.469 0 0 0 0 .938h2.164V3.1a.469.469 0 0 0 .937 0V.47A.47.47 0 0 0 15.531 0M15.531 12.43a.47.47 0 0 0-.469.469v2.164H12.9a.469.469 0 0 0 0 .937h2.632c.26 0 .469-.21.469-.469V12.9a.47.47 0 0 0-.469-.469M3.101 15.063H.938v-2.164a.469.469 0 0 0-.938 0v2.632c0 .26.21.469.469.469H3.1a.469.469 0 0 0 0-.937M13.114 5.98V3.02a.266.266 0 0 0-.266-.266H3.152a.266.266 0 0 0-.266.266v2.96c0 .148.119.267.266.267h1.414c.147 0 .266-.12.266-.266V4.967c0-.148.119-.267.266-.267H6.76c.147 0 .266.12.266.267v7.317c0 .147-.12.266-.266.266h-.728a.266.266 0 0 0-.266.266v1.414c0 .147.12.266.266.266h3.934a.266.266 0 0 0 .266-.266v-1.414a.266.266 0 0 0-.266-.266h-.728a.266.266 0 0 1-.266-.267V4.968c0-.148.12-.267.266-.267h1.663c.147 0 .266.12.266.267V5.98c0 .147.12.266.266.266h1.414c.147 0 .266-.12.266-.266"}))},LL=function(e){return pe.createElement("svg",re({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),pe.createElement("g",{clipPath:"url(#clip0_circle)"},pe.createElement("path",{d:"M1.5 6.75C1.5 7.24246 1.597 7.73009 1.78545 8.18506C1.97391 8.64003 2.25013 9.05343 2.59835 9.40165C2.94657 9.74987 3.35997 10.0261 3.81494 10.2145C4.26991 10.403 4.75754 10.5 5.25 10.5C5.74246 10.5 6.23009 10.403 6.68506 10.2145C7.14003 10.0261 7.55343 9.74987 7.90165 9.40165C8.24987 9.05343 8.52609 8.64003 8.71455 8.18506C8.903 7.73009 9 7.24246 9 6.75C9 6.25754 8.903 5.76991 8.71455 5.31494C8.52609 4.85997 8.24987 4.44657 7.90165 4.09835C7.55343 3.75013 7.14003 3.47391 6.68506 3.28545C6.23009 3.097 5.74246 3 5.25 3C4.75754 3 4.26991 3.097 3.81494 3.28545C3.35997 3.47391 2.94657 3.75013 2.59835 4.09835C2.25013 4.44657 1.97391 4.85997 1.78545 5.31494C1.597 5.76991 1.5 6.25754 1.5 6.75Z",stroke:"#737985",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),pe.createElement("path",{d:"M3.5 4.75C3.5 5.24246 3.597 5.73009 3.78545 6.18506C3.97391 6.64003 4.25013 7.05343 4.59835 7.40165C4.94657 7.74987 5.35997 8.02609 5.81494 8.21455C6.26991 8.403 6.75754 8.5 7.25 8.5C7.74246 8.5 8.23009 8.403 8.68506 8.21455C9.14003 8.02609 9.55343 7.74987 9.90165 7.40165C10.2499 7.05343 10.5261 6.64003 10.7145 6.18506C10.903 5.73009 11 5.24246 11 4.75C11 4.25754 10.903 3.76991 10.7145 3.31494C10.5261 2.85997 10.2499 2.44657 9.90165 2.09835C9.55343 1.75013 9.14003 1.47391 8.68506 1.28545C8.23009 1.097 7.74246 1 7.25 1C6.75754 1 6.26991 1.097 5.81494 1.28545C5.35997 1.47391 4.94657 1.75013 4.59835 2.09835C4.25013 2.44657 3.97391 2.85997 3.78545 3.31494C3.597 3.76991 3.5 4.25754 3.5 4.75Z",fill:"#F2F5F7",stroke:"#737985",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_circle"},pe.createElement("rect",{width:"12",height:"12",fill:"white"}))))},RL=function(e){return React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"24",fill:"none",viewBox:"0 0 16 18"},React.createElement("path",{fill:"url(#paint0_linear_2112_1918)",d:"M.5 9c0-.323.262-.582.584-.614a5.846 5.846 0 0 0 5.231-5.231c.032-.321.29-.584.613-.584s.582.263.613.584a5.846 5.846 0 0 0 5.232 5.231c.321.032.583.29.583.614 0 .322-.262.58-.583.613a5.846 5.846 0 0 0-5.232 5.231c-.031.321-.29.584-.613.584s-.581-.263-.613-.584a5.846 5.846 0 0 0-5.231-5.231C.762 9.58.5 9.323.5 9"}),React.createElement("path",{fill:"url(#paint1_linear_2112_1918)",d:"M12.07 1.928a.19.19 0 0 1 .175-.183 1.754 1.754 0 0 0 1.57-1.57.19.19 0 0 1 .184-.175.19.19 0 0 1 .184.175 1.754 1.754 0 0 0 1.57 1.57.19.19 0 0 1 .174.183.19.19 0 0 1-.175.184 1.754 1.754 0 0 0-1.57 1.57.19.19 0 0 1-.183.175.19.19 0 0 1-.184-.175 1.754 1.754 0 0 0-1.57-1.57.19.19 0 0 1-.175-.184"}),React.createElement("path",{fill:"url(#paint2_linear_2112_1918)",d:"M10.786 15.429c0-.13.105-.233.234-.245a2.34 2.34 0 0 0 2.092-2.093.253.253 0 0 1 .245-.234c.13 0 .233.105.246.234a2.34 2.34 0 0 0 2.092 2.093.253.253 0 0 1 .234.245c0 .129-.105.232-.234.245a2.34 2.34 0 0 0-2.092 2.093.253.253 0 0 1-.246.233.253.253 0 0 1-.245-.233 2.34 2.34 0 0 0-2.092-2.093.253.253 0 0 1-.234-.245"}),React.createElement("defs",null,React.createElement("linearGradient",{id:"paint0_linear_2112_1918",x1:"6.928",x2:"6.928",y1:"2.571",y2:"15.428",gradientUnits:"userSpaceOnUse"},React.createElement("stop",{stopColor:"#E5C8FF"}),React.createElement("stop",{offset:"1",stopColor:"#BA6DFC"})),React.createElement("linearGradient",{id:"paint1_linear_2112_1918",x1:"13.999",x2:"13.999",y1:"0",y2:"3.857",gradientUnits:"userSpaceOnUse"},React.createElement("stop",{stopColor:"#E7CBFF"}),React.createElement("stop",{offset:"1",stopColor:"#F5E9FF"})),React.createElement("linearGradient",{id:"paint2_linear_2112_1918",x1:"13.357",x2:"13.357",y1:"12.857",y2:"18",gradientUnits:"userSpaceOnUse"},React.createElement("stop",{stopColor:"#E7CBFF"}),React.createElement("stop",{offset:"1",stopColor:"#F5E9FF"}))))};var BL=function(e){var t=e.label,n=e.children,r=(e.halfWidth,e.className),o=void 0===r?"":r;return he().createElement("div",{className:"templately-ai-field-wrapper ".concat(o),style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"}},he().createElement("label",{className:"templately-ai-field-label"},t),n)},zL=function(){return he().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255, 255, 255, 0.8)",backdropFilter:"blur(4px)",borderRadius:"0",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},he().createElement("div",{style:{width:"40px",height:"40px",border:"4px solid #f3f4f6",borderTop:"4px solid #6941c6",borderRadius:"50%",animation:"spin 1s linear infinite"}}))},WL=function(e){var t=e.message;return he().createElement("div",{style:{padding:"0",backgroundColor:"transparent",borderRadius:"0",display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:"4px"}},he().createElement(Vu,{size:16,color:"#CC4436",style:{flexShrink:0,marginTop:"1px"}}),he().createElement("span",{style:{color:"#CC4436",fontSize:"12px",fontWeight:"400"},dangerouslySetInnerHTML:{__html:t}}))};function UL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UL(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var HL=[{label:(0,At.__)("Auto","templately"),value:"auto"},{label:(0,At.__)("High","templately"),value:"high"},{label:(0,At.__)("Medium","templately"),value:"medium"},{label:(0,At.__)("Low","templately"),value:"low"}],GL=[{label:(0,At.__)("Typographic Logo","templately"),value:"typographic"},{label:(0,At.__)("Shape Logo","templately"),value:"shaped"},{label:(0,At.__)("Handwritten Logo","templately"),value:"handwritten"}],qL=[{label:(0,At.__)("PNG","templately"),value:"png"},{label:(0,At.__)("JPEG","templately"),value:"jpeg"}],QL=[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4}],$L="auto",YL="auto",XL="typographic",KL="transparent",ZL={control:function(e,t){return VL(VL({},e),{},{borderRadius:"8px",border:t.isHover||t.isFocused?"1px solid #5632D1!important":"1px solid #E4E7EB!important",boxShadow:t.isHover||t.isFocused?"0 0 0 3px #ECE7FD":"none",fontSize:"14px",minHeight:"40px"})},input:function(e){return VL(VL({},e),{},{margin:0})},indicatorSeparator:function(e){return VL(VL({},e),{},{display:"none"})},dropdownIndicator:function(e){return VL(VL({},e),{},{color:"#535865!important"})},menuPortal:function(e){return VL(VL({},e),{},{zIndex:100001,pointerEvents:"auto"})},menu:function(e){return VL(VL({},e),{},{zIndex:100001,background:"#fff",border:"none",boxShadow:"0 4px 8px 0.5px rgba(10, 37, 56, 0.15)",borderRadius:"8px"})},menuList:function(e){return VL(VL({},e),{},{padding:"4px",maxHeight:"200px",overflowY:"scroll"})},option:function(e,t){return VL(VL({},e),{},{backgroundColor:t.isSelected?"#E4E7EB":t.isFocused?"#F2F5F7":"transparent",color:"#40444F",borderRadius:"4px"})}};function JL(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return eR(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(eR(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,eR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,eR(d,"constructor",c),eR(c,"constructor",s),s.displayName="GeneratorFunction",eR(c,o,"GeneratorFunction"),eR(d),eR(d,o,"Generator"),eR(d,r,function(){return this}),eR(d,"toString",function(){return"[object Generator]"}),(JL=function(){return{w:i,m:p}})()}function eR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}eR=function(e,t,n,r){function i(t,n){eR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},eR(e,t,n,r)}var tR=[{label:(0,At.__)("1536×1024 (Landscape)","templately"),value:"1536x1024",icon:he().createElement(tM,{width:24,height:24})},{label:(0,At.__)("1024×1536 (Portrait)","templately"),value:"1024x1536",icon:he().createElement(nM,{width:24,height:24})},{label:(0,At.__)("1024×1024 (Square)","templately"),value:"1024x1024",icon:he().createElement(rM,{width:24,height:24})}],nR=function(e){var t=e.fieldName,n=e.onSubmit,r=e.aiState,o=e.isLoading,i=e.setIsLoading,a=e.setLoaderQuantity,l=e.siteTitle,s=ce((0,pe.useState)((null==r?void 0:r.prompt)||""),2),c=s[0],u=s[1],d=ce((0,pe.useState)(function(){var e,t,n;return!0===(null===(e=window.templatelyDeveloper)||void 0===e?void 0:e.developer_mode)||"1"===(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.developer_mode)||1===(null===(n=window.templatelyDeveloper)||void 0===n?void 0:n.developer_mode)?"low":"medium"}),2),p=d[0],f=d[1],h=ce((0,pe.useState)("1536x1024"),2),m=h[0],g=h[1],v=ce((0,pe.useState)("typographic"),2),y=v[0],b=v[1],w=ce((0,pe.useState)("png"),2),E=w[0],k=w[1],O=ce((0,pe.useState)(1),2),S=O[0],x=O[1],_=(0,pe.useMemo)(function(){return(null==r?void 0:r.images)||[]},[null==r?void 0:r.images]),C=((null==r?void 0:r.url)||_.length,function(){var e=hi(JL().m(function e(){return JL().w(function(e){for(;;)switch(e.n){case 0:if(!c.trim()){e.n=1;break}return a(S),e.n=1,n(t,{prompt:c,quality:p,size:m,category:y,output_format:E,quantity:S},i);case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}());return he().createElement(he().Fragment,null,he().createElement(BL,{label:(0,At.__)("Prompt","templately")},he().createElement(tj.TextareaControl,{value:c,onChange:function(e){return u(e)},placeholder:(0,At.sprintf)((0,At.__)("Create a professional, modern logo for my company “%s” using a clean minimal style and a blue color palette.","templately"),l||" "),rows:4,className:"templately-ai-prompt-textarea",__nextHasNoMarginBottom:!0})),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Number of variations","templately"),halfWidth:!0},he().createElement(Dg,{isSearchable:!1,value:QL.find(function(e){return e.value===S}),options:QL,onChange:function(e){return e&&x(Number(e.value))},styles:ZL,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"})),he().createElement(BL,{label:(0,At.__)("Image size","templately"),halfWidth:!0},he().createElement("div",{className:"templately-ai-logo-size-options"},null==tR?void 0:tR.map(function(e,t){return he().createElement("div",{onClick:function(){return g(e.value)},key:e.value,className:"templately-ai-logo-size-option ".concat(m===e.value?"active-size":"")},e.icon)})))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Category","templately")},he().createElement(Dg,{isSearchable:!1,value:GL.find(function(e){return e.value===y}),options:GL,onChange:function(e){return e&&b(e.value)},styles:ZL,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Image quality","templately"),halfWidth:!0},he().createElement(Dg,{isSearchable:!1,value:HL.find(function(e){return e.value===p}),options:HL,onChange:function(e){return e&&f(e.value)},styles:ZL,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"})),he().createElement(BL,{label:(0,At.__)("Output format","templately"),halfWidth:!0},he().createElement(Dg,{isSearchable:!1,value:qL.find(function(e){return e.value===E}),options:qL,onChange:function(e){return e&&k(e.value)},styles:ZL,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"}))),he().createElement("button",{className:"templately-ai-generate-button",onClick:C,disabled:!c.trim()||o,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",width:"100%",minHeight:"40px",padding:"4px 24px",backgroundColor:!c.trim()||o?"#E4E7EB":"#5632D1",color:!c.trim()||o?"#737985":"#fff",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:!c.trim()||o?"not-allowed":"pointer",marginTop:"28px",boxSizing:"border-box"}},o?(0,At.__)("Generating...","templately"):(0,At.__)("Generate Now","templately")))};function rR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rR(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var iR=function(e,t){var n="fa6"===t?"Fa":"io5"===t?"Io":"md"===t?"Md":"tfi"===t?"Tfi":"",r=(n&&e.startsWith(n)?e.slice(n.length):e).replace(/([A-Z])/g," $1").trim();return{label:r,searchName:r.toLowerCase()}};function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aR(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return cR(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(cR(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,cR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,cR(d,"constructor",c),cR(c,"constructor",s),s.displayName="GeneratorFunction",cR(c,o,"GeneratorFunction"),cR(d),cR(d,o,"Generator"),cR(d,r,function(){return this}),cR(d,"toString",function(){return"[object Generator]"}),(sR=function(){return{w:i,m:p}})()}function cR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}cR=function(e,t,n,r){function i(t,n){cR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},cR(e,t,n,r)}[].concat([{name:"FaCircle",prefix:"fa6",category:"geometric"},{name:"FaSquare",prefix:"fa6",category:"geometric"},{name:"FaStar",prefix:"fa6",category:"geometric"},{name:"FaShapes",prefix:"fa6",category:"geometric"},{name:"FaGem",prefix:"fa6",category:"geometric"},{name:"FaCube",prefix:"fa6",category:"geometric"},{name:"FaCircleNotch",prefix:"fa6",category:"geometric"},{name:"FaRing",prefix:"fa6",category:"geometric"},{name:"FaDiamond",prefix:"fa6",category:"geometric"},{name:"FaHexagonNodes",prefix:"fa6",category:"geometric"},{name:"FaCrown",prefix:"fa6",category:"business"},{name:"FaAward",prefix:"fa6",category:"business"},{name:"FaTrophy",prefix:"fa6",category:"business"},{name:"FaShieldHalved",prefix:"fa6",category:"business"},{name:"FaBriefcase",prefix:"fa6",category:"business"},{name:"FaBuilding",prefix:"fa6",category:"business"},{name:"FaChartLine",prefix:"fa6",category:"business"},{name:"FaHandshake",prefix:"fa6",category:"business"},{name:"FaCoins",prefix:"fa6",category:"business"},{name:"FaBuildingColumns",prefix:"fa6",category:"business"},{name:"FaLeaf",prefix:"fa6",category:"nature"},{name:"FaTree",prefix:"fa6",category:"nature"},{name:"FaSun",prefix:"fa6",category:"nature"},{name:"FaMoon",prefix:"fa6",category:"nature"},{name:"FaFire",prefix:"fa6",category:"nature"},{name:"FaMountain",prefix:"fa6",category:"nature"},{name:"FaWater",prefix:"fa6",category:"nature"},{name:"FaWind",prefix:"fa6",category:"nature"},{name:"FaCloudSun",prefix:"fa6",category:"nature"},{name:"FaSeedling",prefix:"fa6",category:"nature"},{name:"FaLightbulb",prefix:"fa6",category:"creative"},{name:"FaRocket",prefix:"fa6",category:"creative"},{name:"FaPaintbrush",prefix:"fa6",category:"creative"},{name:"FaFeather",prefix:"fa6",category:"creative"},{name:"FaPenFancy",prefix:"fa6",category:"creative"},{name:"FaWandMagicSparkles",prefix:"fa6",category:"creative"},{name:"FaHeart",prefix:"fa6",category:"creative"},{name:"FaPalette",prefix:"fa6",category:"creative"},{name:"FaMagic",prefix:"fa6",category:"creative"},{name:"FaGlobe",prefix:"fa6",category:"communication"},{name:"FaCompass",prefix:"fa6",category:"communication"},{name:"FaLink",prefix:"fa6",category:"communication"},{name:"FaPaperPlane",prefix:"fa6",category:"communication"},{name:"FaBullseye",prefix:"fa6",category:"communication"},{name:"FaVolumeHigh",prefix:"fa6",category:"communication"},{name:"FaEnvelope",prefix:"fa6",category:"communication"},{name:"FaCode",prefix:"fa6",category:"technology"},{name:"FaLaptop",prefix:"fa6",category:"technology"},{name:"FaServer",prefix:"fa6",category:"technology"},{name:"FaMicrochip",prefix:"fa6",category:"technology"},{name:"FaDatabase",prefix:"fa6",category:"technology"},{name:"FaNetworkWired",prefix:"fa6",category:"technology"},{name:"FaCapsules",prefix:"fa6",category:"health"},{name:"FaStethoscope",prefix:"fa6",category:"health"},{name:"FaYinYang",prefix:"fa6",category:"health"},{name:"FaAppleWhole",prefix:"fa6",category:"health"},{name:"FaWineGlass",prefix:"fa6",category:"health"},{name:"FaUtensils",prefix:"fa6",category:"health"},{name:"FaHeartPulse",prefix:"fa6",category:"health"},{name:"FaBook",prefix:"fa6",category:"education"},{name:"FaBookmark",prefix:"fa6",category:"education"},{name:"FaGraduationCap",prefix:"fa6",category:"education"},{name:"FaPenNib",prefix:"fa6",category:"education"},{name:"FaChalkboard",prefix:"fa6",category:"education"},{name:"FaFlask",prefix:"fa6",category:"education"},{name:"FaMicroscope",prefix:"fa6",category:"education"},{name:"FaAtom",prefix:"fa6",category:"education"},{name:"FaCalculator",prefix:"fa6",category:"education"},{name:"FaRuler",prefix:"fa6",category:"education"},{name:"FaMapPin",prefix:"fa6",category:"education"},{name:"FaClipboard",prefix:"fa6",category:"education"},{name:"FaScroll",prefix:"fa6",category:"education"},{name:"FaLandmark",prefix:"fa6",category:"education"},{name:"FaSchool",prefix:"fa6",category:"education"},{name:"FaLaptopCode",prefix:"fa6",category:"education"}],[{name:"IoTriangle",prefix:"io5",category:"geometric"},{name:"IoEllipse",prefix:"io5",category:"geometric"},{name:"IoPrism",prefix:"io5",category:"geometric"},{name:"IoShapes",prefix:"io5",category:"geometric"},{name:"IoDiamond",prefix:"io5",category:"geometric"},{name:"IoHexagon",prefix:"io5",category:"geometric"},{name:"IoPentagon",prefix:"io5",category:"geometric"},{name:"IoSquare",prefix:"io5",category:"geometric"},{name:"IoBriefcase",prefix:"io5",category:"business"},{name:"IoBusiness",prefix:"io5",category:"business"},{name:"IoWallet",prefix:"io5",category:"business"},{name:"IoCard",prefix:"io5",category:"business"},{name:"IoCash",prefix:"io5",category:"business"},{name:"IoTrendingUp",prefix:"io5",category:"business"},{name:"IoStatsChart",prefix:"io5",category:"business"},{name:"IoBarChart",prefix:"io5",category:"business"},{name:"IoPieChart",prefix:"io5",category:"business"},{name:"IoAnalytics",prefix:"io5",category:"business"},{name:"IoLeaf",prefix:"io5",category:"nature"},{name:"IoFlower",prefix:"io5",category:"nature"},{name:"IoRose",prefix:"io5",category:"nature"},{name:"IoSunny",prefix:"io5",category:"nature"},{name:"IoMoon",prefix:"io5",category:"nature"},{name:"IoCloud",prefix:"io5",category:"nature"},{name:"IoRainy",prefix:"io5",category:"nature"},{name:"IoThunderstorm",prefix:"io5",category:"nature"},{name:"IoSnow",prefix:"io5",category:"nature"},{name:"IoPlanet",prefix:"io5",category:"nature"},{name:"IoEarth",prefix:"io5",category:"nature"},{name:"IoWater",prefix:"io5",category:"nature"},{name:"IoFlame",prefix:"io5",category:"nature"},{name:"IoBrush",prefix:"io5",category:"creative"},{name:"IoColorPalette",prefix:"io5",category:"creative"},{name:"IoColorWand",prefix:"io5",category:"creative"},{name:"IoPencil",prefix:"io5",category:"creative"},{name:"IoCreate",prefix:"io5",category:"creative"},{name:"IoBulb",prefix:"io5",category:"creative"},{name:"IoRocket",prefix:"io5",category:"creative"},{name:"IoSparkles",prefix:"io5",category:"creative"},{name:"IoHeart",prefix:"io5",category:"creative"},{name:"IoStar",prefix:"io5",category:"creative"},{name:"IoGlobe",prefix:"io5",category:"communication"},{name:"IoCompass",prefix:"io5",category:"communication"},{name:"IoMail",prefix:"io5",category:"communication"},{name:"IoChatbubble",prefix:"io5",category:"communication"},{name:"IoSend",prefix:"io5",category:"communication"},{name:"IoCall",prefix:"io5",category:"communication"},{name:"IoMegaphone",prefix:"io5",category:"communication"},{name:"IoNotifications",prefix:"io5",category:"communication"},{name:"IoCode",prefix:"io5",category:"technology"},{name:"IoCodeSlash",prefix:"io5",category:"technology"},{name:"IoLaptop",prefix:"io5",category:"technology"},{name:"IoDesktop",prefix:"io5",category:"technology"},{name:"IoPhonePortrait",prefix:"io5",category:"technology"},{name:"IoTabletPortrait",prefix:"io5",category:"technology"},{name:"IoCloud",prefix:"io5",category:"technology"},{name:"IoServer",prefix:"io5",category:"technology"},{name:"IoHardwareChip",prefix:"io5",category:"technology"},{name:"IoWifi",prefix:"io5",category:"technology"},{name:"IoBluetooth",prefix:"io5",category:"technology"},{name:"IoFingerPrint",prefix:"io5",category:"technology"},{name:"IoQrCode",prefix:"io5",category:"technology"},{name:"IoBarcode",prefix:"io5",category:"technology"},{name:"IoFitness",prefix:"io5",category:"health"},{name:"IoMedkit",prefix:"io5",category:"health"},{name:"IoPulse",prefix:"io5",category:"health"},{name:"IoNutrition",prefix:"io5",category:"health"},{name:"IoBandage",prefix:"io5",category:"health"},{name:"IoBody",prefix:"io5",category:"health"},{name:"IoEye",prefix:"io5",category:"health"},{name:"IoBook",prefix:"io5",category:"education"},{name:"IoLibrary",prefix:"io5",category:"education"},{name:"IoSchool",prefix:"io5",category:"education"},{name:"IoReader",prefix:"io5",category:"education"},{name:"IoNewspaper",prefix:"io5",category:"education"},{name:"IoDocumentText",prefix:"io5",category:"education"},{name:"IoFlask",prefix:"io5",category:"education"},{name:"IoConstruct",prefix:"io5",category:"education"},{name:"IoBuild",prefix:"io5",category:"education"},{name:"IoMusicalNotes",prefix:"io5",category:"media"},{name:"IoHeadset",prefix:"io5",category:"media"},{name:"IoCamera",prefix:"io5",category:"media"},{name:"IoFilm",prefix:"io5",category:"media"},{name:"IoVideocam",prefix:"io5",category:"media"},{name:"IoGameController",prefix:"io5",category:"media"},{name:"IoImage",prefix:"io5",category:"media"},{name:"IoImages",prefix:"io5",category:"media"}],[{name:"MdCircle",prefix:"md",category:"geometric"},{name:"MdSquare",prefix:"md",category:"geometric"},{name:"MdStar",prefix:"md",category:"geometric"},{name:"MdHexagon",prefix:"md",category:"geometric"},{name:"MdPentagon",prefix:"md",category:"geometric"},{name:"MdChangeHistory",prefix:"md",category:"geometric"},{name:"MdCategory",prefix:"md",category:"geometric"},{name:"MdInterests",prefix:"md",category:"geometric"},{name:"MdBusiness",prefix:"md",category:"business"},{name:"MdBusinessCenter",prefix:"md",category:"business"},{name:"MdWork",prefix:"md",category:"business"},{name:"MdAccountBalance",prefix:"md",category:"business"},{name:"MdAccountBalanceWallet",prefix:"md",category:"business"},{name:"MdAttachMoney",prefix:"md",category:"business"},{name:"MdMonetizationOn",prefix:"md",category:"business"},{name:"MdTrendingUp",prefix:"md",category:"business"},{name:"MdInsights",prefix:"md",category:"business"},{name:"MdAnalytics",prefix:"md",category:"business"},{name:"MdLeaderboard",prefix:"md",category:"business"},{name:"MdQueryStats",prefix:"md",category:"business"},{name:"MdShowChart",prefix:"md",category:"business"},{name:"MdBarChart",prefix:"md",category:"business"},{name:"MdPieChart",prefix:"md",category:"business"},{name:"MdDonutLarge",prefix:"md",category:"business"},{name:"MdTimeline",prefix:"md",category:"business"},{name:"MdEmojiEvents",prefix:"md",category:"business"},{name:"MdMilitaryTech",prefix:"md",category:"business"},{name:"MdWorkspacePremium",prefix:"md",category:"business"},{name:"MdNature",prefix:"md",category:"nature"},{name:"MdNaturePeople",prefix:"md",category:"nature"},{name:"MdGrass",prefix:"md",category:"nature"},{name:"MdPark",prefix:"md",category:"nature"},{name:"MdForest",prefix:"md",category:"nature"},{name:"MdWaterDrop",prefix:"md",category:"nature"},{name:"MdWaves",prefix:"md",category:"nature"},{name:"MdWbSunny",prefix:"md",category:"nature"},{name:"MdNightlight",prefix:"md",category:"nature"},{name:"MdCloud",prefix:"md",category:"nature"},{name:"MdAir",prefix:"md",category:"nature"},{name:"MdTerrain",prefix:"md",category:"nature"},{name:"MdLandscape",prefix:"md",category:"nature"},{name:"MdLocalFireDepartment",prefix:"md",category:"nature"},{name:"MdSpa",prefix:"md",category:"nature"},{name:"MdYard",prefix:"md",category:"nature"},{name:"MdLightbulb",prefix:"md",category:"creative"},{name:"MdTipsAndUpdates",prefix:"md",category:"creative"},{name:"MdRocketLaunch",prefix:"md",category:"creative"},{name:"MdAutoAwesome",prefix:"md",category:"creative"},{name:"MdAutoFixHigh",prefix:"md",category:"creative"},{name:"MdBrush",prefix:"md",category:"creative"},{name:"MdCreate",prefix:"md",category:"creative"},{name:"MdPalette",prefix:"md",category:"creative"},{name:"MdColorLens",prefix:"md",category:"creative"},{name:"MdDesignServices",prefix:"md",category:"creative"},{name:"MdDraw",prefix:"md",category:"creative"},{name:"MdGesture",prefix:"md",category:"creative"},{name:"MdEdit",prefix:"md",category:"creative"},{name:"MdFavorite",prefix:"md",category:"creative"},{name:"MdPublic",prefix:"md",category:"communication"},{name:"MdExplore",prefix:"md",category:"communication"},{name:"MdLanguage",prefix:"md",category:"communication"},{name:"MdRoute",prefix:"md",category:"communication"},{name:"MdLink",prefix:"md",category:"communication"},{name:"MdSend",prefix:"md",category:"communication"},{name:"MdEmail",prefix:"md",category:"communication"},{name:"MdChat",prefix:"md",category:"communication"},{name:"MdForum",prefix:"md",category:"communication"},{name:"MdMessage",prefix:"md",category:"communication"},{name:"MdContactSupport",prefix:"md",category:"communication"},{name:"MdCampaign",prefix:"md",category:"communication"},{name:"MdAnnouncement",prefix:"md",category:"communication"},{name:"MdNotifications",prefix:"md",category:"communication"},{name:"MdVolumeUp",prefix:"md",category:"communication"},{name:"MdGpsFixed",prefix:"md",category:"communication"},{name:"MdCode",prefix:"md",category:"technology"},{name:"MdTerminal",prefix:"md",category:"technology"},{name:"MdDataObject",prefix:"md",category:"technology"},{name:"MdIntegrationInstructions",prefix:"md",category:"technology"},{name:"MdLaptop",prefix:"md",category:"technology"},{name:"MdComputer",prefix:"md",category:"technology"},{name:"MdDesktopMac",prefix:"md",category:"technology"},{name:"MdSmartphone",prefix:"md",category:"technology"},{name:"MdTablet",prefix:"md",category:"technology"},{name:"MdCloud",prefix:"md",category:"technology"},{name:"MdCloudDone",prefix:"md",category:"technology"},{name:"MdStorage",prefix:"md",category:"technology"},{name:"MdDns",prefix:"md",category:"technology"},{name:"MdMemory",prefix:"md",category:"technology"},{name:"MdDeveloperBoard",prefix:"md",category:"technology"},{name:"MdSettingsEthernet",prefix:"md",category:"technology"},{name:"MdWifi",prefix:"md",category:"technology"},{name:"MdBluetooth",prefix:"md",category:"technology"},{name:"MdSmartToy",prefix:"md",category:"technology"},{name:"MdApi",prefix:"md",category:"technology"},{name:"MdMedicalServices",prefix:"md",category:"health"},{name:"MdLocalHospital",prefix:"md",category:"health"},{name:"MdHealthAndSafety",prefix:"md",category:"health"},{name:"MdMedication",prefix:"md",category:"health"},{name:"MdVaccines",prefix:"md",category:"health"},{name:"MdBiotech",prefix:"md",category:"health"},{name:"MdPsychology",prefix:"md",category:"health"},{name:"MdSelfImprovement",prefix:"md",category:"health"},{name:"MdFitnessCenter",prefix:"md",category:"health"},{name:"MdRestaurant",prefix:"md",category:"health"},{name:"MdLocalDining",prefix:"md",category:"health"},{name:"MdLocalCafe",prefix:"md",category:"health"},{name:"MdLocalBar",prefix:"md",category:"health"},{name:"MdSchool",prefix:"md",category:"education"},{name:"MdMenuBook",prefix:"md",category:"education"},{name:"MdLocalLibrary",prefix:"md",category:"education"},{name:"MdHistoryEdu",prefix:"md",category:"education"},{name:"MdAutoStories",prefix:"md",category:"education"},{name:"MdBookmark",prefix:"md",category:"education"},{name:"MdEditNote",prefix:"md",category:"education"},{name:"MdScience",prefix:"md",category:"education"},{name:"MdBiotech",prefix:"md",category:"education"},{name:"MdCalculate",prefix:"md",category:"education"},{name:"MdFunctions",prefix:"md",category:"education"},{name:"MdArchitecture",prefix:"md",category:"education"},{name:"MdEngineering",prefix:"md",category:"education"},{name:"MdPrecisionManufacturing",prefix:"md",category:"education"},{name:"MdConstruction",prefix:"md",category:"education"},{name:"MdBuild",prefix:"md",category:"education"},{name:"MdMiscellaneousServices",prefix:"md",category:"education"},{name:"MdSupportAgent",prefix:"md",category:"education"},{name:"MdMusicNote",prefix:"md",category:"media"},{name:"MdHeadphones",prefix:"md",category:"media"},{name:"MdMic",prefix:"md",category:"media"},{name:"MdCameraAlt",prefix:"md",category:"media"},{name:"MdPhotoCamera",prefix:"md",category:"media"},{name:"MdVideocam",prefix:"md",category:"media"},{name:"MdMovie",prefix:"md",category:"media"},{name:"MdImage",prefix:"md",category:"media"},{name:"MdPhotoLibrary",prefix:"md",category:"media"},{name:"MdSportsEsports",prefix:"md",category:"media"},{name:"MdVideogameAsset",prefix:"md",category:"media"},{name:"MdPodcasts",prefix:"md",category:"media"},{name:"MdLiveTv",prefix:"md",category:"media"},{name:"MdTheaters",prefix:"md",category:"media"}],[{name:"TfiTarget",prefix:"tfi",category:"geometric"},{name:"TfiStar",prefix:"tfi",category:"geometric"},{name:"TfiMedall",prefix:"tfi",category:"geometric"},{name:"TfiShine",prefix:"tfi",category:"geometric"},{name:"TfiVector",prefix:"tfi",category:"geometric"},{name:"TfiBriefcase",prefix:"tfi",category:"business"},{name:"TfiAgenda",prefix:"tfi",category:"business"},{name:"TfiWallet",prefix:"tfi",category:"business"},{name:"TfiMoney",prefix:"tfi",category:"business"},{name:"TfiCreditCard",prefix:"tfi",category:"business"},{name:"TfiReceipt",prefix:"tfi",category:"business"},{name:"TfiStatsUp",prefix:"tfi",category:"business"},{name:"TfiStatsDown",prefix:"tfi",category:"business"},{name:"TfiPieChart",prefix:"tfi",category:"business"},{name:"TfiBarChart",prefix:"tfi",category:"business"},{name:"TfiCup",prefix:"tfi",category:"business"},{name:"TfiCrown",prefix:"tfi",category:"business"},{name:"TfiMedallAlt",prefix:"tfi",category:"business"},{name:"TfiIdBadge",prefix:"tfi",category:"business"},{name:"TfiLightBulb",prefix:"tfi",category:"creative"},{name:"TfiRocket",prefix:"tfi",category:"creative"},{name:"TfiBrush",prefix:"tfi",category:"creative"},{name:"TfiPaintBucket",prefix:"tfi",category:"creative"},{name:"TfiPencilAlt",prefix:"tfi",category:"creative"},{name:"TfiPencil",prefix:"tfi",category:"creative"},{name:"TfiMarker",prefix:"tfi",category:"creative"},{name:"TfiMarkerAlt",prefix:"tfi",category:"creative"},{name:"TfiPalette",prefix:"tfi",category:"creative"},{name:"TfiWand",prefix:"tfi",category:"creative"},{name:"TfiHeart",prefix:"tfi",category:"creative"},{name:"TfiThought",prefix:"tfi",category:"creative"},{name:"TfiInfinite",prefix:"tfi",category:"creative"},{name:"TfiWorld",prefix:"tfi",category:"communication"},{name:"TfiLocationPin",prefix:"tfi",category:"communication"},{name:"TfiMapAlt",prefix:"tfi",category:"communication"},{name:"TfiLink",prefix:"tfi",category:"communication"},{name:"TfiEmail",prefix:"tfi",category:"communication"},{name:"TfiComment",prefix:"tfi",category:"communication"},{name:"TfiComments",prefix:"tfi",category:"communication"},{name:"TfiAnnouncement",prefix:"tfi",category:"communication"},{name:"TfiBell",prefix:"tfi",category:"communication"},{name:"TfiMicrophone",prefix:"tfi",category:"communication"},{name:"TfiVolumeUp",prefix:"tfi",category:"communication"},{name:"TfiDesktop",prefix:"tfi",category:"technology"},{name:"TfiLaptop",prefix:"tfi",category:"technology"},{name:"TfiMobile",prefix:"tfi",category:"technology"},{name:"TfiTablet",prefix:"tfi",category:"technology"},{name:"TfiServer",prefix:"tfi",category:"technology"},{name:"TfiPlug",prefix:"tfi",category:"technology"},{name:"TfiCloud",prefix:"tfi",category:"technology"},{name:"TfiCloudUp",prefix:"tfi",category:"technology"},{name:"TfiCloudDown",prefix:"tfi",category:"technology"},{name:"TfiHarddrive",prefix:"tfi",category:"technology"},{name:"TfiShortcode",prefix:"tfi",category:"technology"},{name:"TfiWidget",prefix:"tfi",category:"technology"},{name:"TfiWidgetAlt",prefix:"tfi",category:"technology"},{name:"TfiDashboard",prefix:"tfi",category:"technology"},{name:"TfiSettings",prefix:"tfi",category:"technology"},{name:"TfiPanel",prefix:"tfi",category:"technology"},{name:"TfiBook",prefix:"tfi",category:"education"},{name:"TfiBookmarkAlt",prefix:"tfi",category:"education"},{name:"TfiWrite",prefix:"tfi",category:"education"},{name:"TfiBlackboard",prefix:"tfi",category:"education"},{name:"TfiClipboard",prefix:"tfi",category:"education"},{name:"TfiFiles",prefix:"tfi",category:"education"},{name:"TfiFile",prefix:"tfi",category:"education"},{name:"TfiNotepad",prefix:"tfi",category:"education"},{name:"TfiRulerPencil",prefix:"tfi",category:"education"},{name:"TfiRulerAlt",prefix:"tfi",category:"education"},{name:"TfiMusicAlt",prefix:"tfi",category:"media"},{name:"TfiHeadphoneAlt",prefix:"tfi",category:"media"},{name:"TfiCamera",prefix:"tfi",category:"media"},{name:"TfiVideo",prefix:"tfi",category:"media"},{name:"TfiVideoCamera",prefix:"tfi",category:"media"},{name:"TfiGallery",prefix:"tfi",category:"media"},{name:"TfiImage",prefix:"tfi",category:"media"},{name:"TfiGame",prefix:"tfi",category:"media"},{name:"TfiMicrophoneAlt",prefix:"tfi",category:"media"},{name:"TfiLeaf",prefix:"tfi",category:"nature"}]).map(function(e){return oR(oR({},e),iR(e.name,e.prefix))});var uR=new Map,dR=new Map,pR=function(e,t){return"".concat(t,":").concat(e)},fR=new Map,hR=function(){var e=hi(sR().m(function e(t,n){var r,o,i,l;return sR().w(function(e){for(;;)switch(e.n){case 0:return r=["fa6","io5","md","tfi"],o=0,i=function(){var e=hi(sR().m(function e(i){var l,s,c,u,d,p,f;return sR().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!dR.has(i)){e.n=1;break}l=dR.get(i),e.n=10;break;case 1:if(fR.has(i)){e.n=8;break}p=i,e.n="fa6"===p?2:"io5"===p?3:"md"===p?4:"tfi"===p?5:6;break;case 2:return s=a.e(961).then(a.bind(a,9197)),e.a(3,7);case 3:return s=a.e(607).then(a.bind(a,1351)),e.a(3,7);case 4:return s=a.e(705).then(a.bind(a,9879)),e.a(3,7);case 5:return s=a.e(773).then(a.bind(a,6197)),e.a(3,7);case 6:return e.a(2,[]);case 7:fR.set(i,s);case 8:return e.n=9,fR.get(i);case 9:l=e.v,dR.set(i,l),fR.delete(i);case 10:return c=Object.keys(l),u=c.filter(function(e){return/^[A-Z]/.test(e)}),d=[],u.forEach(function(e){var t=l[e];if(t){var n={icon:t,meta:lR({name:e,prefix:i,category:"all"},iR(e,i))};d.push(n);var r=pR(e,i);uR.set(r,t)}}),n&&d.length>0&&n(d),o++,t&&t(200*o,200*r.length),e.a(2,d);case 11:return e.p=11,f=e.v,console.error("Failed to load library ".concat(i,":"),f),e.a(2,[])}},e,null,[[0,11]])}));return function(t){return e.apply(this,arguments)}}(),e.n=1,Promise.all(r.map(function(e){return i(e)}));case 1:return l=e.v,e.a(2,l.flat())}},e)}));return function(t,n){return e.apply(this,arguments)}}(),mR=312,gR=104,vR=500/mR,yR=180,bR=120,wR="Your Logo",ER="rgba(0,0,0,0)",kR=function(e){var t=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0===r.length&&(r=[400,700]),r.includes(t)||(r=[].concat(Nl(r),[t]).sort(function(e,t){return e-t}));var o=r.join(";"),i=document.createElement("link");i.href="https://fonts.googleapis.com/css2?family=".concat(e.replace(/ /g,"+"),":wght@").concat(o,"&display=swap"),i.rel="stylesheet",document.querySelector('link[href="'.concat(i.href,'"]'))||document.head.appendChild(i);var a="".concat(t," ").concat(n,'px "').concat(e,'"');return new Promise(function(t,n){var r=0,o=function(){document.fonts.load(a).then(function(n){n.length>0?t():++r>20?(console.warn("Font load timed out for ".concat(e,", using fallback.")),t()):setTimeout(o,100)}).catch(function(e){console.error("Error loading font:",e),t()})};o()})},OR=function(e){var t=e.name,n=e.color,r=e.defaultColor,o=e.onChange,i=n||r||"#000000";return he().createElement(AF,null,he().createElement(TF,{asChild:!0},he().createElement("button",{type:"button","aria-label":t,style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px",width:"100%",padding:"0",borderRadius:"0",border:"none",outline:"none",boxShadow:"none",background:"transparent",cursor:"pointer"}},he().createElement("span",{style:{backgroundColor:i,width:"32px",height:"32px",borderRadius:"4px",border:"1px solid #d0d5dd",flex:"0 0 auto"}}),he().createElement("span",{style:{fontSize:"14px",fontWeight:500,color:"#40444F"}},function(e){if(!e)return e;if(e.startsWith("rgb")){var t=e.match(/[\d\.]+/g);if(t&&t.length>=3){var n=parseInt(t[0]),r=parseInt(t[1]),o=parseInt(t[2]),i=t[3]?parseFloat(t[3]):1,a=function(e){return e.toString(16).padStart(2,"0").toUpperCase()},l=Math.round(255*i).toString(16).padStart(2,"0").toUpperCase();return"#".concat(a(n)).concat(a(r)).concat(a(o)).concat(l)}}return e.startsWith("#")?e.toUpperCase():e}(i)))),he().createElement(FF,null,he().createElement(MF,{align:"start",className:"templately-ai-prompt-colorpicker",style:{zIndex:1e5},alignOffset:0,sideOffset:12},he().createElement("span",{className:"templately-title"},t),he().createElement(tj.ColorPicker,{color:i,enableAlpha:!0,defaultValue:i,onChangeComplete:function(e){if("string"!=typeof e){if(e&&"object"===ne(e)){if(e.rgb&&"number"==typeof e.rgb.a&&e.rgb.a<1)return void o((t=e.rgb,n="number"==typeof t.a?t.a:1,"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(n,")")));if(e.rgb&&"number"==typeof e.rgb.a&&0===e.rgb.a)return void o("rgba(0,0,0,0)");if(e.hex)return void o(e.hex)}}else o(e);var t,n}}))))};function SR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _R=function(e){var t=e.icons,n=e.selectedIcon,r=e.onIconSelect,o=e.isLoading,i=void 0!==o&&o,a=ce(he().useState(!1),2),l=a[0],s=a[1],c=ce(he().useState(""),2),u=c[0],d=c[1],p=he().useMemo(function(){if(!u.trim())return t;var e=u.toLowerCase().trim();return t.filter(function(t){var n=t.meta.searchName||"",r=t.meta.name||"";return n.includes(e)||r.toLowerCase().includes(e)})},[t,u]),f=he().useMemo(function(){return[null].concat(Nl(p.map(function(e){return{component:e.icon,name:e.meta.name,label:e.meta.label}})))},[p]),h=Math.ceil(f.length/6),m=Math.min(150,30*h+12),g=he().useMemo(function(){return{gridItems:f,selectedIcon:n,onIconSelect:r,setIsOpen:s,setSearchTerm:d,COLUMN_COUNT:6}},[f,n,r,s,d]);return he().createElement(AF,{open:l,onOpenChange:s,modal:!1},he().createElement("div",{className:"templately-ai-icon-picker"},he().createElement(TF,{asChild:!0},he().createElement("div",{className:"templately-ai-icon-picker-trigger ".concat(l?"is-focused":"")},he().createElement("div",{className:"templately-ai-icon-picker-selected"},i?he().createElement("span",{className:"templately-ai-icon-picker-loading"},he().createElement("svg",{className:"templately-ai-spinner",viewBox:"0 0 50 50"},he().createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"5"}))):n?he().createElement("span",{className:"templately-ai-icon-picker-icon"},he().createElement(n)):he().createElement("span",{className:"templately-ai-icon-picker-none"},(0,At.__)("None","templately"))),he().createElement("svg",{className:"templately-ai-icon-picker-chevron ".concat(l?"open":""),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},he().createElement("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))),he().createElement(MF,{className:"templately-ai-icon-picker-dropdown",side:"top",align:"start",sideOffset:4,collisionPadding:8,onOpenAutoFocus:function(e){e.preventDefault()}},he().createElement("div",{className:"templately-ai-icon-picker-search"},he().createElement("input",{type:"text",placeholder:(0,At.__)("Search","templately"),value:u,onChange:function(e){return d(e.target.value)},className:"templately-ai-icon-picker-search-input",autoFocus:!0}),he().createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},he().createElement("path",{d:"M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z",stroke:"#1F2128",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),he().createElement("path",{d:"M19 19L14.65 14.65",stroke:"#1F2128",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),he().createElement("div",{className:"templately-ai-icon-picker-grid",style:{display:"block",padding:"6px"}},i?he().createElement("div",{className:"templately-ai-icon-picker-grid-loading"},he().createElement("svg",{className:"templately-ai-spinner",viewBox:"0 0 50 50",style:{width:"24px",height:"24px"}},he().createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"5"})),he().createElement("span",null,(0,At.__)("Loading icons...","templately"))):he().createElement(Rj,{columnCount:6,columnWidth:30,height:m,rowCount:h,rowHeight:30,width:181,itemData:g,key:f.length},CR)))))},CR=function(e){var t=e.columnIndex,n=e.rowIndex,r=e.style,o=e.data,i=o.gridItems,a=o.selectedIcon,l=o.onIconSelect,s=o.setIsOpen,c=o.setSearchTerm,u=n*o.COLUMN_COUNT+t;if(u>=i.length)return null;var d=i[u],p=d?d.component:null,f=p===a,h=xR(xR({},r),{},{left:Number(r.left)+2,top:Number(r.top)+2,width:Number(r.width)-4,height:Number(r.height)-4});return he().createElement("div",{style:h,className:"templately-ai-icon-picker-item ".concat(f?"active":""),onClick:function(){l(p),s(!1),c("")}},p?he().createElement("span",{className:"templately-ai-icon-picker-item-icon",title:d.label||d.name},he().createElement(p)):he().createElement("span",{className:"templately-ai-icon-picker-item-label"},(0,At.__)("None","templately")))};function DR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DR(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var AR=function(e){return{100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semi-Bold",700:"Bold",800:"Extra Bold",900:"Black"}[e]||e.toString()},TR=function(e){var t=e.settings,n=e.onSettingsChange,r=e.icons,o=e.fontList,i=void 0===o?[]:o,a=e.iconsLoading,l=void 0!==a&&a,s=e.maxDimensions,c=e.onAutoFit,u=he().useCallback(function(e,r){if(["text","fontFamily","fontWeight","icon"].includes(e)){var o=PR(PR({},t),{},Pt({},e,r));c(o)}else n(function(t){var n=PR(PR({},t),{},Pt({},e,r));if(("fontSize"===e||"iconSize"===e)&&t.icon){var o="fontSize"===e?Number(r):t.fontSize,i="iconSize"===e?Number(r):t.iconSize;n.iconGap=Math.round((o+i)/8)}return n})},[t,n,c]),d=(0,pe.useMemo)(function(){return(i||[]).map(function(e){return{label:e.label,value:e.value}})},[i]),p=(0,pe.useMemo)(function(){var e=null==i?void 0:i.find(function(e){return e.value===t.fontFamily});return null!=e&&e.variants?e.variants.map(function(e){var t=e.value;if("regular"===t||"italic"===t)return 400;var n=parseInt(t.replace(/[^\d]/g,""),10);return isNaN(n)?400:n}).filter(function(e,t,n){return n.indexOf(e)===t}).sort(function(e,t){return e-t}):[400]},[t.fontFamily,i]);return he().useEffect(function(){if(!p.includes(t.fontWeight)){var e=p.reduce(function(e,n){return Math.abs(n-t.fontWeight)<Math.abs(e-t.fontWeight)?n:e});u("fontWeight",e)}},[t.fontFamily,p,t.fontWeight,u]),he().createElement(he().Fragment,null,he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Logo text","templately")},he().createElement(tj.TextControl,{value:t.text,onChange:function(e){return u("text",e)},placeholder:(0,At.__)("Enter your logo text","templately"),className:"templately-ai-prompt-textField"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{className:"typography-logo-tab-font-family",label:(0,At.__)("Font family","templately")},he().createElement(Dg,{isSearchable:!0,value:d.find(function(e){return e.value===t.fontFamily}),options:d,onChange:function(e){return e&&u("fontFamily",e.value)},classNamePrefix:"templately-ai-select",styles:ZL,menuPlacement:"auto",getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value}})),he().createElement(BL,{className:"typography-logo-tab-font-weight",label:(0,At.__)("Font weight","templately")},he().createElement(Dg,{isSearchable:!1,value:{label:AR(t.fontWeight),value:t.fontWeight},options:p.map(function(e){return{label:AR(e),value:e}}),onChange:function(e){return e&&u("fontWeight",e.value)},styles:ZL,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Font size","templately")},he().createElement(tj.TextControl,{type:"number",value:t.fontSize,min:8,max:s.maxFontSize,onChange:function(e){var t=parseInt(e.replace(/[^\d]/g,""),10);isNaN(t)||(t=Math.min(t,s.maxFontSize),t=Math.max(t,8)),u("fontSize",isNaN(t)?"":t)},placeholder:"72",className:"templately-ai-prompt-textField"})),he().createElement(BL,{label:(0,At.__)("Icon gap","templately")},he().createElement(tj.TextControl,{type:"number",value:t.iconGap,onChange:function(e){var t=""===e||"-"===e?e:Number(e);u("iconGap",t)},placeholder:String(Math.round((t.fontSize+t.iconSize)/8)),className:"templately-ai-prompt-textField"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Shape","templately")},he().createElement(_R,{icons:r,selectedIcon:t.icon,onIconSelect:function(e){return u("icon",e)},isLoading:l})),he().createElement(BL,{label:(0,At.__)("Shape size","templately")},he().createElement(tj.TextControl,{type:"number",value:t.iconSize,min:6,max:s.maxIconSize,onChange:function(e){var t=parseInt(e.replace(/[^\d]/g,""),10);isNaN(t)||(t=Math.min(t,s.maxIconSize),t=Math.max(t,6)),u("iconSize",isNaN(t)?"":t)},placeholder:"80",className:"templately-ai-prompt-textField"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(BL,{label:(0,At.__)("Text color","templately")},he().createElement(OR,{name:(0,At.__)("Text Color","templately"),color:String(t.textColor),defaultColor:"#1a1a1a",onChange:function(e){return u("textColor",e)}})),he().createElement(BL,{label:(0,At.__)("Background color","templately")},he().createElement(OR,{name:(0,At.__)("Background Color","templately"),color:String(t.backgroundColor),defaultColor:String(ER),onChange:function(e){return u("backgroundColor",e)}}))))},FR=function(){return FR=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},FR.apply(this,arguments)},MR=function(e){var t=e.animate,n=void 0===t||t,r=e.backgroundColor,o=void 0===r?"#f5f6f7":r,i=e.backgroundOpacity,a=void 0===i?1:i,l=e.baseUrl,s=void 0===l?"":l,c=e.children,u=e.foregroundColor,d=void 0===u?"#eee":u,p=e.foregroundOpacity,f=void 0===p?1:p,h=e.gradientRatio,m=void 0===h?2:h,g=e.uniqueKey,v=e.rtl,y=void 0!==v&&v,b=e.speed,w=void 0===b?1.2:b,E=e.style,k=void 0===E?{}:E,O=e.title,S=void 0===O?"Loading...":O,x=e.beforeMask,_=void 0===x?null:x,C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["animate","backgroundColor","backgroundOpacity","baseUrl","children","foregroundColor","foregroundOpacity","gradientRatio","uniqueKey","rtl","speed","style","title","beforeMask"]),D=(0,pe.useId)();g&&(D=g);var P="".concat(D,"-diff"),A="".concat(D,"-animated-diff"),T="".concat(D,"-aria"),F=y?{transform:"scaleX(-1)"}:null,M="".concat(w,"s"),I="".concat(-1*m," 0"),N="".concat(m," 0");return(0,pe.createElement)("svg",FR({"aria-labelledby":T,role:"img",style:FR(FR({},k),F)},C),S?(0,pe.createElement)("title",{id:T},S):null,_&&(0,pe.isValidElement)(_)?_:null,(0,pe.createElement)("rect",{role:"presentation",x:"0",y:"0",width:"100%",height:"100%",clipPath:"url(".concat(s,"#").concat(P,")"),style:{fill:"url(".concat(s,"#").concat(A,")")}}),(0,pe.createElement)("defs",null,(0,pe.createElement)("clipPath",{id:P},c),(0,pe.createElement)("linearGradient",{id:A,gradientTransform:"translate(".concat(I,")")},(0,pe.createElement)("stop",{offset:"0%",stopColor:o,stopOpacity:a}),(0,pe.createElement)("stop",{offset:"50%",stopColor:d,stopOpacity:f}),(0,pe.createElement)("stop",{offset:"100%",stopColor:o,stopOpacity:a}),n&&(0,pe.createElement)("animateTransform",{attributeName:"gradientTransform",type:"translate",values:"".concat(I,"; 0 0; ").concat(N),dur:M,repeatCount:"indefinite"}))))},IR=function(e){return e.children?(0,pe.createElement)(MR,FR({},e)):(0,pe.createElement)(NR,FR({},e))},NR=function(e){return(0,pe.createElement)(IR,FR({viewBox:"0 0 476 124"},e),(0,pe.createElement)("rect",{x:"48",y:"8",width:"88",height:"6",rx:"3"}),(0,pe.createElement)("rect",{x:"48",y:"26",width:"52",height:"6",rx:"3"}),(0,pe.createElement)("rect",{x:"0",y:"56",width:"410",height:"6",rx:"3"}),(0,pe.createElement)("rect",{x:"0",y:"72",width:"380",height:"6",rx:"3"}),(0,pe.createElement)("rect",{x:"0",y:"88",width:"178",height:"6",rx:"3"}),(0,pe.createElement)("circle",{cx:"20",cy:"20",r:"20"}))};const jR=IR;var LR=function(e){var t=e.images,n=(e.selectedImageId,e.onSelectImage),r=e.isLoading,o=e.onInsertSelected,i=e.loaderQuantity;return r?he().createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"16px",flex:1,boxSizing:"border-box"}},he().createElement("div",{style:{width:"100%",display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",boxSizing:"border-box"}},Array.from({length:i}).map(function(e,t){return he().createElement(jR,{speed:2,width:150,height:110,viewBox:"0 0 150 110",backgroundColor:"#F2F5F7",foregroundColor:"#e4e7eb"},he().createElement("rect",{x:"100",y:"0",rx:"10",ry:"10",width:"50",height:"110"}),he().createElement("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"150",height:"45"}),he().createElement("rect",{x:"0",y:"65",rx:"10",ry:"10",width:"150",height:"45"}),he().createElement("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"50",height:"110"}),he().createElement("rect",{x:"63",y:"53",rx:"0",ry:"0",width:"25",height:"4"}))})),he().createElement("p",{style:{fontSize:"14px",lineHeight:"1.5",fontWeight:400,color:"#737A85",margin:0,textAlign:"left"}},(0,At.__)("Generating your site logo… please wait.","templately"))):0===t.length?he().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"#F2F5F7",borderRadius:"12px",padding:"80px 20px",textAlign:"center",gap:"8px"}},he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none",viewBox:"0 0 64 64"},he().createElement("foreignObject",{width:"0",height:"0",x:"0",y:"0"},he().createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",clipPath:"url(#bgblur_0_20560_14311_clip_path)",style:{backdropFilter:"blur(12.98px)",height:"100%",width:"100%"}})),he().createElement("g",{"data-figma-bg-blur-radius":"25.961"},he().createElement("rect",{width:"62.809",height:"62.809",x:"0.595",y:"0.595",fill:"url(#paint0_linear_20560_14311)",rx:"17.06"}),he().createElement("rect",{width:"62.809",height:"62.809",x:"0.595",y:"0.595",stroke:"url(#paint1_linear_20560_14311)",strokeWidth:"1.191",rx:"17.06"}),he().createElement("path",{fill:"url(#paint2_linear_20560_14311)",fillRule:"evenodd",d:"M27.2 6h-.089c-3.285 0-5.873 0-7.955.17-2.125.174-3.9.534-5.512 1.356a14 14 0 0 0-6.118 6.118c-.821 1.613-1.182 3.387-1.356 5.512C6 21.238 6 23.825 6 27.11v9.778c0 3.285 0 5.873.17 7.955.174 2.125.535 3.9 1.356 5.512a14 14 0 0 0 6.118 6.118c1.613.822 3.387 1.182 5.512 1.356 2.082.17 4.67.17 7.955.17h9.778c3.285 0 5.873 0 7.956-.17 2.124-.174 3.899-.534 5.511-1.356a14 14 0 0 0 6.118-6.118c.822-1.613 1.182-3.387 1.356-5.512.17-2.082.17-4.67.17-7.955V27.11c0-3.285 0-5.873-.17-7.956-.174-2.124-.534-3.899-1.356-5.51a14 14 0 0 0-6.118-6.12c-1.612-.82-3.387-1.181-5.511-1.355C42.762 6 40.174 6 36.889 6H27.2M10.142 44.325l.015.194c.153 1.877.447 3.066.933 4.021a10 10 0 0 0 4.37 4.37c.955.487 2.144.78 4.021.933 1.901.155 4.326.157 7.72.157h9.6c3.392 0 5.817-.002 7.718-.157 1.877-.153 3.067-.447 4.021-.933a10 10 0 0 0 4.37-4.37c.487-.955.78-2.144.933-4.021l.016-.194-1.693-1.656-.057-.056c-.998-.977-1.832-1.792-2.568-2.404-.768-.64-1.559-1.169-2.505-1.471a7.33 7.33 0 0 0-4.471 0c-.947.302-1.737.832-2.506 1.471-.736.612-1.57 1.428-2.568 2.404l-.036.035-4.407-5.094-.055-.064c-.985-1.14-1.806-2.088-2.537-2.803-.762-.745-1.558-1.372-2.541-1.751a7.33 7.33 0 0 0-4.7-.196c-1.01.296-1.856.855-2.677 1.533-.789.653-1.685 1.53-2.762 2.583l-.06.06zm32.525-17.658a5.333 5.333 0 1 0 0-10.667 5.333 5.333 0 0 0 0 10.667",clipRule:"evenodd",opacity:"0.8"})),he().createElement("defs",null,he().createElement("linearGradient",{id:"paint0_linear_20560_14311",x1:"32",x2:"32",y1:"0",y2:"64",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#FCFCFD"}),he().createElement("stop",{offset:"1",stopColor:"#fff"})),he().createElement("linearGradient",{id:"paint1_linear_20560_14311",x1:"32",x2:"32.066",y1:"63.652",y2:"0.348",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{offset:"0.016",stopColor:"#F7FAFC"}),he().createElement("stop",{offset:"0.5",stopColor:"#DEE5EB",stopOpacity:"0.75"}),he().createElement("stop",{offset:"1",stopColor:"#F7FAFC"})),he().createElement("linearGradient",{id:"paint2_linear_20560_14311",x1:"6",x2:"58",y1:"6",y2:"58",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#EAF1F7"}),he().createElement("stop",{offset:"0.599",stopColor:"#ADB8CC"}),he().createElement("stop",{offset:"1",stopColor:"#EAF1F7"})),he().createElement("clipPath",{id:"bgblur_0_20560_14311_clip_path"},he().createElement("rect",{width:"62.809",height:"62.809",x:"0.595",y:"0.595",rx:"17.06"})))),he().createElement("h3",{style:{fontSize:"16px",lineHeight:"1.5",fontWeight:500,color:"#40464F",margin:"16px 0 0"}},(0,At.__)("Logo Preview","templately")),he().createElement("p",{style:{fontSize:"12px",lineHeight:"1.5",fontWeight:400,color:"#737A85",margin:0,maxWidth:"35ch"}},(0,At.__)("Generate your logo with AI and see a live preview here.","templately"))):he().createElement(he().Fragment,null,he().createElement("div",{style:{width:"100%",display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",flex:1,boxSizing:"border-box"}},t.map(function(e,t){return he().createElement("div",{key:e.id||t,className:"templately-ai-logo-preview-gallery-image-wrapper",style:{position:"relative",width:"100%",aspectRatio:"152/112",borderRadius:"12px",overflow:"hidden",border:"1px solid #E4E7EB",background:"#FAFBFC",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"}},he().createElement("img",{src:e.url,alt:"Generated ".concat(t+1),style:{width:"100%",height:"100%",objectFit:"contain"}}),he().createElement("div",{className:"templately-ai-logo-preview-gallery-image-overlay",style:{position:"absolute",inset:0,backgroundColor:"rgba(24, 26, 31, 0.4)",display:"flex",alignItems:"center",justifyContent:"center",opacity:0,visibility:"hidden",transition:"all 0.1s ease",boxSizing:"border-box"}},he().createElement("button",{onClick:function(){n(e.id),o(e.id)},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",minHeight:"28px",padding:"4px 12px",backgroundColor:"#5632D1",color:"#fff",border:"none",borderRadius:"4px",fontSize:"12px",fontWeight:500,cursor:"pointer",boxSizing:"border-box"}},(0,At.__)("Insert","templately"))))})))},RR=function(e){var t=e.generatedImages,n=e.selectedImageId,r=e.onSelectImage,o=e.onInsertSelected,i=e.isLoading,a=e.creditCost,l=e.error,s=e.setShowPicker,c=e.loaderQuantity;return he().createElement("div",{style:{flex:1,minWidth:0,padding:"16px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px"}},he().createElement("div",{style:{flex:1,minWidth:0,padding:"0",overflowY:"auto",display:"flex",flexDirection:"column",gap:"20px"}},he().createElement("h4",{style:{fontSize:"14px",fontWeight:"500",color:"#40444F",margin:0,lineHeight:"1.5"}},(0,At.__)("Preview","templately")),he().createElement(LR,{images:t,selectedImageId:n,onSelectImage:r,isLoading:i,onInsertSelected:function(e){o(e),s(!1)},loaderQuantity:c})),l&&he().createElement(WL,{message:l}),!!a&&he().createElement("div",{style:{padding:"0",backgroundColor:"transparent",borderRadius:"0",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}},he().createElement(Vu,{size:16,color:"#737985"}),he().createElement("span",{style:{color:"#40444F",fontSize:"12px",fontWeight:"400"}},he().createElement("span",{style:{fontWeight:"500"}},a)," ",a>1?"Credits":"Credit"," ",(0,At.__)("used for this generation","templately"))))},BR=function(e){return"object"===ne(e)&&"linear"===e.type},zR=function(e,t,n){var r=e*Math.PI/180,o=t/2,i=n/2,a=Math.max(t,n);return{start:{x:o-Math.cos(r)*a/2,y:i-Math.sin(r)*a/2},end:{x:o+Math.cos(r)*a/2,y:i+Math.sin(r)*a/2}}},WR=he().forwardRef(function(e,t){var n=e.text,r=e.fontFamily,o=e.fontSize,i=e.iconSize,a=e.fontWeight,l=e.textColor,s=e.backgroundColor,c=e.iconGap,u=e.icon,d=e.Stage,p=e.Layer,f=e.KonvaText,h=e.Rect,m=e.KonvaImage,g=(0,pe.useRef)(null),v=ce(he().useState(!1),2),y=v[0],b=v[1],w=ce(he().useState(null),2),E=w[0],k=w[1],O=ce(he().useState(0),2),S=O[0],x=O[1],_=ce(he().useState(0),2),C=_[0],D=_[1];(0,pe.useEffect)(function(){t&&("function"==typeof t?t(g.current):t.current=g.current)},[t]);var P=mR,A=gR,T=u?i:0,F=Math.round((o+T)/8),M=u?void 0===c||""===c?F:Number(c):0;(0,pe.useEffect)(function(){var e,t,i=document.createElement("canvas").getContext("2d");if(i){i.font="".concat(a," ").concat(100,'px "').concat(r,'"');var l=i.measureText(n),s=l.width;x(s/100*o*1.05);var c=(null!==(e=l.actualBoundingBoxAscent)&&void 0!==e?e:0)+(null!==(t=l.actualBoundingBoxDescent)&&void 0!==t?t:0);D(c>0?c/100*o:o)}else x(0)},[n,r,a,o,y]),(0,pe.useEffect)(function(){var e=!1;if(u){var t,n,r,o,i,a=BR(l),s="";if(a){var c="icon-gradient-".concat(Math.random().toString(36).substr(2,9)),d=(0,ED.renderToString)(he().createElement(Hn.Vx.Provider,{value:{attr:{fill:"url(#".concat(c,")")},size:"".concat(T,"px"),style:{verticalAlign:"middle"}}},he().createElement(u,null))),p=l,f=p.startColor,h=p.endColor,m=(t=(p.angle-90)*(Math.PI/180),n=50+50*Math.cos(t+Math.PI),r=50+50*Math.sin(t+Math.PI),o=50+50*Math.cos(t),i=50+50*Math.sin(t),{x1:"".concat(n,"%"),y1:"".concat(r,"%"),x2:"".concat(o,"%"),y2:"".concat(i,"%")});s='\n <svg xmlns="http://www.w3.org/2000/svg" width="'.concat(T,'" height="').concat(T,'" viewBox="0 0 ').concat(T," ").concat(T,'">\n <defs>\n <linearGradient id="').concat(c,'" x1="').concat(m.x1,'" y1="').concat(m.y1,'" x2="').concat(m.x2,'" y2="').concat(m.y2,'">\n <stop offset="0%" stop-color="').concat(f,'" />\n <stop offset="100%" stop-color="').concat(h,'" />\n </linearGradient>\n </defs>\n ').concat(d,"\n </svg>\n ")}else{var g="string"==typeof l?l:"#333",v=(0,ED.renderToString)(he().createElement(u,{size:T,color:g,style:{verticalAlign:"middle"}}));s=v.replace(/currentColor/g,g)}var y=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),b=URL.createObjectURL(y),w=new Image;return w.onload=function(){e||k(w),URL.revokeObjectURL(b)},w.onerror=function(t){e||console.error("Failed to load icon SVG. SVG String:",s,t),URL.revokeObjectURL(b)},w.src=b,function(){e=!0}}k(null)},[u,l,T]),(0,pe.useEffect)(function(){b(!1),kR(r,[],a,o).then(function(){b(!0),setTimeout(function(){g.current&&(g.current.clearCache(),g.current.batchDraw())},100)}).catch(function(e){console.error("Failed to load font:",e),b(!0)})},[r,n,a,o,u]);var I={x:0,y:0,width:P,height:A};if(BR(s)){var N=zR(s.angle,P,A);I.fillLinearGradientStartPoint=N.start,I.fillLinearGradientEndPoint=N.end,I.fillLinearGradientColorStops=[0,s.startColor,1,s.endColor]}else I.fill=s;var j=(P-(u?T+M+S:S))/2,L=Math.max(4,j),R=E?{image:E,x:L,y:(A-T)/2,width:T,height:T}:void 0,B=C>0?C:o,z={text:n||"Your Logo",fontSize:o,fontFamily:r,fontStyle:"".concat(a),x:u?L+T+M:L,y:(A-B)/2,width:S>0?S:304,height:B,align:"left",verticalAlign:"middle",wrap:"none"};if(BR(l)){var W=zR(l.angle,P,A);z.fillLinearGradientStartPoint=W.start,z.fillLinearGradientEndPoint=W.end,z.fillLinearGradientColorStops=[0,l.startColor,1,l.endColor]}else z.fill=l;return he().createElement(d,{ref:g,width:P,height:A,style:{backgroundColor:"transparent"}},he().createElement(p,null,he().createElement(h,I),R&&he().createElement(m,R),y&&he().createElement(f,z)))});function UR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return VR(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(VR(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,VR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,VR(d,"constructor",c),VR(c,"constructor",s),s.displayName="GeneratorFunction",VR(c,o,"GeneratorFunction"),VR(d),VR(d,o,"Generator"),VR(d,r,function(){return this}),VR(d,"toString",function(){return"[object Generator]"}),(UR=function(){return{w:i,m:p}})()}function VR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}VR=function(e,t,n,r){function i(t,n){VR(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},VR(e,t,n,r)}var HR=he().lazy(hi(UR().m(function e(){var t,n,r,o,i,l;return UR().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.e(969).then(a.bind(a,2518));case 1:return t=e.v,n=t.Stage,r=t.Layer,o=t.Text,i=t.Rect,l=t.Image,e.a(2,{default:he().forwardRef(function(e,t){return he().createElement(WR,re({},e,{ref:t,Stage:n,Layer:r,KonvaText:o,Rect:i,KonvaImage:l}))})})}},e)}))),GR=function(){var e=hi(UR().m(function e(){return UR().w(function(e){for(;;)if(0===e.n)return e.a(2,a.e(969).then(a.bind(a,2518)))},e)}));return function(){return e.apply(this,arguments)}}(),qR=he().forwardRef(function(e,t){var n;return he().createElement("div",{style:{width:mR,height:gR,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},he().createElement(pe.Suspense,{fallback:he().createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},he().createElement("img",{src:null===(n=window.templately)||void 0===n?void 0:n.loadingImage,alt:"Loading...",style:{width:"40px",height:"40px"}}),he().createElement("span",{style:{fontSize:"12px",color:"#666"}},"Loading Canvas..."))},he().createElement(HR,re({},e,{ref:t}))))});function QR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return $R(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):($R(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$R(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,$R(d,"constructor",c),$R(c,"constructor",s),s.displayName="GeneratorFunction",$R(c,o,"GeneratorFunction"),$R(d),$R(d,o,"Generator"),$R(d,r,function(){return this}),$R(d,"toString",function(){return"[object Generator]"}),(QR=function(){return{w:i,m:p}})()}function $R(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$R=function(e,t,n,r){function i(t,n){$R(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},$R(e,t,n,r)}var YR=.25,XR=function(e,t,n){return Math.min(Math.max(e,t),n)},KR=function(e){var t=e.onClick,n=e.title,r=e.disabled,o=e.children;return he().createElement("button",{onClick:t,title:n,disabled:r,style:{background:"none",border:"none",cursor:r?"default":"pointer",padding:"2px 6px",color:r?"#c0c4cc":"#5f6368",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",transition:"background 0.15s",opacity:r?.5:1},onMouseEnter:function(e){r||(e.currentTarget.style.background="#e8eaed")},onMouseLeave:function(e){e.currentTarget.style.background="none"}},o)},ZR=function(e){var t=e.settings,n=e.onSubmit,r=e.fieldName,o=e.setShowPicker,i=e.onShuffle,a=(0,pe.useRef)(null),l=(0,pe.useRef)(null),s=ce((0,pe.useState)(1),2),c=s[0],u=s[1],d=ce((0,pe.useState)({x:0,y:0}),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!1),2),m=h[0],g=h[1],v=(0,pe.useRef)({x:0,y:0,panX:0,panY:0}),y=t.text||wR,b=(0,pe.useCallback)(function(e,t,n){u(function(r){var o=XR(e,YR,3);return void 0!==t&&void 0!==n&&f(function(e){return{x:t-(t-e.x)*(o/r),y:n-(n-e.y)*(o/r)}}),o})},[]),w=(0,pe.useCallback)(function(){return b(c+.1)},[c,b]),E=(0,pe.useCallback)(function(){return b(c-.1)},[c,b]),k=(0,pe.useCallback)(function(){u(1),f({x:0,y:0})},[]),O=(0,pe.useCallback)(function(){if(l.current){var e=l.current.getBoundingClientRect(),t=e.width/mR,n=e.height/gR,r=XR(.9*Math.min(t,n),YR,3);u(r),f({x:0,y:0})}},[]),S=(0,pe.useRef)(c);S.current=c,(0,pe.useEffect)(function(){var e=l.current;if(e){var t=function(t){t.preventDefault(),t.stopPropagation();var n=e.getBoundingClientRect(),r=t.clientX-n.left-n.width/2,o=t.clientY-n.top-n.height/2,i=.001*-t.deltaY;b(S.current+i*S.current,r,o)};return e.addEventListener("wheel",t,{passive:!1}),function(){return e.removeEventListener("wheel",t)}}},[b]);var x=(0,pe.useCallback)(function(e){(1===e.button||0===e.button&&1!==c)&&(e.preventDefault(),g(!0),v.current={x:e.clientX,y:e.clientY,panX:p.x,panY:p.y},e.currentTarget.setPointerCapture(e.pointerId))},[c,p]),_=(0,pe.useCallback)(function(e){m&&f({x:v.current.panX+(e.clientX-v.current.x),y:v.current.panY+(e.clientY-v.current.y)})},[m]),C=(0,pe.useCallback)(function(e){m&&(g(!1),e.currentTarget.releasePointerCapture(e.pointerId))},[m]);(0,pe.useEffect)(function(){1===c&&f({x:0,y:0})},[c]),(0,pe.useEffect)(function(){u(1),f({x:0,y:0})},[y]);var D=function(){var e=hi(QR().m(function e(){var t;return QR().w(function(e){for(;;)switch(e.n){case 0:if(!a.current){e.n=2;break}return t=a.current.toDataURL({pixelRatio:vR}),e.n=1,n(r,{selectedImage:{id:null,url:t}},function(){});case 1:o(!1);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),P=Math.round(100*c);return he().createElement("div",{style:{flex:1,minWidth:0,padding:"16px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"8px"}},he().createElement("div",{style:{flex:1,minWidth:0,padding:"0",overflowY:"auto",display:"flex",flexDirection:"column",gap:"20px"}},he().createElement("h4",{style:{fontSize:"14px",fontWeight:"500",color:"#40444F",margin:0,lineHeight:"1.5",display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},(0,At.__)("Preview","templately"),i&&he().createElement("button",{onClick:i,title:(0,At.__)("Shuffle Settings","templately"),style:{background:"#F2F5F7",border:"1px solid #E4E7EB",borderRadius:"6px",cursor:"pointer",padding:"4px 8px",color:"#5632D1",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",fontSize:"11px",fontWeight:600,gap:"4px"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#5632D1",e.currentTarget.style.color="#fff"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#F2F5F7",e.currentTarget.style.color="#5632D1"}},he().createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},he().createElement("path",{d:"M21 2v6h-6M3 12a9 9 0 0 1 15-6.7L21 8M3 22v-6h6M21 12a9 9 0 0 1-15 6.7L3 16"})))),he().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",boxSizing:"border-box",position:"relative"}},he().createElement("div",{ref:l,onPointerDown:x,onPointerMove:_,onPointerUp:C,onPointerCancel:C,style:{flex:1,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",cursor:m?"grabbing":1!==c?"grab":"default",userSelect:"none",touchAction:"none",backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",borderRadius:"8px 8px 0 0",minHeight:124}},he().createElement("div",{style:{transform:"translate(".concat(p.x,"px, ").concat(p.y,"px) scale(").concat(c,")"),transformOrigin:"center center",transition:m?"none":"transform 0.15s ease-out",willChange:"transform",lineHeight:0}},he().createElement(qR,{ref:a,text:y,fontFamily:t.fontFamily,fontSize:t.fontSize,iconSize:t.iconSize,fontWeight:t.fontWeight,textColor:t.textColor,backgroundColor:t.backgroundColor,iconGap:Number(t.iconGap),icon:t.icon||void 0}))),he().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",padding:"4px 8px",background:"#f8f9fa",borderTop:"1px solid #e5e7eb",borderRadius:"0 0 8px 8px"}},he().createElement(KR,{onClick:E,title:(0,At.__)("Zoom Out","templately"),disabled:c<=YR},he().createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},he().createElement("circle",{cx:"11",cy:"11",r:"8"}),he().createElement("line",{x1:"7",y1:"11",x2:"15",y2:"11"}),he().createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),he().createElement("button",{onClick:k,title:(0,At.__)("Reset Zoom","templately"),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 6px",fontWeight:600,fontSize:"11px",color:"#5f6368",minWidth:"42px",textAlign:"center",borderRadius:"4px",transition:"background 0.15s"},onMouseEnter:function(e){e.currentTarget.style.background="#e8eaed"},onMouseLeave:function(e){e.currentTarget.style.background="none"}},P,"%"),he().createElement(KR,{onClick:w,title:(0,At.__)("Zoom In","templately"),disabled:c>=3},he().createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},he().createElement("circle",{cx:"11",cy:"11",r:"8"}),he().createElement("line",{x1:"11",y1:"7",x2:"11",y2:"15"}),he().createElement("line",{x1:"7",y1:"11",x2:"15",y2:"11"}),he().createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))),he().createElement("div",{style:{width:"1px",height:"14px",backgroundColor:"#dadce0",margin:"0 4px"}}),he().createElement(KR,{onClick:O,title:(0,At.__)("Fit to View","templately")},he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14px",height:"14px",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 448 512"},he().createElement("path",{stroke:"none",d:"M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32zm32 320c0-17.7-14.3-32-32-32S0 334.3 0 352v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32zm128 320c0-17.7-14.3-32-32-32s-32 14.3-32 32v64h-64c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32z"}))))),he().createElement(tj.Button,{variant:"primary",onClick:D,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",width:"100%",minHeight:"40px",padding:"4px 24px",backgroundColor:"#5632D1",color:"#fff",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:500,cursor:"pointer",boxSizing:"border-box"}},(0,At.__)("Insert Logo","templately"))))};function JR(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return eB(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(eB(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,eB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,eB(d,"constructor",c),eB(c,"constructor",s),s.displayName="GeneratorFunction",eB(c,o,"GeneratorFunction"),eB(d),eB(d,o,"Generator"),eB(d,r,function(){return this}),eB(d,"toString",function(){return"[object Generator]"}),(JR=function(){return{w:i,m:p}})()}function eB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}eB=function(e,t,n,r){function i(t,n){eB(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},eB(e,t,n,r)}var tB=function(){var e=hi(JR().m(function e(t,n,r){var o,i;return JR().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,kR(n,[],r,100);case 1:e.n=3;break;case 2:e.p=2,e.v;case 3:if(o=document.createElement("canvas"),i=o.getContext("2d")){e.n=4;break}return e.a(2,0);case 4:return i.font="".concat(r," ").concat(100,'px "').concat(n,'"'),e.a(2,i.measureText(t||"Your Logo").width/100*1.05)}},e,null,[[0,2]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),nB=function(){var e=hi(JR().m(function e(t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O;return JR().w(function(e){for(;;)switch(e.n){case 0:return n=t.text,r=t.fontFamily,o=t.fontWeight,i=t.icon,a=t.fontSize,l=t.iconSize,s=t.iconGap,c=t.canvasWidth,u=void 0===c?mR:c,d=t.canvasHeight,p=void 0===d?gR:d,f=t.padding,h=void 0===f?4:f,e.n=1,tB(n,r,o);case 1:if(0!==(m=e.v)){e.n=2;break}return e.a(2,{maxFontSize:yR,maxIconSize:bR});case 2:return g=u-2*h,v=p-2*h,b=(y="number"==typeof s)?s:null,w=i?y?(g-l-b)/m:(g-1.125*l)/(m+.125):g/m,E=Math.max(8,Math.min(Math.floor(w),yR,v)),k=i?y?g-m*a-b:(g-a*(m+.125))/1.125:bR,O=Math.max(6,Math.min(Math.floor(k),bR,v)),e.a(2,{maxFontSize:E,maxIconSize:O})}},e)}));return function(t){return e.apply(this,arguments)}}(),rB=function(){var e=hi(JR().m(function e(t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O,S,x,_,C;return JR().w(function(e){for(;;)switch(e.n){case 0:return n=t.text,r=t.fontFamily,o=t.fontWeight,i=t.icon,a=t.canvasWidth,l=void 0===a?mR:a,s=t.padding,c=void 0===s?4:s,u=t.maxFontSize,d=void 0===u?yR:u,p=t.maxIconSize,f=void 0===p?bR:p,h=t.iconGap,e.n=1,tB(n,r,o);case 1:if(m=e.v,g=l-2*c,0!==m){e.n=2;break}return e.a(2,{fontSize:72,iconSize:80,iconGap:0});case 2:if(v=g/m,y=Math.floor(Math.min(Math.max(v,20),d)),b=Math.floor(Math.min(Math.max(.65*y,40),f)),!(i&&b>0)){e.n=3;break}return E=(w=void 0!==h&&""!==h&&"-"!==h)?Number(h):Math.round((b+y)/8),k=g-(b+E),O=Math.floor(Math.min(Math.max(k/m,20),d)),S=Math.floor(Math.min(Math.max(.65*O,40),f)),x=w?Number(h):Math.round((S+O)/8),m*O+S+x>g&&(_=w?m+.65:m+.65+1.65/8,C=Math.floor(Math.min(Math.max(g/_,20),d)),O=C,S=Math.floor(Math.min(Math.max(.65*C,40),f)),x=w?Number(h):Math.round((S+O)/8)),e.a(2,{fontSize:O,iconSize:S,iconGap:x});case 3:return e.a(2,{fontSize:y,iconSize:b,iconGap:0})}},e)}));return function(t){return e.apply(this,arguments)}}();function oB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return iB(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(iB(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,iB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,iB(d,"constructor",c),iB(c,"constructor",s),s.displayName="GeneratorFunction",iB(c,o,"GeneratorFunction"),iB(d),iB(d,o,"Generator"),iB(d,r,function(){return this}),iB(d,"toString",function(){return"[object Generator]"}),(oB=function(){return{w:i,m:p}})()}function iB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}iB=function(e,t,n,r){function i(t,n){iB(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},iB(e,t,n,r)}function aB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sB=[{name:"Classic",colors:["#000000","#1A1A2E","#16213E","#0F3460","#E94560"]},{name:"Professional",colors:["#2C3E50","#34495E","#1ABC9C","#3498DB","#9B59B6"]},{name:"Bold",colors:["#E74C3C","#C0392B","#8E44AD","#2980B9","#27AE60"]},{name:"Earth",colors:["#5D4037","#795548","#A1887F","#6D4C41","#8D6E63"]},{name:"Modern",colors:["#1E3A5F","#3C6E71","#D9B08C","#FF6B6B","#4ECDC4"]},{name:"Dark",colors:["#121212","#1E1E1E","#2D2D2D","#333333","#424242"]}].flatMap(function(e){return e.colors}),cB=function(e){for(var t=Nl(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),o=[t[r],t[n]];t[n]=o[0],t[r]=o[1]}return t},uB=function(){return Sd(function e(t){kd(this,e),Pt(this,"items",void 0),Pt(this,"currentIndex",0),Pt(this,"lastItem",null),this.items=Nl(t),this.shuffle()},[{key:"shuffle",value:function(){for(var e=this.items.length-1;e>0;e--){var t=Math.floor(Math.random()*(e+1)),n=[this.items[t],this.items[e]];this.items[e]=n[0],this.items[t]=n[1]}this.currentIndex=0}},{key:"next",value:function(){if(this.currentIndex>=this.items.length&&(this.shuffle(),this.items.length>1&&this.items[0]===this.lastItem)){var e=Math.floor(Math.random()*(this.items.length-1))+1,t=[this.items[e],this.items[0]];this.items[0]=t[0],this.items[e]=t[1]}var n=this.items[this.currentIndex++];return this.lastItem=n,n}},{key:"updateItems",value:function(e){this.items=Nl(e),this.shuffle()}}])}(),dB=function(e,t,n,r,o,i){var a,l,s=o&&o.length>0?o.map(function(e){return"object"===ne(e)&&null!==e&&e.color?e.color:e}):[],c=[].concat(Nl(s),Nl(sB));0===(c=c.filter(function(e){return function(e){var t,n,r,o=e.startsWith("#")?e.slice(1):e;return 3===o.length?(t=parseInt(o[0]+o[0],16),n=parseInt(o[1]+o[1],16),r=parseInt(o[2]+o[2],16)):(t=parseInt(o.slice(0,2),16),n=parseInt(o.slice(2,4),16),r=parseInt(o.slice(4,6),16)),isNaN(t)||isNaN(n)||isNaN(r)?0:(299*t+587*n+114*r)/1e3}(e)<170})).length&&(c=["#1a1a1a"]),!e.current&&r.length>0&&(e.current=new uB(r)),!t.current&&i.length>0&&(t.current=new uB(i)),n.current&&null!==n.current||(n.current=new uB(c));var u=null===(a=e.current)||void 0===a?void 0:a.next(),d=(null===(l=t.current)||void 0===l?void 0:l.next())||null,p=n.current.next(),f=400;return null!=u&&u.variants&&u.variants.length>0&&(f=function(e){return e[Math.floor(Math.random()*e.length)]}(u.variants.map(function(e){if("regular"===e.value||"italic"===e.value)return 400;var t=parseInt(e.value.replace(/[^\d]/g,""),10);return isNaN(t)?400:t}))),{fontFamily:(null==u?void 0:u.value)||"Inspiration",fontWeight:f,textColor:p,icon:d?d.icon:null}};const pB=a.p+"images/ai-logo.png";function fB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return gB(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(gB(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,gB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,gB(d,"constructor",c),gB(c,"constructor",s),s.displayName="GeneratorFunction",gB(c,o,"GeneratorFunction"),gB(d),gB(d,o,"Generator"),gB(d,r,function(){return this}),gB(d,"toString",function(){return"[object Generator]"}),(mB=function(){return{w:i,m:p}})()}function gB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gB=function(e,t,n,r){function i(t,n){gB(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},gB(e,t,n,r)}var vB=function(e){var t=e.fieldName,n=e.onSubmit,r=e.setAIPromptPickerOpen,o=e.aiState,i=(e.label,e.siteTitle),a=e.fontList,l=e.systemColors,s=e.availableCredit,c=void 0===s?0:s,u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1],f=ce((0,pe.useState)("ai-generation"),2),h=f[0],m=f[1],g=ce((0,pe.useState)(!1),2),v=g[0],y=g[1],b=ce((0,pe.useState)(null),2),w=b[0],E=b[1],k=ce((0,pe.useState)(0),2),O=k[0],S=k[1],x=(0,pe.useMemo)(function(){var e;return null===(e=i||(0,At.__)("Your Logo","templately"))||void 0===e?void 0:e.trim()},[i]),_=ce((0,pe.useState)([]),2),C=_[0],D=_[1],P=ce((0,pe.useState)(!1),2),A=P[0],T=P[1],F=(0,pe.useRef)(!1),M=(0,pe.useRef)(!1),I=(0,pe.useCallback)(hi(mB().m(function e(){var t;return mB().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!F.current&&!M.current){e.n=1;break}return e.a(2);case 1:return T(!0),M.current=!0,e.p=2,e.n=3,hR(void 0,function(e){D(function(t){var n=new Set(t.map(function(e){return"".concat(e.meta.prefix,":").concat(e.meta.name)})),r=e.filter(function(e){return!n.has("".concat(e.meta.prefix,":").concat(e.meta.name))});return 0===r.length?t:[].concat(Nl(t),Nl(r))}),T(!1)});case 3:F.current=!0,e.n=5;break;case 4:e.p=4,t=e.v,console.error("Failed to load icons:",t);case 5:return e.p=5,T(!1),M.current=!1,e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])})),[]);(0,pe.useEffect)(function(){"typography"===h&&I()},[h,I]),(0,pe.useEffect)(function(){d&&(GR(),F.current||I())},[d,I]);var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=(0,pe.useRef)(null),o=(0,pe.useRef)(null),i=(0,pe.useRef)(null);(0,pe.useEffect)(function(){n.length>0&&(o.current?o.current.updateItems(n):o.current=new uB(n))},[n]);var a=(0,pe.useCallback)(function(){return dB(r,o,i,e,t,n)},[e,t,n]),l=(0,pe.useState)(function(){var a=dB(r,o,i,e,t,n);return lB(lB({text:wR,fontSize:72,iconSize:80,iconGap:20},a),{},{backgroundColor:ER})}),s=ce(l,2),c=s[0],u=s[1],d=(0,pe.useRef)(!!c.icon);(0,pe.useEffect)(function(){if(n.length>0&&!d.current){if(c.icon)return void(d.current=!0);var e=null;if(o.current)e=o.current.next().icon;else{var t=new uB(n);o.current=t,e=t.next().icon}if(e){d.current=!0;var r=c.text,i=c.fontFamily,a=c.fontWeight;rB({text:r,fontFamily:i,fontWeight:a,icon:e,canvasWidth:mR,canvasHeight:gR,padding:4,maxFontSize:yR,maxIconSize:bR}).then(function(t){u(function(n){return n.icon?n:lB(lB({},n),{},{icon:e,fontSize:t.fontSize,iconSize:t.iconSize,iconGap:t.iconGap})})}).catch(function(e){console.error("[useTypographySettings] Auto-fit failed during initialization:",e),d.current=!1})}}},[n,c.text,c.fontFamily,c.fontWeight]);var p=(0,pe.useRef)(n.length),f=ce((0,pe.useState)(function(){return n.length>0?cB(Nl(n)):[]}),2),h=f[0],m=f[1];(0,pe.useEffect)(function(){if(n.length>p.current){var e=n.slice(p.current),t=cB(Nl(e));m(function(e){return[].concat(Nl(e),Nl(t))}),p.current=n.length}else 0===n.length&&p.current>0&&(m([]),p.current=0)},[n]);var g=(0,pe.useCallback)(hi(oB().m(function e(){var t,n;return oB().w(function(e){for(;;)switch(e.n){case 0:return t=a(),e.n=1,rB({text:c.text,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon,canvasWidth:mR,canvasHeight:gR,padding:4,maxFontSize:yR,maxIconSize:bR});case 1:n=e.v,u(function(e){return lB(lB({},e),{},{fontSize:n.fontSize,iconSize:n.iconSize,iconGap:n.iconGap},t)});case 2:return e.a(2)}},e)})),[c.text,a]),v=(0,pe.useCallback)(function(e,t){u(function(n){return lB(lB({},n),{},Pt({},e,t))})},[]);return{settings:c,setSettings:u,shuffleSettings:g,updateSetting:v,shuffledIcons:h,iconsLoaded:n.length>0}}(a,l,C),j=N.settings,L=N.setSettings,R=N.shuffleSettings,B=N.shuffledIcons,z=(N.iconsLoaded,ce((0,pe.useState)({maxFontSize:yR,maxIconSize:bR}),2)),W=z[0],U=z[1],V=(0,pe.useMemo)(function(){return(j.text||"").trim()||x},[j.text,x]),H=(0,pe.useMemo)(function(){return hB(hB({},j),{},{text:V})},[j,V]);(0,pe.useEffect)(function(){var e=function(){var e=hi(mB().m(function e(){var t;return mB().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,nB({text:V,fontFamily:j.fontFamily,fontWeight:j.fontWeight,icon:j.icon,fontSize:j.fontSize,iconSize:j.iconSize,iconGap:j.iconGap});case 1:t=e.v,U(t);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();e()},[V,j.fontFamily,j.fontWeight,j.icon,j.fontSize,j.iconSize,j.iconGap]);var G=(0,pe.useCallback)(function(){var e=hi(mB().m(function e(t){var n,r,o;return mB().w(function(e){for(;;)switch(e.n){case 0:return n=(t.text||"").trim()||x,e.n=1,rB({text:n,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon});case 1:return r=e.v,e.n=2,nB({text:n,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon,fontSize:r.fontSize,iconSize:r.iconSize,iconGap:r.iconGap});case 2:o=e.v,r.fontSize=Math.min(r.fontSize,o.maxFontSize),r.iconSize=Math.min(r.iconSize,o.maxIconSize),L(function(e){return hB(hB({},e),{},{text:t.text,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon,fontSize:r.fontSize,iconSize:r.iconSize,iconGap:r.iconGap})});case 3:return e.a(2)}},e)}));return function(_x){return e.apply(this,arguments)}}(),[x,L]);he().useEffect(function(){r(d)},[d,r]),he().useEffect(function(){x&&"Your Logo"===j.text&&L(function(e){return hB(hB({},e),{},{text:x})})},[x,L]);var q=null==o?void 0:o.error,Q=function(){var e=hi(mB().m(function e(t,r,o){return mB().w(function(e){for(;;)switch(e.n){case 0:if(!n){e.n=1;break}return e.n=1,n(t,r,o);case 1:return e.a(2)}},e)}));return function(t,n,r){return e.apply(this,arguments)}}(),$=function(){var e=hi(mB().m(function e(r){var i;return mB().w(function(e){for(;;)switch(e.n){case 0:if(!r||null==o||!o.images){e.n=1;break}if(!(i=o.images.find(function(e){return e.id===r}))){e.n=1;break}return e.n=1,n(t,{selectedImage:i},y);case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();return he().createElement(he().Fragment,null,he().createElement("style",null,"\n\t@keyframes ai-prompt-pulse {\n\t\t0%, 100% { opacity: 1; transform: scale(1); }\n\t\t50% { opacity: 0.5; transform: scale(2.15); }\n\t}\n\t@keyframes spin {\n\t\t0% { transform: rotate(0deg); }\n\t\t100% { transform: rotate(360deg); }\n\t}\n"),he().createElement(PL,{open:d,onOpenChange:function(e){v||p(e)}},he().createElement(AL,{asChild:!0},he().createElement("button",{className:"templately-ai-prompt-button",style:{cursor:"pointer",transformOrigin:"center"},title:q||void 0,type:"button"},he().createElement(RL,null),he().createElement("span",{className:"templately-ai-prompt-button-text"},(0,At.__)("Generate Logo with AI","templately")))),he().createElement(TL,null,he().createElement(FL,{style:{backgroundColor:"rgba(24, 26, 31, 0.7)",position:"fixed",inset:0,zIndex:99999}}),he().createElement(ML,{className:"templately-ai-image-generator-modal",style:{position:"fixed",inset:0,transform:"translate(0%, 0%)",backgroundColor:"transparent",borderRadius:"0",boxShadow:"none",width:"100vw",height:"100vh",overflow:"auto",boxSizing:"border-box",zIndex:1e5,padding:"30px",display:"flex"}},he().createElement("div",{style:{margin:"auto",borderRadius:"16px",boxShadow:"none",width:"95vw",maxWidth:"712px",overflow:"hidden",zIndex:1e5,display:"flex",flexDirection:"column"}},he().createElement("div",{className:"templately-ai-logo-generator-header"},he().createElement("div",{className:"templately-ai-logo-generator-header-left"},he().createElement("img",{className:"templately-ai-logo-generator-logo",src:pB,alt:"AI Logo Generator"}),he().createElement("div",{className:"templately-ai-logo-generator-header-title-wrapper"},he().createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px"}},he().createElement(bL,{className:"templately-ai-logo-generator-header-title"},(0,At.__)("Site Logo Generator","templately")),he().createElement("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"4px 12px",backgroundColor:"#F2F5F7",border:"1px solid #E4E7EB",borderRadius:"10px",fontSize:"12px",fontWeight:500,color:"#40444F",height:"20px"}},he().createElement(LL,null),he().createElement("span",null,(0,At.__)("Available Credit","templately")," ",Math.max(0,c).toLocaleString()))),he().createElement("p",{className:"templately-ai-logo-generator-header-subtitle"},(0,At.__)("Create your site logo using AI or design a custom typography logo manually.","templately")))),he().createElement(IL,{asChild:!0},he().createElement("button",{className:"templately-ai-logo-generator-close-button",disabled:v,"aria-label":"Close"},he().createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},he().createElement("path",{d:"M15 5L5 15M5 5L15 15",stroke:"#6B7280",strokeWidth:"2",strokeLinecap:"round"}))))),he().createElement("div",{className:"templately-ai-logo-generator-body",style:{minHeight:526}},he().createElement("div",{className:"templately-ai-logo-generator-body-left"},he().createElement("div",{className:"templately-ai-logo-generator-tab-switcher"},he().createElement("button",{onClick:function(){return m("ai-generation")},className:"templately-ai-logo-generator-tab-switcher-button ".concat("ai-generation"===h?"active-tab":"")},he().createElement(NL,null),(0,At.__)("AI Generator","templately")),he().createElement("button",{onClick:function(){return m("typography")},className:"templately-ai-logo-generator-tab-switcher-button ".concat("typography"===h?"active-tab":"")},he().createElement(jL,null),(0,At.__)("Typography","templately"))),"ai-generation"===h?he().createElement(nR,{fieldName:t,onSubmit:Q,aiState:o,isLoading:v,setIsLoading:y,setLoaderQuantity:S,siteTitle:x}):he().createElement(TR,{settings:j,onSettingsChange:L,icons:B,fontList:a,iconsLoading:A,maxDimensions:W,onAutoFit:G})),he().createElement("div",{className:"templately-ai-logo-generator-body-right"},"ai-generation"===h?he().createElement(RR,{generatedImages:(null==o?void 0:o.images)||[],selectedImageId:w,onSelectImage:E,onInsertSelected:$,isLoading:v,creditCost:null==o?void 0:o.creditCost,error:null==o?void 0:o.error,setShowPicker:p,loaderQuantity:O}):he().createElement(ZR,{settings:H,onSubmit:n,fieldName:t,setShowPicker:p,onShuffle:R}))))))))};const yB=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),pe.createElement("path",{fill:"url(#paint0_linear_20594_22070)",d:"M2 8c0-.301.245-.543.545-.572a5.456 5.456 0 0 0 4.883-4.883c.03-.3.27-.545.572-.545s.543.245.572.545a5.456 5.456 0 0 0 4.883 4.883c.3.03.545.27.545.572s-.245.543-.545.572a5.456 5.456 0 0 0-4.883 4.883c-.03.3-.27.545-.572.545s-.543-.245-.572-.545a5.456 5.456 0 0 0-4.883-4.883C2.245 8.542 2 8.302 2 8"}),pe.createElement("defs",null,pe.createElement("linearGradient",{id:"paint0_linear_20594_22070",x1:"8",x2:"8",y1:"2",y2:"14",gradientUnits:"userSpaceOnUse"},pe.createElement("stop",{stopColor:"#E5C8FF"}),pe.createElement("stop",{offset:"1",stopColor:"#BA6DFC"}))))},bB=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",fill:"none",viewBox:"0 0 12 12"},e),pe.createElement("g",{stroke:"#737985",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.2",clipPath:"url(#clip0_20659_12598)"},pe.createElement("path",{d:"M1.5 6.75a3.75 3.75 0 1 0 7.5 0 3.75 3.75 0 0 0-7.5 0"}),pe.createElement("path",{fill:"#F2F5F7",d:"M3.5 4.75a3.75 3.75 0 1 0 7.5 0 3.75 3.75 0 0 0-7.5 0"})),pe.createElement("defs",null,pe.createElement("clipPath",{id:"clip0_20659_12598"},pe.createElement("path",{fill:"#fff",d:"M0 0h12v12H0z"}))))};function wB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return EB(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(EB(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,EB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,EB(d,"constructor",c),EB(c,"constructor",s),s.displayName="GeneratorFunction",EB(c,o,"GeneratorFunction"),EB(d),EB(d,o,"Generator"),EB(d,r,function(){return this}),EB(d,"toString",function(){return"[object Generator]"}),(wB=function(){return{w:i,m:p}})()}function EB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}EB=function(e,t,n,r){function i(t,n){EB(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},EB(e,t,n,r)}var kB=function(e){var t=e.fieldName,n=e.onSubmit,r=e.setAIPromptPickerOpen,o=e.aiState,i=e.initialDescription,a=e.label,l=ce((0,pe.useState)(!1),2),s=l[0],c=l[1],u=ce((0,pe.useState)(""),2),d=u[0],p=u[1],f=ce((0,pe.useState)(!1),2),h=f[0],m=f[1],g=ce((0,pe.useState)("typographic"),2),v=(g[0],g[1],null==o?void 0:o.error),y=null==o?void 0:o.text;(0,pe.useEffect)(function(){r(s)},[s,r]),(0,pe.useEffect)(function(){!s||!i||d||"title"!==t&&"tag_line"!==t||p(i)},[s,i,t,d]),(0,pe.useEffect)(function(){!h&&y&&p("")},[h,y]);var b=function(){var e=hi(wB().m(function e(){var r;return wB().w(function(e){for(;;)switch(e.n){case 0:if(!d.trim()){e.n=2;break}return r={prompt:d},e.n=1,n(t,r,m);case 1:e.v&&c(!1);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return he().createElement(AF,{open:s,onOpenChange:function(e){h||c(e)}},he().createElement(TF,{asChild:!0},he().createElement("span",{className:"templately-ai-prompt-trigger",style:{cursor:"pointer",transformOrigin:"center"},title:v||void 0},he().createElement(yB,null),he().createElement("span",{className:"templately-ai-prompt-trigger-text"},(0,At.__)("Generate with AI","templately")))),he().createElement(FF,null,he().createElement(MF,{className:"templately-ai-prompt-picker",side:"right",align:"start",sideOffset:40,alignOffset:6,style:{zIndex:1e5,padding:"0",borderRadius:"16px",backgroundColor:"transparent",boxShadow:"none",width:"364px",display:"flex",flexDirection:"column",gap:"0px"}},h&&he().createElement(zL,null),he().createElement("div",{className:"templately-ai-prompt-picker-header"},he().createElement("h4",{className:"templately-ai-prompt-picker-title"},function(){if(a)return a;switch(t){case"title":return(0,At.__)("Generate Site Title","templately");case"tag_line":return(0,At.__)("Generate Site Tagline","templately");default:return(0,At.__)("Generate Field","templately")}}()),he().createElement("span",{className:"templately-ai-prompt-picker-credit-cost"},he().createElement(bB,null),he().createElement("span",{className:"templately-ai-prompt-picker-credit-cost-text"},"1"))),he().createElement("div",{className:"templately-ai-prompt-picker-body"},he().createElement("div",{className:"templately-ai-prompt-textarea-wrapper"},he().createElement("span",{className:"templately-ai-prompt-textarea-label"},(0,At.__)("Prompt","templately")),he().createElement(tj.TextareaControl,{value:d,onChange:function(e){return p(e)},placeholder:(0,At.__)("Enter your prompt","templately"),rows:4,className:"templately-ai-prompt-textarea"}),v&&he().createElement(WL,{message:v}))),he().createElement("div",{className:"templately-ai-prompt-picker-footer"},he().createElement("button",{className:"templately-ai-prompt-cancel-button",onClick:function(){return c(!1)},disabled:h},(0,At.__)("Cancel","templately")),he().createElement("button",{className:"templately-ai-prompt-submit-button",onClick:b,disabled:!d.trim()||h},h?(0,At.__)("Generating...","templately"):(0,At.__)("Generate","templately"))))))},OB=function(e){var t=e.fieldName,n=e.showAllFields;return"logo"===t&&void 0!==n&&n?he().createElement(vB,e):he().createElement(kB,e)},SB=["data","image_mappings"];function xB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return _B(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(_B(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_B(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,_B(d,"constructor",c),_B(c,"constructor",s),s.displayName="GeneratorFunction",_B(c,o,"GeneratorFunction"),_B(d),_B(d,o,"Generator"),_B(d,r,function(){return this}),_B(d,"toString",function(){return"[object Generator]"}),(xB=function(){return{w:i,m:p}})()}function _B(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_B=function(e,t,n,r){function i(t,n){_B(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},_B(e,t,n,r)}function CB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var PB=function(e){var t,n,r,o,i,a=e.name,l=(e.id,e.next),s=e.back,c=e.formData,u=e.live_url,d=e.has_settings,p=e.showErrorAlert,f=e.isAi,h=e.disableBackButton,m=e.setShowFSIModal,g=e.ogIsAi,v=(e.startModifyAiContent,e.platform),y=e.aiTemplates,b=e.customizerData,w=(e.onHideFSIModal,e.onShowAiSidebar),E=e.isWhiteLabel;if(!b)return console.error("CustomizerIsolated: customizerData prop is missing"),he().createElement("div",null,"Error: Customizer data not available");b.packInfo,b.googleFonts,b.packInfoLoading,b.googleFontsLoading,b.fetchPackImportInfo,b.fetchGoogleFonts;var k=b.aiData,O=(b.setAiData,b.title),S=b.setTitle,x=b.slogan,_=b.setSlogan,C=b.siteLogo,D=b.setSiteLogo,P=b.logoSrc,A=b.setLogoSrc,T=b.logoSize,F=b.setLogoSize,M=b.color,I=b.setColor,N=b.currentStep,j=b.setCurrentStep,L=b.settingsLoaded,R=b.setSettingsLoaded,B=b.systemColors,z=b.setSystemColors,W=b.originalTypography,U=b.setOriginalTypography,V=b.fontList,H=b.setFontList,G=b.generateLogo,q=b.generateTagline,Q=b.logoGeneration,$=b.taglineGeneration,Y=nv(W,v),X=Y.normalizedTypography,K=Y.groupedData,Z=Y.getDeNormalizedTypography,J=ce((0,pe.useState)(function(){return X}),2),ee=J[0],te=J[1],ne=(0,pe.useRef)(W),re=ce((0,pe.useState)(!0),2),oe=re[0],ie=re[1],ae=ce((0,pe.useState)(!0),2),le=ae[0],se=ae[1],ue=ce((0,pe.useState)(!1),2),de=ue[0],fe=ue[1],me=ce((0,pe.useState)(!1),2),ge=me[0],ve=me[1],ye=ce((0,pe.useState)(Math.random()),2),be=ye[0],we=(ye[1],ce((0,pe.useState)(!1),2)),Ee=we[0],ke=we[1],Oe=((0,pe.useRef)(),(0,pe.useRef)(),(0,pe.useRef)(!1)),Se=(null==a?void 0:a.split("-"))||[],xe=(0,pe.useMemo)(function(){return y||{templates:null,process_id:null,ai_page_ids:null}},[y]);(0,pe.useEffect)(function(){},[N]),(0,pe.useEffect)(function(){if(f&&!Oe.current){var e=null==xe?void 0:xe.name;e&&(O||S(e),Oe.current=!0)}},[f,xe,O,S]);var _e=(0,pe.useCallback)(function(e){var t=Z(e);if("gutenberg"===v){t.custom={};for(var n=0,r=Object.entries(e);n<r.length;n++){var o=ce(r[n],2),i=o[0];o[1]._isSystem||(t.custom[i]=t[i],delete t[i])}}c.set("typography",JSON.stringify(t))},[Z,v,c]),Ce=(0,pe.useCallback)(function(e){te(e)},[]);(0,pe.useEffect)(function(){ne.current===W||(0,Ea.isEmpty)(X)||(ne.current=W,te(X))},[W,X]);var De=(0,Ea.throttle)(function(e,t,n,r){var o,i,a={type:"templately_css_variable",log:(null===(o=window.templately)||void 0===o?void 0:o.log)||!1,platform:v,logo:P,color:e,logoSize:t,typography:{selectedTypography:n,screen:r,locale:"en"}};null===(i=Ie.current.contentWindow)||void 0===i||i.postMessage(a,"*")},500),Pe=(0,pe.useMemo)(function(){return(0,Ea.throttle)(function(e){var t,n=DB({type:"templately_ai_data",aiData:e.data,imageMappings:e.image_mappings||null},Wn(e,SB)),r=Ie.current;null!=r&&r.contentWindow&&(r.contentWindow.postMessage(n,"*"),null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.log&&$a("Throttled consolidated AI data and image mappings sent to iframe:",n))},500)},[v]),Ae=(0,pe.useCallback)(function(){var e,t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"postMessage";if(null!=xe&&xe.templates||k){var i=(null===(e=xe.ai_page_ids)||void 0===e?void 0:e["content/page"])||[],a={plugin_preview:be,has_ai_json:"true",platform:v,dev_mode:(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.dev_api)||!1,log:(null===(n=window.templatelyDeveloper)||void 0===n?void 0:n.log)||!1,processBackgroundImages:!0,ai_page_ids:i,isWhiteLabel:null!=E&&E,preview_origin_url:encodeURIComponent((null===(r=window.templately)||void 0===r?void 0:r.url)||window.location.origin)},l={use_partial_ai_content:!0,data:k||xe.templates};xe.imageMappings&&Object.keys(xe.imageMappings).length>0&&(l.image_mappings=xe.imageMappings);var s=DB(DB({},a),l);"postMessage"===o?Pe(s):"form"===o&&("string"==typeof u&&u.trim()?function(e,t,n){if(e&&n){var r=document.createElement("form");r.method="POST",r.action=(0,vi.addQueryArgs)(e,t),r.target="customizer-iframe",Object.keys(n).forEach(function(e){var t=document.createElement("input");t.type="hidden",t.name=e,t.value=JSON.stringify(n[e]),r.appendChild(t)}),document.body.appendChild(r),r.submit(),setTimeout(function(){document.body.removeChild(r)},200)}}(u,a,l):console.error("CustomizerIsolated: live_url is not a valid string for form submission:",u))}},[k,xe,Pe,v,be,u]),Te=ce((0,pe.useState)("desktop"),2),Fe=Te[0],Me=Te[1],Ie=(0,pe.useRef)(),Ne=ce((0,pe.useState)(0),2),je=Ne[0],Le=Ne[1],Re=function(){var e=hi(xB().m(function e(t,n,r){var o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,w,E,k,O,S,x;return xB().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!==(o=window.templatelyDeveloper)&&void 0!==o&&o.log&&$a("AI Prompt submitted:",{fieldName:t,data:n}),r(!0),e.p=1,"logo"!==t){e.n=5;break}if(G){e.n=2;break}throw new Error((0,At.__)("Logo generation is not available","templately"));case 2:if(!n.selectedImage){e.n=3;break}return l=n.selectedImage,Be({id:l.id||0,url:l.url}),null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.log&&$a("Selected image inserted:",l.url),e.a(2,!0);case 3:return s=n.prompt,c=n.logoStyle,u=n.quality,d=void 0===u?$L:u,p=n.size,f=void 0===p?YL:p,h=n.category,m=n.output_format,g=void 0===m?"png":m,v=n.quantity,y=void 0===v?1:v,e.n=4,G({business_name:(null==xe?void 0:xe.name)||"",description:s,quality:d,size:f,category:h||c||XL,background:KL,output_format:g,quantity:y});case 4:return(w=e.v)&&"number"==typeof w.availableCredit&&b.setAvailableCredit(w.availableCredit),null!==(i=window.templatelyDeveloper)&&void 0!==i&&i.log&&$a("Logo generated successfully:",w),e.a(2,w||!0);case 5:if("tag_line"!==t){e.n=8;break}if(q){e.n=6;break}throw new Error((0,At.__)("Tagline generation is not available","templately"));case 6:return k=n.prompt,e.n=7,q({prompt:k});case 7:return O=e.v,S=O.text,_(S),null!==(E=window.templatelyDeveloper)&&void 0!==E&&E.log&&$a("tagline generated successfully:",S),e.a(2,O||!0);case 8:return e.a(2,!1);case 9:return e.p=9,x=e.v,console.error("AI generation error:",x),e.a(2,!1);case 10:return e.p=10,r(!1),e.f(10);case 11:return e.a(2)}},e,null,[[1,9,10,11]])}));return function(_x,t,n){return e.apply(this,arguments)}}(),Be=function(e){if(null!=e&&e.url){c.set("logo",JSON.stringify({id:e.id,url:e.url}));var t=function(e){var t;return e&&(null===(t=window.templately)||void 0===t?void 0:t.is_ssl)&&/^http:\/\//i.test(e)?e.replace(/^http:\/\//i,"https://"):e}(e.url);fetch(t).then(function(e){return e.blob()}).then(function(e){var t=new FileReader;t.onloadend=function(){A(t.result)},t.readAsDataURL(e)}).catch(function(t){$a("Failed to convert logo to base64:",t),A(e.url)})}};return(0,pe.useEffect)(function(){je&&Ae("postMessage")},[k,je,Ae,xe]),(0,pe.useEffect)(function(){var e,t=null==b?void 0:b.packInfo;if(null!=t&&t.data&&null!==(e=t.data)&&void 0!==e&&null!==(e=e.manifest)&&void 0!==e&&e.has_settings&&t.data.settings){var n=t.data.settings,r="elementor"===v,o=Jg(n,v),i=o.colors,a=o._systemColors;if(z(a),(0,Ea.isEmpty)(M)&&I(i),(0,Ea.isEmpty)(W)){var l=tv(n,v),s=l.systemTypography,c=l.customTypography;U({systemTypography:s,customTypography:c})}if(R(!0),r){var u=n.site_logo;null!=u&&u.url&&D(u.url)}else{var d=n.logo;null!=d&&d.url&&D(null==d?void 0:d.url)}}else null!=t&&t.data&&null!==t.data&&R(0)},[null==b||null===(t=b.packInfo)||void 0===t?void 0:t.data,v]),(0,pe.useEffect)(function(){var e,t=null==b?void 0:b.packInfo;null!=t&&t.error&&(R(0),p(t.error),null!==(e=window.templately)&&void 0!==e&&e.log&&console.error("Pack info error:",t.error))},[null==b||null===(n=b.packInfo)||void 0===n?void 0:n.error]),(0,pe.useEffect)(function(){var e,t=null==b?void 0:b.googleFonts;(null==t||null===(e=t.data)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.length)>0&&H(t.data.data.map(function(e){return{value:e.family,label:e.family,variants:e.variants.map(function(e){return{value:e,label:e}})}}))},[null==b||null===(r=b.googleFonts)||void 0===r?void 0:r.data]),(0,pe.useEffect)(function(){je>0&&De(M,T,ee,Fe)},[M,T,ee,Fe,je,De]),(0,pe.useEffect)(function(){var e=function(t){var n,r;if("templately_preview_window_loaded"===(null===(n=t.data)||void 0===n?void 0:n.type))return se(!1),void Le(function(e){return e+1});"templately_css_variable"===(null===(r=t.data)||void 0===r?void 0:r.type)&&t.data.logoWidth&&(F(parseFloat(t.data.logoWidth)),window.removeEventListener("message",e))};return window.addEventListener("message",e),function(){window.removeEventListener("message",e)}},[v]),(0,pe.useEffect)(function(){xe.session_id&&(c.set("session_id",xe.session_id),c.set("process_id",xe.process_id)),xe.templates&&($a("AI templates detected:",xe.templates),Ae("form"))},[xe,Ae]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-dependency-modal-customizer"},he().createElement("div",{className:"templately-dependency-modal-customizer-left ".concat(oe?"show":"hide")},he().createElement("div",{className:"templately-dmc-header"},he().createElement("p",{className:"templately-dmc-header-label",onDoubleClick:function(){var e,t;(null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api||null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_mode)&&Ae("form")}},"Template Name:"),he().createElement("h2",{className:"templately-dmc-header-title",onDoubleClick:function(){var e,t;(null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.dev_api||null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_mode)&&Ae("postMessage")}},a),h?null:he().createElement("button",{className:"templately-dmc-header-close-button",onClick:function(){return m()}},he().createElement(rj,null)),he().createElement("button",{className:"templately-dmc-header-toggle-button ".concat(oe?"show":"hide"),onClick:function(){return ie(!oe)}},he().createElement(nj,null))),he().createElement("div",{className:"templately-dmc-body"},he().createElement("div",{className:"templately-dmc-body-inner"},0===N&&he().createElement(he().Fragment,null,he().createElement(ej,{type:"text",name:"page_title",placeholder:Se[0]?"i.e: ".concat(Se[0]):"",label:(0,At.__)("Site Title","templately"),value:O,onChange:function(e){return S(e.target.value)}}),he().createElement(ej,{type:"text",name:"page_name",placeholder:Se[1]?"i.e: ".concat(Se[1]):"",label:(0,At.__)("Site Tagline","templately"),additionalButtons:[he().createElement(OB,{fieldName:"tag_line",onSubmit:Re,setAIPromptPickerOpen:ke,initialDescription:null==y?void 0:y.description,aiState:$,systemColors:B,availableCredit:b.availableCredit})],value:x,onChange:function(e){return _(e.target.value)}}),d&&!0===L&&he().createElement("div",{className:"templately-dmc-file-uploader-wrapper"},he().createElement("div",{className:"templately-title-wrapper"},he().createElement("h4",{className:"templately-title"},"Upload a logo")),he().createElement("p",{className:"templately-info"},"Upload a logo for your site. You can upload/update it anytime later."),he().createElement(ZF.MediaUpload,{onSelect:Be,allowedTypes:["image"],value:P,render:function(e){var t=e.open;return he().createElement("button",{onClick:t,className:"templately-dmc-file-uploader"},he().createElement("span",{className:"icon"},P&&he().createElement(he().Fragment,null,he().createElement("span",{className:"templately-dmc-file-remove-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),A(""),c.delete("logo")}},he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 -0.5 21 21"},he().createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},he().createElement("g",{fill:"#fff",transform:"translate(-179 -360)"},he().createElement("g",{transform:"translate(56 160)"},he().createElement("path",{d:"M130.35 216h2.1v-8h-2.1v8zm4.2 0h2.1v-8h-2.1v8zm-6.3 2h10.5v-12h-10.5v12zm2.1-14h6.3v-2h-6.3v2zm8.4 0v-4h-10.5v4H123v2h3.15v14h14.7v-14H144v-2h-5.25z"})))))),he().createElement("img",{src:P,alt:""})),!P&&he().createElement(oj,null)),he().createElement("span",{className:"content"},he().createElement("span",{className:"title"},he().createElement("span",{className:"highlighted"},(0,At.__)("Upload your own logo","templately"))),he().createElement("span",{className:"info"},"SVG, PNG, JPG or GIF (max. 800x400 px)")))}}),P&&he().createElement(he().Fragment,null,he().createElement("br",null),he().createElement(tj.RangeControl,{label:"Logo Width (px)",value:T,onChange:function(e){F(e)},min:20,max:800})),he().createElement("div",{className:"templately-ai-divider"},he().createElement("span",null,(0,At.__)("OR","templately"))),he().createElement(OB,{fieldName:"logo",onSubmit:Re,setAIPromptPickerOpen:ke,aiState:Q,label:(0,At.__)("Logo","templately"),showAllFields:!0,siteTitle:O||(null==xe?void 0:xe.name)||Se[0]||"",fontList:V,systemColors:B,availableCredit:b.availableCredit}))),1===N&&d&&!0===L&&he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-color-picker-section"},he().createElement("div",{className:"templately-color-picker-section-label-wrapper"},he().createElement("label",{className:"templately-color-picker-section-label"},"Select Color"),he().createElement("button",{className:"templately-color-picker-reset-button",onClick:function(){var e={};B.forEach(function(t){e[t._id]=t.color}),I(e)}},he().createElement(YN,null))),he().createElement("div",{className:"templately-color-picker-panel"},B&&(null==B?void 0:B.map(function(e,t){var n;return he().createElement(ij,{key:e._id,name:e.title,setColorPickerOpen:fe,color:null!==(n=null==M?void 0:M[e._id])&&void 0!==n?n:e.color,setColor:function(t){return I(function(n){return DB(DB({},n),{},Pt({},e._id,t))})},defaultValue:e.color})})))),he().createElement(Xj,{normalizedTypography:X,selectedTypography:ee,setSelectedTypography:Ce,groupedData:K,setTypographyPickerOpen:ve,fontList:V,screen:Fe,setScreen:Me})),d&&!1===L&&he().createElement(El,{isWhiteLabel:E})),he().createElement("div",{className:"templately-dmc-button-wrapper"},he().createElement("button",{disabled:d&&!1===L&&!(null!==(o=window.templatelyDeveloper)&&void 0!==o&&o.dev_mode),onClick:function(){return!d&&0===N||N>=1?(c.set("title",O||Se[0]||""),c.set("slogan",x||Se[1]||""),c.set("color",JSON.stringify(M)),_e(ee),c.get("logo")||c.set("logo",C),c.get("logo")&&c.set("logo_size",T),null!=xe&&xe.imageMappings&&c.set("image_mappings",JSON.stringify(xe.imageMappings)),void 0!==(null==xe?void 0:xe.isLocalSite)&&c.set("isLocalSite",xe.isLocalSite),void l()):void j(N+1<=0?0:N+1)},className:"templately-dmc-submit-button"},he().createElement("span",null,d&&0===N?"Style Website":"Confirm Setup"),he().createElement($N,null)),(d||g)&&he().createElement("button",{onClick:function(){0===N&&g?(w&&w(),m&&m(!1)):N>0?j(N-1):s()},disabled:0===N&&(!g||h),className:"templately-dmc-back-button"},he().createElement(QN,null),he().createElement("span",null,"Back"))))),he().createElement("div",{className:"templately-dependency-modal-customizer-right"},(de||ge||Ee)&&he().createElement("div",{className:"templately-dependency-modal-customizer-right-overlay"}),he().createElement("div",{style:{margin:"auto",maxWidth:"100%",maxHeight:"100%",width:"tablet"===Fe?"720px":"mobile"===Fe?"320px":"100%",height:"tablet"===Fe?"1080px":"mobile"===Fe?"480px":"100%"}},he().createElement("iframe",{ref:Ie,name:"customizer-iframe",src:u+"?plugin_preview="+be+"&preview_origin_url="+encodeURIComponent((null===(i=window.templately)||void 0===i?void 0:i.url)||window.location.origin),frameBorder:0,width:"100%",height:"100%",onLoad:function(e){$a("iframe loaded",e),se(!1),Le(function(e){return e+1})},onError:function(e){se(!1)}})),le&&he().createElement("div",{className:"templately-dependency-modal-customizer-right-loader","data-iswhitelabel":E},he().createElement(El,{isWhiteLabel:E})))))};const AB=he().memo(PB);function TB(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return FB(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(FB(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,FB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,FB(d,"constructor",c),FB(c,"constructor",s),s.displayName="GeneratorFunction",FB(c,o,"GeneratorFunction"),FB(d),FB(d,o,"Generator"),FB(d,r,function(){return this}),FB(d,"toString",function(){return"[object Generator]"}),(TB=function(){return{w:i,m:p}})()}function FB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}FB=function(e,t,n,r){function i(t,n){FB(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},FB(e,t,n,r)}const MB=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=t.isAi,o=void 0!==r&&r,i=t.shouldFetchData,a=void 0!==i&&i,l=t.showErrorAlert,s=t.aiTemplates,c=t.requestedPlatform,u=void 0===c?"templately":c,d=(0,pe.useCallback)(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return n;try{var r=e.get(t);return r&&"string"==typeof r&&r.startsWith("{")?JSON.parse(r):r||n}catch(e){return n}},[e]),p=ce((0,pe.useState)(null),2),f=p[0],h=p[1],m=ce((0,pe.useState)({}),2),g=m[0],v=m[1],y=ce((0,pe.useState)(!1),2),b=y[0],w=y[1],E=ce((0,pe.useState)(!1),2),k=E[0],O=E[1],S=ce((0,pe.useState)(null),2),x=S[0],_=S[1],C=ce((0,pe.useState)(null),2),D=C[0],P=C[1],A=ce((0,pe.useState)(function(){return d("title","")}),2),T=A[0],F=A[1],M=ce((0,pe.useState)(function(){return d("slogan","")}),2),I=M[0],N=M[1],j=ce((0,pe.useState)(""),2),L=j[0],R=j[1],B=ce((0,pe.useState)(function(){var e=d("logo",{});return((0,vi.isURL)(e)?"":null==e?void 0:e.url)||""}),2),z=B[0],W=B[1],U=ce((0,pe.useState)(function(){return d("logo_size",211)}),2),V=U[0],H=U[1],G=ce((0,pe.useState)(function(){return d("color",{})}),2),q=G[0],Q=G[1],$=ce((0,pe.useState)(0),2),Y=$[0],X=$[1],K=ce((0,pe.useState)(!1),2),Z=K[0],J=K[1],ee=ce((0,pe.useState)([]),2),te=ee[0],re=ee[1],oe=ce((0,pe.useState)({}),2),ie=oe[0],ae=oe[1],le=ce((0,pe.useState)([]),2),se=le[0],ue=le[1],de=ce((0,pe.useState)(null),2),fe=de[0],he=de[1],me=ce((0,pe.useState)(null),2),ge=me[0],ve=me[1],ye=(0,pe.useRef)(null),be=(0,pe.useRef)(null),we=ce((0,pe.useState)(!1),2),Ee=we[0],ke=we[1],Oe=(0,pe.useRef)(!1),Se=ce((0,pe.useState)(!1),2),xe=Se[0],_e=Se[1],Ce=ce((0,pe.useState)(null),2),De=Ce[0],Pe=Ce[1],Ae=ce((0,pe.useState)(""),2),Te=Ae[0],Fe=Ae[1],Me=ce((0,pe.useState)(!1),2),Ie=Me[0],Ne=Me[1],je=ce((0,pe.useState)(null),2),Le=je[0],Re=je[1],Be=ce((0,pe.useState)([]),2),ze=Be[0],We=Be[1],Ue=ce((0,pe.useState)(null),2),Ve=Ue[0],He=Ue[1],Ge=ce((0,pe.useState)(0),2),qe=Ge[0],Qe=Ge[1],$e=(0,pe.useCallback)(hi(TB().m(function e(){var t,n,r,o;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/logo-generation/available-credits",{},{method:"GET"});case 1:"success"===(null==(r=e.v)||null===(t=r.response)||void 0===t?void 0:t.status)&&"number"==typeof(null==r||null===(n=r.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.available_credit)&&Qe(r.response.data.available_credit),e.n=3;break;case 2:e.p=2,o=e.v,console.error("Failed to fetch available credits:",o);case 3:return e.a(2)}},e,null,[[0,2]])})),[]);(0,pe.useEffect)(function(){$e()},[$e]);var Ye=function(e){var t,n;return"string"==typeof(null==e?void 0:e.message)?e.message:"string"==typeof(null==e?void 0:e.error)?e.error:"object"===ne(null==e?void 0:e.error)&&null!=e&&null!==(t=e.error)&&void 0!==t&&t.message?e.error.message:"object"===ne(null==e?void 0:e.data)&&null!=e&&null!==(n=e.data)&&void 0!==n&&n.message?e.data.message:"string"==typeof(null==e?void 0:e.data)?e.data:"string"==typeof e?e:"Request failed"},Xe=(0,pe.useCallback)(function(){var e=hi(TB().m(function e(t){var r,o,i,a,l,s,c,u,d,p,f=arguments;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=f.length>1&&void 0!==f[1]&&f[1],o=t||n){e.n=1;break}return console.error("Pack ID is required for fetchPackImportInfo"),e.a(2);case 1:return w(!0),_(null),e.p=2,a={id:o,isAi:r,action:"templately_pack_import_info",nonce:(null===(i=window.templately)||void 0===i?void 0:i.nonce)||""},l=(0,vi.addQueryArgs)(window.ajaxurl,a),e.n=3,fa(l);case 3:s=e.v,c=s.response,(u=s.error)?(console.error("Pack import info error:",Ye(u)),_(Ye(u)),h({})):(d=(null==c?void 0:c.data)||{},h(d),_(null)),e.n=5;break;case 4:e.p=4,p=e.v,_(p.message),h({});case 5:return e.p=5,w(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(_x){return e.apply(this,arguments)}}(),[n]),Ke=(0,pe.useCallback)(hi(TB().m(function e(){var t,n,r,o,i,a,l;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:return O(!0),P(null),e.p=1,n={action:"templately_pack_google_font",nonce:(null===(t=window.templately)||void 0===t?void 0:t.nonce)||""},r=(0,vi.addQueryArgs)(window.ajaxurl,n),e.n=2,fa(r);case 2:o=e.v,i=o.response,(a=o.error)?(console.error("Google fonts error:",Ye(a)),P(Ye(a)),v({})):(v(i||{}),P(null)),e.n=4;break;case 3:e.p=3,l=e.v,P(l.message),v({});case 4:return e.p=4,O(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])})),[]),Ze=(0,pe.useCallback)(function(){var e=hi(TB().m(function e(t,n){var r,o;return TB().w(function(e){for(;;)if(0===e.n)return r=0,o=!0,e.a(2,new Promise(function(e,i){var a=function(){var l=hi(TB().m(function l(){var s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O,S,x,_,C,D,P;return TB().w(function(l){for(;;)switch(l.p=l.n){case 0:if(null==n||!n.aborted){l.n=1;break}return i(new Error((0,At.__)("Logo generation polling cancelled","templately"))),l.a(2);case 1:return r++,$a("Logo polling attempt ".concat(r,"/").concat(84)),l.p=2,l.n=3,ha((0,vi.addQueryArgs)("/templately/v1/logo-generation/data",{process_id:t}),{},{method:"GET"});case 3:if(s=l.v,c=s.response,!(u=s.error)){l.n=6;break}if(404!==(null==c?void 0:c.code)&&"error"!==(null==c?void 0:c.status)){l.n=5;break}if(!(r>=84)){l.n=4;break}return d=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(d),i(new Error(d)),l.a(2);case 4:return p=o?1e4:5e3,o=!1,setTimeout(a,p),l.a(2);case 5:return f=Ye(u)||(0,At.__)("Failed to retrieve logo generation data","templately"),Pe(f),i(new Error(f)),l.a(2);case 6:if("success"!==(null==c?void 0:c.status)||null==c||!c.data){l.n=7;break}return m=c.data,g=m.images,v=void 0===g?[]:g,y=m.credit_cost,b=void 0===y?null:y,w=m.remaining_credit,E=void 0===w?null:w,k=m.available_credit,O=void 0===k?null:k,We(v),He(b),_e(!1),e({logoUrl:(null===(h=v[0])||void 0===h?void 0:h.url)||"",images:v,creditCost:b,message:(0,At.__)("Logo generation completed","templately"),availableCredit:null!==E?E:O}),l.a(2);case 7:if("pending"!==(null==c?void 0:c.status)){l.n=9;break}if(!(r>=84)){l.n=8;break}return S=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(S),i(new Error(S)),l.a(2);case 8:return x=o?15e3:5e3,o=!1,setTimeout(a,x),l.a(2);case 9:if(!(r>=84)){l.n=10;break}return _=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(_),i(new Error(_)),l.a(2);case 10:C=o?15e3:5e3,o=!1,setTimeout(a,C),l.n=12;break;case 11:l.p=11,P=l.v,D=P.message||(0,At.__)("An error occurred while polling logo generation","templately"),Pe(D),i(P);case 12:return l.a(2)}},l,null,[[2,11]])}));return function(){return l.apply(this,arguments)}}();a()}))},e)}));return function(t,n){return e.apply(this,arguments)}}(),[]),Je=(0,pe.useCallback)(function(){var e=hi(TB().m(function e(t){var n,r;return TB().w(function(e){for(;;)if(0===e.n)return n=0,r=!0,e.a(2,new Promise(function(e,o){var i=function(){var a=hi(TB().m(function a(){var l,s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O,S,x,_,C,D;return TB().w(function(a){for(;;)switch(a.p=a.n){case 0:return n++,a.p=1,a.n=2,ha((0,vi.addQueryArgs)("/templately/v1/logo-generation/data",{process_id:t,is_local_site:"true"}),{},{method:"GET"});case 2:if(l=a.v,s=l.response,!(c=l.error)){a.n=5;break}if(404!==(null==s?void 0:s.code)&&"error"!==(null==s?void 0:s.status)){a.n=4;break}if(!(n>=84)){a.n=3;break}return u=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(u),o(new Error(u)),a.a(2);case 3:return d=r?15e3:5e3,r=!1,setTimeout(i,d),a.a(2);case 4:return p=Ye(c)||(0,At.__)("Failed to retrieve logo generation data","templately"),Pe(p),o(new Error(p)),a.a(2);case 5:if("success"!==(null==s?void 0:s.status)||null==s||!s.data){a.n=6;break}return h=s.data,m=h.images,g=void 0===m?[]:m,v=h.credit_cost,y=void 0===v?null:v,b=h.remaining_credit,w=void 0===b?null:b,E=h.available_credit,k=void 0===E?null:E,We(g),He(y),_e(!1),e({logoUrl:(null===(f=g[0])||void 0===f?void 0:f.url)||"",images:g,creditCost:y,message:(0,At.__)("Logo generation completed","templately"),availableCredit:null!==w?w:k}),a.a(2);case 6:if("pending"!==(null==s?void 0:s.status)){a.n=8;break}if(!(n>=84)){a.n=7;break}return O=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(O),o(new Error(O)),a.a(2);case 7:return S=r?15e3:5e3,r=!1,setTimeout(i,S),a.a(2);case 8:if(!(n>=84)){a.n=9;break}return x=(0,At.__)("Logo generation timed out. Please try again.","templately"),Pe(x),o(new Error(x)),a.a(2);case 9:_=r?15e3:5e3,r=!1,setTimeout(i,_),a.n=11;break;case 10:a.p=10,D=a.v,C=D.message||(0,At.__)("An error occurred while polling logo generation","templately"),Pe(C),o(D);case 11:return a.a(2)}},a,null,[[1,10]])}));return function(){return a.apply(this,arguments)}}();i()}))},e)}));return function(t){return e.apply(this,arguments)}}(),[]),et=(0,pe.useCallback)(function(){var e=hi(TB().m(function e(t){var n,r,o,i,a,l,s,c,d,p,f,h,m,g,v,y,b,w,E,k,O,S;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:return _e(!0),Pe(null),We([]),He(null),Fe(t.description||""),e.p=1,e.n=2,ha("/templately/v1/logo-generation/generate",{business_name:t.business_name||"",description:t.description,quality:null!==(n=t.quality)&&void 0!==n?n:$L,size:null!==(r=t.size)&&void 0!==r?r:YL,category:null!==(o=t.category)&&void 0!==o?o:XL,background:null!==(i=t.background)&&void 0!==i?i:KL,output_format:null!==(a=t.output_format)&&void 0!==a?a:"png",quantity:null!==(l=t.quantity)&&void 0!==l?l:1,requested_platform:u},{method:"POST"});case 2:if(d=e.v,p=d.response,!(f=d.error)){e.n=3;break}throw h=Ye(f)||(0,At.__)("Failed to generate logo","templately"),Pe(h),_e(!1),new Error(h);case 3:if(!(null!=p&&p.code||"error"===(null==p?void 0:p.status))){e.n=4;break}throw m=(null==p?void 0:p.message)||(0,At.__)("Failed to generate logo","templately"),Pe(m),_e(!1),new Error(m);case 4:if("success"!==(null==p?void 0:p.status)||null==p||!p.process_id){e.n=8;break}if($a("Logo generation started with process_id: ".concat(p.process_id)),!0!==(null==p?void 0:p.is_local_site)){e.n=6;break}return $a("Logo generation on local site, using polling mechanism"),e.n=5,Je(p.process_id);case 5:return g=e.v,e.a(2,g);case 6:return $a("Logo generation on production site, using callback pattern"),e.n=7,Ze(p.process_id);case 7:return v=e.v,e.a(2,v);case 8:if("success"!==(null==p?void 0:p.status)||!(null!=p&&null!==(s=p.data)&&void 0!==s&&s.url||null!=p&&null!==(c=p.data)&&void 0!==c&&c.images)){e.n=9;break}return b=p.data.images||[{id:p.data.id||Date.now().toString(),url:p.data.url}],We(b),w=p.data.creditCost||p.data.credit_cost||null,E=p.data.remaining_credit,He(w),_e(!1),e.a(2,{logoUrl:p.data.url||(null===(y=b[0])||void 0===y?void 0:y.url),images:b,creditCost:p.data.creditCost||p.data.credit_cost||null,message:p.message,availableCredit:E});case 9:throw k=(0,At.__)("Failed to generate logo","templately"),Pe(k),_e(!1),new Error(k);case 10:throw e.p=10,S=e.v,O=S.message||(0,At.__)("An error occurred while generating logo","templately"),Pe(O),_e(!1),S;case 11:return e.a(2)}},e,null,[[1,10]])}));return function(t){return e.apply(this,arguments)}}(),[u,Ze]),tt=(0,pe.useCallback)(function(){var e=hi(TB().m(function e(t){var n,r,o,i,a,l,s,c,d;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:return Ne(!0),Re(null),e.p=1,e.n=2,ha("/templately/v1/ai-content/generate-tagline",{prompt:t.prompt,requested_platform:u},{method:"POST"});case 2:if(r=e.v,o=r.response,!(i=r.error)){e.n=3;break}throw a=Ye(i)||(0,At.__)("Failed to generate tagline","templately"),Re(a),new Error(a);case 3:if(!(null!=o&&o.code||"error"===(null==o?void 0:o.status))){e.n=4;break}throw l=(null==o?void 0:o.message)||(0,At.__)("Failed to generate tagline","templately"),Re(l),new Error(l);case 4:if("success"!==(null==o?void 0:o.status)||null==o||null===(n=o.data)||void 0===n||!n.content){e.n=5;break}return Ne(!1),$e(),e.a(2,{text:o.data.content,message:o.message});case 5:throw s=(0,At.__)("Failed to generate tagline","templately"),Re(s),new Error(s);case 6:throw e.p=6,d=e.v,c=d.message||(0,At.__)("An error occurred while generating tagline","templately"),Re(c),Ne(!1),d;case 7:return e.a(2)}},e,null,[[1,6]])}));return function(t){return e.apply(this,arguments)}}(),[u,$e]),nt=(0,pe.useCallback)(function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t&&e&&o){var a=new AbortController;ye.current=a;var l=$F(e,t,n,r,function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&$a("AI content polling update:",Object.keys(e),t),he(e)},function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&$a("AI content polling completed:",e,t),he(e),ve(null),ye.current=null},function(e){var t,n,r,o;if(null!=e&&null!==(t=e.message)&&void 0!==t&&t.includes("cancelled")||null!=e&&null!==(n=e.message)&&void 0!==n&&n.includes("Starting new polling session")||null!=e&&null!==(r=e.message)&&void 0!==r&&r.includes("Component unmounting"))return null!==(o=window.templatelyDeveloper)&&void 0!==o&&o.log&&$a("AI polling cancelled (expected):",e.message),ve(null),void(ye.current=null);console.error("AI content polling error:",e),ve(null),ye.current=null},a.signal,i);return ve(l),function(){null!=l&&l.cleanup&&l.cleanup(),ye.current=null}}},[o,l]),rt=(0,pe.useCallback)(function(){if(h({}),v({}),w(!1),O(!1),_(null),P(null),he(null),ve(null),ye.current)try{ye.current.abort("Data reset requested")}catch(t){var e;null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.log&&$a("Polling abort error during reset:",(null==t?void 0:t.message)||"Unknown error")}finally{ye.current=null}},[]);return(0,pe.useEffect)(function(){if(a&&!Oe.current&&n){Oe.current=!0,ke(!0);var e=function(){var e=hi(TB().m(function e(){var t;return TB().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.all([Xe(n,o),Ke()]);case 1:e.n=3;break;case 2:e.p=2,t=e.v,console.error("Failed to load customizer data:",t),l&&l((0,At.__)("Failed to load customizer settings. Please try again.","templately"));case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();e()}},[a,n,o,Xe,Ke,l]),(0,pe.useEffect)(function(){a&&Ee&&!b&&!k&&!Z&&f&&Object.keys(f).length>0&&J(!0)},[a,Ee,f,g,b,k,Z]),(0,pe.useEffect)(function(){return function(){if(ye.current)try{ye.current.abort("Component unmounting")}catch(t){var e;null!==(e=window.templatelyDeveloper)&&void 0!==e&&e.log&&$a("Polling cleanup error (expected during unmount):",(null==t?void 0:t.message)||"Unknown error")}finally{ye.current=null}be.current=null}},[]),(0,pe.useEffect)(function(){if(s&&o){var e=s.process_id,t=s.session_id,n=s.ai_page_ids,r=s.preview_pages,i=s.isLocalSite;if(e&&t&&n&&Object.keys(n).length>0){var a="".concat(t,"-").concat(e);if(be.current===a)return;if(ye.current)try{ye.current.abort("Starting new polling session")}catch(e){var l;null!==(l=window.templatelyDeveloper)&&void 0!==l&&l.log&&$a("Polling abort error during session change:",(null==e?void 0:e.message)||"Unknown error")}finally{ye.current=null}be.current=a,nt(t,e,n,r||[],i||!1)}return function(){be.current&&(be.current=null)}}},[s,o,nt]),{packInfo:(0,pe.useMemo)(function(){return{data:f,loading:b,error:x}},[f,b,x]),googleFonts:(0,pe.useMemo)(function(){return{data:g,loading:k,error:D}},[g,k,D]),packInfoLoading:b,googleFontsLoading:k,packInfoError:x,googleFontsError:D,title:T,setTitle:F,slogan:I,setSlogan:N,siteLogo:L,setSiteLogo:R,logoSrc:z,setLogoSrc:W,logoSize:V,setLogoSize:H,color:q,setColor:Q,currentStep:Y,setCurrentStep:X,settingsLoaded:Z,setSettingsLoaded:J,systemColors:te,setSystemColors:re,originalTypography:ie,setOriginalTypography:ae,fontList:se,setFontList:ue,aiData:fe,setAiData:he,pollingController:ge,setPollingController:ve,fetchPackImportInfo:Xe,fetchGoogleFonts:Ke,pollForAIContent:nt,resetData:rt,getFormData:d,generateLogo:et,generateTagline:tt,logoGeneration:{loading:xe,error:De,images:ze,creditCost:Ve,prompt:Te},taglineGeneration:{loading:Ie,error:Le},availableCredit:qe,setAvailableCredit:Qe,fetchAvailableCredits:$e,isLoading:b||k,hasErrors:!!x||!!D,initialFetchAttempted:Ee}},IB=function(e){var t=e.name,n=e.id,r=e.next,o=e.back,i=e.formData,a=e.live_url,l=e.has_settings,s=e.showErrorAlert,c=e.isAi,u=e.setShowFSIModal,d=e.ogIsAi,p=e.startModifyAiContent,f=xn(function(e){return e.general.platform},Jt),h=xn(function(e){var t;return(null==e||null===(t=e.general)||void 0===t||null===(t=t.fullSiteImport)||void 0===t||null===(t=t.fsiModalContext)||void 0===t?void 0:t.aiTemplates)||{templates:null,process_id:null,ai_page_ids:null,description:null}},Jt),m=MB(i,{id:n,isAi:d,shouldFetchData:!0,showErrorAlert:s,aiTemplates:h}),g=En(),v=(0,pe.useCallback)(function(){g(Ny())},[g]),y=(0,pe.useCallback)(function(){g(My())},[g]);return React.createElement(AB,{name:t,id:n,next:r,back:o,formData:i,live_url:a,has_settings:l,showErrorAlert:s,isAi:c,setShowFSIModal:u,ogIsAi:d,startModifyAiContent:p,platform:f,aiTemplates:h,customizerData:m,onHideFSIModal:v,onShowAiSidebar:y})},NB=function(e){var t="string"==typeof(null==e?void 0:e.value)?"true"===(null==e?void 0:e.value.toLowerCase()):null==e?void 0:e.value;return he().createElement("label",{className:"templately-checkbox"},he().createElement("input",{type:"checkbox",className:"templately-checkbox-input",checked:t,disabled:null==e?void 0:e.disabled,onChange:null==e?void 0:e.onChange}),he().createElement("span",{className:"templately-checkbox-content"},he().createElement("span",{className:"templately-checkbox-content-inner"},null==e?void 0:e.label,null!=e&&e.disabled?he().createElement(he().Fragment,null," | ",he().createElement("span",{className:"installed"},"Installed")):"",null!=e&&e.recommended?he().createElement(he().Fragment,null," ",he().createElement("span",{className:"recommended"},"( Recommended )")):"")))},jB=function(e){var t,n=e.isAi,r=e.back,o=e.next,i=e.setSteps,a=e.formData,l=e.dependencies,s=e.categories,c=e.hasAttachment,u=ce((0,pe.useState)([]),2),d=u[0],p=u[1],f=ce((0,pe.useState)(null===(t=a.get("import_demo_content"))||void 0===t||t),2),h=f[0],m=f[1],g=ce((0,pe.useState)(!0),2),v=g[0],y=g[1],b=ce((0,pe.useState)([]),2),w=b[0],E=b[1],k=xn(function(e){return e.general.platform}),O=ce((0,pe.useState)({}),2),S=O[0],x=O[1];(0,pe.useEffect)(function(){$a("Dependencies mounted",l)},[]),(0,pe.useEffect)(function(){var e;a.set("import_demo_content",null===(e=a.get("import_demo_content"))||void 0===e||e)},[]),(0,pe.useEffect)(function(){var e,t,n={dependencies:Object.fromEntries(l)||{},platform:k,categories:s||[],isNetworkAdmin:(null===(e=window)||void 0===e||null===(e=e.templately)||void 0===e?void 0:e.isNetworkAdmin)||!1};ha("/templately/v1/dependencies/plugins",n).then(function(e){var t=e.response,n=e.error;n?console.error("Error fetching plugins:",n):(E(t.dependencyList||[]),p(t.requiredPlugins||[]))});var r={platform:k,isNetworkAdmin:(null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t?void 0:t.isNetworkAdmin)||!1};ha("/templately/v1/dependencies/themes",r).then(function(e){var t=e.response,n=e.error;n?console.error("Error fetching themes:",n):(x(t),a.set("theme",JSON.stringify(t)))})},[l,k]);var _=(0,pe.useCallback)(function(e){return void 0!==(null==d?void 0:d.find(function(t){return t.plugin_file===e}))},[d]),C=[];return null==w||w.map(function(e){var t,n=function(){return null};e.mustHave||(n=function(){return function(e){var t=Nl(d);t=_(e.plugin_file)?t.filter(function(t){return(null==t?void 0:t.plugin_file)!==e.plugin_file}):[].concat(Nl(t),[e]),p(t)}(e)}),C.push(React.createElement(NB,{key:e.plugin_file,value:_(e.plugin_file),onChange:n,label:null==e?void 0:e.name,disabled:null!==(t=null==e?void 0:e.installed)&&void 0!==t&&t}))}),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},"Required Dependencies"),React.createElement("p",{className:"templately-details"},"To import this pack, please install all the listed plugins, theme, and demo contents to avoid missing dependent sections.")),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement(aj,{title:"Plugin Dependencies",current:void 0,setCurrent:function(){},id:null},C),(null==S?void 0:S.name)&&React.createElement(aj,{title:"Theme Dependency",current:void 0,setCurrent:function(){},id:null},React.createElement(NB,{value:v,onChange:function(e){return function(e,t){y(e.target.checked),"active"!==t.status&&e.target.checked?a.set("theme",JSON.stringify(t)):a.delete("theme")}(e,S)},label:S.name,recommended:"active"!==S.status,disabled:"active"===S.status}),!v&&React.createElement("p",{className:"templately-details"},"We recommend you to use this theme for a smooth importing experience.")),React.createElement("div",{className:"templately-new-collapser"},React.createElement("div",{className:"templately-new-collapser-header not-clickable"},React.createElement("div",null,React.createElement(NB,{value:"true"===h||h,onChange:function(e){m(!h),h?a.delete("import_demo_content"):a.set("import_demo_content",!0)},label:"Import Demo Content"}),!h&&React.createElement("p",{className:"templately-details"},"Demo content such as posts, products, forms, etc will be excluded from the import."))))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("button",{className:"templately-button close-button",onClick:function(){r()}},(0,At.__)("Back","templately")),React.createElement("button",{onClick:function(){var e=[uO("writing_permission_check","Permission Passed",1,"processing"),uO("download","Downloading Template Pack","--","processing"),uO("theme","Installing Required Theme","--","processing"),uO("plugin","Installing Required Theme","--","processing"),uO("attachments","Importing Media Attachments","--","processing"),uO("templates","Importing Templates (i.e: Header, Footer, etc)","--","processing"),uO("content","Importing Page and Post Templates","--","processing"),uO("wp-content","Importing Content (Pages, Posts, Products, Navigation)","--","processing"),uO("finalize","Finalizing Your Imports","--","processing")];0===d.length&&(e=e.filter(function(e){return"plugin"!==e.type})),c||(e=e.filter(function(e){return"attachments"!==e.type})),n&&(e=e.filter(function(e){return"download"!==e.type})),i(e),a.set("plugins",JSON.stringify(d)),o()},className:"templately-dmc-submit-button"},React.createElement("span",null,"Install & Proceed"),React.createElement($N,null))))};var LB,RB,BB=a(4552);function zB(e,t){return e+Math.random()*(t-e)}!function(e){e[e.Circle=0]="Circle",e[e.Square=1]="Square",e[e.Strip=2]="Strip"}(LB||(LB={})),function(e){e[e.Positive=1]="Positive",e[e.Negative=-1]="Negative"}(RB||(RB={}));const WB=1e3/60;class UB{constructor(e,t,n,r){this.getOptions=t;const{colors:o,initialVelocityX:i,initialVelocityY:a}=this.getOptions();this.context=e,this.x=n,this.y=r,this.w=zB(5,20),this.h=zB(5,20),this.radius=zB(5,10),this.vx="number"==typeof i?zB(-i,i):zB(i.min,i.max),this.vy="number"==typeof a?zB(-a,0):zB(a.min,a.max),this.shape=Math.floor(0+3*Math.random()),this.angle=zB(0,360)*Math.PI/180,this.angularSpin=zB(-.2,.2),this.color=o[Math.floor(Math.random()*o.length)],this.rotateY=zB(0,1),this.rotationDirection=zB(0,1)?RB.Positive:RB.Negative}update(e){const{gravity:t,wind:n,friction:r,opacity:o,drawShape:i}=this.getOptions(),a=e/WB;this.x+=this.vx*a,this.y+=this.vy*a,this.vy+=t*a,this.vx+=n*a,this.vx*=r**a,this.vy*=r**a,this.rotateY>=1&&this.rotationDirection===RB.Positive?this.rotationDirection=RB.Negative:this.rotateY<=-1&&this.rotationDirection===RB.Negative&&(this.rotationDirection=RB.Positive);const l=.1*this.rotationDirection*a;if(this.rotateY+=l,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=o,this.context.lineCap="round",this.context.lineWidth=2,i&&"function"==typeof i)i.call(this,this.context);else switch(this.shape){case LB.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case LB.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case LB.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}class VB{constructor(e,t){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=e=>{this.particles.splice(e,1)},this.getParticle=()=>{const e=zB(this.x,this.w+this.x),t=zB(this.y,this.h+this.y);return new UB(this.context,this.getOptions,e,t)},this.animate=e=>{const{canvas:t,context:n,particlesGenerated:r,lastNumberOfPieces:o}=this,{run:i,recycle:a,numberOfPieces:l,debug:s,tweenFunction:c,tweenDuration:u}=this.getOptions();if(!i)return!1;const d=this.particles.length,p=a?d:r;if(p<l){o!==l&&(this.tweenProgress=0,this.tweenFrom=p,this.lastNumberOfPieces=l),this.tweenProgress=Math.min(u,Math.max(0,this.tweenProgress+e));const t=c(this.tweenProgress,this.tweenFrom,l,u),n=Math.round(t-p);for(let e=0;e<n;e++)this.particles.push(this.getParticle());this.particlesGenerated+=n}s&&(n.font="12px sans-serif",n.fillStyle="#333",n.textAlign="right",n.fillText(`Particles: ${d}`,t.width-10,t.height-20));for(let n=this.particles.length-1;n>=0;n--){const r=this.particles[n];r.update(e),(r.y>t.height||r.y<-100||r.x>t.width+100||r.x<-100)&&(a&&p<=l?this.particles[n]=this.getParticle():this.removeParticleAt(n))}return d>0||p<l},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.getOptions=t}}const HB={width:"undefined"!=typeof window?window.innerWidth:300,height:"undefined"!=typeof window?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:BB.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class GB{constructor(e,t){this.lastFrameTime=0,this.setOptionsWithDefaults=e=>{const t={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...t,...HB,...e},Object.assign(this,e.confettiSource)},this.update=(e=0)=>{const{options:{run:t,onConfettiComplete:n,frameRate:r},canvas:o,context:i}=this,a=Math.min(e-this.lastFrameTime,50);r&&a<1e3/r?this.rafId=requestAnimationFrame(this.update):(this.lastFrameTime=e-(r?a%r:0),t&&(i.fillStyle="white",i.clearRect(0,0,o.width,o.height)),this.generator.animate(a)?this.rafId=requestAnimationFrame(this.update):(n&&"function"==typeof n&&this.generator.particlesGenerated>0&&n.call(this,this),this._options.run=!1))},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=e;const n=this.canvas.getContext("2d");if(!n)throw new Error("Could not get canvas context");this.context=n,this.generator=new VB(this.canvas,()=>this.options),this.options=t,this.update()}get options(){return this._options}set options(e){const t=this._options?.run,n=this._options?.recycle;this.setOptionsWithDefaults(e),this.generator&&(Object.assign(this.generator,this.options.confettiSource),"boolean"==typeof e.recycle&&e.recycle&&!1===n&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),"boolean"==typeof e.run&&e.run&&!1===t&&this.update()}}const qB=pe.createRef();class QB extends pe.Component{constructor(e){super(e),this.canvas=pe.createRef(),this.canvas=e.canvasRef||qB}componentDidMount(){if(this.canvas.current){const e=$B(this.props)[0];this.confetti=new GB(this.canvas.current,e)}}componentDidUpdate(){const e=$B(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,t]=$B(this.props),n={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...t.style};return(0,KP.jsx)("canvas",{width:e.width,height:e.height,ref:this.canvas,...t,style:n})}}function $B(e){const t={},n={},r=[...Object.keys(HB),"confettiSource","drawShape","onConfettiComplete","frameRate"],o=["canvasRef"];for(const i in e){const a=e[i];r.includes(i)?t[i]=a:o.includes(i)?o[i]=a:n[i]=a}return[t,n,{}]}QB.defaultProps={...HB},QB.displayName="ReactConfetti";const YB=pe.forwardRef((e,t)=>(0,KP.jsx)(QB,{canvasRef:t,...e}));var XB=a(4364);function KB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const JB=function(e){var t,n,r,o,i,a,l,s=e.results,c=(e.steps,e.isAi),u=(e.importCounter,e.formData),d=ce((0,pe.useState)({0:!0}),2),p=d[0],f=d[1],h=ce((0,pe.useState)(!0),2),m=h[0],g=h[1];(0,pe.useEffect)(function(){var e=setTimeout(function(){g(!1)},3500);return function(){return clearTimeout(e)}},[]);var v=(0,XB.A)(),y=v.width,b=v.height;function w(e){var t=e.filter(function(e){return e}).map(function(e){return e.replace(/_/g," ").split(" ").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")});return t.slice(0,-1).join(", ")+(t.length>1?" & ":"")+t.slice(-1)}var E,k=[],O=templately.url;if(null!=s&&null!==(t=s.results)&&void 0!==t&&t.home_url&&(O=s.results.home_url),c){var S,x,_,C={label:" ",details:[]};if(null==s||null===(S=s.results)||void 0===S||!S.ai_content)return C.label=(0,At.__)("AI Content Processing Information Unavailable","templately"),void k.push(C);if(void 0!==(null==s||null===(x=s.results)||void 0===x||null===(x=x.ai_content)||void 0===x||null===(x=x.processed)||void 0===x?void 0:x.credit_cost)){var D=s.results.ai_content.processed.credit_cost;C.label=(0,At.__)("Credit Cost:","templately")+" ".concat(D)}else C.label=(0,At.__)("Credit Cost: Not Available","templately");if((0,Ea.isEmpty)(null==s||null===(_=s.results)||void 0===_||null===(_=_.ai_content)||void 0===_||null===(_=_.processed)||void 0===_?void 0:_.pages))C.details.push(React.createElement(React.Fragment,null,(0,At.__)("No AI pages were processed","templately")));else{var P=s.results.ai_content.processed.pages,A=Object.values(P).filter(function(e){return"1"!==e}).length;C.details.push(React.createElement(React.Fragment,null,(0,At.__)("AI Generated Pages & Templates:","templately")," ",A));var T=s.results.ai_content.requested,F=s.results.ai_content.processed.pages,M=Object.values(T).flat().filter(function(e){return!F.hasOwnProperty(e)});M.length>0&&C.details.push(React.createElement(React.Fragment,null,(0,At.__)("Failed:","templately")," ",M.length," ",(0,At.__)("pages or templates","templately")))}k.push(C)}if(null!=s&&null!==(n=s.results)&&void 0!==n&&null!==(n=n.dependency_data)&&void 0!==n&&null!==(n=n.plugins)&&void 0!==n&&n.total){var I,N=s.results.dependency_data.plugins,j={label:" ".concat((0,At.__)("Installed Required Plugins","templately")," (").concat(N.succeed,"/").concat(N.total,")"),details:[]},L={"elementor-pro":"https://wpdeveloper.com/go/elementor","essential-addons-elementor":"https://essential-addons.com/#pricing","essential-blocks-pro":"https://essential-blocks.com/#pricing"};if((null===(I=N.failed)||void 0===I?void 0:I.length)>0)for(var R=0;R<N.failed.length;R++){var B=N.failed[R];j.details.push(React.createElement(React.Fragment,null,B.name," ",(0,At.__)("not found.","templately"),L[B.slug]&&React.createElement(React.Fragment,null," ".concat((0,At.__)("Please get it","templately")," "),React.createElement("a",{href:L[B.slug],target:"_blank",rel:"noopener noreferrer"},(0,At.__)("here","templately")),".")))}k.push(j)}if(null!=s&&null!==(r=s.results)&&void 0!==r&&null!==(r=r.dependency_data)&&void 0!==r&&r.theme&&u.get("theme")&&(E=s.results.dependency_data.theme.success?{label:(0,At.__)("Installed Recommended Theme","templately")}:{label:(0,At.__)("Theme Installation Failed","templately")},k.push(E)),(null==s||null===(o=s.results)||void 0===o?void 0:o.attachments)>0){var z=s.results.attachments;k.push({label:"".concat((0,At.__)("Imported Attachments:","templately")," ").concat(z)})}if((null==s||null===(i=s.results)||void 0===i||null===(i=i.post_types)||void 0===i?void 0:i.length)>0){var W=w(s.results.post_types);k.push({label:"".concat((0,At.__)("Imported Contents:","templately")," ").concat(W)})}if((null==s||null===(a=s.results)||void 0===a||null===(a=a.template_types)||void 0===a?void 0:a.length)>0){var U=s.results.template_types;U=U.map(function(e){return e.includes("single")?(0,At.__)("Single Post type","templately"):e});var V=w(U=Nl(new Set(U)));k.push({label:"".concat((0,At.__)("Imported Templates:","templately")," ").concat(V)})}if((null==s||null===(l=s.results)||void 0===l||null===(l=l.skipped_items)||void 0===l?void 0:l.length)>0){for(var H=s.results.skipped_items,G={label:"⚠️ ".concat((0,At.__)("Skipped Items:","templately")," ").concat(H.length),details:[]},q=0;q<H.length;q++){var Q=H[q],$=Q.class?Q.class.split("::").pop():"Unknown";G.details.push(React.createElement(React.Fragment,null,$," - ",(0,At.__)("Item","templately")," #",Q.key,": ",Q.reason||(0,At.__)("Unknown error","templately")))}k.push(G)}return k.push({label:(0,At.__)("Imported Site Settings: Layout, Fonts, Colors, Typography, Images, Custom CSS, etc.","templately")}),React.createElement(React.Fragment,null,React.createElement(YB,{className:"templately-confetti-canvas",width:y,height:b,recycle:m}),React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},(0,At.__)("Congratulations! Your Website is ready 🚀","templately")),React.createElement("p",{className:"templately-details"},(0,At.__)("You have imported and applied the following to your site:","templately"))),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("ul",{className:"templately-dependency-processing-wrapper"},null==k?void 0:k.map(function(e,t){var n,r,o;return React.createElement("li",{key:t,className:"templately-dependency-processing-item complete ".concat((null==e||null===(n=e.details)||void 0===n?void 0:n.length)>0?"has-sub-menu":""," ").concat(null!=p&&p[t]?"collapsed":"show")},React.createElement("span",{className:"templately-label"},null==e?void 0:e.label,React.createElement("div",{className:"templately-collapse-icon",onClick:function(){return f(function(e){return ZB(ZB({},e),{},Pt({},t,!(null!=e&&e[t])))})}},React.createElement(Cn,null))),(null==e||null===(r=e.details)||void 0===r?void 0:r.length)>0&&React.createElement("div",{className:"templately-dependency-processing-details-wrapper"},React.createElement("ul",{className:"templately-dependency-processing-details"},null==e||null===(o=e.details)||void 0===o?void 0:o.map(function(e,t){return React.createElement("li",{key:t},e)}))))}))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("a",{href:O,target:"_blank",className:"templately-dependency-modal-footer-final-button",style:{marginLeft:0,width:"100%",color:"#FFF"}},(0,At.__)("Visit your website","templately"))))},ez=function(e){var t,n,r,o,i=e.steps,a=e.formData,l=e.start,s=(e.startModifyAiContent,e.isAi),c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1],p=ce(uj("process_id",""),2),f=(p[0],p[1],ce(uj("aiRequestData",[]),1)[0]),h=ce(uj("isRequestStarted",!1),2),m=h[0],g=h[1],v=ce(uj("isAIRequestDone",!1),2),y=(v[0],v[1],(0,Ea.isEmpty)(f)||null==f||!f.prompt||null==f||f.AIPageIDs,xn(function(e){return{processId:e.general.fullSiteImport.processId,AIPageIDs:e.general.fullSiteImport.AIPageIDs}},Jt));return y.processId,y.AIPageIDs,(0,pe.useEffect)(function(){m||(g(!0),l(a))},[]),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header"},React.createElement("h3",{className:"templately-title"},"Your website is being ready..."),React.createElement("p",{className:"templately-details"},s?(0,At.__)("This usually takes a few minutes. Please do not close the window until the process is complete.","templately"):(0,At.__)("This usually takes a few moments. Please do not close the window until the process is complete.","templately"))),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("ul",{className:"templately-dependency-processing-wrapper"},null==i||null===(t=i.filter(function(e){return"error"!==(null==e?void 0:e.type)}))||void 0===t?void 0:t.map(function(e){return React.createElement("li",{key:e.type,className:"templately-dependency-processing-item ".concat(null==e?void 0:e.status)},React.createElement("span",{className:"templately-label"},null==e?void 0:e.message),"error"!==(null==e?void 0:e.status)&&React.createElement("span",{className:"templately-count"},"string"==typeof(null==e?void 0:e.progress)?null==e?void 0:e.progress:"".concat(null==e?void 0:e.progress,"%")))})),(null==i||null===(n=i.filter(function(e){return"error"===(null==e?void 0:e.type)}))||void 0===n?void 0:n.length)>0&&React.createElement("div",{className:"templately-dependency-processing-wrapper"},null==i||null===(r=i.filter(function(e){return"error"===(null==e?void 0:e.type)&&(null==e?void 0:e.handleRetry)}))||void 0===r?void 0:r.map(function(e){return React.createElement("button",{id:"templately-fsi-retry-button",_isDisabled:u,onClick:function(t){d(!0),e.handleRetry(t)}},React.createElement(Rn,null))}),React.createElement("ul",null,null==i||null===(o=i.filter(function(e){return"error"===(null==e?void 0:e.type)}))||void 0===o?void 0:o.map(function(e){return React.createElement("li",{key:e.type,className:"templately-dependency-processing-item ".concat(null==e?void 0:e.status," warning no-icon")},React.createElement("h4",{className:"templately-title"},(null==e?void 0:e.title)||"Something went wrong"),React.createElement("span",{className:"templately-label"},React.createElement(ED.RawHTML,null,null==e?void 0:e.message)))}))),React.createElement("div",{style:{width:"300px",marginLeft:"auto",marginRight:"auto"}},React.createElement("img",{src:templately.icons.construction,alt:"construction",style:{width:"100%"}}))))};var tz=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],nz=function(){var e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,n=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toLowerCase(),r=String(t.getOptionValue(e)).toLowerCase(),o=String(t.getOptionLabel(e)).toLowerCase();return r===n||o===n},rz={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(t){return nz(e,t,r)})||n.some(function(t){return nz(e,t,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}},oz=(0,pe.forwardRef)(function(e,t){var n=function(e){var t=e.allowCreateWhileLoading,n=void 0!==t&&t,r=e.createOptionPosition,o=void 0===r?"last":r,i=e.formatCreateLabel,a=void 0===i?rz.formatCreateLabel:i,l=e.isValidNewOption,s=void 0===l?rz.isValidNewOption:l,c=e.getNewOptionData,u=void 0===c?rz.getNewOptionData:c,d=e.onCreateOption,p=e.options,f=void 0===p?[]:p,h=e.onChange,m=Wn(e,tz),g=m.getOptionValue,v=void 0===g?cg:g,y=m.getOptionLabel,b=void 0===y?sg:y,w=m.inputValue,E=m.isLoading,k=m.isMulti,O=m.value,S=m.name,x=(0,pe.useMemo)(function(){return s(w,Bh(O),f,{getOptionValue:v,getOptionLabel:b})?u(w,a(w)):void 0},[a,u,b,v,w,s,f,O]),_=(0,pe.useMemo)(function(){return!n&&E||!x?f:"first"===o?[x].concat(Nl(f)):[].concat(Nl(f),[x])},[n,o,E,x,f]),C=(0,pe.useCallback)(function(e,t){if("select-option"!==t.action)return h(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]!==x)h(e,t);else if(d)d(w);else{var r=u(w,w),o={action:"create-option",name:S,option:r};h(Jh(k,[].concat(Nl(Bh(O)),[r]),r),o)}},[u,w,k,S,x,d,h,O]);return bd(bd({},m),{},{options:_,onChange:C})}(Ed(e));return pe.createElement(_g,re({ref:t},n))}),iz=oz;const az=function(){return he().createElement("svg",{className:"templately-ai-content-header-bg",xmlns:"http://www.w3.org/2000/svg",width:"61",height:"71",fill:"none",viewBox:"0 0 61 71"},he().createElement("path",{fill:"url(#paint0_linear_2112_1895)",d:"M.275 35.21c0-1.258 1.022-2.265 2.274-2.389C13.305 31.755 21.86 23.2 22.927 12.443c.123-1.251 1.13-2.273 2.388-2.273 1.257 0 2.264 1.022 2.388 2.273C28.77 23.2 37.324 31.755 48.081 32.821c1.251.124 2.273 1.131 2.273 2.389s-1.022 2.264-2.273 2.388c-10.757 1.066-19.311 9.621-20.378 20.378-.124 1.251-1.131 2.273-2.388 2.273s-2.265-1.022-2.389-2.273C21.86 47.22 13.307 38.664 2.55 37.598 1.297 37.474.275 36.467.275 35.21"}),he().createElement("path",{fill:"#F5EAFF",d:"M45.344 7.665c0-.377.306-.68.682-.716A6.83 6.83 0 0 0 52.139.835c.037-.375.34-.682.717-.682s.679.307.716.682a6.83 6.83 0 0 0 6.113 6.114c.376.037.682.34.682.716 0 .377-.306.68-.681.717a6.83 6.83 0 0 0-6.114 6.113c-.037.376-.34.682-.716.682-.378 0-.68-.306-.717-.682a6.83 6.83 0 0 0-6.113-6.113c-.376-.037-.682-.34-.682-.717M40.344 60.251c0-.503.409-.905.909-.955a9.11 9.11 0 0 0 8.151-8.151c.05-.5.453-.91.955-.91.503 0 .906.41.956.91a9.11 9.11 0 0 0 8.151 8.15c.5.05.91.453.91.956s-.41.906-.91.956a9.11 9.11 0 0 0-8.151 8.15c-.05.501-.453.91-.956.91s-.905-.409-.955-.91a9.11 9.11 0 0 0-8.151-8.15c-.5-.05-.91-.453-.91-.956"}),he().createElement("defs",null,he().createElement("linearGradient",{id:"paint0_linear_2112_1895",x1:"25.315",x2:"25.315",y1:"10.17",y2:"60.249",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#F7EEFF"}),he().createElement("stop",{offset:"1",stopColor:"#F4E7FF"}))))},lz=function(){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"18",fill:"none",style:{marginLeft:0,marginRight:"8px"},viewBox:"0 0 16 18"},he().createElement("path",{fill:"url(#paint0_linear_2112_1918)",d:"M.5 9c0-.323.262-.582.584-.614a5.846 5.846 0 0 0 5.231-5.231c.032-.321.29-.584.613-.584s.582.263.613.584a5.846 5.846 0 0 0 5.232 5.231c.321.032.583.29.583.614 0 .322-.262.58-.583.613a5.846 5.846 0 0 0-5.232 5.231c-.031.321-.29.584-.613.584s-.581-.263-.613-.584a5.846 5.846 0 0 0-5.231-5.231C.762 9.58.5 9.323.5 9"}),he().createElement("path",{fill:"url(#paint1_linear_2112_1918)",d:"M12.07 1.928a.19.19 0 0 1 .175-.183 1.754 1.754 0 0 0 1.57-1.57.19.19 0 0 1 .184-.175.19.19 0 0 1 .184.175 1.754 1.754 0 0 0 1.57 1.57.19.19 0 0 1 .174.183.19.19 0 0 1-.175.184 1.754 1.754 0 0 0-1.57 1.57.19.19 0 0 1-.183.175.19.19 0 0 1-.184-.175 1.754 1.754 0 0 0-1.57-1.57.19.19 0 0 1-.175-.184"}),he().createElement("path",{fill:"url(#paint2_linear_2112_1918)",d:"M10.786 15.429c0-.13.105-.233.234-.245a2.34 2.34 0 0 0 2.092-2.093.253.253 0 0 1 .245-.234c.13 0 .233.105.246.234a2.34 2.34 0 0 0 2.092 2.093.253.253 0 0 1 .234.245c0 .129-.105.232-.234.245a2.34 2.34 0 0 0-2.092 2.093.253.253 0 0 1-.246.233.253.253 0 0 1-.245-.233 2.34 2.34 0 0 0-2.092-2.093.253.253 0 0 1-.234-.245"}),he().createElement("defs",null,he().createElement("linearGradient",{id:"paint0_linear_2112_1918",x1:"6.928",x2:"6.928",y1:"2.571",y2:"15.428",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#E5C8FF"}),he().createElement("stop",{offset:"1",stopColor:"#BA6DFC"})),he().createElement("linearGradient",{id:"paint1_linear_2112_1918",x1:"13.999",x2:"13.999",y1:"0",y2:"3.857",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#E7CBFF"}),he().createElement("stop",{offset:"1",stopColor:"#F5E9FF"})),he().createElement("linearGradient",{id:"paint2_linear_2112_1918",x1:"13.357",x2:"13.357",y1:"12.857",y2:"18",gradientUnits:"userSpaceOnUse"},he().createElement("stop",{stopColor:"#E7CBFF"}),he().createElement("stop",{offset:"1",stopColor:"#F5E9FF"}))))};var sz=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n+1,0);if(e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()){var o=24-e.getHours();return"".concat(o," hour").concat(1!==o?"s":"")}var i=r.getDate()-e.getDate();return"".concat(i," day").concat(1!==i?"s":"")};const cz=function(e){var t,n=e.creditData,r=Number(n.total_used_credit)||0,o=Number(n.total_credit)||0,i=Number(n.available_credit)||0,a=Number(n.estimated_cost)||0,l=n.subscription_credit.interval||"one_time",s=o>0?Math.min(Math.round(r/o*100),100):0;return React.createElement("div",{className:"optimizer-container"},React.createElement("div",{className:"optimizer-header"},React.createElement("div",{className:"title-area"},React.createElement("h3",{className:"optimizer-title"},(0,At.__)("Your AI Credit","templately"))),React.createElement("a",{href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",target:"_blank",className:"increase-limit-btn"},(0,At.__)("Increase Limit","templately"))),React.createElement("div",{className:"usage-container"},React.createElement("div",{className:"usage-text"},React.createElement(React.Fragment,null,r.toLocaleString(),"/",o.toLocaleString()," ",(0,At.__)("Credit","templately"))),React.createElement("span",{className:"credits-info tt-top","data-templately-tooltip":i?"recurring"===l?(0,At.__)("Monthly reset in ".concat(sz()),"templately"):(0,At.__)("AI credit validity: Lifetime – use anytime.","templately"):(0,At.__)("To generate AI content - buy credits now!","templately")},React.createElement("i",{className:"dashicons dashicons-info"}))),React.createElement("div",{className:"progress-container"},React.createElement("div",{className:"progress-bar",style:{width:"".concat(s,"%")}})),a>0&&React.createElement("p",{className:"estimated-credit"},(0,At.__)("Estimated AI Credits for this generation:","templately")," ",React.createElement("strong",null,a)))};function uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const pz=function(e){var t,n=e.pack_id,r=(e.startModifyAiContent,e.back,e.next),o=e.setIsAi,i=e.removeStep,a=ce((0,pe.useState)("website-information"),2),l=a[0],s=a[1],c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1],p=ce((0,pe.useState)(""),2),f=p[0],h=p[1],m=ce(uj("prompt",""),2),g=m[0],v=m[1],y=ce(uj("businessNiches",[]),2),b=y[0],w=y[1],E=ce(uj("address",""),2),k=E[0],O=E[1],S=ce(uj("email",""),2),x=S[0],_=S[1],C=ce(uj("phone",""),2),D=C[0],P=C[1],A=En(),T=ce((0,pe.useState)([]),2),F=T[0],M=T[1],I=ce(uj("AIPageIDs",{"content/page":[],templates:[]}),2),N=I[0],j=I[1],L=ce(uj("aiRequestData",[]),2),R=(L[0],L[1]),B=ce(uj("previewPages",[]),2),z=B[0],W=B[1],U=ce(uj("process_id",""),2),V=(U[0],U[1]),H=ce(uj("cachedPreviewInput",{}),2),G=H[0],q=H[1],Q=(0,pe.useMemo)(function(){return Object.values(N).flat().length},[N]),$=["Agency","Restaurant","Entrepreneur","Event","Non-profit","Local business","Gym","Spa","SaaS","Dentist","Blog","Construction","Creative","Cyber","eCommerce","Education","Entertainment","Fashion","Restaurants","Health","Holiday","Multipurpose","NFT","Photography","Portfolio","Technology","Travel","Dentists","Law Firms","Wedding Photographers"].concat(Nl((0,Ea.isArray)(F)?F:[])),Y=xn(function(e){return e.general.platform},Jt),X=xn(function(e){var t;return null!==(t=e.general.fullSiteImport.availableCredit)&&void 0!==t?t:{available_credit:0,interval:"",purchased_credit:0,subscription_credit:0,total_credit:0,total_used_credit:0,estimated_cost:0}},Jt),K=X.available_credit-X.estimated_cost,Z=function(e,t){var o,i;if(e.preventDefault(),!g||!g.length||!g.trim())return h((0,At.__)("Oops! We need some details about your website.","templately")),s("website-information"),!1;h(""),R({address:k,email:x,phone:D,platform:Y,pack_id:n,prompt:g,AIPageIDs:N,preview_pages:z,businessNiches:null!==(o=null==b?void 0:b.value)&&void 0!==o?o:"",isBusinessNichesNew:!$.includes(null!==(i=null==b?void 0:b.value)&&void 0!==i?i:"")}),r()};return(0,pe.useEffect)(function(){g&&h("")},[g]),(0,pe.useEffect)(function(){d(!0);var e=(0,vi.addQueryArgs)(window.ajaxurl,{action:"templately_pack_import_info",id:n,isAi:!0,nonce:window.templately.nonce});ha(e,{},{method:"GET"}).then(function(e){var t,n,r,o,i,a=e.response,l=e.error;if(l)return console.error("Error fetching pack import info:",l),void d(!1);if(null!=a&&a.business_niches&&M(null==a?void 0:a.business_niches),null!=a&&null!==(t=a.data)&&void 0!==t&&t.ai_process){var s,c=null==a||null===(s=a.data)||void 0===s?void 0:s.ai_process;V(null==c?void 0:c.process_id),v(null==c?void 0:c.prompt),w({value:null==c?void 0:c.business_niches,label:null==c?void 0:c.business_niches}),O(null==c?void 0:c.address),_(null==c?void 0:c.email),P(null==c?void 0:c.phone),q(c)}if(null!=a&&null!==(n=a.data)&&void 0!==n&&n.credit_balance||null!=a&&null!==(r=a.data)&&void 0!==r&&r.estimated_cost){var u,p,f=null!==(u=a.data.credit_balance)&&void 0!==u?u:{},h=null!==(p=a.data.estimated_cost)&&void 0!==p?p:0;A(Fy(dz(dz({},f),{},{estimated_cost:h})))}if(null!=a&&null!==(o=a.data)&&void 0!==o&&null!==(o=o.manifest)&&void 0!==o&&null!==(o=o.content)&&void 0!==o&&o.page||null!=a&&null!==(i=a.data)&&void 0!==i&&null!==(i=i.manifest)&&void 0!==i&&i.templates){var m,g,y,b,E=null!==(m=null==a||null===(g=a.data)||void 0===g||null===(g=g.manifest)||void 0===g||null===(g=g.content)||void 0===g?void 0:g.page)&&void 0!==m?m:{},k=null!==(y=null==a||null===(b=a.data)||void 0===b||null===(b=b.manifest)||void 0===b?void 0:b.templates)&&void 0!==y?y:{},S=Object.values(E).filter(function(e){var t;return!0!==(null===(t=e.page_settings)||void 0===t?void 0:t.page_for_posts)}),x=Object.values(E).filter(function(e){var t;return!0===(null===(t=e.page_settings)||void 0===t?void 0:t.page_on_front)}).map(function(e){return e.post_id}),C=Object.values(k),D=S.map(function(e){return e.post_id}),T=C.filter(function(e){return!D.includes(e.post_id)}).map(function(e){return e.post_id});x.length>0&&W(x),(D.length>0||T.length>0)&&j({"content/page":D,templates:T})}d(!1)}).catch(function(e){d(!1),window.templately.log&&console.error(e)})},[]),(0,pe.useEffect)(function(){(0,Ea.isEmpty)(G)||(G.prompt!==g||G.business_niches!==(null==b?void 0:b.value)||G.address!==k||G.email!==x||G.phone!==D)&&V("")},[G,g,b,k,x,D]),u?React.createElement("div",{className:"templately-dependency-modal-customizer-right-loader ai-content-loader"},React.createElement(El,null)):React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-dependency-modal-header templately-ai-content-header"},React.createElement("h3",{className:"templately-title"},(0,At.__)("Launch your website in seconds!","templately")),React.createElement("p",{className:"templately-details"},(0,At.__)("Just a few details about your site – we’ll take care of the rest.","templately")),React.createElement(az,null)),React.createElement("div",{className:"templately-dependency-modal-body"},React.createElement("div",{className:"templately-ai-content-wrapper"},React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-ai-content-inner-wrapper"},React.createElement(aj,{title:(0,At.__)("Website Information","templately"),current:l,setCurrent:s,id:"website-information"},React.createElement("div",{className:"templately-ai-content business-type"},React.createElement("h4",{className:"templately-ai-content-title"},(0,At.__)("Select website type","templately")),React.createElement(iz,{placeholder:(0,At.__)(" e.g., Portfolio, Blog, Business, etc.","templately"),noOptionsMessage:function(){return(0,At.__)("No category found, create new one!","templately")},value:b,options:$.map(function(e){return{value:e,label:e}}),className:"templately-ai-prompt-category",classNamePrefix:"templately-ai-prompt-category",onChange:function(e){w(e)}})),React.createElement("div",{className:"templately-ai-content"},React.createElement("h4",{className:"templately-ai-content-title"},(0,At.__)("Tell us what your site is about","templately")),React.createElement(tj.TextareaControl,{value:g,onChange:function(e){return v(e)},className:"templately-ai-prompt ".concat(f?"templately-ai-prompt-error":""),placeholder:"Briefly describe your website’s purpose",help:(0,At.__)("Your input will reflect throughout the entire templates.","templately"),rows:4}),f&&React.createElement(tj.Notice,{status:"error",isDismissible:!1},f))),React.createElement(aj,{title:(0,At.__)("Contact Information","templately"),current:l,setCurrent:s,initialCollapsed:!0,id:"contact-information"},React.createElement("div",{className:"templately-ai-content"},React.createElement(tj.TextControl,{label:(0,At.__)("Full address","templately"),value:k,onChange:function(e){return O(e)},placeholder:(0,At.__)("123 Main St, Anytown, USA","templately"),className:"templately-ai-prompt"}),React.createElement(tj.TextControl,{label:(0,At.__)("Email address","templately"),value:x,onChange:function(e){return _(e)},placeholder:(0,At.__)("you@example.com","templately"),className:"templately-ai-prompt"}),React.createElement(tj.TextControl,{label:(0,At.__)("Contact number","templately"),value:D,onChange:function(e){return P(e)},placeholder:(0,At.__)("(123) 456-7890","templately"),className:"templately-ai-prompt"}))))),React.createElement(cz,{creditData:X}),0===Q&&React.createElement(tj.Notice,{status:"error",isDismissible:!1},(0,At.__)("Oops! Something went wrong while generating AI content for this template. Need help? Please contact","templately")," ",React.createElement("a",{href:"https://wpdeveloper.com/support",target:"_blank"},(0,At.__)("support","templately"))))),React.createElement("div",{className:"templately-dependency-modal-footer"},React.createElement("button",{className:"templately-button skip-button",onClick:function(){h(""),R(null),o(!1),i({type:"ai-content"}),r()}},(0,At.__)("Switch to Regular","templately")),K<=0&&React.createElement("a",{target:"_blank",href:null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.dev_api?"https://www.templately.dev/#credit":"https://www.templately.com/#credit",className:"templately-dmc-submit-button"},React.createElement(lz,null),React.createElement("span",null,(0,At.__)("Buy Credit","templately")),React.createElement($N,null)),K>0&&React.createElement("button",{disabled:0===Q,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(lz,null),React.createElement("span",null,(0,At.__)("Preview","templately"))),K>0&&React.createElement("button",{disabled:0===Q,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(lz,null),React.createElement("span",null,(0,At.__)("Set Branding","templately")),React.createElement($N,null))))},fz=function(e){var t,n,r,o=En(),i=ce(uj("isAi",e.isAi),2),a=i[0],l=i[1],s=hO(),c=s.setSteps,u=s.steps,d=s.removeStep,p=s.startImporting,f=s.eventSourceRef,h=s.isImportRunning,m=s.isImportComplete,g=s.startModifyAiContent,v=xn(function(e){var t;return{currentStep:null!==(t=e.general.fullSiteImport.currentStep)&&void 0!==t?t:1,results:e.general.fullSiteImport.results}},Jt),y=v.currentStep,b=v.results,w=xn(function(e){var t=e.general.fullSiteImport.formData;return e.general.fullSiteImport.formData||(t=new FormData,o({type:Qo,payload:t})),t},Jt),E=new Map;null===(t=e.items)||void 0===t||t.map(function(e){var t;null===(t=e.dependencies)||void 0===t||t.map(function(e){E.set(e.plugin_file,e)})}),w.set("id",null==e?void 0:e.id);var k=ce(he().useState(!1),2),O=k[0],S=k[1],x=function(){var e=ce((0,pe.useState)(window.location),2),t=e[0],n=e[1];return(0,pe.useEffect)(function(){var e=function(e){n(cO({},window.location))};return window.addEventListener("popstate",e),function(){window.removeEventListener("popstate",e)}},[]),t}(),_=null!==(n=null===(r=window.history.state)||void 0===r?void 0:r.usr)&&void 0!==n?n:{};return(0,pe.useEffect)(function(){m&&(o({type:qo,payload:m}),o(Dy(4)))},[m]),(0,pe.useEffect)(function(){var t=null==_?void 0:_.isRunning;h?t||e.pushState("isRunning"):e.removeState("isRunning")},[h]),(0,pe.useEffect)(function(){!(null==_?void 0:_.isRunning)&&O&&h&&e.pushState("isRunning")},[x,O]),(0,pe.useEffect)(function(){!0!==(null==_?void 0:_.modal)&&O&&!h&&(S(!1),Sl.close())},[x]),(e=>{const t=(0,pe.useRef)(e);(0,pe.useEffect)(()=>{t.current=e});const n="function"==typeof e;(0,pe.useEffect)(()=>{if(n){const e=e=>{const n=t.current(e);n||"string"==typeof n?(e.preventDefault(),e.returnValue=n):e.defaultPrevented&&(e.returnValue=!0)};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)}},[n])})(function(e){if((null==_?void 0:_.isRunning)&&O&&h)return e.preventDefault(),alert((0,At.__)("Please wait until the import process is complete before navigating back.","templately")),!1}),(0,pe.useEffect)(function(){return S(!0),function(){var e;null===(e=f.current)||void 0===e||e.close(),S(!1)}},[]),he().createElement(he().Fragment,null,0===y&&he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(pz,{back:function(){return o(Dy(0))},next:function(){return o(Dy(1))},pack_id:null==e?void 0:e.id,formData:w,removeStep:d,setIsAi:l}),he().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},he().createElement(rj,null)))),1===y&&he().createElement("div",{className:"templately-dependency-modal-container full-screen"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(IB,{id:null==e?void 0:e.id,live_url:null==e?void 0:e.live_url,has_settings:null==e?void 0:e.has_settings,name:e.name,back:function(){return o(Dy(0))},next:function(){return o(Dy(2))},formData:w,showErrorAlert:e.showErrorAlert,isAi:a,ogIsAi:e.isAi,setShowFSIModal:e.setShowFSIModal,startModifyAiContent:g}))),2===y&&(null==u?void 0:u.length)<=0&&he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(jB,{back:function(){return o(Dy(1))},next:function(){return o(Dy(3))},dependencies:E,categories:e.categories,formData:w,setSteps:c,steps:u,hasAttachment:e.hasAttachment,isAi:a}),he().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},he().createElement(rj,null)))),3===y&&(null==u?void 0:u.length)>0&&he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(ez,{steps:u,formData:w,start:p,startModifyAiContent:g,isAi:a}),he().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},he().createElement(rj,null)))),4===y&&he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(JB,{results:b,steps:u,isAi:a,formData:w}),he().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:function(){return e.setShowFSIModal()}},he().createElement(rj,null)))))};function hz(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return mz(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(mz(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,mz(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,mz(d,"constructor",c),mz(c,"constructor",s),s.displayName="GeneratorFunction",mz(c,o,"GeneratorFunction"),mz(d),mz(d,o,"Generator"),mz(d,r,function(){return this}),mz(d,"toString",function(){return"[object Generator]"}),(hz=function(){return{w:i,m:p}})()}function mz(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}mz=function(e,t,n,r){function i(t,n){mz(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},mz(e,t,n,r)}const gz=function(e){var t=xn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n||null===(n=n.fsiModalContext)||void 0===n?void 0:n.show)&&void 0!==t&&t},Jt),n=ce(uj("isAi",!1),2),r=n[0],o=n[1],i=xn(function(e){var t,n;return null!==(t=null==e||null===(n=e.general)||void 0===n||null===(n=n.fullSiteImport)||void 0===n?void 0:n.triggerHandleClick)&&void 0!==t?t:null},Jt),a=xn(function(e){return null!=e.profile.data},Jt),l=xn(function(e){return e.profile},Jt),s=En(),c=rt(),u=tt(),d=function(){var e,t,n=En(),r=ce((0,pe.useState)(!1),2),o=r[0],i=r[1],a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=ce((0,pe.useState)(null),2),u=c[0],d=c[1],p=xn(function(e){var t;return null!==(t=e.profile.isVerifying)&&void 0!==t&&t}),f=xn(function(e){return e.profile}),h=xn(function(e){return null!==e.profile.data});return(0,pe.useEffect)(function(){var e,t;l&&!p&&(i(!1),s(!1),Sl.close(),u&&(u.resolve({is_verified:null!==(e=null==f||null===(t=f.data)||void 0===t?void 0:t.is_verified)&&void 0!==e&&e}),d(null)))},[p,l,null==f||null===(e=f.data)||void 0===e?void 0:e.is_verified,u]),(0,pe.useCallback)(hi(Xg().m(function e(){var t;return Xg().w(function(e){for(;;)switch(e.n){case 0:if(!h||null!=f&&null!==(t=f.data)&&void 0!==t&&t.is_verified||o||p){e.n=1;break}return i(!0),s(!0),xl({icon:"info",showCloseButton:!0,allowOutsideClick:!0,showConfirmButton:!1,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(Yu,{code:"verification_check",title:(0,At.__)("Checking Account Verification...","templately"),message:(0,At.sprintf)((0,At.__)('We are checking your account verification status. Please wait while we verify your account. If you haven\'t verified your account yet, please check your email for the verification link. Need help? Contact our <a href="%s" target="_blank" rel="noopener noreferrer">support team</a>.',"templately"),"https://wpdeveloper.com/support/")}))},!0),n(Ri()),e.a(2,new Promise(function(e,t){var n=setTimeout(function(){i(!1),s(!1),window.Swal&&window.Swal.isVisible()&&window.Swal.close(),t(new Error("Verification check timeout"))},1e4);d({resolve:function(t){clearTimeout(n),e(t)},reject:function(e){clearTimeout(n),t(e)}})}));case 1:return e.a(2,!1)}},e)})),[n,h,null==f||null===(t=f.data)||void 0===t?void 0:t.is_verified,o,p])}(),p=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"modal";null!==(e=u.state)&&void 0!==e&&e[t]||c(nb(u.pathname.replace(/^\/+/,"")),{state:Pt({},t,!0)})},f=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"modal";null!==(e=window.history.state)&&void 0!==e&&null!==(e=e.usr)&&void 0!==e&&e[t]&&c(-1)},h=function(){var t=hi(hz().m(function t(n){var r,i,h;return hz().w(function(t){for(;;)switch(t.p=t.n){case 0:if(a){t.n=1;break}return c(nb("sign-in"),{state:{redirectTo:u.pathname.replace(/^\/(.*)/,"$1")}}),t.a(2);case 1:return i=null==l||null===(r=l.data)||void 0===r?void 0:r.is_verified,t.p=2,t.n=3,d();case 3:!0===(null==(h=t.v)?void 0:h.is_verified)&&(i=!0),t.n=5;break;case 4:t.p=4,t.v;case 5:if(!Yg(a,i)){t.n=6;break}return t.a(2);case 6:if(f(),f("isRunning"),p(),s(Ty()),s(Wy()),s(Dy(1)),s(Py(0)),s(Ay(!1)),window.templately.can_fsi){t.n=7;break}return xl({icon:"warning",showCloseButton:!0,html:React.createElement(oC,{title:(0,At.__)("Oops!","templately"),content:(0,At.__)("Unfortunately, you don't have permission to import templates. Please check your permissions or contact the website admin for help.","templately")})},!1),t.a(2);case 7:s(n?My({id:e.id}):Iy()),o(n);case 8:return t.a(2)}},t,null,[[2,4]])}));return function(_x){return t.apply(this,arguments)}}(),m=function(){s(Ty()),f(),f("isRunning"),s(Ay(!0)),s(Ny())};return(0,pe.useEffect)(function(){t||m()},[t]),(0,pe.useEffect)(function(){i&&i.id===e.id&&h(i.isWithAI)},[i]),React.createElement(React.Fragment,null,React.createElement(N_(),{isOpen:t,onRequestClose:function(){return m()},className:"templately-dependency-modal-content",portalClassName:"templately-dependency-modal-portal",overlayClassName:"templately-dependency-modal-overlay",style:{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",zIndex:"159999"},content:{position:"fixed",top:0,left:0,right:0,bottom:0,border:"none",background:"transparent",borderRadius:"0",outline:"none",padding:"0",width:"100vw",height:"100vh"}}},React.createElement(fz,re({},e,{pushState:p,removeState:f,setShowFSIModal:function(){return s(Ny())},showErrorAlert:function(e){s(Ty()),s(Ay(!0)),xl({icon:"info",showCloseButton:!0,html:React.createElement(oC,{title:(0,At.__)("Oops!","templately"),content:e})},!1)},isAi:r}))),React.createElement("button",{type:"button",onClick:function(){return h(!1)},className:"templately-item-details-fsi-button"},React.createElement(BN,null),React.createElement("span",null,(0,At.__)("Build Full Website","templately"))),(null==e?void 0:e.ai_compatible)&&React.createElement("button",{type:"button",onClick:function(){return h(!0)},className:"templately-item-details-fsi-ai-button with-ai"},React.createElement(qN,{classNamePrefix:Ya()}),React.createElement("span",null,(0,At.__)("Build with Templately AI","templately")),React.createElement("span",{className:"templately-button-badge"},"Beta")))};var vz=["children","details"],yz=(0,pe.createContext)({items:[],templateType:"",type:"",setType:function(e){return e}}),bz=function(e){var t,n,r,o,i,a=e.children,l=e.details,s=(Wn(e,vz),ce((0,pe.useState)({blocks:!1,pages:!1}),2)),c=s[0],u=s[1],d=ce((0,pe.useState)("all"),2),p=d[0],f=d[1],h=ce((0,pe.useState)(null),2),m=h[0],g=h[1],v=ce((0,pe.useState)([]),2),y=v[0],b=v[1],w=ce((0,pe.useState)([]),2),E=w[0],k=w[1];return(0,pe.useEffect)(function(){var e;if((null==l||null===(e=l.items)||void 0===e?void 0:e.length)>0){var t=null==l?void 0:l.items.filter(function(e){return"block"===e.type}),n=null==l?void 0:l.items.filter(function(e){return"page"===e.type});b(t),k(n)}},[l]),(0,pe.useEffect)(function(){g(null)},[p]),he().createElement(yz.Provider,{value:{id:null==l?void 0:l.id,name:null==l?void 0:l.name,fullsite_import:null!==(t=null==l?void 0:l.fullsite_import)&&void 0!==t&&t,ai_compatible:null!==(n=null==l?void 0:l.ai_compatible)&&void 0!==n&&n,has_settings:null!==(r=null==l?void 0:l.has_settings)&&void 0!==r&&r,hasAttachment:null!==(o=null==l?void 0:l.has_attachments)&&void 0!==o&&o,items:null==l?void 0:l.items,live_url:null==l?void 0:l.live_url,categories:null!==(i=null==l?void 0:l.categories)&&void 0!==i?i:[],blocksData:y,pagesData:E,type:p,setType:f,templateType:m,setTemplateType:g,isOpen:c,setIsOpen:u}},a)},wz=yz.Consumer,Ez={trigger:{color:"#475467",fontSize:"1rem","line-height":"1.25 !important","font-weight":600},content:{backgroundColor:"#fff",border:"1px solid #ddd",borderRadius:"4px",padding:"10px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",zIndex:100,maxWidth:"20rem"},arrow:{fill:"#fff"}};const kz=function(e){var t;return React.createElement(AF,null,React.createElement(TF,{asChild:!0},React.createElement("button",{className:"templately-item-details-item-meta-category-popover-button"},(null==e||null===(t=e.details)||void 0===t||null===(t=t.categories)||void 0===t?void 0:t.length)-1," more")),React.createElement(FF,null,React.createElement(MF,{className:"hello",sideOffset:5,align:"end",style:Ez.content},null==e?void 0:e.children)))},Oz=a.p+"images/blurry-bg.png",Sz=a.p+"images/templately-bg-gradient.png";function xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cz(e){if(e){var t=(e=e.toString()).match(/^-?\d+(?:\.\d{0,2})?/);return t?t[0]:e}return e}const Dz=gn(function(e){var t,n;return{proPlans:(null!==(t=null===(n=e.general)||void 0===n||null===(n=n.pricing)||void 0===n?void 0:n.data)&&void 0!==t?t:[]).filter(function(e){return("year"===e.type||"one_time"===e.type)&&e.price>0}),counts:e.general.counts,isCountsLoading:null===e.general.counts}})(function(e){var t,n=e.proPlans,r=e.counts,o=e.isCountsLoading,i=function(e){return function(e,t,n,r,o,i){var a,l="https://templately.com/checkout/";null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.dev_api&&(l="https://templately.dev/checkout/");var s={planId:t,plan_name:e,type:o,slug:n,utm_source:"plugin",utm_medium:"upgradeButton"};return r&&(s.coupon=r),i&&(s.sites=i),(0,vi.addQueryArgs)(l,s)}(e.name,e.id,e.slug,e.coupon,e.type,e.sites)},a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=ce((0,pe.useState)({starter:0,pro:0}),2),u=c[0],d=c[1];return(0,pe.useEffect)(function(){if(Ia(r)){var e=Object.values(r).map(function(e){return e.items}),t=e.reduce(function(e,t){return e+t.starter},0),n=e.reduce(function(e,t){return e+t.pro},0);d({starter:t,pro:n})}},[r]),n&&0!==n.length?he().createElement(he().Fragment,null,he().createElement("button",{className:"templately-item-details-upgrade-plan-button",onClick:function(){return s(!0)}},he().createElement("span",{className:"templately-item-details-upgrade-plan-button-text"},he().createElement("span",null,"Unlimited template from"),he().createElement("span",{className:"templately-item-details-upgrade-plan-button-price"},"$",(t=function(e){if(!e||0===e.length)return null;var t=e.map(function(e){var t=parseFloat(e.discounted_price?e.discounted_price/12:e.price/12);return _z(_z({},e),{},{calculatedPrice:t})}).reduce(function(e,t){return t.calculatedPrice<e.calculatedPrice?t:e});return{price:Cz(t.calculatedPrice),plan:t}}(n),t?t.price:"4.99")))),he().createElement(N_(),{isOpen:l,onRequestClose:function(){return s(!1)},style:{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",zIndex:3},content:{position:"absolute",top:"50%",left:"50%",right:0,bottom:"auto",border:"none",background:"#28222D",borderRadius:"0.25rem",outline:"none",padding:"0",transform:"translate(-50%, -50%)",width:"40rem",overflow:"visible"}}},he().createElement("div",{className:"templately-item-details-upgrade-plan-modal"},he().createElement("button",{type:"button",className:"templately-item-details-upgrade-plan-modal-close",onClick:function(){return s(!1)}},he().createElement("i",{className:"dashicons dashicons-no-alt"})),he().createElement("div",{className:"templately-item-details-upgrade-plan-modal-content"},he().createElement("img",{src:Sz,alt:"background",className:"templately-item-details-upgrade-plan-modal-bg"}),he().createElement("div",{className:"templately-item-details-upgrade-plan-modal-inner"},he().createElement("h2",{className:"templately-item-details-upgrade-plan-modal-heading"},"Download Unlimited and ",he().createElement("br",null)," Save upto ",he().createElement("span",{className:""},"52%")),he().createElement("ul",{className:"templately-item-details-upgrade-plan-modal-list"},he().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},he().createElement("i",{className:"dashicons dashicons-yes-alt"}),he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},o?"...":u.starter," Starter Items")),he().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},he().createElement("i",{className:"dashicons dashicons-yes-alt"}),he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},"Unlimited WorkSpace")),he().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},he().createElement("i",{className:"dashicons dashicons-yes-alt"}),he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},o?"...":u.pro," PRO Items")),he().createElement("li",{className:"templately-item-details-upgrade-plan-modal-list-item"},he().createElement("i",{className:"dashicons dashicons-yes-alt"}),he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-list-item-text"},"Unlimited Items On My Cloud"))),he().createElement("div",{className:"templately-item-details-upgrade-plan-modal-plans"},n.map(function(e){return he().createElement("a",{href:i(e),target:"_blank",className:"templately-item-details-upgrade-plan-modal-plans-item",key:Math.random()},he().createElement("div",{className:"templately-item-details-upgrade-plan-modal-plans-item-inner"},he().createElement("p",{className:"templately-item-details-upgrade-plan-modal-plans-item-name"},"one_time"===e.type?he().createElement(he().Fragment,null,he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-name-bold"},e.name)," - Unlimited Sites"):"".concat(e.name," - ").concat(e.sites," Sites")),he().createElement("p",{className:"templately-item-details-upgrade-plan-modal-plans-item-price"},"one_time"===e.type?he().createElement(he().Fragment,null,"$".concat(Cz(parseFloat(e.discounted_price?e.discounted_price:e.price))),e.discounted_price?he().createElement("sub",{className:"templately-item-details-upgrade-plan-modal-plans-item-price-sub"},he().createElement("del",{style:{marginLeft:10,marginRight:0}},"$",e.price)):he().createElement(he().Fragment,null)):he().createElement(he().Fragment,null,"$".concat(Cz(parseFloat(e.discounted_price?e.discounted_price/12:e.price/12)),"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t"),he().createElement("sub",{className:"templately-item-details-upgrade-plan-modal-plans-item-price-sub"}," ","/ month"))),he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-button"},he().createElement("span",{className:"templately-item-details-upgrade-plan-modal-plans-item-button-icon"},he().createElement("i",{className:"dashicons dashicons-arrow-right-alt2"})))))}))))),he().createElement("div",{className:"tly__modal__closer",onClick:function(){return s(!1)}}))):null});var Pz=["template_type","categories","pack","id","platform","dependencies","isPurchased","isSubscribed","details","favourite_count","downloads","rating","price"];function Az(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Az(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Az(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Fz=function(e){var t,n,r,o,i,a,l=e.template_type,s=e.categories,c=(e.pack,e.id),u=e.platform,d=e.dependencies,p=e.isPurchased,f=e.isSubscribed,h=e.details,m=e.favourite_count,g=e.downloads,v=e.rating,y=e.price,b=Wn(e,Pz),w=En(),E=rt(),k=ce(Ct(),1)[0],O=xn(function(e){return null!=e.profile.data}),S=xn(function(e){return e.profile},Jt),x=function(e,t,n,r){var o=rt(),i=ce(Ct(),1)[0],a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=ce((0,pe.useState)(null),2),u=c[0],d=c[1],p=ce((0,pe.useState)(r),2),f=p[0],h=p[1],m=En(),g=xn(function(e){return e.profile},Jt),v=xn(function(e){return null!==e.profile.data}),y=xn(function(e){var t,n;return null!==(t=null===(n=e.profile.favourite)||void 0===n?void 0:n.loading)&&void 0!==t&&t}),b=xn(function(e){var t,n;return null!==(t=null===(n=e.profile.favourite)||void 0===n?void 0:n.error)&&void 0!==t&&t}),w=(0,pe.useMemo)(function(){return null===u||b?n:u},[u,n,b]);return(0,pe.useEffect)(function(){if(l&&!v)return s(!1),o(nb("sign-in",Pt({},"redirect-to",i.get("path"))));if(l){if(y)return;d(function(e){return!e}),h(function(e){return w?e-1:e+1}),m(Yi({action:w?"undo":"do",id:e,itemType:t})),s(!1)}},[l]),(0,pe.useEffect)(function(){b&&"string"==typeof b&&(d(null),rv(v,g,b))},[b]),{starred:w,isClicked:l,favouriteLoading:y,setIsClicked:s,favouriteCount:f}}(c,b.type,b.is_favourite,m),_=x.starred,C=x.setIsClicked,D=x.favouriteLoading,P=x.favouriteCount,A=ce((0,pe.useState)(null),2),T=A[0],F=A[1],M=xn(function(e){var t,n;return null!==(t=null===(n=e.profile.rating)||void 0===n?void 0:n.error)&&void 0!==t&&t}),I=xn(function(e){var t,n;return null!==(t=null===(n=e.profile.rating)||void 0===n?void 0:n.loading)&&void 0!==t&&t}),N=(0,pe.useMemo)(function(){return null===T||M?b.is_reviewed:T},[b.is_reviewed,T,M]),j=(0,pe.useMemo)(function(){if("pack"==b.type){var e,t={};return null===(e=b.items)||void 0===e||e.filter(function(e){var n;(null==e||null===(n=e.dependencies)||void 0===n?void 0:n.length)>0&&e.dependencies.map(function(e){t[e.id]=e})}),Object.values(t)}return d},[]);(0,pe.useEffect)(function(){M&&"string"==typeof M&&rv(O,S,M)},[M]);var L=ce((0,pe.useState)(!1),2),R=L[0],B=L[1],z=function(e){var t;e!==u&&E(nb("".concat(e,"/").concat("pack"===b.type?"packs":"page"===b.type?"pages":"blocks","/").concat(null==b||null===(t=b.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.slug)))},W=function(){return function(e,t,n,r,o,i){var a,l="https://templately.com/".concat(o,"/").concat(n);null!==(a=window.templatelyDeveloper)&&void 0!==a&&a.dev_api&&(l="https://templately.dev/".concat(o,"/").concat(n));var s={action:"payment",type:o,item_id:t,utm_source:"plugin",utm_medium:"purchaseButton"};return r&&(s.coupon=r),i&&(s.sites=i),(0,vi.addQueryArgs)(l,s)}(null==b||b.name,(null==b?void 0:b.id)||c,null==b?void 0:b.slug,null==b?void 0:b.coupon,(null==b?void 0:b.type)||"pack",null==b?void 0:b.sites)};return(0,pe.useEffect)(function(){R&&xl({showConfirmButton:!1,showDenyButton:!1,icon:!1,type:"warning",title:!1,showCloseButton:!0,customClass:{container:"templately-video-container",popup:"templately-video-popup",closeButton:"templately-video-close-button",htmlContainer:"templately-video-html"},html:he().createElement("iframe",{width:"850",height:"480",src:"https://www.youtube.com/embed/ZhzHWqMD1Zk?autoplay=1&rel=0",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowfullscreen:!0})},!1).then(function(e){(null!=e&&e.isConfirmed||null!=e&&e.isDismissed)&&B(!1)})},[R]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta"},he().createElement("img",{src:Oz,alt:"background",height:1456,width:1696,className:"templately-item-details-item-meta-background"}),he().createElement("div",{className:"templately-item-details-item-meta-header"},he().createElement("div",{className:"templately-item-details-item-meta-variations-button-wrapper ".concat("")},"elementor"!==(null==b||null===(t=b.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.platform)&&"elementor"!==u?he().createElement(NN,{enableClick:!0,content:(0,At.__)("Coming Soon","templately")},he().createElement("span",{className:"templately-item-details-item-meta-variations-button not-available"},(0,At.__)("Elementor","templately"))):he().createElement("button",{type:"button",onClick:function(){z("elementor")},className:"templately-item-details-item-meta-variations-button ".concat("elementor"===u?"active":"")},(0,At.__)("Elementor","templately")),"gutenberg"!==(null==b||null===(n=b.variations)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.platform)&&"gutenberg"!==u?he().createElement(NN,{enableClick:!0,content:(0,At.__)("Coming Soon","templately")},he().createElement("span",{className:"templately-item-details-item-meta-variations-button not-available"},(0,At.__)("Gutenberg","templately"))):he().createElement("button",{type:"button",onClick:function(){z("gutenberg")},className:"templately-item-details-item-meta-variations-button ".concat("gutenberg"===u?"active":"")},(0,At.__)("Gutenberg","templately")))),he().createElement("div",{className:"templately-item-details-item-meta-body"},he().createElement("div",{className:"templately-item-details-item-meta-content-wrapper"},he().createElement("div",{className:"templately-item-details-item-meta-content"},he().createElement("div",{className:"templately-item-details-item-meta-content-inner"},he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta-title"},"Published Date"),he().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(r=null==h?void 0:h.published_at)&&void 0!==r?r:"--")),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta-title"},"Last Update"),he().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(o=null==h?void 0:h.updated_at)&&void 0!==o?o:"--")),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta-title"},"Type"),he().createElement("div",{className:"templately-item-details-item-meta-info"},null!==(i=null==l?void 0:l.name)&&void 0!==i?i:"--")),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta-title"},"Category"),he().createElement("div",{className:"templately-item-details-item-meta-categories"},0!==(null==s?void 0:s.length)?(null==s?void 0:s.length)<2?null==s?void 0:s.map(function(e,t){return he().createElement(he().Fragment,{key:Math.random()},he().createElement(Zx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(b.type,"s"),className:"templately-item-details-item-meta-category"},e.name))}):he().createElement(he().Fragment,null,null==s?void 0:s.slice(0,1).map(function(e,t){return he().createElement(he().Fragment,{key:Math.random()},he().createElement(Zx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(b.type,"s"),className:"templately-item-details-item-meta-category"},e.name),he().createElement("span",{className:"templately-item-details-item-meta-category-separator"}," and "))}),he().createElement(kz,{details:h},he().createElement(he().Fragment,null,null==s?void 0:s.map(function(e,t){return he().createElement(he().Fragment,{key:Math.random()},he().createElement(Zx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(u,"/").concat(b.type,"s"),className:"templately-item-details-item-meta-category"},e.name)," ",t+1<(null==s?void 0:s.length)?", ":"")})))):"--")),g?he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta-title"},"Total downloads"),he().createElement("div",{className:"templately-item-details-item-meta-info"},null!=g?g:"--")):he().createElement(he().Fragment,null)),he().createElement("div",{className:"templately-item-details-item-meta-content-badges"},null==h||null===(a=h.badges)||void 0===a?void 0:a.map(function(e){var t=Xa.find(function(t){return t.key===e});return t?he().createElement("div",{key:t.key,className:"templately-item-details-item-meta-content-badges-badge ".concat(t.class)},he().createElement("img",{src:t.image,alt:"trending",height:63,width:56,className:"templately-item-details-item-meta-content-badges-badge-image"}),he().createElement("h4",{className:"templately-item-details-item-meta-content-badges-badge-title"},t.title)):null})),he().createElement("div",{className:"templately-item-details-item-meta-content-ratting-and-favorite flex gap-2 items-center"},he().createElement("div",{className:"templately-item-details-item-meta-content-ratting-wrapper"},he().createElement("span",{className:"templately-item-details-item-meta-title"},"Rate this"),he().createElement("div",{className:"templately-item-details-item-meta-content-ratting-group-wrapper"},he().createElement("div",{className:"templately-item-details-item-meta-content-ratting-group"},[1,2,3,4,5].map(function(e){return he().createElement("button",{key:e,type:"button",onClick:function(){return function(e){var t;O?I||(F(e),w((t={type_id:c,itemType:b.type,rating:e},Pi({type:oo},t)))):E(nb("sign-in",{"redirect-to":k.get("path")}))}(e)},className:"templately-item-details-item-meta-content-ratting-button"},e<=N?he().createElement(WN,{fill:"#FEB273"}):he().createElement(HN,{fill:"#FEB273"}))})),v&&he().createElement("div",{className:"templately-item-details-item-meta-content-average-ratting"},null==v?void 0:v.toFixed(1)))),he().createElement("button",{type:"button",onClick:function(){return C(!0)},className:"templately-item-details-item-meta-content-favorite-button"},he().createElement("span",{className:"templately-item-details-item-meta-content-favorite-button-tooltip"},_?"Added to Favorite":"Add to Favorite"),D?he().createElement(zN,{fill:"#F96796",className:"animate-spin"}):_?he().createElement(UN,{fill:"#F96796"}):he().createElement(VN,{fill:"#F96796"}),null!=P?P:he().createElement(he().Fragment,null))))),he().createElement("div",{className:"templately-item-details-button-wrapper"},"pack"===(null==b?void 0:b.type)?he().createElement(he().Fragment,null,parseInt(y)>0&&!p&&!f&&he().createElement("a",{target:"_blank",href:W(),className:"templately-item-details-fsi-button"},he().createElement(BN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"Pack"))),(null==b?void 0:b.fullsite_import)&&(0===parseInt(y)||p||f)&&he().createElement(bz,{details:h},he().createElement(wz,null,function(e){return he().createElement(gz,re({sidebar:!0,platform:u},e))})),!f&&he().createElement(Dz,null)):he().createElement(he().Fragment,null,parseInt(y)>0&&!p&&!f&&he().createElement("a",{target:"_blank",href:W(),className:"templately-item-details-fsi-button"},he().createElement(BN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"page"===b.type?"Page":"Block"))),(0===parseInt(y)||p||f)&&he().createElement("button",{onClick:function(){b.isLoggedIn?Yg(b.isLoggedIn,S)||fd({ModalComponent:rd,content:Tz({id:c,dependencies:j},b)}):E(nb("sign-in",{"redirect-to":k.get("path")}))},className:"templately-item-details-fsi-button"},he().createElement(BN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Insert This %s","templately"),"page"===b.type?"Page":"Block"))),!f&&he().createElement(Dz,null))))),null!=j&&j.length?he().createElement("div",{className:"templately-item-details-item-meta-dependencies-wrapper"},he().createElement("div",{className:"templately-item-details-item-meta-dependencies-header"},he().createElement("div",{className:"templately-item-details-item-meta-dependencies-title-wrapper"},he().createElement("span",{className:"templately-item-details-item-meta-dependencies-title"},"Dependency"))),he().createElement("div",{className:"templately-item-details-item-meta-dependencies-body"},he().createElement("div",{className:"templately-item-details-item-meta-dependencies-body-inner"},j.map(function(e,t){return he().createElement(he().Fragment,{key:t},he().createElement("a",{href:e.link&&"#"!==e.link?e.link:void 0,target:e.link&&"#"!==e.link?"_blank":void 0,rel:"noreferrer",className:"templately-item-details-item-meta-dependencies-item"},he().createElement("span",{className:"templately-item-details-item-meta-dependencies-item-tooltip"},e.name),e.icon?he().createElement("img",{src:e.icon,alt:e.name,height:"30",width:"30",className:"templately-item-details-item-meta-dependencies-item-icon"}):he().createElement("span",{className:"templately-item-details-item-meta-dependencies-item-text"},e.name[0])))})))):he().createElement(he().Fragment,null))};var Mz=function(e){var t=e.data,n=e.platform,r=e.type;return 0===t.length?React.createElement("div",null):React.createElement("div",{className:"templately-item-details-items-grid-panel"},t.map(function(e,t){return React.createElement("div",{key:t,className:"templately-item-details-items-grid-panel-items"},React.createElement("h4",{className:"templately-item-details-items-grid-panel-items-title"},e.name),React.createElement(St,{to:nb("".concat(n,"/").concat(r,"/").concat(null==e?void 0:e.slug)),className:"templately-item-details-items-grid-panel-items-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-items-grid-panel-items-image"})))}))};const Iz=function(e){var t=e.items,n=e.platform,r=ce((0,pe.useState)([]),2),o=r[0],i=r[1],a=ce((0,pe.useState)([]),2),l=a[0],s=a[1],c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1];return(0,pe.useEffect)(function(){var e=null==t?void 0:t.filter(function(e){return"block"===e.type}),n=null==t?void 0:t.filter(function(e){return"page"===e.type});s(n),i(e)},[t]),(0,pe.useEffect)(function(){l.length<=0&&o.length>0&&d(!0)},[o,l]),React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-inner"},l.length>0&&React.createElement("button",{type:"button",onClick:function(){return d(!1)},className:"templately-item-details-panel-header-button ".concat(u?"not-selected":"selected")},(0,At.__)("Pages","templately")),o.length>0&&React.createElement("button",{type:"button",onClick:function(){return d(!0)},className:"templately-item-details-panel-header-button ".concat(u?"selected":"not-selected")},(0,At.__)("Blocks","templately")))),u?React.createElement(Mz,{data:o,platform:n,type:"blocks"}):React.createElement(Mz,{data:l,platform:n,type:"pages"}))};var Nz=function(e){var t=e.data,n=e.platform,r=e.type;return 0===t.length?React.createElement("div",null):React.createElement("div",{className:"templately-item-details-items-grid-panel"},t.map(function(e,t){return React.createElement("div",{key:t,className:"templately-item-details-items-grid-panel-items"},React.createElement("h4",{className:"templately-item-details-items-grid-panel-items-title"},e.name),React.createElement(St,{to:nb("".concat(n,"/").concat(r,"/").concat(null==e?void 0:e.slug)),className:"templately-item-details-items-grid-panel-items-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-items-grid-panel-items-image"})))}))};const jz=function(e){var t=e.items,n=e.pack,r=e.platform,o=ce((0,pe.useState)([]),2),i=o[0],a=o[1],l=ce((0,pe.useState)([]),2),s=l[0],c=l[1],u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1];return(0,pe.useEffect)(function(){var e=null==t?void 0:t.filter(function(e){return"block"===e.type}),n=null==t?void 0:t.filter(function(e){return"page"===e.type});c(n),a(e)},[t]),(0,pe.useEffect)(function(){s.length<=0&&i.length>0&&p(!0)},[i,s]),React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-title-wrapper"},React.createElement("h4",{className:"templately-item-details-panel-header-title"},(0,At.__)("More ".concat(d?"blocks":"pages"," of "),"templately"),null==n?void 0:n.name," ",(0,At.__)("Pack","templately")),React.createElement(St,{to:nb("".concat(r,"/packs/").concat(null==n?void 0:n.slug)),className:"templately-item-details-panel-header-title-link"},(0,At.__)("View full Pack","templately"))),React.createElement("div",{className:"templately-item-details-panel-header-inner"},s.length>0&&React.createElement("button",{type:"button",onClick:function(){return p(!1)},className:"templately-item-details-panel-header-button ".concat(d?"not-selected":"selected")},(0,At.__)("Pages","templately")),i.length>0&&React.createElement("button",{type:"button",onClick:function(){return p(!0)},className:"templately-item-details-panel-header-button ".concat(d?"selected":"not-selected")},(0,At.__)("Blocks","templately")))),d?React.createElement(Nz,{data:i,platform:r,type:"blocks"}):React.createElement(Nz,{data:s,platform:r,type:"pages"}))};var Lz=a(4145);const Rz=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),pe.createElement("path",{d:"m13.333 7.6-7.417 7.416a.8.8 0 0 1-.583.23.8.8 0 0 1-.583-.23.8.8 0 0 1-.23-.583.8.8 0 0 1 .23-.583l7.416-7.417H5.833a.8.8 0 0 1-.594-.24A.8.8 0 0 1 5 5.6q0-.354.24-.594t.594-.24h8.333q.355 0 .594.24.24.24.24.594v8.333q0 .354-.24.594a.8.8 0 0 1-.594.24.8.8 0 0 1-.593-.24.8.8 0 0 1-.24-.594z"}))};var Bz=function(e){var t=e.hasCarousel,n=e.data,r=e.platform;return t?React.createElement("div",{className:"templately-item-details-more-product-panel-carousel-body"},React.createElement(Lz.default,{autoPlay:!0,ssr:!0,arrows:!1,showDots:!1,infinite:!0,responsive:{desktop:{breakpoint:{max:3e3,min:1600},items:4},laptop:{breakpoint:{max:1599.98,min:1200},items:4},tablet:{breakpoint:{max:1199.98,min:480},items:2},mobile:{breakpoint:{max:479.98,min:0},items:2}},itemClass:"templately-item-details-more-product-panel-item"},n.map(function(e,t){var n;return React.createElement(St,{key:t,to:nb("".concat(r,"/packs/").concat(null==e?void 0:e.slug)),className:"templately-item-details-more-product-panel-item-inner"},React.createElement("span",{className:"templately-item-details-more-product-panel-item-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-more-product-panel-item-image"})),React.createElement("h3",{className:"templately-item-details-more-product-panel-item-title"},null==e?void 0:e.name),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta"},null==e||null===(n=e.badges)||void 0===n||null===(n=n.slice(0,1))||void 0===n?void 0:n.map(function(e){var t=Xa.find(function(t){return t.key===e});return React.createElement("div",{key:t.key,className:"templately-item-details-more-product-panel-item-meta-badge ".concat(t.class)},React.createElement("img",{src:t.image,alt:t.title,height:63,width:56,className:"templately-item-details-more-product-panel-item-meta-badge-image"}),React.createElement("h4",{className:"templately-item-details-more-product-panel-item-meta-badge-title"},t.title))}),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta-right"},+(null==e?void 0:e.price)>0&&React.createElement(YI,{className:"templately-item-details-more-product-panel-item-meta-price-badge",showTitle:!1,isPro:+(null==e?void 0:e.price)>0}),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta-price"},+(null==e?void 0:e.price)>0?"$".concat(null==e?void 0:e.price):"Free"))))}))):React.createElement("div",{className:"templately-item-details-more-product-panel-grid-body"},n.map(function(e,t){var n;return React.createElement("div",{key:t,className:"templately-item-details-more-product-panel-item"},React.createElement(St,{to:nb("".concat(r,"/packs/").concat(null==e?void 0:e.slug)),className:"templately-item-details-more-product-panel-item-inner"},React.createElement("span",{className:"templately-item-details-more-product-panel-item-image-wrapper"},React.createElement("img",{src:e.thumbnail?"".concat(e.thumbnail):"https://assets.templately.com/frontend/banner.jpg",alt:"".concat(e&&e.name," thumbnail"),className:"templately-item-details-more-product-panel-item-image"})),React.createElement("h3",{className:"templately-item-details-more-product-panel-item-title"},null==e?void 0:e.name),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta"},null==e||null===(n=e.badges)||void 0===n||null===(n=n.slice(0,1))||void 0===n?void 0:n.map(function(e){var t=Xa.find(function(t){return t.key===e});return React.createElement("div",{key:t.key,className:"templately-item-details-more-product-panel-item-meta-badge ".concat(t.class)},React.createElement("img",{src:t.image,alt:t.title,height:63,width:56,className:"templately-item-details-more-product-panel-item-meta-badge-image"}),React.createElement("h4",{className:"templately-item-details-more-product-panel-item-meta-badge-title"},t.title))}),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta-right"},+(null==e?void 0:e.price)>0&&React.createElement(YI,{className:"templately-item-details-more-product-panel-item-meta-price-badge",showTitle:!1,isPro:+(null==e?void 0:e.price)>0}),React.createElement("span",{className:"templately-item-details-more-product-panel-item-meta-price"},+(null==e?void 0:e.price)>0?"$".concat(null==e?void 0:e.price):"Free")))))}))};const zz=function(e){var t=e.title,n=void 0===t?"More Items":t,r=e.browseLink,o=e.redBg,i=void 0!==o&&o,a=e.data,l=void 0===a?[]:a,s=e.hasCarousel,c=void 0!==s&&s,u=e.platform;if(l.length)return React.createElement("div",{className:"templately-item-details-more-product-panel ".concat(i?"red-bg":"white-bg")},React.createElement("div",{className:"templately-item-details-more-product-panel-head"},React.createElement("h4",{className:"templately-item-details-more-product-panel-title"},(0,At.__)(n,"templately")),r&&React.createElement(St,{to:r,className:"templately-item-details-more-product-panel-link"},React.createElement("span",null,(0,At.__)("Browse More","templately")),React.createElement(Rz,null))),React.createElement(Bz,{hasCarousel:c,data:l,platform:u}))},Wz=gn(function(e){return{platform:e.general.platform,items:e.general.featured.items,isLoading:e.general.featured.isLoading}},function(e){return{getFeaturedTemplates:function(t){return e(function(e){return kv({type:xo},e)}(t))}}})(function(e){return(0,pe.useEffect)(function(){e.getFeaturedTemplates({platform:e.platform})},[]),e.isLoading?he().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},he().createElement(El,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(zz,{title:"Featured Products",browseLink:nb("".concat(null==e?void 0:e.platform)),redBg:!0,data:e.items,platform:e.platform,hasCarousel:!0}))});function Uz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}gn(function(e,t){var n,r,o,i;return{counts:e.general.counts,profile:e.profile.data,isLoggedIn:null!=e.profile.data,pricing:null!==(n=null===(r=e.general)||void 0===r||null===(r=r.pricing)||void 0===r?void 0:r.data)&&void 0!==n?n:[],isPricingLoading:null===(o=null===(i=e.general)||void 0===i||null===(i=i.pricing)||void 0===i?void 0:i.isLoading)||void 0===o||o}},function(e){return{}})(function(e){var t,n,r,o,i,a,l,s,c,u=ce((0,pe.useState)("lifetime"),2),d=u[0],p=u[1],f=ce((0,pe.useState)(qa("lifetime")),2),h=f[0],m=f[1],g=ce((0,pe.useState)({starter:0,pro:0}),2),v=g[0],y=g[1];(0,pe.useEffect)(function(){if(Ia(e.counts)){var t=0,n=0;Object.keys(e.counts).map(function(r){Object.keys(e.counts[r]).map(function(o){t+=e.counts[r][o].starter,n+=e.counts[r][o].pro})}),y(function(e){return Vz(Vz({},e),{},{starter:t,pro:n})})}},[e.counts]),(0,pe.useEffect)(function(){m(qa(d))},[d]),(0,pe.useEffect)(function(){null!=e.profile&&e.profile.plan.indexOf("yearly")>-1&&p("lifetime")},[e.profile]);var b=(null===(t=e.profile)||void 0===t||null===(t=t.plan)||void 0===t?void 0:t.indexOf("free"))>-1,w=(null===(n=e.profile)||void 0===n||null===(n=n.plan)||void 0===n?void 0:n.indexOf("lifetime"))>-1;if(!b&&e.isLoggedIn)return null;var E={},k={},O="";if(e.details.price>0&&!w){var S=e.pricing.filter(function(e){return"year"==e.type&&e.price>0});if(k=S[0],"premium"===d){if((null==S?void 0:S.length)>0){E=S[0];var x=S[0].discounted_price/12;O="".concat(x.toString().substr(0,x.toString().indexOf(".")+3),"/month")}}else if("lifetime"===d){var _=e.pricing.filter(function(e){return"one_time"==e.type});(null==_?void 0:_.length)>0&&(E=_[0],O="<del>$".concat(_[0].price,"</del> $").concat(_[0].discounted_price))}}return he().createElement(he().Fragment,null,e.details.price>0&&!w&&he().createElement("div",{className:"tly__sidebar__widget tly__site__promote__widget templately-subscription-upgrade-widget templately-item-widget"},he().createElement("div",{className:"tly__promo_heading"},he().createElement("img",{src:window.templately.promo_image,alt:"Ultimate Access To All Premium Templates"}),he().createElement("div",{className:"tly__plan__card tly__center"},he().createElement("h5",{className:"tly__plan__heading tly__lg"},"Ultimate Access To All Premium Templates"),he().createElement("div",{className:"tly__plan__description_wrapper tly__mt_0"},he().createElement("p",{className:"tly__plan__description"},"Build your websites with any of our powerful, premium WordPress templates & the ultimate cloud-based WorkSpace. Go PRO now!")))),he().createElement("div",{className:"tly__promo_body"},he().createElement("div",{className:"tly__plan__card"},he().createElement("h5",{className:"tly__plan__heading"},"Select Your Plan"),he().createElement("div",{className:"tly__plan__wrapper"},he().createElement("label",{className:"tly__plan",htmlFor:"templately-subscription-plan-free"},he().createElement("input",{id:"templately-subscription-plan-free",type:"radio",name:"plan",value:"premium",onChange:function(){return p("premium")},checked:"premium"===d}),he().createElement("span",{className:"tly__plan_content"},"Premium",he().createElement("span",{className:"tly__plan__badge"},"Save ",Math.floor(((null===(r=k)||void 0===r?void 0:r.price)-(null===(o=k)||void 0===o?void 0:o.discounted_price))/(null===(i=k)||void 0===i?void 0:i.price)*100),"%"))),he().createElement("label",{className:"tly__plan",htmlFor:"templately-subscription-plan-lifetime"},he().createElement("input",{type:"radio",name:"plan",id:"templately-subscription-plan-lifetime",value:"lifetime",onChange:function(){return p("lifetime")},checked:"lifetime"===d}),he().createElement("span",{className:"tly__plan_content"},"Lifetime"))),he().createElement("div",{className:"tly__plan__description_wrapper"},he().createElement("h5",{className:"tly__plan__heading"},"Get Unlimited Access & Save Up To ",Math.floor(((null===(a=E)||void 0===a?void 0:a.price)-(null===(l=E)||void 0===l?void 0:l.discounted_price))/(null===(s=E)||void 0===s?void 0:s.price)*100),"%"),he().createElement("ul",{className:"tly__plan__description_list"},he().createElement("li",null,v.starter," STARTER Items"),he().createElement("li",null,v.pro," PRO Items"),he().createElement("li",null,"Unlimited WorkSpace"),he().createElement("li",null,"Unlimited Items On My Cloud")),he().createElement("h5",{className:"tly__plan__heading tly__mt_1",dangerouslySetInnerHTML:{__html:"".concat("premium"===d?"Starting from: $"+O:"Price: "+O)}}),he().createElement("a",{href:h,className:"tly__button tly__success__button templately-button",target:"_blank"},he().createElement("span",null,e.isLoggedIn?"Upgrade Now":"Go With Subscription")))))),0==e.details.price&&!e.isLoggedIn&&he().createElement("div",{className:"tly__sidebar__widget tly__site__promote__widget templately-item-widget"},he().createElement("div",{className:"tly__promo_heading"},he().createElement("img",{src:window.templately.promo_image,alt:"Get Free Access To"})),he().createElement("div",{className:"tly__promo_body"},he().createElement("div",{className:"tly__plan__card tly__center"},he().createElement("h5",{className:"tly__plan__heading tly__lg"},"Get Free Access To ",null==e||null===(c=e.details)||void 0===c?void 0:c.name),he().createElement("div",{className:"tly__plan__description_wrapper tly__mt_0"},he().createElement("p",{className:"tly__plan__description"},"Build your website with this powerful, customizable, and FREE WordPress template. To get started, register now!"),he().createElement(Zx,{to:"sign-in",style:{marginTop:10},className:"tly__button templately-button tly__success__button tly__mt_1_5"},he().createElement("span",null,"Access This Template")))))))});const Hz=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),pe.createElement("path",{d:"M10.499 18.95a.8.8 0 0 1-.313-.063.9.9 0 0 1-.27-.188l-4.667-4.646a.8.8 0 0 1-.23-.583q0-.354.23-.604a.8.8 0 0 1 .593-.25q.345 0 .594.25l3.23 3.25V10.97q0-.354.239-.594.24-.24.594-.24t.593.24.24.594v5.146l3.25-3.25a.78.78 0 0 1 .573-.23q.344 0 .594.25a.8.8 0 0 1 .229.584.8.8 0 0 1-.23.583L11.083 18.7a.9.9 0 0 1-.27.188.8.8 0 0 1-.313.062m0-10.48a.8.8 0 0 1-.594-.24.8.8 0 0 1-.24-.593v-.834q0-.354.24-.593.24-.24.594-.24t.593.24.24.593v.834q0 .354-.24.593a.8.8 0 0 1-.593.24m0-4.167a.8.8 0 0 1-.594-.24.8.8 0 0 1-.24-.593q0-.354.24-.594t.594-.24.593.24.24.594-.24.594a.8.8 0 0 1-.593.24"}))},Gz=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 21"},e,{style:{fill:"currentColor",height:"18px",width:"18px"}}),pe.createElement("path",{d:"M10.499 2.05a.8.8 0 0 0-.313.063.9.9 0 0 0-.27.188L5.248 6.947a.8.8 0 0 0-.23.583q0 .354.23.604.25.25.593.25.345 0 .594-.25l3.23-3.25v5.146q0 .354.239.594.24.24.594.24t.593-.24.24-.594V4.884l3.25 3.25q.23.23.573.23.344 0 .594-.25a.8.8 0 0 0 .229-.584.8.8 0 0 0-.23-.583L11.083 2.3a.9.9 0 0 0-.27-.188.8.8 0 0 0-.313-.062m0 10.48a.8.8 0 0 0-.594.24.8.8 0 0 0-.24.593v.834q0 .354.24.593.24.24.594.24t.593-.24.24-.593v-.834a.8.8 0 0 0-.24-.593.8.8 0 0 0-.593-.24m0 4.167a.8.8 0 0 0-.594.24.8.8 0 0 0-.24.593q0 .354.24.594t.594.24.593-.24.24-.594a.8.8 0 0 0-.24-.594.8.8 0 0 0-.593-.24"}))},qz=function(e){var t,n,r,o,i,a,l=ce((0,pe.useState)("description"),2),s=l[0],c=l[1],u=(null==e?void 0:e.features)&&null!==JSON.parse(null==e?void 0:e.features),d=(0,pe.useRef)("descriptionRef"),p=ce((0,pe.useState)(0),2),f=p[0],h=p[1],m=ce((0,pe.useState)(!1),2),g=m[0],v=m[1],y=480;return(0,pe.useEffect)(function(){var e;h(null==d||null===(e=d.current)||void 0===e?void 0:e.scrollHeight)},[null==d?void 0:d.current.scrollHeight,s]),(0,pe.useEffect)(function(){var t,n;null!=e&&null!==(t=e.description)&&void 0!==t&&t.length?c("description"):null!=e&&null!==(n=e.features)&&void 0!==n&&n.length?c("features"):c("tags")},[e]),React.createElement(React.Fragment,null,React.createElement("div",{className:"templately-item-details-panel"},React.createElement("div",{className:"templately-item-details-panel-header"},React.createElement("div",{className:"templately-item-details-panel-header-inner"},(null==e||null===(t=e.description)||void 0===t?void 0:t.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("description")},className:"templately-item-details-panel-header-button ".concat("description"===s?"selected":"not-selected")},(0,At.__)("Description","templately")),(null==e||null===(n=e.features)||void 0===n?void 0:n.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("features")},className:"templately-item-details-panel-header-button ".concat("features"===s?"selected":"not-selected")},(0,At.__)("Features","templately")),(null==e||null===(r=e.tags)||void 0===r?void 0:r.length)>0&&React.createElement("button",{type:"button",onClick:function(){return c("tags")},className:"templately-item-details-panel-header-button ".concat("tags"===s?"selected":"not-selected")},(0,At.__)("Tags","templately")))),(null==e||null===(o=e.description)||void 0===o?void 0:o.length)>0&&React.createElement("div",{className:"templately-item-details-items-text-panel ".concat("description"===s?"show":"hide")},React.createElement("div",{className:"".concat(f>y?"templately-item-details-items-description-with-show-more-button ".concat(g?"show":"hide"):"templately-item-details-items-description-without-show-more-button"),style:{maxHeight:f>y&&g?f:y}},React.createElement("div",{ref:d,className:"templately-item-details-items-text-panel-inner",dangerouslySetInnerHTML:{__html:e.description}}),(null==e?void 0:e.video_url)&&React.createElement("iframe",{width:"100%",height:"400",className:"w-full rounded-2xl",src:e.video_url,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",allowFullScreen:"allowFullScreen",frameBorder:"0"}))),(null==e||null===(i=e.features)||void 0===i?void 0:i.length)>0&&React.createElement("div",{className:"templately-item-details-items-text-panel ".concat("features"===s?"show":"hide")},u?React.createElement("div",{className:"templately-item-details-items-text-panel-inner",dangerouslySetInnerHTML:{__html:JSON.parse(null==e?void 0:e.features).join("")}}):React.createElement(React.Fragment,null)),(null==e||null===(a=e.tags)||void 0===a?void 0:a.length)>0&&React.createElement("div",{className:"templately-item-details-items-tags-panel ".concat("tags"===s?"show":"hide")},e.tags.map(function(t,n){return React.createElement(St,{key:n,to:"/".concat("pack"===(null==e?void 0:e.type)?"":"".concat(null==e?void 0:e.type,"s"),"?tag_id=").concat(null==t?void 0:t.id),className:"templately-item-details-items-tag"},t.name)}))),null!=e&&e.description&&"description"===s&&f>y?React.createElement("div",{className:"templately-item-details-items-description-show-more-button-wrapper ".concat(g?"show":"hide")},React.createElement("button",{className:"templately-item-details-items-description-show-more-button",onClick:function(){return v(function(e){return!e})}},React.createElement("span",{className:"templately-item-details-items-description-show-more-button-text"},g?"View Less":"View More"),React.createElement("span",{className:"templately-item-details-items-description-show-more-button-icon"},g?React.createElement(Gz,null):React.createElement(Hz,null)))):React.createElement(React.Fragment,null))},Qz=gn(function(e){return{items:e.general.related.items,isLoading:e.general.related.isLoading}},function(e){return{getRelatedTemplates:function(t){return e(function(e){return kv({type:To},e)}(t))}}})(function(e){return(0,pe.useEffect)(function(){e.itemId&&e.itemType&&e.getRelatedTemplates({item_id:e.itemId,_type:e.itemType})},[e.itemId,e.itemType]),e.isLoading?he().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},he().createElement(El,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(zz,{title:"Related Products",browseLink:nb("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!1}))}),$z=function(e){var t,n,r=ce(((null==e||null===(t=e.pack)||void 0===t?void 0:t.name)||"").split(" - ",2),2),o=r[0],i=void 0===o?"":o,a=(r[1],ce(((null==e?void 0:e.name)||"").split(" - ",2),2)),l=a[0],s=void 0===l?"":l;return a[1],React.createElement("ul",{className:"templately-item-details-breadcrumb"},React.createElement("li",{className:"templately-item-details-breadcrumb-item"},React.createElement(St,{className:"templately-item-details-breadcrumb-item-link",to:nb("".concat(null==e?void 0:e.platform))},(0,At.__)("Home","templately"))),React.createElement("li",{className:"templately-item-details-breadcrumb-separator"},"/"),React.createElement("li",{className:"templately-item-details-breadcrumb-item"},"pack"===(null==e?void 0:e.type)?React.createElement(St,{className:"templately-item-details-breadcrumb-item-link",to:nb("".concat(null==e?void 0:e.platform,"/packs"))},"elementor"===(null==e?void 0:e.platform)?(0,At.__)("Elementor","templately"):(0,At.__)("Gutenberg","templately")):React.createElement(St,{className:"templately-item-details-breadcrumb-item-link",to:nb("".concat(null==e?void 0:e.platform,"/packs/").concat(null==e||null===(n=e.pack)||void 0===n?void 0:n.slug))},i)),React.createElement("li",{className:"templately-item-details-breadcrumb-separator"},"/"),React.createElement("li",{className:"templately-item-details-breadcrumb-item"},"pack"===(null==e?void 0:e.type)?"Pack":s))},Yz=gn(function(e){return{platform:e.general.platform,items:e.general.trending.items,isLoading:e.general.trending.isLoading}},function(e){return{getTrendingTemplates:function(t){return e(function(e){return kv({type:Do},e)}(t))}}})(function(e){return(0,pe.useEffect)(function(){e.getTrendingTemplates({platform:e.platform})},[]),e.isLoading?he().createElement("div",{className:"templately-item-details-more-product-panel",style:{padding:0}},he().createElement(El,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(zz,{title:"Trending Products",browseLink:nb("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!0}))});function Xz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Zz=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d=null!==(n="blocks"===(null==t||null===(r=t.params)||void 0===r?void 0:r.type)?"sections":null==t||null===(o=t.params)||void 0===o?void 0:o.type)&&void 0!==n?n:"packs",p=null==t||null===(i=t.params)||void 0===i?void 0:i.slug,f=null!==(a=null==t||null===(l=t.params)||void 0===l?void 0:l.platform)&&void 0!==a?a:e.general.platform;return{details:null!=e&&e[d]&&null!==(s=e[d])&&void 0!==s&&s[f]&&null!==(c=e[d][f])&&void 0!==c&&c.itemsDetails&&null!==(u=e[d][f].itemsDetails)&&void 0!==u&&u[p]?e[d][f].itemsDetails[p]:{},platform:f,profile:e.profile.data,isLoggedIn:null!=e.profile.data}},function(e){return{getTemplate:function(t){return e(function(e){return kv({type:ja(ko,e.key)},e)}(t))},setPlatform:function(t){return e(av(t))}}})(function(e){var t,n,r=ce((0,pe.useState)(!1),2),o=r[0],i=r[1],a=e.params,l=e.details,s=e.platform,c=ce(Ct(),1)[0],u=rt(),d=En(),p=(0,pe.useRef)(!1),f=dP({maxWidth:1170});(0,pe.useEffect)(function(){e.setPlatform(e.platform),e.getTemplate({key:Fa(a.type),slug:a.slug,platform:s})},[a.slug,a.type,s]),(0,pe.useEffect)(function(){var t=c.get("process");if("pack"===l.type&&"ai"===t&&l.id&&!p.current){if(p.current=!0,!e.isLoggedIn){var n=c.get("path")||"";return void u(nb("sign-in",{"redirect-to":n}),{})}d(function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:di,payload:_y({id:null!==(e=null==n?void 0:n.id)&&void 0!==e?e:null,isWithAI:null===(t=null==n?void 0:n.isWithAI)||void 0===t||t},n)}}({id:l.id,isWithAI:!0}));var r=c.get("path")||"",o=nb(r,null,["process"]);u(o,{replace:!0})}},[l.type,l.id,c,u,d,e.isLoggedIn]),null===(t=e.profile)||void 0===t||null===(t=t.plan)||void 0===t||t.indexOf("lifetime");var h=C_(l.id,l.type,null==l||null===(n=l.pack)||void 0===n?void 0:n.id),m=h.isPurchased,g=h.isSubscribed;return React.createElement("div",{className:"templately-container-row"},React.createElement(rC,{type:a.type,stateSubKey:"itemsDetails",element:React.createElement(Jz,{className:"templately-item-details-wrapper",render:function(){var t,n,r,c,u,d,p,h,v,y,b,w,E;return React.createElement("div",{className:"templately-item-details-wrapper-inner"},React.createElement(eC,{images:"packs"!==a.type?null!==(t=null==l?void 0:l.screenshots)&&void 0!==t?t:[{url:null!==(n=null==l?void 0:l.banner)&&void 0!==n?n:null==l?void 0:l.thumbnail,alt:null==l?void 0:l.name}]:null!==(r=null==l||null===(c=l.items)||void 0===c?void 0:c.map(function(e){var t;return{url:null!==(t=null==e?void 0:e.banner)&&void 0!==t?t:null==e?void 0:e.thumbnail,alt:null==e?void 0:e.name}}))&&void 0!==r?r:[{url:null!==(u=null==l?void 0:l.banner)&&void 0!==u?u:null==l?void 0:l.thumbnail,alt:null==l?void 0:l.name}],isOpen:o,setIsOpen:i}),React.createElement($z,re({},l,{platform:s})),React.createElement("div",{className:"templately-item-details-container"},React.createElement("div",{className:"templately-item-details"},React.createElement(RN,{isPack:"packs"===a.type,price:null==l?void 0:l.price,name:null==l?void 0:l.name,thumbnail:null!==(d=null==l?void 0:l.banner)&&void 0!==d?d:null==l?void 0:l.thumbnail,alt:null==l?void 0:l.name,url:null==l?void 0:l.live_url,screenshotsEnabled:{setIsOpen:i,hasShots:"packs"!==a.type&&(null==l||null===(p=l.screenshots)||void 0===p?void 0:p.length)>0},urlProps:Kz(Kz({details:l,isPurchased:m,isSubscribed:g,params:a},l),{},{platform:e.params.platform,isLoggedIn:e.isLoggedIn})}),f&&React.createElement("div",{className:"templately-item-details-mini-sidebar"},React.createElement(Fz,re({details:l,isPurchased:m,isSubscribed:g,params:a},l,{platform:e.params.platform,isLoggedIn:e.isLoggedIn}))),React.createElement("div",{className:"templately-item-details-inner"},"packs"===(null==a?void 0:a.type)&&(null==l||null===(h=l.items)||void 0===h?void 0:h.length)>0&&React.createElement(Iz,{items:null==l?void 0:l.items,platform:s}),(null==l||null===(v=l.description)||void 0===v?void 0:v.length)>0||(null==l||null===(y=l.features)||void 0===y?void 0:y.length)>0||(null==l||null===(b=l.tags)||void 0===b?void 0:b.length)>0?React.createElement(qz,l):React.createElement(React.Fragment,null)),"packs"!==a.type&&(null==l||null===(w=l.pack)||void 0===w||null===(w=w.items)||void 0===w?void 0:w.length)>0&&React.createElement("div",{className:"templately-item-details-inner",style:{marginTop:"3rem"}},React.createElement(jz,{pack:null==l?void 0:l.pack,platform:s,items:null==l||null===(E=l.pack)||void 0===E?void 0:E.items}))),!f&&React.createElement("div",{className:"templately-item-details-sidebar"},React.createElement(Fz,re({details:l,isPurchased:m,isSubscribed:g,params:a},l,{platform:e.params.platform,isLoggedIn:e.isLoggedIn})))),React.createElement(Qz,{slug:a.slug,itemId:l.id,itemType:l.type||a.type,platform:s}),React.createElement(Wz,{slug:a.slug,platform:s}),React.createElement(Yz,{slug:a.slug,platform:s}))}})}),React.createElement(GI,{packId:null==l?void 0:l.id}))}),Jz=function(e){var t=e.render,n=e.hasSticky,r=void 0===n||n,o=e.header,i=void 0===o?"":o,a=(0,pe.useRef)(null),l=ce((0,pe.useState)(""),2),s=l[0],c=l[1],u=(0,pe.useCallback)(function(e){null!=a&&a.current&&r&&(e.target.scrollTop>250&&""===s?c("templately-sticky"):c(""))},[]);(0,pe.useEffect)(function(){return a.current=!0,function(){return a.current=!1}},[]);var d=Vn()("templately-contents",e.className,{"templately-has-sticky":r&&""!==s});return he().createElement("div",{className:d,onScroll:r?u:null},"function"==typeof i?i({stickyClass:s}):i,"function"==typeof t?t({stickyClass:s}):t)},eW=a.p+"images/footer-bar-bg.png",tW=a.p+"images/footer-bar-icon.png",nW=function(e){return pe.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"12",fill:"none",viewBox:"0 0 23 13"},e),pe.createElement("path",{fill:"currentColor",d:"M1.057 7.081h17.736l-3.323 3.323c-.954.954.477 2.386 1.432 1.432l3.026-3.031 2.02-2.023a1.01 1.01 0 0 0 0-1.424L16.902.306A1 1 0 0 0 16.17 0c-.909 0-1.355 1.107-.7 1.737L18.8 5.06H1.006c-1.4.07-1.295 2.091.052 2.021"}))};function rW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var oW=function(e){var t,n=e.headerHeight,r=e.current_screen,o=it(),i="templately"===r&&"1"==(null===(t=window.templately)||void 0===t?void 0:t.is_free_user),a=Vn()("templately-container",Pt(Pt({},"templately-".concat(null==o?void 0:o.type,"-container"),void 0!==(null==o?void 0:o.type)),"templately-templates-container",void 0===(null==o?void 0:o.type)&&"elementor"===o.platform)),l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({height:"calc(100% - ".concat(n,"px)")},"templately"===r&&{top:n});return he().createElement("div",{className:a,style:l},he().createElement(vt,null),i&&he().createElement("footer",{className:"templately-template-library-footer"},he().createElement("img",{src:eW,alt:"footer-bar-bg",className:"footer-bar-bg"}),he().createElement("div",{className:"footer-bar-content"},he().createElement("img",{src:tW,alt:"footer-bar-icon",className:"footer-bar-icon"}),he().createElement("p",{className:"footer-bar-text"},"Unlock all the premium template packs with up to 50% OFF")),he().createElement("a",{href:"https://wpdeveloper.com/go/feb2026",target:"_blank",className:"footer-bar-link"},he().createElement("span",null,"Grab the offer now"),he().createElement(nW,null))))};const iW=gn(function(e){return{headerHeight:e.general.headerHeight,current_screen:e.general.current_screen}})(he().memo(oW));function aW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const sW=gn(function(e){var t,n,r,o,i,a,l=e.general.platform,s=e.general.current_screen,c=null!==(t=null===(n=e.savedTemplates)||void 0===n||null===(n=n[l])||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1,u=null!==(r=null===(o=e.savedTemplates)||void 0===o||null===(o=o[l])||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1;return{platform:l,current_screen:s,has_elementor:e.general.has_elementor,currentPage:c,totalPage:u,items:null!==(i=null===(a=e.savedTemplates)||void 0===a||null===(a=a[l])||void 0===a?void 0:a[c])&&void 0!==i?i:[]}})(function(e){var t=ce((0,pe.useState)([]),2),n=t[0],r=t[1];(0,pe.useEffect)(function(){if(e.items.length>0){var t=e.items.map(function(t){return[{id:"name",data:he().createElement(NC,{title:t.title,platform:e.platform})},[{id:"last_modified",data:t.date},{id:"action",data:he().createElement("div",{className:"tt-actions"},he().createElement(WC,{current_screen:e.current_screen,args:{content:lW(lW({},t),{},{my_cloud_id:t.id,origin:"local",currentPage:e.currentPage})},menus:Gg(t.is_pushed,e.current_screen,e.has_elementor,t.type)}))}]]});r(t)}},[e.items,e.has_elementor]);var o=Vn()("templately-saved-templates",{"templately-nas-no-items":0==n.length});return he().createElement(he().Fragment,null,he().createElement("div",{className:o},n.length>0?he().createElement(o_,{view:"list",head:he().createElement(l_,null)},he().createElement(c_,{view:"list",data:n})):he().createElement(lC,null),e.totalPage>1&&he().createElement(tC,{type:"savedTemplates",total:e.totalPage})))});var cW=["plan","active","label","total"],uW=function(e){var t=e.plan,n=void 0===t?"all":t,r=e.active,o=void 0===r||r,i=e.label,a=e.total,l=Wn(e,cW),s=Vn()("components-button","templately-plan-".concat(n),{"templately-plan-active":o});return he().createElement("button",re({className:s},l),i," (",a,")")};const dW=gn(function(e){var t,n=e.general.platform;return{plan:e.general.plan,counts:null===(t=e.general.counts)||void 0===t?void 0:t[n]}},function(e){return{setPlan:function(t){return e(function(e){return{type:dr,plan:e}}(t))}}})(function(e){var t,n,r,o,i,a,l=ce((0,pe.useState)(e.plan),2),s=l[0],c=l[1],u=it();return(0,pe.useEffect)(function(){s!==e.plan&&e.setPlan(s)},[e.plan,s]),he().createElement("div",{className:"templately-plan-switcher"},he().createElement(uW,{onClick:function(){return c("all")},label:(0,At.__)("All","templately"),active:"all"===s,total:null!==(t=null===(n=e.counts)||void 0===n||null===(n=n[null==u?void 0:u.type])||void 0===n?void 0:n.total)&&void 0!==t?t:0,plan:"all"}),he().createElement(uW,{onClick:function(){return c("starter")},label:(0,At.__)("Starter","templately"),active:"starter"===s,total:null!==(r=null===(o=e.counts)||void 0===o||null===(o=o[null==u?void 0:u.type])||void 0===o?void 0:o.starter)&&void 0!==r?r:0,plan:"starter"}),he().createElement(uW,{onClick:function(){return c("pro")},label:(0,At.__)("Pro","templately"),active:"pro"===s,total:null!==(i=null===(a=e.counts)||void 0===a||null===(a=a[null==u?void 0:u.type])||void 0===a?void 0:a.pro)&&void 0!==i?i:0,plan:"pro"}))}),pW=function(e){var t=e.className,n=e.label,r=void 0===n?null:n,o=e.element,i=e.hideTitle,a=void 0!==i&&i,l=it();return he().createElement("div",{className:"templately-contents-header ".concat(null!=t?t:"")},(0,ae.applyFilters)("templately_before_content_header","",l),he().createElement("div",{className:"templately-contents-header-inner"},!a&&he().createElement("div",{className:"templately-header-title"},he().createElement("h3",null,null===r?(0,At.__)("All","templately")+" "+(null==l?void 0:l.type):r)),"function"==typeof o?o():o))},fW=function(){var e=rt(),t=it();return he().createElement("div",{className:"templately-logo"},he().createElement(Fn,{width:"37.66px"}),null==(null==t?void 0:t.slug)&&he().createElement(Mn,null),null!=(null==t?void 0:t.slug)&&he().createElement("span",{className:"templately-back-2-library",onClick:function(){return e(-1)}},he().createElement(qn,{color:"#000"}),(0,At.__)("Back to Library","templately")))};function hW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gW=function(e){return e.join("/")};const vW=gn(function(e){var t;return{platform:null!==(t=e.general.platform)&&void 0!==t?t:"elementor",isLoggedIn:null!=e.profile.data}})(function(e){var t=it(),n=tt(),r=rt(),o=ce((0,pe.useState)([]),2),i=o[0],a=o[1];return(0,pe.useEffect)(function(){var o,i=function(e){var t=e.platform,n=void 0===t?"elementor":t,r=[],o=["q","add-account","redirect-to","tag_id","category","templateType","activeFilter","include","exclude","tags"];return r.push({to:gW([n,"packs"]),label:(0,At.__)("Packs","templately"),element:!1,query:{}}),"gutenberg"===n&&r.push({to:gW([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),r.push({to:gW([n,"pages"]),label:(0,At.__)("Pages","templately"),element:!1,capability:"templately_read",query:{}}),"elementor"===n&&r.push({to:gW([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),"elementor"===n&&r.push({to:gW([n,"templates"]),label:(0,At.__)("Templates","templately"),element:!1,query:{}}),r.push({to:"clouds",query:{platform:n},label:(0,At.__)("My Cloud","templately"),element:!1,icon:React.createElement(Dn,null)}),r.map(function(e){return mW(mW({},e),{},{ignoreKeys:o})})}({platform:null!==(o=t.platform)&&void 0!==o?o:e.platform});a(i),i.filter(function(e){return e.to===n.pathname.substring(1)}).length||null!=(null==t?void 0:t.slug)||"clouds/save-template"==n.pathname.substring(1)||r(nb(i[0].to))},[e.platform]),he().createElement(r_,{className:"templately-menu",ulClasses:"templately-nav",liClasses:function(e){var t=e.isActive,n=e.toPathname,r=e.locationPathname,o=["templately-nav-item",t?"templately-nav-active":null];return"/clouds"!==n||"/favourites"!==r&&"/downloads"!==r&&"/purchased-items"!==r||o.push("templately-nav-active"),o.filter(Boolean).join(" ")},activeItemClassName:"templately-nav-active",routes:i})});function yW(e){return(0,Hn.k5)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12zM7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"},child:[]}]})(e)}const bW=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(av(t))}}})(function(e){var t=it(),n=tt(),r=rt(),o=ce(Ct(),1)[0],i=xn(function(e){var n,r,o;if(null==t||!t.slug)return{hasVariation:!1,variation:null};var i=null==t?void 0:t.platform,a=null==t?void 0:t.slug,l=null===(r=e[null!==(n="blocks"===(null==t?void 0:t.type)?"sections":null==t?void 0:t.type)&&void 0!==n?n:"packs"])||void 0===r||null===(r=r[i])||void 0===r||null===(r=r.itemsDetails)||void 0===r?void 0:r[a],s=Boolean(null==l||null===(o=l.variations)||void 0===o?void 0:o.length);return{hasVariation:s,variation:s?l.variations:null}}),a=i.hasVariation,l=i.variation,s=ce((0,pe.useState)([{value:"elementor",label:he().createElement(he().Fragment,null,he().createElement("span",{className:"tswitcher-icon tswitch-elementor"}),he().createElement("span",{className:"templately-editor-name"},(0,At.__)("Elementor","templately")))},{value:"gutenberg",label:he().createElement(he().Fragment,null,he().createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),he().createElement("span",{className:"templately-editor-name"},(0,At.__)("Gutenberg","templately")))}]),1)[0],c=ce((0,pe.useState)(null==s?void 0:s[0]),2),u=c[0],d=c[1];return(0,pe.useEffect)(function(){var r,i,a,l,c,u,p=null!==(r=null!==(i=null!==(a=null!==(l=null==t?void 0:t.platform)&&void 0!==l?l:o.get("platform"))&&void 0!==a?a:null===(c=n.state)||void 0===c?void 0:c.platform)&&void 0!==i?i:e.platform)&&void 0!==r?r:"elementor",f=s.filter(function(e){return e.value==p});f.length>0&&d(null!==(u=f[0])&&void 0!==u?u:s[0])},[t]),(0,pe.useEffect)(function(){var t=o.get("platform");t&&["elementor","gutenberg"].includes(t)&&e.setPlatform(t)},[]),he().createElement(Dg,{options:s,classNamePrefix:"templately-switcher",onChange:function(o){if(d(o),e.setPlatform(o.value),t.type){var i=[],s=[o.value,t.type];if(t.slug&&i.push("q"),a){var c=l.find(function(e){return e.platform===o.value});c&&(s=[o.value,t.type,c.slug])}r(nb(s,{platform:o.value},i))}else r(nb(n.pathname.substring(1),{platform:o.value}))},value:u,isSearchable:!1})}),wW=gn(function(e){var t,n,r,o,i,a,l;return{isLoggedIn:null!==(null===(t=e.profile)||void 0===t?void 0:t.data),canLinkAccount:null!==(n=null===(r=e.profile)||void 0===r?void 0:r.link_account)&&void 0!==n&&n,canUnLinkAccount:null!==(o=null===(i=e.profile)||void 0===i?void 0:i.unlink_account)&&void 0!==o&&o,isGloballySigned:null===(a=e.profile)||void 0===a?void 0:a.is_globally_signed,signedAsGlobal:null===(l=e.profile)||void 0===l?void 0:l.signed_as_global}},function(e){return{logout:function(t){return e(Ti(t))},linkAccount:function(){return e(Fi({linking:!0}))}}})(function(e){var t=rt();return e.canLinkAccount?he().createElement(Zx,{to:"sign-in",query:{"add-account":!0},className:"tb-link-account templately-button"},(0,At.__)("Link My Account","templately")):e.isLoggedIn&&!e.canLinkAccount?he().createElement(pl,{className:"tb-logout",onClick:function(){t(nb("sign-in"),{state:{is_logging_out:{isGloballySigned:!e.signedAsGlobal&&e.canUnLinkAccount?!e.isGloballySigned:e.isGloballySigned}}})},label:!e.signedAsGlobal&&e.canUnLinkAccount?(0,At.__)("Unlink My Account","templately"):(0,At.__)("Logout","templately")}):void 0}),EW=function(e){var t,n=e.name,r=e.first_name,o=e.last_name,i=e.email,a=e.profile_photo,l=ce((0,pe.useState)(!1),2),s=l[0],c=l[1],u=(0,pe.useRef)(null),d=function(e){if(u.current.contains(e.target)&&"A"!==e.target.nodeName)c(!0);else var t=setTimeout(function(){c(!1),clearTimeout(t)},100)};return(0,pe.useEffect)(function(){return document.addEventListener("mousedown",d),function(){return document.removeEventListener("mousedown",d)}},[s]),he().createElement("div",{className:"templately-profile-drops-wrapper",ref:u},he().createElement("span",{className:"templately-profile-btn templately-button ".concat(null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.is_connected_to_dev_api?"dev-api-mode":"")},null!=a?he().createElement("img",{src:a,alt:n,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}}):he().createElement(jn,null)),s&&he().createElement("div",{className:"templately-profile-drops-inner"},he().createElement("ul",null,he().createElement("li",{className:"templately-profile-drops"},he().createElement("div",{className:"d-flex align-center"},null!=a?he().createElement("img",{width:"40px",height:"40px",src:a,alt:n,onError:function(e){var t;e.target.src=null===(t=window)||void 0===t||null===(t=t.templately)||void 0===t||null===(t=t.icons)||void 0===t?void 0:t.profile}}):he().createElement(jn,{width:"40px",height:"40px"}),he().createElement("div",{className:"templately-profile-drops-details"},he().createElement("h4",null,null!=n?n:r+" "+o),he().createElement("p",null,i)))),he().createElement("li",null,he().createElement("a",{target:"_blank",className:"d-flex align-center",href:"https://templately.com/profile?utm_source=plugin&utm_medium=profileDrops"},(0,At.__)("Manage Account","templately"))),he().createElement("li",null,he().createElement(Zx,{isActive:!0,className:"d-flex align-center",to:"favourites",children:function(e){return e.isActive,he().createElement(he().Fragment,null,he().createElement(rr,null),(0,At.__)("My Favourites","templately"))}})),he().createElement("li",null,he().createElement(Zx,{className:"d-flex align-center",to:"downloads"},he().createElement(Jn,null),(0,At.__)("My Downloads","templately"))),he().createElement("li",null,he().createElement(Zx,{className:"d-flex align-center",to:"purchased-items"},he().createElement(sC,null),(0,At.__)("Purchased Items","templately"))),he().createElement("li",null,he().createElement(wW,null)))))},kW=gn(function(e){return{platform:e.general.platform,isLoggedIn:null!=e.profile.data,profile:e.profile.data,syncing:e.profile.syncing,shouldClose:e.clouds.push2cloud.isLoading}},function(e){return{syncProfile:function(t){return e(function(e){return Pi({type:Gr},e)}(t))}}})(function(e){var t,n=e.platform,r=e.isLoggedIn,o=ce(Ct(),1)[0];return he().createElement("div",{className:"templately-actions"},("templately"===o.get("page")||"templately_settings"===o.get("page"))&&he().createElement(bW,null),he().createElement("a",{className:"templately-button templately-chat-button",href:"https://wpdeveloper.com/support/",target:"_blank",rel:"noopener"},he().createElement(yW,null),he().createElement("span",null,"Talk to Support")),r&&o.get("path")&&$g(o.get("path"))&&he().createElement(pl,{className:"templately-cloud-sync ".concat(e.syncing?"tc-syncing":""),onClick:function(){return e.syncProfile()}},he().createElement(Rn,null)),!r&&he().createElement(Zx,{to:"sign-in",query:{"redirect-to":o.get("path")},className:"components-button templately-button tb-login"},he().createElement(cr,{style:{marginRight:"10px"}}),(0,At.__)("Login","templately")),r&&he().createElement(EW,e.profile),"templately"!==o.get("page")&&"templately_settings"!==o.get("page")&&he().createElement(pl,{disabled:null!==(t=e.shouldClose)&&void 0!==t&&t,className:"templately-close",onClick:function(){"gutenberg"===n&&window.TemplatelyAppManager.close("templately-gutenberg"),"elementor"===n&&window.TemplatelyModal.hide()}},he().createElement(sr,{color:"#a4b0c1"})))});function OW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const SW=gn(null,function(e){return{setHeaderHeight:function(t){return e(function(e){return{type:Hr,height:e}}(t))}}})(function(e){var t=(0,pe.useRef)(null);return(0,pe.useLayoutEffect)(function(){if(t.current){var n=function(){var n=t.current.offsetHeight;e.setHeaderHeight(n)},r=new ResizeObserver(function(t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return OW(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OW(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value.target.offsetHeight;e.setHeaderHeight(o)}}catch(e){r.e(e)}finally{r.f()}});return r.observe(t.current),requestAnimationFrame(function(){requestAnimationFrame(n)}),function(){r.disconnect()}}},[]),he().createElement("div",{className:"templately-header",ref:t},he().createElement(fW,null),he().createElement(vW,null),he().createElement(kW,null))}),xW=function(e){var t,n=e.isVerifiedProfile,r=xn(function(e){return null!==e.profile.data}),o=xn(function(e){return e.profile}),i=xn(function(e){var t;return null===(t=e.profile)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.is_verified});return!r||i?null:he().createElement("div",{className:"templately-verification"},he().createElement("p",null,(0,At.__)("Please complete your account by the verification email we sent you, If you don't get an email","templately")," ",he().createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://templately.com/resend-verification-email?email=".concat(window.btoa(null==o||null===(t=o.data)||void 0===t?void 0:t.email),"&from=plugin&utm_source=plugin&utm_medium=globalLayout")},(0,At.__)("click here","templately"))," ",(0,At.__)("to resend verification mail.","templately")),he().createElement("button",{onClick:function(){return n()},className:"templately-button components-button tb-verified"},null!=o&&o.isVerifying?(0,At.__)("Verifying . . .","templately"):(0,At.__)("I've verified & Close","templately")))},_W=function(e){var t,n=null===(t=window)||void 0===t?void 0:t.templately,r=n.current_screen,o=void 0===r?"templately":r,i=n.theme,a=void 0===i?"light":i;(0,pe.useEffect)(function(){var e;return"templately"===o&&"1"==(null===(e=window.templately)||void 0===e?void 0:e.is_free_user)&&document.body.classList.add("templately_template_library"),function(){document.body.classList.remove("templately_template_library")}},[o]);var l=Vn()("templately-wrapper","templately-theme-".concat(a),"templately-screen-".concat(o));return he().createElement("div",{className:l,id:"templately-wrapper"},he().createElement(SW,null),he().createElement(iW,null),he().createElement(xW,{isVerifiedProfile:e.isVerifiedProfile}))},CW=gn(function(e,t){var n,r="clouds";location.pathname.startsWith("/clouds/workspace")?r="workspaces":location.pathname.startsWith("/clouds/shared-workspace")&&(r="sharedWorkspaces");var o=null==e?void 0:e[r].view,i=(null==e||e[r].isLoading,null==e?void 0:e[r].currentPage);return null==e||e[r].totalPage,null==e||null===(n=e[r])||void 0===n?void 0:n[i],{view:o,platform:e.general.platform,isLoggedIn:null!=e.profile.data,favouritesType:e.profile.favourites.type,favouritesPlan:e.profile.favourites.plan}},function(e){return{getClouds:function(t){return e(Mv(t))},getWorkSpaces:function(t){return e(Jv(t))},getWorkSpaceDetails:function(t){return e(uy(t))},getFavourites:function(t){return e(zi(t))},getDownloads:function(t){return e(ea(t))},getPurchasedItems:function(t){return e(Hi(t))}}})(function(e){var t=it(),n=tt(),r=rt(),o=ce(Ct(),1)[0],i=ce((0,pe.useState)(""),2),a=i[0],l=i[1],s=ce((0,pe.useState)((0,At.__)("My Clouds","templately")),2),c=s[0],u=s[1],d=ce((0,pe.useState)(!1),2),p=d[0],f=d[1],h=ce((0,pe.useState)(e.isLoggedIn),2),m=h[0],g=h[1];return(0,pe.useEffect)(function(){var t=nb("sign-in",{platform:e.platform});!1===e.isLoggedIn&&!0===m&&"/profile"!==n.pathname&&"profile"!==n.pathname&&(g(!m),r(t,{replace:!0})),!1!==e.isLoggedIn||!0!==m||"/profile"!==n.pathname&&"profile"!==n.pathname||r(t,{replace:!0}),!1===e.isLoggedIn&&!1===m&&r(t,{replace:!0})},[e.isLoggedIn]),(0,pe.useEffect)(function(){if(null!=o.get("path")){var e=o.get("path").split("/").pop();switch(f(!1),e){case"profile":u((0,At.__)("Profile","templately")),l("profile");break;case"favourites":u((0,At.__)("My Favourites","templately")),l("favourites");break;case"downloads":u((0,At.__)("My Downloads","templately")),l("downloads");break;case"clouds":u((0,At.__)("My Clouds","templately")),l("clouds");break;case"workspace":u((0,At.__)("My WorkSpace","templately")),l("workspaces");break;case"shared-workspace":u((0,At.__)("Shared with Me","templately")),l("sharedWorkspaces");break;case"save-template":u((0,At.__)("Save your template","templately")),l("saveTemplate");break;case"purchased-items":u((0,At.__)("Purchased Items","templately")),l("purchasedItems");break;default:null!=t&&t.slug&&(u((0,At.__)("My Clouds","templately")),l("workspaceDetails"),f(!0))}}},[o.get("path")]),(0,pe.useEffect)(function(){if(""!==a){var r=o.get("q");if("clouds"===a){var i={page:1,search:r};(o.has("q")||o.has("refresh"))&&(i.refresh=!0),e.getClouds(i)}if("favourites"===a&&e.getFavourites({platform:e.platform,itemType:e.favouritesType,plan:e.favouritesPlan}),"purchasedItems"===a&&e.getPurchasedItems({platform:e.platform,itemType:e.favouritesType,plan:e.favouritesPlan}),"downloads"===a&&e.getDownloads(),"workspaceDetails"===a&&null!=t&&t.slug){var l,s,c,u=!((null==n||null===(l=n.state)||void 0===l?void 0:l.slug)===t.slug),d={slug:null==t?void 0:t.slug,directLoad:!((null==n||null===(s=n.state)||void 0===s?void 0:s.slug)===t.slug),shared:"sharedWorkspaces"===a,platform:null!==(c=e.platform)&&void 0!==c?c:"elementor",refresh:o.has("refresh")};u&&e.getWorkSpaceDetails(d)}"sharedWorkspaces"!==a&&"workspaces"!==a||e.getWorkSpaces({page:1,shared:"sharedWorkspaces"===a,refresh:o.has("refresh")})}},[a,e.platform,o.get("q")]),he().createElement("div",{className:"templately-clouds-layout templately-container-row"},he().createElement(MC,null),he().createElement(rC,{type:a,isKey:a,isLoadingKey:{clouds:["clouds","isLoading"],workspaces:["workspaces","isLoading"],sharedWorkspaces:["sharedWorkspaces","isLoading"],workspaceDetails:["workspaceDetails","isLoading"],profile:["profile","isLoading"],favourites:["profile","favourites","isLoading"],purchasedItems:["profile","purchasedItems","isLoading"],downloads:["profile","downloads","isLoading"],saveTemplate:[]},element:function(e){return e.isLoading,he().createElement(Jz,{header:function(e){var t=e.stickyClass;if("profile"!==a&&"purchasedItems"!==a&&"downloads"!==a&&"saveTemplate"!==a&&!p)return he().createElement(pW,{hideTitle:"favourites"===a||"purchasedItems"===a,element:he().createElement(mD,{type:a}),label:c,className:t})},render:function(){return he().createElement(vt,null)}})}}))}),DW=gn(function(e){var t,n,r,o,i=e.general.platform;return{platform:i,currentPage:null!==(t=null===(n=e.savedTemplates)||void 0===n||null===(n=n[i])||void 0===n?void 0:n.currentPage)&&void 0!==t?t:1,totalPage:null!==(r=null===(o=e.savedTemplates)||void 0===o||null===(o=o[i])||void 0===o?void 0:o.totalPage)&&void 0!==r?r:1}},function(e){return{getSavedTemplates:function(t){return e(wy(t))}}})(function(e){return(0,pe.useEffect)(function(){e.getSavedTemplates({platform:e.platform,page:e.currentPage})},[e.currentPage]),he().createElement("div",{className:"templately-container-row"},he().createElement(rC,{type:"savedTemplates",element:he().createElement(Jz,{header:function(e){var t=e.stickyClass;return he().createElement(pW,{label:"Saved Templates",className:t})},render:he().createElement(sW,null)})}))});var PW=["prevQuery","doQuery","results"];function AW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const FW=gn(function(e,t){var n,r=t.type,o=t.query,i=void 0===o?null:o,a=null!==(n="blocks"===r?"sections":r)&&void 0!==n?n:"packs",l=e.general.plan,s=e.general.platform,c=e.general.filter,u=c.prevQuery,d=c.doQuery,p=(c.results,Wn(c,PW)),f=1,h=0,m=[a,l,s];return d||null!=i||(f=La(e,[].concat(Nl(m),["currentPage"]),1),h=La(e,[].concat(Nl(m),["totalPage"]),0),m.push(f)),d&&d===u&&(m.push("filteredResults"),f=La(e,[].concat(Nl(m),["currentPage"]),1),h=La(e,[].concat(Nl(m),["totalPage"]),0),m=m.concat([f])),null!==i&&(m.push("search"),f=La(e,[].concat(Nl(m),["currentPage"]),1),h=La(e,[].concat(Nl(m),["totalPage"]),0),m=m.concat([f])),{plan:l,currentPage:f,totalPage:h,items:La(e,m,[]),platform:e.general.platform,isLoggedIn:null!=e.profile.data,prevFilterableQuery:u,isFilterableQuery:d,filteredQuery:p}},function(e){return{getTemplates:function(t){return e(function(e){return kv({type:ja(yo,e.key)},e)}(t))},setPlatform:function(t){return e(av(t))},setPrevQuery:function(t){return e(lv({key:"prevQuery",data:null!=t?t:Date.now()}))}}})(function(e){var t=it(),n=ce(Ct(),1)[0],r=ce((0,pe.useState)(n.get("q")),2),o=r[0],i=r[1];return(0,pe.useEffect)(function(){e.setPlatform(t.platform)},[]),(0,pe.useEffect)(function(){e.isFilterableQuery===e.prevFilterableQuery||e.items.length||e.setPrevQuery(e.isFilterableQuery)},[e.isFilterableQuery]),(0,pe.useEffect)(function(){var r=n.get("q");i(null!=r?(0,At.sprintf)((0,At.__)("You are looking for: %s","templately"),n.get("q")):null);var o=n.get("category");e.getTemplates(TW(TW({key:Fa(t.type),page:e.currentPage,search:r,prevFilterableQuery:e.prevFilterableQuery,isFilterableQuery:e.isFilterableQuery,category_id:o},e.filteredQuery),{},{platform:e.platform}))},[t.type,e.currentPage,e.platform,e.plan,e.isFilterableQuery,n.get("q")]),he().createElement("div",{className:"templately-container-row"},he().createElement(MC,null),he().createElement(rC,{type:t.type,element:he().createElement(Jz,{className:"templately-search-results",header:function(e){var t=e.stickyClass;return he().createElement(pW,{label:o,element:he().createElement(he().Fragment,null,he().createElement(ul,null),he().createElement(dW,null)),className:t})},render:he().createElement(qD,{platform:e.platform,items:e.items,currentPage:e.currentPage,totalPage:e.totalPage,type:null==t?void 0:t.type,isLoggedIn:e.isLoggedIn})})}))});var MW=["selected","setSelected","settings"];function IW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?IW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const jW=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(Uy(t))}}})(function(e){var t=e.selected,n=(e.setSelected,e.settings),r=Wn(e,MW),o=it(),i=tt(),a=rt(),l=ce(Ct(),1)[0],s=(0,pe.useMemo)(function(){var e=[{value:"elementor",label:he().createElement(he().Fragment,null,he().createElement("span",{className:"tswitcher-icon tswitch-elementor"}),he().createElement("span",{className:"templately-editor-name"},(0,At.__)("Elementor","templately")))},{value:"gutenberg",label:he().createElement(he().Fragment,null,he().createElement("span",{className:"tswitcher-icon tswitch-gutenberg"}),he().createElement("span",{className:"templately-editor-name"},(0,At.__)("Gutenberg","templately")))}];return n.has_elementor?e:[e[1],e[0]]},[n.has_elementor,n.has_eb]),c=(0,pe.useState)((null==s?void 0:s.find(function(e){return e.value===t}))||(null==s?void 0:s[0])),u=ce(c,2),d=u[0],p=u[1];(0,pe.useEffect)(function(){var e,t,n,a,c,u=null!==(e=null!==(t=null!==(n=null!==(a=null==o?void 0:o.platform)&&void 0!==a?a:l.get("platform"))&&void 0!==n?n:null===(c=i.state)||void 0===c?void 0:c.platform)&&void 0!==t?t:r.platform)&&void 0!==e?e:"elementor",d=s.filter(function(e){return e.value==u&&!e.isdisabled});if(d.length>0){var h;p(null!==(h=d[0])&&void 0!==h?h:s[0])}else{var m=s.find(function(e){return!e.isdisabled});m&&f(m)}},[]);var f=function(e){var t=e.value;if("elementor"===t&&!n.has_elementor){var o=(0,At.__)("Please Install Elementor.","templately");return 0===n.has_elementor&&(o=(0,At.__)("Please Activate Elementor.","templately")),xl({icon:"error",timer:2e3,html:he().createElement(oC,{title:o})},!1),!1}p(e),r.setPlatform(t);var i=Ha("/settings/:platform/:tab",l.get("path")).tab;a(nb(["settings",t,i]))};return he().createElement(Dg,{components:{Option:function(e){return he().createElement(_m.Option,re({},e,{className:"tt-top",innerProps:NW(NW({},e.innerProps),{},{"data-templately-tooltip":e.data.tooltip})}))}},options:s,className:"templately-switcher",classNamePrefix:"templately-switcher",onChange:f,value:d,isSearchable:!1,isOptionDisabled:function(e){return e.isdisabled}})});function LW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const BW=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,b,w,E,k,O,S,x,_=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",C=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[_])&&void 0!==r?r:{};return RW(RW({},t),{},{platform:_,settings:null!==(i=null===(a=e.settingsPage.settings)||void 0===a?void 0:a[_])&&void 0!==i?i:{},templatelySettings:null!==(l=null===(s=e.settingsPage)||void 0===s?void 0:s.settings)&&void 0!==l?l:{},importedPlatform:null!==(c=e.settingsPage.settings.imported_platform)&&void 0!==c&&c,formData:{siteTitle:null!==(u=null!==(d=null===(p=e.settingsPage)||void 0===p?void 0:p.siteTitle)&&void 0!==d?d:null===(f=e.settingsPage)||void 0===f||null===(f=f.settings)||void 0===f?void 0:f.siteTitle)&&void 0!==u?u:"",siteTagline:null!==(h=null!==(m=null===(g=e.settingsPage)||void 0===g?void 0:g.siteTagline)&&void 0!==m?m:null===(v=e.settingsPage)||void 0===v||null===(v=v.settings)||void 0===v?void 0:v.siteTagline)&&void 0!==h?h:"",logoImage:null!==(y=null===(b=e.settingsPage)||void 0===b?void 0:b.logoImage)&&void 0!==y?y:"",customCSS:null!==(w=null!==(E=null===(k=e.settingsPage)||void 0===k?void 0:k.customCSS)&&void 0!==E?E:null===(O=e.settingsPage)||void 0===O||null===(O=O.settings)||void 0===O?void 0:O.customCSS)&&void 0!==w?w:"",colors:null!==(S=null==C?void 0:C.colors)&&void 0!==S?S:{},typography:null!==(x=null==C?void 0:C.selectedTypography)&&void 0!==x?x:{}}})},function(e){return{setSettings:function(t){return e((0,vy.setSettings)(t))},setPlatform:function(t){return e(Uy(t))}}})(function(e){var t,n=e.templatelySettings,r=e.settings,o=e.platform,i=e.setPlatform,a=e.formData,l=(e.importedPlatform,it()),s=tt(),c=rt(),u=ce(Ct(),1)[0].get("path"),d=Fe("/settings/:platform/:tab","/"+u).params.tab,p=ev(r,o)._systemColors,f=tv(r,o),h=nv(f,o),m=h.normalizedTypography,g=h.groupedData,v=h.getDeNormalizedTypography,y=ce((0,pe.useState)(0),2),b=y[0],w=y[1];(0,pe.useEffect)(function(){return(0,ae.addAction)("templately.settings.tabs.updated","templately/settings",function(){w(function(e){return e+1})}),function(){(0,ae.removeAction)("templately.settings.tabs.updated","templately/settings")}},[]);var E=(0,pe.useMemo)(function(){return(0,ae.applyFilters)("templately.settings.tabs",[{key:"general",label:"General"},{key:"colors",label:"Colors"},{key:"typography",label:"Typography"},{key:"custom_css",label:"Custom CSS"},{key:"miscellaneous",label:"Revert"}],o).filter(function(e){if("general"===e.key||"custom_css"===e.key||"miscellaneous"===e.key)return!0;if("developer"===e.key)return!0;if("elementor"===l.platform)return n.has_elementor;if("gutenberg"===l.platform){if(n.has_eb){if("colors"===e.key&&(0,Ea.isEmpty)(p))return!1;if("typography"===e.key&&(0,Ea.isEmpty)(g))return!1}return n.has_eb}return!1})},[o,l.platform,n,b]);(0,pe.useEffect)(function(){i(l.platform),Fe("/settings/:platform/:tab","/"+u);var e=E.some(function(e){return e.key===d});if(!e&&E.length>0){var t=E[0];c(nb(["settings",l.platform,t.key]))}},[d,E,c,l.platform,i]);var k=(0,pe.useMemo)(function(){return E.map(function(e){var t=je(o+"/"+e.key,"/settings"),n=t.pathname.startsWith("/")?t.pathname.slice(1):t.pathname,r=s.pathname===t.pathname||"general"===e.key&&"/settings"===s.pathname;return{key:e.key,label:e.label,to:n,isActive:r}})},[E,o,s.pathname]);return React.createElement("div",{className:"templately-setting-container templately-wrapper"},React.createElement("div",{className:"wrap"},React.createElement("h1",{className:"wp-heading-inline"},"Templately Settings ",(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.dev_api)&&"(".concat(o,")")),React.createElement("hr",{className:"wp-header-end"}),React.createElement("div",{className:"templately-builder-nav"},React.createElement("ul",{className:"nav-tab-wrapper"},k.map(function(e){var t=e.key,n=e.label,r=e.to,o=e.isActive;return React.createElement("li",{key:t,className:"nav-tab ".concat(t," ").concat(o?"active":"")},React.createElement(Zx,{to:r,isActive:o},n))})),React.createElement(jW,{selected:o,setSelected:i,settings:n}))),React.createElement("div",{className:"wrap"},React.createElement("div",{className:"templately-setting-tab-panel-wrapper"},React.createElement(vt,{context:{normalizedTypography:m,groupedData:g}}),"miscellaneous"!==d&&"developer"!==d&&React.createElement("div",{className:"templately-setting-save-button-wrapper"},React.createElement("button",{onClick:function(e){e.preventDefault();var t=RW(RW({},a),{},{platform:o}),n=v(a.typography);if("gutenberg"===o&&!(0,Ea.isEmpty)(n)){n.custom={};for(var r=0,i=Object.entries(a.typography);r<i.length;r++){var l=ce(i[r],2),s=l[0];l[1]._isSystem||(n.custom[s]=n[s],delete n[s])}}t.typography=n,gi()({path:"/templately/v1/settings/update",method:"POST",data:{settings:t}}).then(function(e){xl({icon:"success",timer:2e3,html:React.createElement(oC,{title:(0,At.__)("Successfully Updated Settings","templately")})},!1)}).catch(function(e){var t;xl({icon:"error",timer:2e3,html:React.createElement(oC,{title:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:(0,At.__)("Failed to Update Settings","templately")})},!1)})},className:"components-button templately-setting-save-button"},"Save")))))});var zW=function(e){var t=e.name,n=e.color,r=e.setColor,o=e.defaultColor,i=e.setColorPickerOpen,a=ce((0,pe.useState)(!1),2),l=a[0],s=a[1],c=(0,pe.useRef)(null);return(0,pe.useEffect)(function(){i(l)},[l]),function(e){(0,pe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&s(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(c),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-setting-colorpicker-wrap"},he().createElement("div",{className:"templately-colorpicker-screen"},he().createElement("span",{className:"templately-picker-title"},t),he().createElement("span",{className:"templately-picker-sub-title"},n),he().createElement("span",{className:"templately-picker-display-wrapper",onClick:function(){return s(!l)}},he().createElement("span",{className:"templately-picker-display",style:{backgroundColor:n}}))),l&&he().createElement("div",{className:"templately-colorpicker-wrapper"},he().createElement("div",{className:"templately-colorpicker",ref:c},he().createElement("span",{className:"templately-title"},t),he().createElement(tj.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o})))))};function WW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const VW=gn(function(e,t){var n,r,o,i,a,l=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return UW(UW({},t),{},{platform:l,settings:null!==(r=null===(o=e.settingsPage.settings)||void 0===o?void 0:o[l])&&void 0!==r?r:{},colors:null!==(i=null===(a=e.settingsPage)||void 0===a||null===(a=a[l])||void 0===a?void 0:a.colors)&&void 0!==i?i:{}})},function(e){return{setColors:function(t){return e(function(e){return{type:pi.SET_COLORS,colors:e}}(t))}}})(function(e){var t=e.platform,n=e.settings,r=e.colors,o=e.setColors,i=ev(n,t),a=i.colors,l=i._systemColors,s=ce((0,pe.useState)(!1),2),c=s[0],u=s[1];return(0,pe.useEffect)(function(){(0,Ea.isEmpty)(r)&&o(a)},[t]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-colors"},he().createElement("div",{className:"templately-setting-color-picker-section"},he().createElement("div",{className:"templately-setting-color-picker-section-label-wrapper"},he().createElement("label",{className:"templately-setting-color-picker-section-label"},"Select Color"),he().createElement("button",{className:"templately-setting-color-picker-reset-button",onClick:function(){o(a)}},he().createElement(YN,null))),"elementor"===t?he().createElement("div",{className:"templately-setting-color-picker-panel"},l&&(null==l?void 0:l.map(function(e,t){var n;return he().createElement(zW,{key:e._id,name:e.title,setColorPickerOpen:u,color:null!==(n=null==r?void 0:r[e._id])&&void 0!==n?n:e.color,setColor:function(t){return o(UW(UW({},r),{},Pt({},e._id,t)))},defaultValue:e.color})}))):he().createElement("div",{className:"templately-setting-color-picker-panel-2"},l&&(null==l?void 0:l.map(function(e,t){var n;return he().createElement(zW,{key:e._id,name:e.title,setColorPickerOpen:u,color:null!==(n=null==r?void 0:r[e._id])&&void 0!==n?n:e.color,setColor:function(t){return o(UW(UW({},r),{},Pt({},e._id,t)))},defaultValue:e.color})}))))),c&&he().createElement("div",{className:"templately-setting-overlay"}))}),HW=1024;let GW=0;class qW{constructor(e,t){this.from=e,this.to=t}}class QW{constructor(e={}){this.id=GW++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=XW.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}QW.closedBy=new QW({deserialize:e=>e.split(" ")}),QW.openedBy=new QW({deserialize:e=>e.split(" ")}),QW.group=new QW({deserialize:e=>e.split(" ")}),QW.isolate=new QW({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),QW.contextHash=new QW({perNode:!0}),QW.lookAhead=new QW({perNode:!0}),QW.mounted=new QW({perNode:!0});class $W{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[QW.mounted.id]}}const YW=Object.create(null);class XW{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):YW,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new XW(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(QW.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(QW.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?e.name:n[r]];if(o)return o}}}}XW.none=new XW("",Object.create(null),0,8);class KW{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],o=e[0];o.combine&&o.id in r&&(t=o.combine(r[o.id],t)),r[o.id]=t}}t.push(r?new XW(n.name,r,n.id,n.flags):n)}return new KW(t)}}const ZW=new WeakMap,JW=new WeakMap;var eU;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"}(eU||(eU={}));class tU{constructor(e,t,n,r,o){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[e,t]of o)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=$W.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new hU(this.topNode,e)}cursorAt(e,t=0,n=0){let r=ZW.get(this)||this.topNode,o=new hU(r);return o.moveTo(e,t),ZW.set(this,o._tree),o}get topNode(){return new lU(this,0,0,null)}resolve(e,t=0){let n=iU(ZW.get(this)||this.topNode,e,t,!1);return ZW.set(this,n),n}resolveInner(e,t=0){let n=iU(JW.get(this)||this.topNode,e,t,!0);return JW.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),o=null;for(let e=r instanceof lU?r:r.context.parent;e;e=e.parent)if(e.index<0){let i=e.parent;(o||(o=[r])).push(i.resolve(t,n)),e=i}else{let i=$W.get(e.tree);if(i&&i.overlay&&i.overlay[0].from<=t&&i.overlay[i.overlay.length-1].to>=t){let a=new lU(i.tree,i.overlay[0].from+e.from,-1,e);(o||(o=[r])).push(iU(a,t,n,!1))}}return o?pU(o):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:o=this.length}=e,i=e.mode||0,a=(i&eU.IncludeAnonymous)>0;for(let e=this.cursor(i|eU.IncludeAnonymous);;){let i=!1;if(e.from<=o&&e.to>=r&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;i=!0}for(;i&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;i=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:yU(XW.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new tU(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new tU(XW.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:o=HW,reused:i=[],minRepeatType:a=r.types.length}=e,l=Array.isArray(n)?new nU(n,n.length):n,s=r.types,c=0,u=0;function d(e,t,n,g,v,y){let{id:b,start:w,end:E,size:k}=l,O=u,S=c;if(k<0){if(l.next(),-1==k){let t=i[b];return n.push(t),void g.push(w-e)}if(-3==k)return void(c=b);if(-4==k)return void(u=b);throw new RangeError(`Unrecognized record size: ${k}`)}let x,_,C=s[b],D=w-e;if(E-w<=o&&(_=function(e,t){let n=l.fork(),r=0,i=0,s=0,c=n.end-o,u={size:0,start:0,skip:0};e:for(let o=n.pos-e;n.pos>o;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=i,u.skip=s,s+=4,r+=4,n.next();continue}let l=n.pos-e;if(e<0||l<o||n.start<c)break;let d=n.id>=a?4:0,p=n.start;for(n.next();n.pos>l;){if(n.size<0){if(-3!=n.size&&-4!=n.size)break e;d+=4}else n.id>=a&&(d+=4);n.next()}i=p,r+=e,s+=d}return(t<0||r==e)&&(u.size=r,u.start=i,u.skip=s),u.size>4?u:void 0}(l.pos-t,v))){let t=new Uint16Array(_.size-_.skip),n=l.pos-_.size,o=t.length;for(;l.pos>n;)o=m(_.start,t,o);x=new rU(t,E-_.start,r),D=_.start-e}else{let e=l.pos-k;l.next();let t=[],n=[],r=b>=a?b:-1,i=0,s=E;for(;l.pos>e;)r>=0&&l.id==r&&l.size>=0?(l.end<=s-o&&(f(t,n,w,i,l.end,s,r,O,S),i=t.length,s=l.end),l.next()):y>2500?p(w,e,t,n):d(w,e,t,n,r,y+1);if(r>=0&&i>0&&i<t.length&&f(t,n,w,i,w,s,r,O,S),t.reverse(),n.reverse(),r>-1&&i>0){let e=function(e,t){return(n,r,o)=>{let i,a,l=0,s=n.length-1;if(s>=0&&(i=n[s])instanceof tU){if(!s&&i.type==e&&i.length==o)return i;(a=i.prop(QW.lookAhead))&&(l=r[s]+i.length+a)}return h(e,n,r,o,l,t)}}(C,S);x=yU(C,t,n,0,t.length,0,E-w,e,e)}else x=h(C,t,n,E-w,O-E,S)}n.push(x),g.push(D)}function p(e,t,n,i){let a=[],s=0,c=-1;for(;l.pos>t;){let{id:e,start:t,end:n,size:r}=l;if(r>4)l.next();else{if(c>-1&&t<c)break;c<0&&(c=n-o),a.push(e,t,n),s++,l.next()}}if(s){let t=new Uint16Array(4*s),o=a[a.length-2];for(let e=a.length-3,n=0;e>=0;e-=3)t[n++]=a[e],t[n++]=a[e+1]-o,t[n++]=a[e+2]-o,t[n++]=n;n.push(new rU(t,a[2]-o,r)),i.push(o-e)}}function f(e,t,n,o,i,a,l,s,c){let u=[],d=[];for(;e.length>o;)u.push(e.pop()),d.push(t.pop()+n-i);e.push(h(r.types[l],u,d,a-i,s-a,c)),t.push(i-n)}function h(e,t,n,r,o,i,a){if(i){let e=[QW.contextHash,i];a=a?[e].concat(a):[e]}if(o>25){let e=[QW.lookAhead,o];a=a?[e].concat(a):[e]}return new tU(e,t,n,r,a)}function m(e,t,n){let{id:r,start:o,end:i,size:s}=l;if(l.next(),s>=0&&r<a){let a=n;if(s>4){let r=l.pos-(s-4);for(;l.pos>r;)n=m(e,t,n)}t[--n]=a,t[--n]=i-e,t[--n]=o-e,t[--n]=r}else-3==s?c=r:-4==s&&(u=r);return n}let g=[],v=[];for(;l.pos>0;)d(e.start||0,e.bufferStart||0,g,v,-1,0);let y=null!==(t=e.length)&&void 0!==t?t:g.length?v[0]+g[0].length:0;return new tU(s[e.topID],g.reverse(),v.reverse(),y)}(e)}}tU.empty=new tU(XW.none,[],[],0);class nU{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new nU(this.buffer,this.index)}}class rU{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return XW.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),n==(e+=4))return o;let i=[];for(;e<n;)i.push(this.childString(e)),e=this.buffer[e+3];return o+"("+i.join(",")+")"}findChild(e,t,n,r,o){let{buffer:i}=this,a=-1;for(let l=e;l!=t&&!(oU(o,r,i[l+1],i[l+2])&&(a=l,n>0));l=i[l+3]);return a}slice(e,t,n){let r=this.buffer,o=new Uint16Array(t-e),i=0;for(let a=e,l=0;a<t;){o[l++]=r[a++],o[l++]=r[a++]-n;let t=o[l++]=r[a++]-n;o[l++]=r[a++]-e,i=Math.max(i,t)}return new rU(o,i,this.set)}}function oU(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function iU(e,t,n,r){for(var o;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof lU&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:eU.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof lU&&r.index<0&&(null===(o=a.enter(t,n,i))||void 0===o?void 0:o.from)!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}class aU{cursor(e=0){return new hU(this,e)}getChild(e,t=null,n=null){let r=sU(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return sU(this,e,t,n)}resolve(e,t=0){return iU(this,e,t,!1)}resolveInner(e,t=0){return iU(this,e,t,!0)}matchContext(e){return cU(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class lU extends aU{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,o=0){for(let i=this;;){for(let{children:a,positions:l}=i._tree,s=t>0?a.length:-1;e!=s;e+=t){let s,c=a[e],u=l[e]+i.from;if(o&eU.EnterBracketed&&c instanceof tU&&(s=$W.get(c))&&!s.overlay&&s.bracketed&&n>=u&&n<=u+c.length||oU(r,n,u,u+c.length))if(c instanceof rU){if(o&eU.ExcludeBuffers)continue;let a=c.findChild(0,c.buffer.length,t,n-u,r);if(a>-1)return new dU(new uU(i,c,e,u),null,a)}else if(o&eU.IncludeAnonymous||!c.type.isAnonymous||mU(c)){let a;if(!(o&eU.IgnoreMounts)&&(a=$W.get(c))&&!a.overlay)return new lU(a.tree,u,e,i);let l=new lU(c,u,e,i);return o&eU.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?c.children.length-1:0,t,n,r,o)}}if(o&eU.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&eU.IgnoreOverlays)&&(r=$W.get(this._tree))&&r.overlay){let o=e-this.from,i=n&eU.EnterBracketed&&r.bracketed;for(let{from:e,to:n}of r.overlay)if((t>0||i?e<=o:e<o)&&(t<0||i?n>=o:n>o))return new lU(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function sU(e,t,n,r){let o=e.cursor(),i=[];if(!o.firstChild())return i;if(null!=n)for(let e=!1;!e;)if(e=o.type.is(n),!o.nextSibling())return i;for(;;){if(null!=r&&o.type.is(r))return i;if(o.type.is(t)&&i.push(o.node),!o.nextSibling())return null==r?i:[]}}function cU(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class uU{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dU extends aU{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return o<0?null:new dU(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&eU.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new dU(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dU(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dU(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,o=n.buffer[this.index+3];if(o>r){let i=n.buffer[this.index+1];e.push(n.slice(r,o,i)),t.push(0)}return new tU(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function pU(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let o=e[r];(o.from>n.from||o.to<n.to)&&(n=o,t=r)}let r=n instanceof lU&&n.index<0?null:n.parent,o=e.slice();return r?o[t]=r:o.splice(t,1),new fU(o,n)}class fU{constructor(e,t){this.heads=e,this.node=t}get next(){return pU(this.heads)}}class hU{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~eU.EnterBracketed,e instanceof lU)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof lU?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&eU.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&eU.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&eU.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let e=n._tree.children[r];if(this.mode&eU.IncludeAnonymous||e instanceof rU||!e.type.isAnonymous||mU(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;t=i,n=o+1;break e}r=this.stack[--o]}for(let e=n;e<this.stack.length;e++)t=new dU(this.buffer,t,this.stack[e]);return this.bufferNode=new dU(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return cU(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return cU(this._tree,e,r);let i=n[t.buffer[this.stack[o]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function mU(e){return e.children.some(e=>e instanceof rU||!e.type.isAnonymous||mU(e))}const gU=new WeakMap;function vU(e,t){if(!e.isAnonymous||t instanceof rU||t.type!=e)return 1;let n=gU.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof tU)){n=1;break}n+=vU(e,r)}gU.set(t,n)}return n}function yU(e,t,n,r,o,i,a,l,s){let c=0;for(let n=r;n<o;n++)c+=vU(e,t[n]);let u=Math.ceil(1.5*c/8),d=[],p=[];return function t(n,r,o,a,l){for(let c=o;c<a;){let o=c,f=r[c],h=vU(e,n[c]);for(c++;c<a;c++){let t=vU(e,n[c]);if(h+t>=u)break;h+=t}if(c==o+1){if(h>u){let e=n[o];t(e.children,e.positions,0,e.children.length,r[o]+l);continue}d.push(n[o])}else{let t=r[c-1]+n[c-1].length-f;d.push(yU(e,n,r,o,c,f,t,null,s))}p.push(f+l-i)}}(t,n,r,o,0),(l||s)(d,p,a)}class bU{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dU?this.setBuffer(e.context.buffer,e.index,t):e instanceof lU&&this.map.set(e.tree,t)}get(e){return e instanceof dU?this.getBuffer(e.context.buffer,e.index):e instanceof lU?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class wU{constructor(e,t,n,r,o=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(o?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new wU(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],o=1,i=e.length?e[0]:null;for(let a=0,l=0,s=0;;a++){let c=a<t.length?t[a]:null,u=c?c.fromA:1e9;if(u-l>=n)for(;i&&i.from<u;){let t=i;if(l>=t.from||u<=t.to||s){let e=Math.max(t.from,l)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new wU(e,n,t.tree,t.offset+s,a>0,!!c)}if(t&&r.push(t),i.to>u)break;i=o<e.length?e[o++]:null}if(!c)break;l=c.toA,s=c.toA-c.toB}return r}}class EU{startParse(e,t,n){return"string"==typeof e&&(e=new kU(e)),n=n?n.length?n.map(e=>new qW(e.from,e.to)):[new qW(0,0)]:[new qW(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class kU{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new QW({perNode:!0});class OU{constructor(e,t,n,r,o,i,a,l,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=o,this.score=i,this.buffer=a,this.bufferBase=l,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new OU(e,[],t,n,n,0,[],0,r?new SU(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:o}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=o.dynamicPrecedence(r);if(a&&(this.score+=a),0==n)return this.pushState(o.getGoto(this.state,r,!0),this.reducePos),r<o.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,i?8:4,!0),void this.reduceContext(r,this.reducePos);let l=this.stack.length-3*(n-1)-(262144&e?6:0),s=l?this.stack[l-2]:this.p.ranges[0].from,c=this.reducePos-s;c>=2e3&&!(null===(t=this.p.parser.nodeSet.types[r])||void 0===t?void 0:t.isAnonymous)&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let u=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-u;if(r<o.minRepeatTerm||131072&e){let e=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,s,e,d+4,!0)}if(262144&e)this.state=this.stack[l];else{let e=this.stack[l-3];this.state=o.getGoto(e,r,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(r,s)}storeNode(e,t,n,r=4,o=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(0==r&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t)return void(e.buffer[r-2]=n)}}if(o&&this.pos!=n){let o=this.buffer.length;if(o>0&&(0!=this.buffer[o-4]||this.buffer[o-1]<0)){let e=!1;for(let t=o;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if(262144&e)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let o=e,{parser:i}=this.p;this.pos=r;let a=i.stateFlag(o,1);!a&&(r>n||t<=i.maxNode)&&(this.reducePos=r),this.pushState(o,a?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new OU(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new xU(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(!(65536&n))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r,o=0;o<t.length;o+=2)(r=t[o+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[o],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[e],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(65536&t))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,o=this.stack.length-3*n;if(o<0||e.getGoto(this.stack[o],r,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,o)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-o;if(n>1){let r=65535&t,o=this.stack.length-3*n;if(o>=0&&e.getGoto(this.stack[o],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,o+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new SU(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead||(this.emitLookAhead(),this.lookAhead=e,0))}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class SU{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class xU{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class _U{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new _U(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new _U(this.stack,this.pos,this.index)}}function CU(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,o=0;r<e.length;){let i=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){i=65535;break}t>=92&&t--,t>=34&&t--;let o=t-32;if(o>=46&&(o-=46,n=!0),i+=o,n)break;i*=46}n?n[o++]=i:n=new t(i)}return n}class DU{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const PU=new DU;class AU{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=PU,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,o=this.pos+e;for(;o<n.from;){if(!r)return null;let e=this.ranges[--r];o-=n.from-e.to,n=e}for(;t<0?o>n.to:o>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];o+=e.from-n.to,n=e}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,n,r=this.chunkOff+e;if(r>=0&&r<this.chunk.length)t=this.pos+e,n=this.chunk.charCodeAt(r);else{let r=this.resolveOffset(e,1);if(null==r)return-1;if(t=r,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,r=this.range;for(;r.to<=t;)r=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>r.to&&(this.chunk2=this.chunk2.slice(0,r.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=PU,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class TU{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;IU(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}TU.prototype.contextual=TU.prototype.fallback=TU.prototype.extend=!1;class FU{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?CU(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,o=e.resolveOffset(1,1);if(IU(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||r++,null==o)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}FU.prototype.contextual=TU.prototype.fallback=TU.prototype.extend=!1;class MU{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function IU(e,t,n,r,o,i){let a=0,l=1<<r,{dialect:s}=n.p.parser;e:for(;0!=(l&e[a]);){let n=e[a+1];for(let r=a+3;r<n;r+=2)if((e[r+1]&l)>0){let n=e[r];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||jU(n,t.token.value,o,i))){t.acceptToken(n);break}}let r=t.next,c=0,u=e[a+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c<u;){let o=c+u>>1,i=n+o+(o<<1),l=e[i],s=e[i+1]||65536;if(r<l)u=o;else{if(!(r>=s)){a=e[i+2],t.advance();continue e}c=o+1}}break}a=e[n+3*u-1]}}function NU(e,t,n){for(let r,o=t;65535!=(r=e[o]);o++)if(r==n)return o-t;return-1}function jU(e,t,n,r){let o=NU(n,r,t);return o<0||NU(n,r,e)<o}const LU="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let RU=null;function BU(e,t,n){let r=e.cursor(eU.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class zU{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?BU(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?BU(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=n.children[r],i=this.start[t]+n.positions[r];if(i>e)return this.nextStart=i,null;if(o instanceof tU){if(i==e){if(i<this.safeFrom)return null;let e=i+o.length;if(e<=this.safeTo){let t=o.prop(QW.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[t]++,i+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+o.length}}}class WU{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new DU)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:o}=r,i=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let r=0;r<o.length;r++){if(!(1<<r&i))continue;let s=o[r],c=this.tokens[r];if((!n||s.fallback)&&((s.contextual||c.start!=e.pos||c.mask!=i||c.context!=a)&&(this.updateCachedToken(c,s,e),c.mask=i,c.context=a),c.lookAhead>c.end+25&&(l=Math.max(c.lookAhead,l)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!s.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),n||e.pos!=this.stream.end||(n=new DU,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new DU,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let o=t.specializers[r](this.stream.read(e.start,e.end),n);if(o>=0&&n.p.parser.dialect.allows(o>>1)){1&o?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:o}=e,{parser:i}=e.p,{data:a}=i;for(let e=0;e<2;e++)for(let l=i.stateSlot(o,e?2:1);;l+=3){if(65535==a[l]){if(1!=a[l+1]){0==r&&2==a[l+1]&&(r=this.putAction(qU(a,l+2),t,n,r));break}l=qU(a,l+2)}a[l]==t&&(r=this.putAction(qU(a,l+1),t,n,r))}return r}}class UU{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new AU(t,r),this.tokens=new WU(e,this.stream),this.topTerm=e.top[1];let{from:o}=r[0];this.stacks=[OU.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>4*e.bufferLength?new zU(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,o=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;i<n.length;i++){let a=n[i];for(;;){if(this.tokens.mainToken=null,a.pos>r)o.push(a);else{if(this.advanceStack(a,o,n))continue;{e||(e=[],t=[]),e.push(a);let n=this.tokens.getMainToken(a);t.push(n.value,n.end)}}break}}if(!o.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return LU&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw LU&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,o);if(n)return LU&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(o.length>e)for(o.sort((e,t)=>t.score-e.score);o.length>e;)o.pop();o.some(e=>e.reducePos>r)&&this.recovering--}else if(o.length>1){e:for(let e=0;e<o.length-1;e++){let t=o[e];for(let n=e+1;n<o.length;n++){let r=o[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500){if(!((t.score-r.score||t.buffer.length-r.buffer.length)>0)){o.splice(e--,1);continue e}o.splice(n--,1)}}}o.length>12&&(o.sort((e,t)=>t.score-e.score),o.splice(12,o.length-12))}this.minStackPos=o[0].pos;for(let e=1;e<o.length;e++)o[e].pos<this.minStackPos&&(this.minStackPos=o[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:o}=this,i=LU?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?o.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(QW.contextHash)||0)==n))return e.useNode(a,r),LU&&console.log(i+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof tU)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof tU&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),LU&&console.log(i+this.stackID(e)+` (via always-reduce ${o.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;a<l.length;){let s=l[a++],c=l[a++],u=l[a++],d=a==l.length||!n,p=d?e:e.split(),f=this.tokens.mainToken;if(p.apply(s,c,f?f.start:p.pos,u),LU&&console.log(i+this.stackID(p)+` (via ${65536&s?`reduce of ${o.getName(65535&s)}`:"shift"} for ${o.getName(c)} @ ${r}${p==e?"":", split"})`),d)return!0;p.pos>r?t.push(p):n.push(p)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return VU(e,t),!0}}runRecovery(e,t,n){let r=null,o=!1;for(let i=0;i<e.length;i++){let a=e[i],l=t[i<<1],s=t[1+(i<<1)],c=LU?this.stackID(a)+" -> ":"";if(a.deadEnd){if(o)continue;if(o=!0,a.restart(),LU&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))continue}let u=a.split(),d=c;for(let e=0;e<10&&u.forceReduce()&&(LU&&console.log(d+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));e++)LU&&(d=this.stackID(u)+" -> ");for(let e of a.recoverByInsert(l))LU&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(s==a.pos&&(s++,l=0),a.recoverByDelete(l,s),LU&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),VU(a,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),tU.build({buffer:_U.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(RU||(RU=new WeakMap)).get(e);return t||RU.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function VU(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e))return void(t[n].score<e.score&&(t[n]=e))}t.push(e)}class HU{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class GU extends EU{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function o(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=QW[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)o(r,e,t[n++]);else{let i=t[n+-r];for(let a=-r;a>0;a--)o(t[n++],e,i);n++}}}this.nodeSet=new KW(t.map((t,o)=>XW.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=HW;let i=CU(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(QU),this.states=CU(e.states,Uint32Array),this.data=CU(e.stateData),this.goto=CU(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new TU(i,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new UU(this,e,t,n);for(let o of this.wrappers)r=o(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let o=r[t+1];;){let t=r[o++],i=1&t,a=r[o++];if(i&&n)return a;for(let n=o+(t>>1);o<n;o++)if(r[o]==e)return a;if(i)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let o,i=this.stateSlot(e,r?2:1);;i+=3){if(65535==(o=n[i])){if(1!=n[i+1]){if(2==n[i+1])return qU(n,i+2);break}o=n[i=qU(n,i+2)]}if(o==t||0==o)return qU(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=qU(this.data,n+2)}r=t(qU(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=qU(this.data,n+2)}if(!(1&this.data[n+2])){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(GU.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let o=e.specializers.find(e=>e.from==n.external);if(!o)return n;let i=Object.assign(Object.assign({},n),{external:o.to});return t.specializers[r]=QU(i),i})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n,o=this.dialects[t[e]];65535!=(n=this.data[o++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[n]=1;return new HU(e,n,r)}static deserialize(e){return new GU(e)}}function qU(e,t){return e[t]|e[t+1]<<16}function QU(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}let $U=0;class YU{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=$U++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n="string"==typeof e?e:"?";if(e instanceof YU&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let r=new YU(n,[],null,[]);if(r.set.push(r),t)for(let e of t.set)r.set.push(e);return r}static defineModifier(e){let t=new KU(e);return e=>e.modified.indexOf(t)>-1?e:KU.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let XU=0;class KU{constructor(e){this.name=e,this.instances=[],this.id=XU++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{return n.base==e&&(r=t,o=n.modified,r.length==o.length&&r.every((e,t)=>e==o[t]));var r,o});if(n)return n;let r=[],o=new YU(e.name,r,e,t);for(let e of t)e.instances.push(o);let i=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,o=t.length;r<o;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of i)r.push(KU.get(t,e));return o}}function ZU(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(" "))if(e){let n=[],o=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){o=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!r)throw new RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let a=e[t++];if(t==e.length&&"!"==a){o=0;break}if("/"!=a)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let a=n.length-1,l=n[a];if(!l)throw new RangeError("Invalid path: "+e);let s=new eV(r,o,a>0?n.slice(0,a):null);t[l]=s.sort(t[l])}}return JU.add(t)}const JU=new QW({combine(e,t){let n,r,o;for(;e||t;){if(!e||t&&e.depth>=t.depth?(o=t,t=t.next):(o=e,e=e.next),n&&n.mode==o.mode&&!o.context&&!n.context)continue;let i=new eV(o.tags,o.mode,o.context);n?n.next=i:r=i,n=i}return r}});class eV{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function tV(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:o=null}=t||{};return{style:e=>{let t=o;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function nV(e,t,n,r=0,o=e.length){let i=new rV(r,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),r,o,"",i.highlighters),i.flush(o)}eV.empty=new eV([],2,null);class rV{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,o){let{type:i,from:a,to:l}=e;if(a>=n||l<=t)return;i.isTop&&(o=this.highlighters.filter(e=>!e.scope||e.scope(i)));let s=r,c=function(e){let t=e.type.prop(JU);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||eV.empty,u=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(o,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(r+=(r?" ":"")+u)),this.startSpan(Math.max(t,a),s),c.opaque)return;let d=e.tree&&e.tree.prop(QW.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+a,1),c=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let p=0,f=a;;p++){let h=p<d.overlay.length?d.overlay[p]:null,m=h?h.from+a:l,g=Math.max(t,f),v=Math.min(n,m);if(g<v&&u)for(;e.from<v&&(this.highlightRange(e,g,v,r,o),this.startSpan(Math.min(v,e.to),s),!(e.to>=m)&&e.nextSibling()););if(!h||m>n)break;f=h.to+a,f>t&&(this.highlightRange(i.cursor(),Math.max(t,h.from+a),Math.min(n,f),"",c),this.startSpan(Math.min(n,f),s))}u&&e.parent()}else if(e.firstChild()){d&&(r="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,o),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const oV=YU.define,iV=oV(),aV=oV(),lV=oV(aV),sV=oV(aV),cV=oV(),uV=oV(cV),dV=oV(cV),pV=oV(),fV=oV(pV),hV=oV(),mV=oV(),gV=oV(),vV=oV(gV),yV=oV(),bV={comment:iV,lineComment:oV(iV),blockComment:oV(iV),docComment:oV(iV),name:aV,variableName:oV(aV),typeName:lV,tagName:oV(lV),propertyName:sV,attributeName:oV(sV),className:oV(aV),labelName:oV(aV),namespace:oV(aV),macroName:oV(aV),literal:cV,string:uV,docString:oV(uV),character:oV(uV),attributeValue:oV(uV),number:dV,integer:oV(dV),float:oV(dV),bool:oV(cV),regexp:oV(cV),escape:oV(cV),color:oV(cV),url:oV(cV),keyword:hV,self:oV(hV),null:oV(hV),atom:oV(hV),unit:oV(hV),modifier:oV(hV),operatorKeyword:oV(hV),controlKeyword:oV(hV),definitionKeyword:oV(hV),moduleKeyword:oV(hV),operator:mV,derefOperator:oV(mV),arithmeticOperator:oV(mV),logicOperator:oV(mV),bitwiseOperator:oV(mV),compareOperator:oV(mV),updateOperator:oV(mV),definitionOperator:oV(mV),typeOperator:oV(mV),controlOperator:oV(mV),punctuation:gV,separator:oV(gV),bracket:vV,angleBracket:oV(vV),squareBracket:oV(vV),paren:oV(vV),brace:oV(vV),content:pV,heading:fV,heading1:oV(fV),heading2:oV(fV),heading3:oV(fV),heading4:oV(fV),heading5:oV(fV),heading6:oV(fV),contentSeparator:oV(pV),list:oV(pV),quote:oV(pV),emphasis:oV(pV),strong:oV(pV),link:oV(pV),monospace:oV(pV),strikethrough:oV(pV),inserted:oV(),deleted:oV(),changed:oV(),invalid:oV(),meta:yV,documentMeta:oV(yV),annotation:oV(yV),processingInstruction:oV(yV),definition:YU.defineModifier("definition"),constant:YU.defineModifier("constant"),function:YU.defineModifier("function"),standard:YU.defineModifier("standard"),local:YU.defineModifier("local"),special:YU.defineModifier("special")};for(let e in bV){let t=bV[e];t instanceof YU&&(t.name=e)}tV([{tag:bV.link,class:"tok-link"},{tag:bV.heading,class:"tok-heading"},{tag:bV.emphasis,class:"tok-emphasis"},{tag:bV.strong,class:"tok-strong"},{tag:bV.keyword,class:"tok-keyword"},{tag:bV.atom,class:"tok-atom"},{tag:bV.bool,class:"tok-bool"},{tag:bV.url,class:"tok-url"},{tag:bV.labelName,class:"tok-labelName"},{tag:bV.inserted,class:"tok-inserted"},{tag:bV.deleted,class:"tok-deleted"},{tag:bV.literal,class:"tok-literal"},{tag:bV.string,class:"tok-string"},{tag:bV.number,class:"tok-number"},{tag:[bV.regexp,bV.escape,bV.special(bV.string)],class:"tok-string2"},{tag:bV.variableName,class:"tok-variableName"},{tag:bV.local(bV.variableName),class:"tok-variableName tok-local"},{tag:bV.definition(bV.variableName),class:"tok-variableName tok-definition"},{tag:bV.special(bV.variableName),class:"tok-variableName2"},{tag:bV.definition(bV.propertyName),class:"tok-propertyName tok-definition"},{tag:bV.typeName,class:"tok-typeName"},{tag:bV.namespace,class:"tok-namespace"},{tag:bV.className,class:"tok-className"},{tag:bV.macroName,class:"tok-macroName"},{tag:bV.propertyName,class:"tok-propertyName"},{tag:bV.operator,class:"tok-operator"},{tag:bV.comment,class:"tok-comment"},{tag:bV.meta,class:"tok-meta"},{tag:bV.invalid,class:"tok-invalid"},{tag:bV.punctuation,class:"tok-punctuation"}]);const wV=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function EV(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function kV(e){return e>=48&&e<=57}function OV(e){return kV(e)||e>=97&&e<=102||e>=65&&e<=70}const SV=(e,t,n)=>(r,o)=>{for(let i=!1,a=0,l=0;;l++){let{next:s}=r;if(EV(s)||45==s||95==s||i&&kV(s))!i&&(45!=s||l>0)&&(i=!0),a===l&&45==s&&a++,r.advance();else{if(92!=s||10==r.peek(1)){i&&r.acceptToken(2==a&&o.canShift(2)?t:40==s?n:e);break}if(r.advance(),OV(r.next)){do{r.advance()}while(OV(r.next));32==r.next&&r.advance()}else r.next>-1&&r.advance();i=!0}}},xV=new MU(SV(123,2,124)),_V=new MU(SV(125,3,4)),CV=new MU(e=>{if(wV.includes(e.peek(-1))){let{next:t}=e;(EV(t)||95==t||35==t||46==t||42==t||91==t||58==t&&EV(e.peek(1))||45==t||38==t)&&e.acceptToken(122)}}),DV=new MU(e=>{if(!wV.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),EV(t)){do{e.advance()}while(EV(e.next)||kV(e.next));e.acceptToken(1)}}}),PV=ZU({"AtKeyword import charset namespace keyframes media supports":bV.definitionKeyword,"from to selector":bV.keyword,NamespaceName:bV.namespace,KeyframeName:bV.labelName,KeyframeRangeName:bV.operatorKeyword,TagName:bV.tagName,ClassName:bV.className,PseudoClassName:bV.constant(bV.className),IdName:bV.labelName,"FeatureName PropertyName":bV.propertyName,AttributeName:bV.attributeName,NumberLiteral:bV.number,KeywordQuery:bV.keyword,UnaryQueryOp:bV.operatorKeyword,"CallTag ValueName":bV.atom,VariableName:bV.variableName,Callee:bV.operatorKeyword,Unit:bV.unit,"UniversalSelector NestingSelector":bV.definitionOperator,"MatchOp CompareOp":bV.compareOperator,"ChildOp SiblingOp, LogicOp":bV.logicOperator,BinOp:bV.arithmeticOperator,Important:bV.modifier,Comment:bV.blockComment,ColorLiteral:bV.color,"ParenthesizedContent StringLiteral":bV.string,":":bV.punctuation,"PseudoOp #":bV.derefOperator,"; ,":bV.separator,"( )":bV.paren,"[ ]":bV.squareBracket,"{ }":bV.brace}),AV={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},TV={__proto__:null,or:98,and:98,not:106,only:106,layer:170},FV={__proto__:null,selector:112,layer:166},MV={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},IV={__proto__:null,to:207},NV=GU.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[PV],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[CV,DV,xV,_V,1,2,3,4,new FU("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:e=>AV[e]||-1},{term:125,get:e=>TV[e]||-1},{term:4,get:e=>FV[e]||-1},{term:25,get:e=>MV[e]||-1},{term:123,get:e=>IV[e]||-1}],tokenPrec:1963});let jV=[],LV=[];function RV(e){if(e<768)return!1;for(let t=0,n=jV.length;;){let r=t+n>>1;if(e<jV[r])n=r;else{if(!(e>=LV[r]))return!0;t=r+1}if(t==n)return!1}}function BV(e){return e>=127462&&e<=127487}function zV(e,t,n=!0,r=!0){return(n?WV:UV)(e,t,r)}function WV(e,t,n){if(t==e.length)return t;t&&HV(e.charCodeAt(t))&&GV(e.charCodeAt(t-1))&&t--;let r=VV(e,t);for(t+=qV(r);t<e.length;){let o=VV(e,t);if(8205==r||8205==o||n&&RV(o))t+=qV(o),r=o;else{if(!BV(o))break;{let n=0,r=t-2;for(;r>=0&&BV(VV(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function UV(e,t,n){for(;t>0;){let r=WV(e,t-2,n);if(r<t)return r;t--}return 0}function VV(e,t){let n=e.charCodeAt(t);if(!GV(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return HV(r)?r-56320+(n-55296<<10)+65536:n}function HV(e){return e>=56320&&e<57344}function GV(e){return e>=55296&&e<56320}function qV(e){return e<65536?1:2}(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?LV:jV).push(n+=e[t])})();class QV{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=nH(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),YV.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=nH(this,e,t);let n=[];return this.decompose(e,t,n,0),YV.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new ZV(this),o=new ZV(e);for(let e=t,i=t;;){if(r.next(e),o.next(e),e=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(i+=r.value.length,r.done||i>=n)return!0}}iter(e=1){return new ZV(this,e)}iterRange(e,t=this.length){return new JV(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new eH(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new $V(e):YV.from($V.split(e,[])):QV.empty}}class $V extends QV{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.text[o],a=r+i.length;if((t?n:a)>=e)return new tH(r,a,n,i);r=a+1,n++}}decompose(e,t,n,r){let o=e<=0&&t>=this.length?this:new $V(KV(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=XV(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new $V(t,e.length+o.length));else{let e=t.length>>1;n.push(new $V(t.slice(0,e)),new $V(t.slice(e)))}}else n.push(o)}replace(e,t,n){if(!(n instanceof $V))return super.replace(e,t,n);[e,t]=nH(this,e,t);let r=XV(this.text,XV(n.text,KV(this.text,0,e)),t),o=this.length+n.length-(t-e);return r.length<=32?new $V(r,o):YV.from($V.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=nH(this,e,t);let r="";for(let o=0,i=0;o<=t&&i<this.text.length;i++){let a=this.text[i],l=o+a.length;o>e&&i&&(r+=n),e<l&&t>o&&(r+=a.slice(Math.max(0,e-o),t-o)),o=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let o of e)n.push(o),r+=o.length+1,32==n.length&&(t.push(new $V(n,r)),n=[],r=-1);return r>-1&&t.push(new $V(n,r)),t}}class YV extends QV{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.children[o],a=r+i.length,l=n+i.lines-1;if((t?l:a)>=e)return i.lineInner(e,t,n,r);r=a+1,n=l+1}}decompose(e,t,n,r){for(let o=0,i=0;i<=t&&o<this.children.length;o++){let a=this.children[o],l=i+a.length;if(e<=l&&t>=i){let o=r&((i<=e?1:0)|(l>=t?2:0));i>=e&&l<=t&&!o?n.push(a):a.decompose(e-i,t-i,n,o)}i=l+1}}replace(e,t,n){if([e,t]=nH(this,e,t),n.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let i=this.children[r],a=o+i.length;if(e>=o&&t<=a){let l=i.replace(e-o,t-o,n),s=this.lines-i.lines+l.lines;if(l.lines<s>>4&&l.lines>s>>6){let o=this.children.slice();return o[r]=l,new YV(o,this.length-(t-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=nH(this,e,t);let r="";for(let o=0,i=0;o<this.children.length&&i<=t;o++){let a=this.children[o],l=i+a.length;i>e&&o&&(r+=n),e<l&&t>i&&(r+=a.sliceString(e-i,t-i,n)),i=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof YV))return 0;let n=0,[r,o,i,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==i||o==a)return n;let l=this.children[r],s=e.children[o];if(l!=s)return n+l.scanIdentical(s,t);n+=l.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new $V(n,t)}let r=Math.max(32,n>>5),o=r<<1,i=r>>1,a=[],l=0,s=-1,c=[];function u(e){let t;if(e.lines>o&&e instanceof YV)for(let t of e.children)u(t);else e.lines>i&&(l>i||!l)?(d(),a.push(e)):e instanceof $V&&l&&(t=c[c.length-1])instanceof $V&&e.lines+t.lines<=32?(l+=e.lines,s+=e.length+1,c[c.length-1]=new $V(t.text.concat(e.text),t.length+1+e.length)):(l+e.lines>r&&d(),l+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=l&&(a.push(1==c.length?c[0]:YV.from(c,s)),s=-1,l=c.length=0)}for(let t of e)u(t);return d(),1==a.length?a[0]:new YV(a,t)}}function XV(e,t,n=0,r=1e9){for(let o=0,i=0,a=!0;i<e.length&&o<=r;i++){let l=e[i],s=o+l.length;s>=n&&(s>r&&(l=l.slice(0,r-o)),o<n&&(l=l.slice(n-o)),a?(t[t.length-1]+=l,a=!1):t.push(l)),o=s+1}return t}function KV(e,t,n){return XV(e,[""],t,n)}QV.empty=new $V([""],0);class ZV{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof $V?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],o=this.offsets[n],i=o>>1,a=r instanceof $V?r.text.length:r.children.length;if(i==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof $V){let o=r.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=0==e?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[i+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof $V?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class JV{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new ZV(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class eH{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(QV.prototype[Symbol.iterator]=function(){return this.iter()},ZV.prototype[Symbol.iterator]=JV.prototype[Symbol.iterator]=eH.prototype[Symbol.iterator]=function(){return this});class tH{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function nH(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function rH(e,t,n=!0,r=!0){return zV(e,t,n,r)}function oH(e,t){let n=e.charCodeAt(t);if(!((r=n)>=55296&&r<56320&&t+1!=e.length))return n;var r;let o=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(o)?o-56320+(n-55296<<10)+65536:n}function iH(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function aH(e){return e<65536?1:2}const lH=/\r\n?|\n/;var sH=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(sH||(sH={}));class cH{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let o=this.sections[t++],i=this.sections[t++];i<0?(e(n,r,o),r+=o):r+=i,n+=o}}iterChangedRanges(e,t=!1){fH(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new cH(e)}composeDesc(e){return this.empty?e:e.empty?this:mH(this,e)}mapDesc(e,t=!1){return e.empty?this:hH(this,e,t)}mapPos(e,t=-1,n=sH.Simple){let r=0,o=0;for(let i=0;i<this.sections.length;){let a=this.sections[i++],l=this.sections[i++],s=r+a;if(l<0){if(s>e)return o+(e-r);o+=a}else{if(n!=sH.Simple&&s>=e&&(n==sH.TrackDel&&r<e&&s>e||n==sH.TrackBefore&&r<e||n==sH.TrackAfter&&s>e))return null;if(s>e||s==e&&t<0&&!a)return e==r||t<0?o:o+l;o+=l}r=s}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let o=r+this.sections[n++];if(this.sections[n++]>=0&&r<=t&&o>=e)return!(r<e&&o>t)||"cover";r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeDesc");return new cH(e)}static create(e){return new cH(e)}}class uH extends cH{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return fH(this,(t,n,r,o,i)=>e=e.replace(r,r+(n-t),i),!1),e}mapDesc(e,t=!1){return hH(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,o=0;r<t.length;r+=2){let i=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=i;let l=r>>1;for(;n.length<l;)n.push(QV.empty);n.push(i?e.slice(o,o+i):QV.empty)}o+=i}return new uH(t,n)}compose(e){return this.empty?e:e.empty?this:mH(this,e,!0)}map(e,t=!1){return e.empty?this:hH(this,e,t,!0)}iterChanges(e,t=!1){fH(this,e,t)}get desc(){return cH.create(this.sections)}filter(e){let t=[],n=[],r=[],o=new gH(this);e:for(let i=0,a=0;;){let l=i==e.length?1e9:e[i++];for(;a<l||a==l&&0==o.len;){if(o.done)break e;let e=Math.min(o.len,l-a);dH(r,e,-1);let i=-1==o.ins?-1:0==o.off?o.ins:0;dH(t,e,i),i>0&&pH(n,t,o.text),o.forward(e),a+=e}let s=e[i++];for(;a<s;){if(o.done)break e;let e=Math.min(o.len,s-a);dH(t,e,-1),dH(r,e,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(e),a+=e}}return{changes:new uH(t,n),filtered:cH.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],o=[],i=0,a=null;function l(e=!1){if(!e&&!r.length)return;i<t&&dH(r,t-i,-1);let n=new uH(r,o);a=a?a.compose(n.map(a)):n,r=[],o=[],i=0}return function e(s){if(Array.isArray(s))for(let t of s)e(t);else if(s instanceof uH){if(s.length!=t)throw new RangeError(`Mismatched change set length (got ${s.length}, expected ${t})`);l(),a=a?a.compose(s.map(a)):s}else{let{from:e,to:a=e,insert:c}=s;if(e>a||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=c?"string"==typeof c?QV.of(c.split(n||lH)):c:QV.empty,d=u.length;if(e==a&&0==d)return;e<i&&l(),e>i&&dH(r,e-i,-1),dH(r,a-e,d),pH(o,r,u),i=a}}(e),l(!a),a}static empty(e){return new uH(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let o=e[r];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some((e,t)=>t&&"string"!=typeof e))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;n.length<r;)n.push(QV.empty);n[r]=QV.of(o.slice(1)),t.push(o[0],n[r].length)}}}return new uH(t,n)}static createSet(e,t){return new uH(e,t)}}function dH(e,t,n,r=!1){if(0==t&&n<=0)return;let o=e.length-2;o>=0&&n<=0&&n==e[o+1]?e[o]+=t:o>=0&&0==t&&0==e[o]?e[o+1]+=n:r?(e[o]+=t,e[o+1]+=n):e.push(t,n)}function pH(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(QV.empty);e.push(n)}}function fH(e,t,n){let r=e.inserted;for(let o=0,i=0,a=0;a<e.sections.length;){let l=e.sections[a++],s=e.sections[a++];if(s<0)o+=l,i+=l;else{let c=o,u=i,d=QV.empty;for(;c+=l,u+=s,s&&r&&(d=d.append(r[a-2>>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],s=e.sections[a++];t(o,c,i,u,d),o=c,i=u}}}function hH(e,t,n,r=!1){let o=[],i=r?[]:null,a=new gH(e),l=new gH(t);for(let e=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(-1==a.ins&&-1==l.ins){let e=Math.min(a.len,l.len);dH(o,e,-1),a.forward(e),l.forward(e)}else if(l.ins>=0&&(a.ins<0||e==a.i||0==a.off&&(l.len<a.len||l.len==a.len&&!n))){let t=l.len;for(dH(o,l.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(dH(o,0,a.ins),i&&pH(i,o,a.text),e=a.i),a.forward(n),t-=n}l.next()}else{if(!(a.ins>=0)){if(a.done&&l.done)return i?uH.createSet(o,i):cH.create(o);throw new Error("Mismatched change set lengths")}{let t=0,n=a.len;for(;n;)if(-1==l.ins){let e=Math.min(n,l.len);t+=e,n-=e,l.forward(e)}else{if(!(0==l.ins&&l.len<n))break;n-=l.len,l.next()}dH(o,t,e<a.i?a.ins:0),i&&e<a.i&&pH(i,o,a.text),e=a.i,a.forward(a.len-n)}}}}function mH(e,t,n=!1){let r=[],o=n?[]:null,i=new gH(e),a=new gH(t);for(let e=!1;;){if(i.done&&a.done)return o?uH.createSet(r,o):cH.create(r);if(0==i.ins)dH(r,i.len,0,e),i.next();else if(0!=a.len||a.done){if(i.done||a.done)throw new Error("Mismatched change set lengths");{let t=Math.min(i.len2,a.len),n=r.length;if(-1==i.ins){let n=-1==a.ins?-1:a.off?0:a.ins;dH(r,t,n,e),o&&n&&pH(o,r,a.text)}else-1==a.ins?(dH(r,i.off?0:i.len,t,e),o&&pH(o,r,i.textBit(t))):(dH(r,i.off?0:i.len,a.off?0:a.ins,e),o&&!a.off&&pH(o,r,a.text));e=(i.ins>t||a.ins>=0&&a.len>t)&&(e||r.length>n),i.forward2(t),a.forward(t)}}else dH(r,0,a.ins,e),o&&pH(o,r,a.text),a.next()}}class gH{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?QV.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?QV.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vH{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new vH(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return yH.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return yH.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||this.goalColumn!=e.goalColumn||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return yH.range(e.anchor,e.head)}static create(e,t,n){return new vH(e,t,n)}}class yH{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:yH.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new yH([this.main],0)}addRange(e,t=!0){return yH.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,yH.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new yH(e.ranges.map(e=>vH.fromJSON(e)),e.main)}static single(e,t=e){return new yH([yH.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=n:o.from<n)return yH.normalized(e.slice(),t);n=o.to}return new yH(e,t)}static cursor(e,t=0,n,r){return vH.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:16777215)<<6)}static range(e,t,n,r){let o=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return t<e?vH.create(t,e,48|o):vH.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],o=e[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let i=o.from,a=Math.max(r.to,o.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?yH.range(a,i):yH.range(i,a))}}return new yH(e,t)}}function bH(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let wH=0;class EH{constructor(e,t,n,r,o){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=wH++,this.default=e([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(e={}){return new EH(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:kH),!!e.static,e.enables)}of(e){return new OH([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new OH(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new OH(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function kH(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class OH{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=wH++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,o=this.id,i=e[o]>>1,a=2==this.type,l=!1,s=!1,c=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?s=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(l&&t.docChanged||s&&(t.docChanged||t.selection)||xH(e,c)){let t=n(e);if(a?!SH(t,e.values[i],r):!r(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let l,s=t.config.address[o];if(null!=s){let o=jH(t,s);if(this.dependencies.every(n=>n instanceof EH?t.facet(n)===e.facet(n):!(n instanceof DH)||t.field(n,!1)==e.field(n,!1))||(a?SH(l=n(e),o,r):r(l=n(e),o)))return e.values[i]=o,0}else l=n(e);return e.values[i]=l,1}}}}function SH(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function xH(e,t){let n=!1;for(let r of t)1&NH(e,r)&&(n=!0);return n}function _H(e,t,n){let r=n.map(t=>e[t.id]),o=n.map(e=>e.type),i=r.filter(e=>!(1&e)),a=e[t.id]>>1;function l(e){let n=[];for(let t=0;t<r.length;t++){let i=jH(e,r[t]);if(2==o[t])for(let e of i)n.push(e);else n.push(i)}return t.combine(n)}return{create(e){for(let t of r)NH(e,t);return e.values[a]=l(e),1},update(e,n){if(!xH(e,i))return 0;let r=l(e);return t.compare(r,e.values[a])?0:(e.values[a]=r,1)},reconfigure(e,o){let i=xH(e,r),s=o.config.facets[t.id],c=o.facet(t);if(s&&!i&&kH(n,s))return e.values[a]=c,0;let u=l(e);return t.compare(u,c)?(e.values[a]=c,0):(e.values[a]=u,1)}}}const CH=EH.define({static:!0});class DH{constructor(e,t,n,r,o){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let t=new DH(wH++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(CH).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(e.values[t]=o,1)},reconfigure:(e,n)=>{let r,o=e.facet(CH),i=n.facet(CH);return(r=o.find(e=>e.field==this))&&r!=i.find(e=>e.field==this)?(e.values[t]=r.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,CH.of({field:this,create:e})]}get extension(){return this}}function PH(e){return t=>new TH(t,e)}const AH={highest:PH(0),high:PH(1),default:PH(2),low:PH(3),lowest:PH(4)};class TH{constructor(e,t){this.inner=e,this.prec=t}}class FH{of(e){return new MH(this,e)}reconfigure(e){return FH.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class MH{constructor(e,t){this.compartment=e,this.inner=t}}class IH{constructor(e,t,n,r,o,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=o,this.facets=i,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],o=Object.create(null),i=new Map;for(let n of function(e,t,n){let r=[[],[],[],[],[]],o=new Map;return function e(i,a){let l=o.get(i);if(null!=l){if(l<=a)return;let e=r[l].indexOf(i);e>-1&&r[l].splice(e,1),i instanceof MH&&n.delete(i.compartment)}if(o.set(i,a),Array.isArray(i))for(let t of i)e(t,a);else if(i instanceof MH){if(n.has(i.compartment))throw new RangeError("Duplicate use of compartment in extensions");let r=t.get(i.compartment)||i.inner;n.set(i.compartment,r),e(r,a)}else if(i instanceof TH)e(i.inner,i.prec);else if(i instanceof DH)r[a].push(i),i.provides&&e(i.provides,a);else if(i instanceof OH)r[a].push(i),i.facet.extensions&&e(i.facet.extensions,2);else{let t=i.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,a)}}(e,2),r.reduce((e,t)=>e.concat(t))}(e,t,i))n instanceof DH?r.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let a=Object.create(null),l=[],s=[];for(let e of r)a[e.id]=s.length<<1,s.push(t=>e.slot(t));let c=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],r=t[0].facet,i=c&&c[e]||[];if(t.every(e=>0==e.type))if(a[r.id]=l.length<<1|1,kH(i,t))l.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));l.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(a[e.id]=l.length<<1|1,l.push(e.value)):(a[e.id]=s.length<<1,s.push(t=>e.dynamicSlot(t)));a[r.id]=s.length<<1,s.push(e=>_H(e,r,t))}}let u=s.map(e=>e(a));return new IH(e,i,u,a,l,o)}}function NH(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let o=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|o}function jH(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const LH=EH.define(),RH=EH.define({combine:e=>e.some(e=>e),static:!0}),BH=EH.define({combine:e=>e.length?e[0]:void 0,static:!0}),zH=EH.define(),WH=EH.define(),UH=EH.define(),VH=EH.define({combine:e=>!!e.length&&e[0]});class HH{constructor(e,t){this.type=e,this.value=t}static define(){return new GH}}class GH{of(e){return new HH(this,e)}}class qH{constructor(e){this.map=e}of(e){return new QH(this,e)}}class QH{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new QH(this.type,t)}is(e){return this.type==e}static define(e={}){return new qH(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}QH.reconfigure=QH.define(),QH.appendConfig=QH.define();class $H{constructor(e,t,n,r,o,i){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=o,this.scrollIntoView=i,this._doc=null,this._state=null,n&&bH(n,t.newLength),o.some(e=>e.type==$H.time)||(this.annotations=o.concat($H.time.of(Date.now())))}static create(e,t,n,r,o,i){return new $H(e,t,n,r,o,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation($H.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function YH(e,t){let n=[];for(let r=0,o=0;;){let i,a;if(r<e.length&&(o==t.length||t[o]>=e[r]))i=e[r++],a=e[r++];else{if(!(o<t.length))return n;i=t[o++],a=t[o++]}!n.length||n[n.length-1]<i?n.push(i,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function XH(e,t,n){var r;let o,i,a;return n?(o=t.changes,i=uH.empty(t.changes.length),a=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(o)),{changes:a,selection:t.selection?t.selection.map(i):null===(r=e.selection)||void 0===r?void 0:r.map(o),effects:QH.mapEffects(e.effects,o).concat(QH.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function KH(e,t,n){let r=t.selection,o=eG(t.annotations);return t.userEvent&&(o=o.concat($H.userEvent.of(t.userEvent))),{changes:t.changes instanceof uH?t.changes:uH.of(t.changes||[],n,e.facet(BH)),selection:r&&(r instanceof yH?r:yH.single(r.anchor,r.head)),effects:eG(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function ZH(e,t,n){let r=KH(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let o=1;o<t.length;o++){!1===t[o].filter&&(n=!1);let i=!!t[o].sequential;r=XH(r,KH(e,t[o],i?r.changes.newLength:e.doc.length),i)}let o=$H.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(UH),r=e;for(let o=n.length-1;o>=0;o--){let i=n[o](e);i&&Object.keys(i).length&&(r=XH(r,KH(t,i,e.changes.newLength),!0))}return r==e?e:$H.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(zH)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:YH(n,t))}if(!0!==n){let r,o;if(!1===n)o=e.changes.invertedDesc,r=uH.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=$H.create(t,r,e.selection&&e.selection.map(o),QH.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(WH);for(let n=r.length-1;n>=0;n--){let o=r[n](e);e=o instanceof $H?o:Array.isArray(o)&&1==o.length&&o[0]instanceof $H?o[0]:ZH(t,eG(o),!1)}return e}(o):o)}$H.time=HH.define(),$H.userEvent=HH.define(),$H.addToHistory=HH.define(),$H.remote=HH.define();const JH=[];function eG(e){return null==e?JH:Array.isArray(e)?e:[e]}var tG=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(tG||(tG={}));const nG=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let rG;try{rG=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class oG{constructor(e,t,n,r,o,i){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,i&&(i._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)NH(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return NH(this,n),jH(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return ZH(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:o}=n;for(let t of e.effects)t.is(FH.reconfigure)?(n&&(o=new Map,n.compartments.forEach((e,t)=>o.set(t,e)),n=null),o.set(t.value.compartment,t.value.extension)):t.is(QH.reconfigure)?(n=null,r=t.value):t.is(QH.appendConfig)&&(n=null,r=eG(r).concat(t.value));n?t=e.startState.values.slice():(n=IH.resolve(r,o,this),t=new oG(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let i=e.startState.facet(RH)?e.newSelection:e.newSelection.asSingle();new oG(n,e.newDoc,i,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:yH.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),o=[n.range],i=eG(n.effects);for(let n=1;n<t.ranges.length;n++){let a=e(t.ranges[n]),l=this.changes(a.changes),s=l.map(r);for(let e=0;e<n;e++)o[e]=o[e].map(s);let c=r.mapDesc(l,!0);o.push(a.range.map(c)),r=r.compose(s),i=QH.mapEffects(i,s).concat(QH.mapEffects(eG(a.effects),c))}return{changes:r,selection:yH.create(o,t.mainIndex),effects:i}}changes(e=[]){return e instanceof uH?e:uH.of(e,this.doc.length,this.facet(oG.lineSeparator))}toText(e){return QV.of(e.split(this.facet(oG.lineSeparator)||lH))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(NH(this,t),jH(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof DH&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let o=n[t],i=e[t];r.push(o.init(e=>o.spec.fromJSON(i,e)))}return oG.create({doc:e.doc,selection:yH.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=IH.resolve(e.extensions||[],new Map),n=e.doc instanceof QV?e.doc:QV.of((e.doc||"").split(t.staticFacet(oG.lineSeparator)||lH)),r=e.selection?e.selection instanceof yH?e.selection:yH.single(e.selection.anchor,e.selection.head):yH.single(0);return bH(r,n.length),t.staticFacet(RH)||(r=r.asSingle()),new oG(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(oG.tabSize)}get lineBreak(){return this.facet(oG.lineSeparator)||"\n"}get readOnly(){return this.facet(VH)}phrase(e,...t){for(let t of this.facet(oG.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let o of this.facet(LH))for(let i of o(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&r.push(i[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return n=t.length?t[0]:"",e=>{if(!/\S/.test(e))return tG.Space;if(function(e){if(rG)return rG.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||nG.test(n)))return!0}return!1}(e))return tG.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return tG.Word;return tG.Other};var n}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),i=e-n,a=e-n;for(;i>0;){let e=rH(t,i,!1);if(o(t.slice(e,i))!=tG.Word)break;i=e}for(;a<r;){let e=rH(t,a);if(o(t.slice(a,e))!=tG.Word)break;a=e}return i==a?null:yH.range(i+n,a+n)}}function iG(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let o=t[e],i=r[e];if(void 0===i)r[e]=o;else if(i===o||void 0===o);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);r[e]=n[e](i,o)}}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}oG.allowMultipleSelections=RH,oG.tabSize=EH.define({combine:e=>e.length?e[0]:4}),oG.lineSeparator=BH,oG.readOnly=VH,oG.phrases=EH.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),oG.languageData=LH,oG.changeFilter=zH,oG.transactionFilter=WH,oG.transactionExtender=UH,FH.reconfigure=QH.define();class aG{eq(e){return this==e}range(e,t=e){return sG.create(e,t,this)}}function lG(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}aG.prototype.startSide=aG.prototype.endSide=0,aG.prototype.point=!1,aG.prototype.mapMode=sH.TrackDel;class sG{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new sG(e,t,n)}}function cG(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class uG{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let o=n?this.to:this.from;for(let i=r,a=o.length;;){if(i==a)return i;let r=i+a>>1,l=o[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==i)return l>=0?i:a;l>=0?a=r:i=r+1}}between(e,t,n,r){for(let o=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,o);o<i;o++)if(!1===r(this.from[o]+e,this.to[o]+e,this.value[o]))return!1}map(e,t){let n=[],r=[],o=[],i=-1,a=-1;for(let l=0;l<this.value.length;l++){let s,c,u=this.value[l],d=this.from[l]+e,p=this.to[l]+e;if(d==p){let e=t.mapPos(d,u.startSide,u.mapMode);if(null==e)continue;if(s=c=e,u.startSide!=u.endSide&&(c=t.mapPos(d,u.endSide),c<s))continue}else if(s=t.mapPos(d,u.startSide),c=t.mapPos(p,u.endSide),s>c||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(a=Math.max(a,c-s)),n.push(u),r.push(s-i),o.push(c-i))}return{mapped:n.length?new uG(r,o,n,a):null,pos:i}}}class dG{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new dG(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:o=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(cG)),this.isEmpty)return t.length?dG.of(t):this;let a=new hG(this,null,-1).goto(0),l=0,s=[],c=new pG;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let e=t[l++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==a.rangeIndex&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!i||r>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!i||r>a.to||o<a.from||i(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||s.push(sG.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!s.length?dG.empty:this.nextLayer.update({add:s,filter:i,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let i=this.chunkPos[o],a=this.chunk[o],l=e.touchesRange(i,i+a.length);if(!1===l)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(i));else if(!0===l){let{mapped:o,pos:l}=a.map(i,e);o&&(r=Math.max(r,o.maxPoint),t.push(o),n.push(l))}}let o=this.nextLayer.map(e);return 0==t.length?o:new dG(n,t,o||dG.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],i=this.chunk[r];if(t>=o&&e<=o+i.length&&!1===i.between(o,e-o,t-o,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return mG.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return mG.from(e).goto(t)}static compare(e,t,n,r,o=-1){let i=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o),a=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o),l=fG(i,a,n),s=new vG(i,l,o),c=new vG(a,l,o);n.iterGaps((e,t,n)=>yG(s,e,c,t,n,r)),n.empty&&0==n.length&&yG(s,0,c,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=999999999);let o=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),i=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(o.length!=i.length)return!1;if(!o.length)return!0;let a=fG(o,i),l=new vG(o,a,0).goto(n),s=new vG(i,a,0).goto(n);for(;;){if(l.to!=s.to||!bG(l.active,s.active)||l.point&&(!s.point||!lG(l.point,s.point)))return!1;if(l.to>r)return!0;l.next(),s.next()}}static spans(e,t,n,r,o=-1){let i=new vG(e,null,o).goto(t),a=t,l=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),o=i.pointFrom<t?n.length+1:i.point.startSide<0?n.length:Math.min(n.length,l);r.point(a,e,i.point,n,o,i.pointRank),l=Math.min(i.openEnd(e),n.length)}else e>a&&(r.span(a,e,i.active,l),l=i.openEnd(e));if(i.to>n)return l+(i.point&&i.to>n?1:0);a=i.to,i.next()}}static of(e,t=!1){let n=new pG;for(let r of e instanceof sG?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(cG(t,r)>0)return e.slice().sort(cG);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return dG.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=dG.empty;r=r.nextLayer)t=new dG(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}dG.empty=new dG([],[],null,-1),dG.empty.nextLayer=dG.empty;class pG{finishChunk(e){this.chunks.push(new uG(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new pG)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(dG.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=dG.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function fG(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let o=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let i=r.get(e.chunk[t]);null==i||(n?n.mapPos(i):i)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(i,i+e.chunk[t].length))||o.add(e.chunk[t])}return o}class hG{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class mG{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let o=0;o<e.length;o++)for(let i=e[o];!i.isEmpty;i=i.nextLayer)i.maxPoint>=n&&r.push(new hG(i,t,n,o));return 1==r.length?r[0]:new mG(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)gG(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)gG(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),gG(this.heap,0)}}}function gG(e,t){for(let n=e[t];;){let r=1+(t<<1);if(r>=e.length)break;let o=e[r];if(r+1<e.length&&o.compare(e[r+1])>=0&&(o=e[r+1],r++),n.compare(o)<0)break;e[r]=n,e[t]=o,t=r}}class vG{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=mG.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){wG(this.active,e),wG(this.activeTo,e),wG(this.activeRank,e),this.minActive=kG(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||r-this.activeTo[t])>0;)t++;EG(this.active,t,n),EG(this.activeTo,t,r),EG(this.activeRank,t,o),e&&EG(e,t,this.cursor.from),this.minActive=kG(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&wG(n,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function yG(e,t,n,r,o,i){e.goto(t),n.goto(r);let a=r+o,l=r,s=r-t,c=!!i.boundChange;for(let t=!1;;){let r=e.to+s-n.to,o=r||e.endSide-n.endSide,u=o<0?e.to+s:n.to,d=Math.min(u,a);if(e.point||n.point?(e.point&&n.point&&lG(e.point,n.point)&&bG(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(l,d,e.point,n.point),t=!1):(t&&i.boundChange(l),d>l&&!bG(e.active,n.active)&&i.compareRange(l,d,e.active,n.active),c&&d<a&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>a)break;l=u,o<=0&&e.next(),o>=0&&n.next()}}function bG(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!lG(e[n],t[n]))return!1;return!0}function wG(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function EG(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function kG(e,t){let n=-1,r=1e9;for(let o=0;o<t.length;o++)(t[o]-r||e[o].endSide-e[n].endSide)<0&&(n=o,r=t[o]);return n}function OG(e,t,n=e.length){let r=0;for(let o=0;o<n&&o<e.length;)9==e.charCodeAt(o)?(r+=t-r%t,o++):(r++,o=rH(e,o));return r}function SG(e,t,n,r){for(let r=0,o=0;;){if(o>=t)return r;if(r==e.length)break;o+=9==e.charCodeAt(r)?n-o%n:1,r=rH(e,r)}return!0===r?-1:e.length}const xG="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),_G="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),CG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class DG{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function o(e,t,i,a){let l=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let a=t[n];if(/&/.test(n))o(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),a,i);else if(a&&"object"==typeof a){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");o(r(n),a,l,c)}else null!=a&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+a+";")}(l.length||c)&&i.push((!n||s||a?e:e.map(n)).join(", ")+" {"+l.join(" ")+"}")}for(let t in e)o(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=CG[xG]||1;return CG[xG]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[_G],o=n&&n.nonce;r?o&&r.setNonce(o):r=new AG(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let PG=new Map;class AG{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=PG.get(n);if(t)return e[_G]=t;this.sheet=new r.CSSStyleSheet,PG.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[_G]=this}mount(e,t){let n=this.sheet,r=0,o=0;for(let t=0;t<e.length;t++){let i=e[t],a=this.modules.indexOf(i);if(a<o&&a>-1&&(this.modules.splice(a,1),o--,a=-1),-1==a){if(this.modules.splice(o++,0,i),n)for(let e=0;e<i.rules.length;e++)n.insertRule(i.rules[e],r++)}else{for(;o<a;)r+=this.modules[o++].rules.length;r+=i.rules.length,o++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var TG={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},FG={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},MG="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),IG="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),NG=0;NG<10;NG++)TG[48+NG]=TG[96+NG]=String(NG);for(NG=1;NG<=24;NG++)TG[NG+111]="F"+NG;for(NG=65;NG<=90;NG++)TG[NG]=String.fromCharCode(NG+32),FG[NG]=String.fromCharCode(NG);for(var jG in TG)FG.hasOwnProperty(jG)||(FG[jG]=TG[jG]);function LG(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];"string"==typeof o?e.setAttribute(r,o):null!=o&&(e[r]=o)}t++}for(;t<arguments.length;t++)RG(e,arguments[t]);return e}function RG(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)RG(e,t[n])}}let BG="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},zG="undefined"!=typeof document?document:{documentElement:{style:{}}};const WG=/Edge\/(\d+)/.exec(BG.userAgent),UG=/MSIE \d/.test(BG.userAgent),VG=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(BG.userAgent),HG=!!(UG||VG||WG),GG=!HG&&/gecko\/(\d+)/i.test(BG.userAgent),qG=!HG&&/Chrome\/(\d+)/.exec(BG.userAgent),QG="webkitFontSmoothing"in zG.documentElement.style,$G=!HG&&/Apple Computer/.test(BG.vendor),YG=$G&&(/Mobile\/\w+/.test(BG.userAgent)||BG.maxTouchPoints>2);var XG={mac:YG||/Mac/.test(BG.platform),windows:/Win/.test(BG.platform),linux:/Linux|X11/.test(BG.platform),ie:HG,ie_version:UG?zG.documentMode||6:VG?+VG[1]:WG?+WG[1]:0,gecko:GG,gecko_version:GG?+(/Firefox\/(\d+)/.exec(BG.userAgent)||[0,0])[1]:0,chrome:!!qG,chrome_version:qG?+qG[1]:0,ios:YG,android:/Android\b/.test(BG.userAgent),webkit:QG,webkit_version:QG?+(/\bAppleWebKit\/(\d+)/.exec(BG.userAgent)||[0,0])[1]:0,safari:$G,safari_version:$G?+(/\bVersion\/(\d+(\.\d+)?)/.exec(BG.userAgent)||[0,0])[1]:0,tabSize:null!=zG.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function KG(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const ZG=Object.create(null);function JG(e,t,n){if(e==t)return!0;e||(e=ZG),t||(t=ZG);let r=Object.keys(e),o=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(-1==o.indexOf(i)||e[i]!==t[i]))return!1;return!0}function eq(e,t,n){let r=!1;if(t)for(let o in t)n&&o in n||(r=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(n)for(let o in n)t&&t[o]==n[o]||(r=!0,"style"==o?e.style.cssText=n[o]:e.setAttribute(o,n[o]));return r}function tq(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class nq{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var rq=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(rq||(rq={}));class oq extends aG{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new iq(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new lq(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:o,end:i}=sq(e,r);t=(o?r?-3e8:-1:5e8)-1,n=1+(i?r?2e8:1:-6e8)}return new lq(e,t,n,r,e.widget||null,!0)}static line(e){return new aq(e)}static set(e,t=!1){return dG.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}oq.none=dG.empty;class iq extends oq{constructor(e){let{start:t,end:n}=sq(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?KG(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ZG}eq(e){return this==e||e instanceof iq&&this.tagName==e.tagName&&JG(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}iq.prototype.point=!1;class aq extends oq{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof aq&&this.spec.class==e.spec.class&&JG(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}aq.prototype.mapMode=sH.TrackBefore,aq.prototype.point=!0;class lq extends oq{constructor(e,t,n,r,o,i){super(t,n,o,e),this.block=r,this.isReplace=i,this.mapMode=r?t<=0?sH.TrackBefore:sH.TrackAfter:sH.TrackDel}get type(){return this.startSide!=this.endSide?rq.WidgetRange:this.startSide<=0?rq.WidgetBefore:rq.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof lq&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function sq(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function cq(e,t,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=e?n[o]=Math.max(n[o],t):n.push(e,t)}lq.prototype.point=!0;class uq extends aG{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof uq&&this.tagName==e.tagName&&JG(this.attributes,e.attributes)}static create(e){return new uq(e.tagName,e.attributes||ZG)}static set(e,t=!1){return dG.of(e,t)}}function dq(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function pq(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function fq(e,t){if(!t.anchorNode)return!1;try{return pq(e,t.anchorNode)}catch(e){return!1}}function hq(e){return 3==e.nodeType?Cq(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function mq(e,t,n,r){return!!n&&(yq(e,t,n,r,-1)||yq(e,t,n,r,1))}function gq(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function vq(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function yq(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:bq(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=gq(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?bq(e):0}}}function bq(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function wq(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Eq(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function kq(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}uq.prototype.startSide=uq.prototype.endSide=-1;class Oq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?bq(t):0),n,Math.min(e.focusOffset,n?bq(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Sq,xq=null;function _q(e){if(e.setActive)return e.setActive();if(xq)return e.focus(xq);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==xq?{get preventScroll(){return xq={preventScroll:!0},!0}}:void 0),!xq){xq=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],o=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=o&&(n.scrollLeft=o)}}}function Cq(e,t,n=t){let r=Sq||(Sq=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Dq(e,t,n,r){let o={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let i=new KeyboardEvent("keydown",o);i.synthetic=!0,e.dispatchEvent(i);let a=new KeyboardEvent("keyup",o);return a.synthetic=!0,e.dispatchEvent(a),i.defaultPrevented||a.defaultPrevented}function Pq(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Aq(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r>0)return{node:n,offset:r};if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;n=n.childNodes[r-1],r=bq(n)}else{if(!n.parentNode||vq(n))return null;r=gq(n),n=n.parentNode}}}function Tq(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||vq(n))return null;r=gq(n)+1,n=n.parentNode}}}XG.safari&&XG.safari_version>=26&&(xq=!1);class Fq{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Fq(e.parentNode,gq(e),t)}static after(e,t){return new Fq(e.parentNode,gq(e)+1,t)}}var Mq=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Mq||(Mq={}));const Iq=Mq.LTR,Nq=Mq.RTL;function jq(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const Lq=jq("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Rq=jq("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Bq=Object.create(null),zq=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Bq[t]=n,Bq[n]=-t}function Wq(e){return e<=247?Lq[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Rq[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const Uq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vq{get dir(){return this.level%2?Nq:Iq}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let o=-1;for(let i=0;i<e.length;i++){let a=e[i];if(a.from<=t&&a.to>=t){if(a.level==n)return i;(o<0||(0!=r?r<0?a.from<t:a.to>t:e[o].level>a.level))&&(o=i)}}if(o<0)throw new RangeError("Index out of range");return o}}function Hq(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!Hq(r.inner,o.inner))return!1}return!0}const Gq=[];function qq(e,t,n,r,o,i,a){let l=r%2?2:1;if(r%2==o%2)for(let s=t,c=0;s<n;){let t=!0,u=!1;if(c==i.length||s<i[c].from){let e=Gq[s];e!=l&&(t=!1,u=16==e)}let d=t||1!=l?null:[],p=t?r:r+1,f=s;e:for(;;)if(c<i.length&&f==i[c].from){if(u)break e;let h=i[c];if(!t)for(let e=h.to,t=c+1;;){if(e==n)break e;if(!(t<i.length&&i[t].from==e)){if(Gq[e]==l)break e;break}e=i[t++].to}c++,d?d.push(h):(h.from>s&&a.push(new Vq(s,h.from,p)),Qq(e,h.direction==Iq!=!(p%2)?r+1:r,o,h.inner,h.from,h.to,a),s=h.to),f=h.to}else{if(f==n||(t?Gq[f]!=l:Gq[f]==l))break;f++}d?qq(e,s,f,r+1,o,d,a):s<f&&a.push(new Vq(s,f,p)),s=f}else for(let s=n,c=i.length;s>t;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=Gq[s-1];e!=l&&(n=!1,u=16==e)}let d=n||1!=l?null:[],p=n?r:r+1,f=s;e:for(;;)if(c&&f==i[c-1].to){if(u)break e;let h=i[--c];if(!n)for(let e=h.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(Gq[e-1]==l)break e;break}e=i[--n].from}d?d.push(h):(h.to<s&&a.push(new Vq(h.to,s,p)),Qq(e,h.direction==Iq!=!(p%2)?r+1:r,o,h.inner,h.from,h.to,a),s=h.from),f=h.from}else{if(f==t||(n?Gq[f-1]!=l:Gq[f-1]==l))break;f--}d?qq(e,f,s,r+1,o,d,a):f<s&&a.push(new Vq(f,s,p)),s=f}}function Qq(e,t,n,r,o,i,a){let l=t%2?2:1;!function(e,t,n,r,o){for(let i=0;i<=r.length;i++){let a=i?r[i-1].to:t,l=i<r.length?r[i].from:n,s=i?256:o;for(let t=a,n=s,r=s;t<l;t++){let o=Wq(e.charCodeAt(t));512==o?o=n:8==o&&4==r&&(o=16),Gq[t]=4==o?2:o,7&o&&(r=o),n=o}for(let e=a,t=s,r=s;e<l;e++){let o=Gq[e];if(128==o)e<l-1&&t==Gq[e+1]&&24&t?o=Gq[e]=t:Gq[e]=256;else if(64==o){let o=e+1;for(;o<l&&64==Gq[o];)o++;let i=e&&8==t||o<n&&8==Gq[o]?1==r?1:8:256;for(let t=e;t<o;t++)Gq[t]=i;e=o-1}else 8==o&&1==r&&(Gq[e]=1);t=o,7&o&&(r=o)}}}(e,o,i,r,l),function(e,t,n,r,o){let i=1==o?2:1;for(let a=0,l=0,s=0;a<=r.length;a++){let c=a?r[a-1].to:t,u=a<r.length?r[a].from:n;for(let t,n,r,a=c;a<u;a++)if(n=Bq[t=e.charCodeAt(a)])if(n<0){for(let e=l-3;e>=0;e-=3)if(zq[e+1]==-n){let t=zq[e+2],n=2&t?o:4&t?1&t?i:o:0;n&&(Gq[a]=Gq[zq[e]]=n),l=e;break}}else{if(189==zq.length)break;zq[l++]=a,zq[l++]=t,zq[l++]=s}else if(2==(r=Gq[a])||1==r){let e=r==o;s=e?0:1;for(let t=l-3;t>=0;t-=3){let n=zq[t+2];if(2&n)break;if(e)zq[t+2]|=2;else{if(4&n)break;zq[t+2]|=4}}}}}(e,o,i,r,l),function(e,t,n,r){for(let o=0,i=r;o<=n.length;o++){let a=o?n[o-1].to:e,l=o<n.length?n[o].from:t;for(let s=a;s<l;){let a=Gq[s];if(256==a){let a=s+1;for(;;)if(a==l){if(o==n.length)break;a=n[o++].to,l=o<n.length?n[o].from:t}else{if(256!=Gq[a])break;a++}let c=1==i,u=c==(1==(a<t?Gq[a]:r))?c?1:2:r;for(let t=a,r=o,i=r?n[r-1].to:e;t>s;)t==i&&(t=n[--r].from,i=r?n[r-1].to:e),Gq[--t]=u;s=a}else i=a,s++}}}(o,i,r,l),qq(e,o,i,t,n,r,a)}function $q(e){return[new Vq(0,e,0)]}let Yq="";function Xq(e,t,n,r,o){var i;let a=r.head-e.from,l=Vq.find(t,a,null!==(i=r.bidiLevel)&&void 0!==i?i:-1,r.assoc),s=t[l],c=s.side(o,n);if(a==c){let e=l+=o?1:-1;if(e<0||e>=t.length)return null;s=t[l=e],a=s.side(!o,n),c=s.side(o,n)}let u=rH(e.text,a,s.forward(o,n));(u<s.from||u>s.to)&&(u=c),Yq=e.text.slice(Math.min(a,u),Math.max(a,u));let d=l==(o?t.length-1:0)?null:t[l+(o?1:-1)];return d&&u==c&&d.level+(o?0:1)<s.level?yH.cursor(d.side(!o,n)+e.from,d.forward(o,n)?1:-1,d.level):yH.cursor(u+e.from,s.forward(o,n)?-1:1,s.level)}function Kq(e,t,n){for(let r=t;r<n;r++){let t=Wq(e.charCodeAt(r));if(1==t)return Iq;if(2==t||4==t)return Nq}return Iq}const Zq=EH.define(),Jq=EH.define(),eQ=EH.define(),tQ=EH.define(),nQ=EH.define(),rQ=EH.define(),oQ=EH.define(),iQ=EH.define(),aQ=EH.define(),lQ=EH.define({combine:e=>e.some(e=>e)}),sQ=EH.define({combine:e=>e.some(e=>e)}),cQ=EH.define();class uQ{constructor(e,t="nearest",n="nearest",r=5,o=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=o,this.isSnapshot=i}map(e){return e.empty?this:new uQ(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new uQ(yH.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dQ=QH.define({map:(e,t)=>e.map(t)}),pQ=QH.define();function fQ(e,t,n){let r=e.facet(tQ);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const hQ=EH.define({combine:e=>!e.length||e[0]});let mQ=0;const gQ=EH.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class vQ{constructor(e,t,n,r,o){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(gQ.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(gQ.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:o,decorations:i}=t||{};return new vQ(mQ++,e,n,r,e=>{let t=[];return i&&t.push(EQ.of(t=>{let n=t.plugin(e);return n?i(n):oq.none})),o&&t.push(o(e)),t})}static fromClass(e,t){return vQ.define((t,n)=>new e(t,n),t)}}class yQ{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(fQ(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){fQ(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){fQ(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const bQ=EH.define(),wQ=EH.define(),EQ=EH.define(),kQ=EH.define(),OQ=EH.define(),SQ=EH.define(),xQ=EH.define();function _Q(e,t){let n=e.state.facet(xQ);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),o=[];return dG.spans(r,t.from,t.to,{point(){},span(e,n,r,i){let a=e-t.from,l=n-t.from,s=o;for(let e=r.length-1;e>=0;e--,i--){let n,o=r[e].spec.bidiIsolate;if(null==o&&(o=Kq(t.text,a,l)),i>0&&s.length&&(n=s[s.length-1]).to==a&&n.direction==o)n.to=l,s=n.inner;else{let e={from:a,to:l,direction:o,inner:[]};s.push(e),s=e.inner}}}}),o}const CQ=EH.define();function DQ(e){let t=0,n=0,r=0,o=0;for(let i of e.state.facet(CQ)){let a=i(e);a&&(null!=a.left&&(t=Math.max(t,a.left)),null!=a.right&&(n=Math.max(n,a.right)),null!=a.top&&(r=Math.max(r,a.top)),null!=a.bottom&&(o=Math.max(o,a.bottom)))}return{left:t,right:n,top:r,bottom:o}}const PQ=EH.define();class AQ{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new AQ(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,o=0,i=0;;){let a=r<e.length?e[r].fromB:1e9,l=o<t.length?t[o]:1e9,s=Math.min(a,l);if(1e9==s)break;let c=s+i,u=s,d=c;for(;;)if(o<t.length&&t[o]<=u){let n=t[o+1];o+=2,u=Math.max(u,n);for(let t=r;t<e.length&&e[t].fromB<=u;t++)i=e[t].toA-e[t].toB;d=Math.max(d,n+i)}else{if(!(r<e.length&&e[r].fromB<=u))break;{let t=e[r++];u=Math.max(u,t.toB),d=Math.max(d,t.toA),i=t.toA-t.toB}}n.push(new AQ(c,d,s,u))}return n}}class TQ{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=uH.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,o)=>r.push(new AQ(e,t,n,o))),this.changedRanges=r}static create(e,t,n){return new TQ(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}const FQ=[];class MQ{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return FQ}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=gq(this.dom),r=this.length?e>0:t>0;return new Fq(this.parent.dom,n+(r?1:0),0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof jQ)return e;return null}static get(e){return e.cmTile}}class IQ extends MQ{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t,n=this.dom,r=null,o=(null==e?void 0:e.node)==n?e:null,i=0;for(let a of this.children){if(a.sync(e),i+=a.length+a.breakAfter,t=r?r.nextSibling:n.firstChild,o&&t!=a.dom&&(o.written=!0),a.dom.parentNode==n)for(;t&&t!=a.dom;)t=NQ(t);else n.insertBefore(a.dom,t);r=a.dom}for(t=r?r.nextSibling:n.firstChild,o&&t&&(o.written=!0);t;)t=NQ(t);this.length=i}}function NQ(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class jQ extends IQ{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=MQ.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,o=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&o++,r=t.pop()}else{let i=n.children[r++];if(i instanceof LQ)t.push(r),n=i,r=0;else{let t=o+i.length,n=e(i,o);if(void 0!==n)return n;o=t+i.breakAfter}}}resolveBlock(e,t){let n,r,o=-1,i=-1;if(this.blockTiles((a,l)=>{let s=l+a.length;if(e>=l&&e<=s){if(a.isWidget()&&t>=-1&&t<=1){if(32&a.flags)return!0;16&a.flags&&(n=void 0)}(l<e||e==s&&(t<-1?a.length:a.covers(1)))&&(!n||!a.isWidget()&&n.isWidget())&&(n=a,o=e-l),(s>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l)}}),!n&&!r)throw new Error("No tile at position "+e);return n&&t<0||!r?{tile:n,offset:o}:{tile:r,offset:i}}}class LQ extends IQ{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new LQ(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class RQ extends IQ{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new RQ(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,o=-1,i=null,a=-1;!function e(l,s){for(let c=0,u=0;c<l.children.length&&u<=s;c++){let d=l.children[c],p=u+d.length;p>=s&&(d.isComposite()?e(d,s-u):(!i||i.isHidden&&(t>0||n&&BQ(i,d)))&&(p>s||32&d.flags)?(i=d,a=s-u):(u<s||16&d.flags&&!d.isHidden)&&(r=d,o=s-u)),u=p}}(this,e);let l=(t<0?r:i)||r||i;return l?{tile:l,offset:l==r?o:a}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=hq(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new Fq(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,16&e.flags?1:32&e.flags?-1:t);let o=n.tile.parent,i=!1;for(let e of o.children){if(i)return new Fq(e.dom,0);e==n.tile&&(i=!0)}}return new Fq(this.dom,0)}}function BQ(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class zQ extends IQ{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new zQ(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class WQ extends MQ{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,o=e,i=0;0==e&&t<0||e==n&&t>=0?XG.chrome||XG.gecko||(e?(r--,i=1):o<n&&(o++,i=-1)):t<0?r--:o<n&&o++;let a=Cq(this.dom,r,o).getClientRects();if(!a.length)return null;let l=a[(i?i<0:t>=0)?0:a.length-1];return XG.safari&&!i&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),i?wq(l,i<0):l||null}static of(e,t){let n=new WQ(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class UQ extends MQ{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return wq(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let o=r?t.length-1:0;n=t[o],!(e>0?0==o:o==t.length-1||n.top<n.bottom);o+=r?-1:1);return wq(n,!r)}}get overrideDOMText(){if(!this.length)return QV.empty;let{root:e}=this;if(!e)return QV.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,o){return o||(o=e.toDOM(t),e.editable||(o.contentEditable="false")),new UQ(o,n,e,r)}}class VQ extends MQ{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return QV.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class HQ{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:o,beforeBreak:i,parents:a}=this;for(;e||t>0;)if(r.isComposite())if(i){if(!e)break;n&&n.break(),e--,i=!1}else if(o==r.children.length){if(!e&&!a.length)break;n&&n.leave(r),i=!!r.breakAfter,({tile:r,index:o}=a.pop()),o++}else{let l=r.children[o],s=l.breakAfter;!(t>0?l.length<=e:l.length<e)||n&&!1===n.skip(l,0,l.length)&&l.isComposite?(a.push({tile:r,index:o}),r=l,o=0,n&&l.isComposite()&&n.enter(l)):(i=!!s,o++,e-=l.length)}else if(o==r.length)i=!!r.breakAfter,({tile:r,index:o}=a.pop()),o++;else{if(!e)break;{let t=Math.min(e,r.length-o);n&&n.skip(r,o,o+t),e-=t,o+=t}}return this.tile=r,this.index=o,this.beforeBreak=i,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class GQ{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class qQ{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var o;this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;a&&a.isText()&&!(8&a.flags)&&a.length+e.length<512?(this.cache.reused.set(a,2),(i.children[i.children.length-1]=new WQ(a.dom,a.text+e)).parent=i):i.append(r||WQ.of(e,null===(o=this.cache.find(WQ))||void 0===o?void 0:o.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?JQ(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],o=r.lastChild;if(o instanceof zQ&&o.mark.eq(n.mark))o.dom!=n.dom&&o.setDOM(JQ(n.dom)),r=o;else{if(this.cache.reused.get(n)){let e=MQ.get(n.dom);e&&e.setDOM(JQ(n.dom))}let e=zQ.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let o=MQ.get(e.text);o&&this.cache.reused.set(o,2);let i=new WQ(e.text,e.text.nodeValue);i.flags|=8,r.append(i)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let o=this.ensureMarks(t,n);r||16&e.flags||o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){(this.afterWidget||this.lastBlock).length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=ZQ);let r=RQ.start(e,t||(null===(n=this.cache.find(RQ))||void 0===n?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let i,a=e[o];if(t>0&&(i=r.lastChild)&&i instanceof zQ&&i.mark.eq(a))r=i,t--;else{let e=zQ.of(a,null===(n=this.cache.find(zQ,e=>e.mark.eq(a)))||void 0===n?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;e&&KQ(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||XG.ios&&KQ(this.curLine,!0))||this.curLine.append(this.cache.findWidget(t$,0,32)||new UQ(t$.toDOM(),0,t$,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new GQ(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof LQ&&r.wrapper.eq(n.wrapper))t=r;else{let r=LQ.of(n.wrapper,null===(e=this.cache.find(LQ,e=>e.wrapper.eq(n.wrapper)))||void 0===e?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(VQ,void 0,1);return n&&(n.flags=t),n||new VQ(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class QQ{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw new Error("Ran out of text content when drawing inline views");this.text=t;let o=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}const $Q=[UQ,RQ,WQ,zQ,VQ,LQ,jQ];for(let e=0;e<$Q.length;e++)$Q[e].bucket=e;class YQ{constructor(e){this.view=e,this.buckets=$Q.map(()=>[]),this.index=$Q.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,o=this.buckets[r],i=this.index[r];for(let e=o.length-1;e>=0;e--){let a=(e+i)%o.length,l=o[a];if((!t||t(l))&&!this.reused.has(l))return o.splice(a,1),a<i&&this.index[r]--,this.reused.set(l,n),l}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let o=0,i=0;;o++){if(o==r.length){if(i)return null;i=1,o=0}let a=r[o];if(!this.reused.has(a)&&(0==i?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(497&a.flags)==n?(this.reused.set(a,1),a):(this.reused.set(a,2),new UQ(a.dom,t,e,-498&a.flags|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class XQ{constructor(e,t,n,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new YQ(e),this.text=new QQ(e.state.doc),this.builder=new qQ(this.cache,new jQ(e,e.contentDOM),dG.iter(n)),this.cache.reused.set(t,2),this.old=new HQ(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,o=0,i=0;;){let a=i<e.length?e[i++]:null,l=a?a.fromA:this.old.root.length;if(l>r){let e=l-r;this.preserve(e,!i,!a),r=l,o+=e}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(o,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(o,a.toB)),o=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof zQ&&t.push(r.mark)}return t}(this.old),o=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let i=n>0||t<e.length?UQ.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&i.flags?(i.flags&=-2,this.builder.addBlockWidget(i)):(this.builder.ensureLine(null),this.builder.addInlineWidget(i,r,o),o=r.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,o)):this.builder.addText(e.text,r,o,this.cache.reuse(e)),o=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof VQ)this.cache.add(e);else{if(!(e instanceof zQ))return!1;this.builder.ensureLine(null),this.builder.addMark(e,r,o),this.cache.reused.set(e,1),o=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof zQ&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=o=0):e instanceof zQ&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,o=0,i=dG.spans(this.decorations,e,t,{point:(e,t,i,a,l,s)=>{if(i instanceof lq){if(this.disallowBlockEffectsFor[s]){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=a.length,l>a.length)r.continueWidget(t-e);else{let o=i.widget||(i.block?e$.block:e$.inline),s=function(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}(i),c=this.cache.findWidget(o,t-e,s)||UQ.of(o,this.view,t-e,s);i.block?(i.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(c)):(r.ensureLine(n),r.addInlineWidget(c,a,l))}n=null}else n=function(e,t){let n=t.spec.attributes,r=t.spec.class;return n||r?(e||(e={class:"cm-line"}),n&&KG(n,e),r&&(e.class+=" "+r),e):e}(n,i);t>e&&this.text.skip(t-e)},span:(e,t,o,i)=>{for(let a=e;a<t;){let l=this.text.next(Math.min(512,t-a));null==l?(r.addLineStartIfNotCovered(n),r.addBreak(),a++):(r.ensureLine(n),r.addText(l,o,a==e?i:o.length),a+=l.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=i>o,this.openMarks=i}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=MQ.get(r);if(r==this.view.contentDOM)break;e instanceof zQ?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof LQ||("DIV"!=r.nodeName||n||r==this.view.contentDOM?n||t.push(zQ.of(new iq({tagName:r.nodeName.toLowerCase(),attributes:tq(r)}),r)):n=new RQ(r,ZQ))}return{line:n,marks:t}}}function KQ(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}const ZQ={class:"cm-line"};function JQ(e){let t=MQ.get(e);return t&&t.setDOM(e.cloneNode()),e}class e$ extends nq{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}e$.inline=new e$("span"),e$.block=new e$("div");const t$=new class extends nq{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class n${constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=oq.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new jQ(e,e.contentDOM),this.updateInner([new AQ(0,0,0,e.state.doc.length)],null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?r=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}(e.changes,this.hasComposition)||e.selectionSet||(r=e.state.selection.main.head));let o=r>-1?function(e,t,n){let r=o$(e,n);if(!r)return null;let{node:o,from:i,to:a}=r,l=o.nodeValue;if(/[\n\r]/.test(l))return null;if(e.state.doc.sliceString(r.from,r.to)!=l)return null;let s=t.invertedDesc;return{range:new AQ(s.mapPos(i),s.mapPos(a),i,a),text:o}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:r}=this.hasComposition;n=new AQ(t,r,e.changes.mapPos(t,-1),e.changes.mapPos(r,1)).addToSet(n.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(XG.ie||XG.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let l=function(e,t,n){let r=new i$;return dG.compare(e,t,n,r),r.changes}(i,this.decorations,e.changes);l.length&&(n=AQ.extendWithRanges(n,l));let s=function(e,t,n){let r=new a$;return dG.compare(e,t,n,r),r.changes}(a,this.blockWrappers,e.changes);return s.length&&(n=AQ.extendWithRanges(n,s)),o&&!n.some(e=>e.fromA<=o.range.fromA&&e.toA>=o.range.toA)&&(n=o.range.addToSet(n.slice())),!(2&this.tile.flags&&0==n.length||(this.updateInner(n,o),e.transactions.length&&(this.lastUpdate=Date.now()),0))}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new XQ(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),r$(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=XG.chrome||XG.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),!r||!r.written&&n.selectionRange.focusNode==r.node&&this.tile.dom.contains(r.node)||(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof l$&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(pQ)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,o=r==n,i=!o&&!(this.view.state.facet(hQ)||n.tabIndex>-1)&&fq(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(o||t||i))return;let a=this.forceSelection;this.forceSelection=!1;let l,s,c=this.view.state.selection.main;if(c.empty?s=l=this.inlineDOMNearPos(c.anchor,c.assoc||1):(s=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),l=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),XG.gecko&&c.empty&&!this.hasComposition&&1==(u=l).node.nodeType&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(e,l.node.childNodes[l.offset]||null)),l=s=new Fq(e,0),a=!0}var u;let d=this.view.observer.selectionRange;!a&&d.focusNode&&(mq(l.node,l.offset,d.anchorNode,d.anchorOffset)&&mq(s.node,s.offset,d.focusNode,d.focusOffset)||this.suppressWidgetCursorChange(d,c))||(this.view.observer.ignore(()=>{XG.android&&XG.chrome&&n.contains(d.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=dq(this.view.root);if(e)if(c.empty){if(XG.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}(l.node,l.offset);if(e&&3!=e){let t=(1==e?Aq:Tq)(l.node,l.offset);t&&(l=new Fq(t.node,t.offset))}}e.collapse(l.node,l.offset),null!=c.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=c.bidiLevel)}else if(e.extend){e.collapse(l.node,l.offset);try{e.extend(s.node,s.offset)}catch(e){}}else{let t=document.createRange();c.anchor>c.head&&([l,s]=[s,l]),t.setEnd(s.node,s.offset),t.setStart(l.node,l.offset),e.removeAllRanges(),e.addRange(t)}i&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,s)),this.impreciseAnchor=l.precise?null:new Fq(d.anchorNode,d.anchorOffset),this.impreciseHead=s.precise?null:new Fq(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&mq(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=dq(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=this.lineAt(t.head,t.assoc);if(!i)return;let a=i.posAtStart;if(t.head==a||t.head==a+i.length)return;let l=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!l||!s||l.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,o)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(!n.isComposite())return n.isText()?e==n.dom?r+t:r+(t?n.length:0):r;{let o;if(e==n.dom)o=n.dom.childNodes[t];else{let r=0==bq(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}o=r<0?e:e.nextSibling}if(o==n.dom.firstChild)return r;for(;o&&!MQ.get(o);)o=o.nextSibling;if(!o)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==o)return t;t+=r.length+r.breakAfter}}}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r,o=-1,i=!1,a=-1,l=!1;return this.tile.blockTiles((t,s)=>{if(t.isWidget()){if(32&t.flags&&s>=e)return!0;16&t.flags&&(i=!0)}else{let c=s+t.length;if(s<=e&&(n=t,o=e-s,i=c<e),c>=e&&!r&&(r=t,a=e-s,l=s>e),s>e&&r)return!0}}),n||r?(i&&r?n=null:l&&n&&(r=null),n&&t<0||!r?n.domIn(o,t):r.domIn(a,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof l$?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=rH(t.text,n);if(e==n)return null;let r=Cq(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,o=this.view.contentDOM.clientWidth,i=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Mq.LTR,s=0,c=(e,u,d)=>{for(let p=0;p<e.children.length&&!(u>r);p++){let r=e.children[p],f=u+r.length,h=r.dom.getBoundingClientRect(),{height:m}=h;if(d&&!p&&(s+=h.top-d.top),r instanceof LQ)f>n&&c(r,u,h);else if(u>=n&&(s>0&&t.push(-s),t.push(m+s),s=0,i)){let e=r.dom.lastChild,t=e?hq(e):[];if(t.length){let e=t[t.length-1],n=l?e.right-h.left:h.right-e.left;n>a&&(a=n,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=f)}}d&&p==e.children.length-1&&(s+=d.bottom-h.bottom),u=f+r.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?Mq.RTL:Mq.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t,n=0;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=hq(r.dom);if(1!=e.length)return;n+=e[0].width,t=e[0].height}if(n)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:n/e.length,textHeight:t}}});if(e)return e;let t,n,r,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(o);let e=hq(o.firstChild)[0];t=o.getBoundingClientRect().height,n=e&&e.width?e.width/27:7,r=e&&e.height?e.height:t,o.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],i=o?o.from-1:this.view.state.doc.length;if(i>n){let r=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(oq.replace({widget:new l$(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!o)break;n=o.to+1}return oq.set(e)}updateDeco(){let e=1,t=this.view.state.facet(EQ).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(OQ).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(dG.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(kQ).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(cQ))try{if(t(this.view,e.range,e))return!0}catch(e){fQ(this.view.state,e,"scroll handler")}let t,{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(!r)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,t.left),top:Math.min(r.top,t.top),right:Math.max(r.right,t.right),bottom:Math.max(r.bottom,t.bottom)});let o=DQ(this.view),i={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(function(e,t,n,r,o,i,a,l){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,f=1,h=1;if(p)e=Eq(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:f,scaleY:h}=kq(u,t)),e={left:t.left,right:t.left+u.clientWidth*f,top:t.top,bottom:t.top+u.clientHeight*h}}let m=0,g=0;if("nearest"==o)t.top<e.top?(g=t.top-(e.top+a),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+a)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+a,n<0&&t.top-g<e.top&&(g=t.top-(e.top+a)));else{let r=t.bottom-t.top,i=e.bottom-e.top;g=("center"==o&&r<=i?t.top+r/2-i/2:"start"==o||"center"==o&&n<0?t.top-a:t.bottom-i+a)-e.top}if("nearest"==r?t.left<e.left?(m=t.left-(e.left+i),n>0&&t.right>e.right+m&&(m=t.right-e.right+i)):t.right>e.right&&(m=t.right-e.right+i,n<0&&t.left<e.left+m&&(m=t.left-(e.left+i))):m=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==l?t.left-i:t.right-(e.right-e.left)+i)-e.left,m||g)if(p)c.scrollBy(m,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/h,n=(u.scrollTop-e)*h}if(m){let t=u.scrollLeft;u.scrollLeft+=m/f,e=(u.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-m)<1&&(r="nearest"),n&&Math.abs(n-g)<1&&(o="nearest")}if(p)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,i,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==Mq.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(n.head,1);e&&e.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){r$(this.tile)}}function r$(e,t){let n=null==t?void 0:t.get(e);if(1!=n){null==n&&e.destroy();for(let n of e.children)r$(n,t)}}function o$(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Aq(n.focusNode,n.focusOffset),o=Tq(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let t=MQ.get(o.node);if(!t||t.isText()&&t.text!=o.node.nodeValue)i=o;else if(e.docView.lastCompositionAfterCursor){let e=MQ.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(i=o)}}if(e.docView.lastCompositionAfterCursor=i!=r,!i)return null;let a=t-i.offset;return{from:a,to:a+i.node.nodeValue.length,node:i.node}}let i$=class{constructor(){this.changes=[]}compareRange(e,t){cq(e,t,this.changes)}comparePoint(e,t){cq(e,t,this.changes)}boundChange(e){cq(e,e,this.changes)}};class a${constructor(){this.changes=[]}compareRange(e,t){cq(e,t,this.changes)}comparePoint(){}boundChange(e){cq(e,e,this.changes)}}class l$ extends nq{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function s$(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let o of r.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;e&&(o.type!=rq.Text||e.type==o.type&&!(n<0?o.from<t:o.to>t))||(e=o)}}return e||r}return r}function c$(e,t,n,r){let o=e.state.doc.lineAt(t.head),i=e.bidiSpans(o),a=e.textDirectionAt(o.from);for(let l=t,s=null;;){let t=Xq(o,i,a,l,n),c=Yq;if(!t){if(o.number==(n?e.state.doc.lines:1))return l;c="\n",o=e.state.doc.line(o.number+(n?1:-1)),i=e.bidiSpans(o),t=e.visualLineSide(o,!n)}if(s){if(!s(c))return l}else{if(!r)return t;s=r(c)}l=t}}function u$(e,t,n){for(;;){let r=0;for(let o of e)o.between(t-1,t+1,(e,o,i)=>{if(t>e&&t<o){let i=r||n||(t-e<o-t?-1:1);t=i<0?e:o,r=i}});if(!r)return t}}function d$(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let o=t.ranges[r],i=null;if(o.empty){let t=u$(e,o.from,0);t!=o.from&&(i=yH.cursor(t,-1))}else{let t=u$(e,o.from,-1),n=u$(e,o.to,1);t==o.from&&n==o.to||(i=yH.range(o.from==o.anchor?t:n,o.from==o.head?t:n))}i&&(n||(n=t.ranges.slice()),n[r]=i)}return n?yH.create(n,t.mainIndex):t}function p$(e,t,n){let r=u$(e.state.facet(SQ).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:yH.cursor(r,r<n.from?1:-1)}class f${constructor(e,t){this.pos=e,this.assoc=t}}function h$(e,t,n,r){let o,i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:l,y:s}=t,c=s-a;for(;;){if(c<0)return new f$(0,1);if(c>e.viewState.docHeight)return new f$(e.state.doc.length,-1);if(o=e.elementAtHeight(c),null==r)break;if(o.type==rq.Text){if(r<0?o.to<e.viewport.from:o.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?o.from:o.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?o.bottom+t:o.top-t}if(e.viewport.from>=o.to||e.viewport.to<=o.from){if(n)return null;if(o.type==rq.Text){let t=function(e,t,n,r,o){let i=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((o-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(n.from,n.to);return n.from+SG(a,i,e.state.tabSize)}(e,i,o,l,s);return new f$(t,t==o.from?1:-1)}}if(o.type!=rq.Text)return c<(o.top+o.bottom)/2?new f$(o.from,1):new f$(o.to,-1);let u=e.docView.lineAt(o.from,2);return u&&u.length==o.length||(u=e.docView.lineAt(o.from,-2)),new m$(e,l,s,e.textDirectionAt(o.from)).scanTile(u,o.from)}class m${constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Vq.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Vq.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n,r,o,i=0,a=e.length-1,l=new Set,s=this.bidiIn(e[0],e[a]),c=-1,u=1e9;e:for(;i<a;){let d=a-i,p=i+a>>1;t:if(l.has(p)){let e=i+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!l.has(e)){p=e;break t}e++,e==a&&(e=i)}break e}l.add(p);let f=t(p);if(f)for(let t=0;t<f.length;t++){let l=f[t],d=0;if(l.bottom<this.y)(!n||n.bottom<l.bottom)&&(n=l),d=1;else if(l.top>this.y)(!r||r.top>l.top)&&(r=l),d=-1;else{let e=l.left>this.x?this.x-l.left:l.right<this.x?this.x-l.right:0,t=Math.abs(e);t<u&&(c=p,u=t,o=l),e&&(d=e<0==(this.baseDir==Mq.LTR)?-1:1)}-1!=d||s&&!this.baseDirAt(e[p],1)?1!=d||s&&!this.baseDirAt(e[p+1],-1)||(i=p+1):a=p}}if(!o){let o=n&&(!r||this.y-n.bottom<r.top-this.y)?n:r;return this.y=(o.top+o.bottom)/2,this.scan(e,t)}let d=(s?this.dirAt(e[c],1):this.baseDir)==Mq.LTR;return{i:c,after:this.x>(o.left+o.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=rH(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let o=n[r]-t,i=n[r+1]-t;return Cq(e.dom,o,i).getClientRects()});return r.after?new f$(n[r.i+1],-1):new f$(n[r.i],1)}scanTile(e,t){if(!e.length)return new f$(t,1);if(1==e.children.length){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,o=t;r<e.children.length;r++)n.push(o+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return 48&n.flags?null:(1==n.dom.nodeType?n.dom:Cq(n.dom,0,n.length)).getClientRects()}),o=e.children[r.i],i=n[r.i];return o.isText()?this.scanText(o,i):o.isComposite()?this.scanTile(o,i):r.after?new f$(n[r.i+1],-1):new f$(i,1)}}const g$="";class v${constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(oG.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=g$}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let o=MQ.get(r),i=r.nextSibling;if(i==t){(null==o?void 0:o.breakAfter)&&!i&&n!=this.view.contentDOM&&this.lineBreak();break}let a=MQ.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:vq(r))||vq(i)&&("BR"!=r.nodeName||(null==o?void 0:o.isWidget()))&&this.text.length>e)&&!b$(i,t)&&this.lineBreak(),r=i}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o,i=-1,a=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=MQ.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(y$(e,n.node,n.offset)?t:0))}}function y$(e,t,n){for(;;){if(!t||n<bq(t))return!1;if(t==e)return!0;n=gq(t)+1,t=t.parentNode}}function b$(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=MQ.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}class w${constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class E${constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:i}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=k$(e.docView.tile,t,n,0))){let t=o||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new w$(n,r)),o==n&&i==r||t.push(new w$(o,i))),t}(e),n=new v$(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?yH.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=o&&o.node==t.focusNode&&o.offset==t.focusOffset||!pq(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!pq(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((XG.ios||XG.chrome)&&e.state.selection.main.empty&&n!=r&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(n,r),o=Math.max(n,r),i=a.from-t,l=a.to-o;0!=i&&1!=i&&0!=t||0!=l&&-1!=l&&o!=e.state.doc.length||(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(yH.range(r,n)):this.newSel=yH.single(r,n)}}}function k$(e,t,n,r){if(e.isComposite()){let o=-1,i=-1,a=-1,l=-1;for(let s=0,c=r,u=r;s<e.children.length;s++){let r=e.children[s],d=c+r.length;if(c<t&&d>n)return k$(r,t,n,c);if(d>=t&&-1==o&&(o=s,i=c),c>n&&r.dom.parentNode==e.dom){a=s,l=u;break}u=d,c=d+r.breakAfter}return{from:i,to:l<0?r+e.length:l,startDOM:(o?e.children[o-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:a<e.children.length&&a>=0?e.children[a].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function O$(e,t){let n,{newSel:r}=t,o=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:a}=t.bounds,l=o.from,s=null;(8===i||XG.android&&t.text.length<a-r)&&(l=o.to,s="end");let c=x$(e.state.doc.sliceString(r,a,g$),t.text,l-r,s);c&&(XG.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==g$+g$&&c.toB--,n={from:r+c.from,to:r+c.toA,insert:QV.of(t.text.slice(c.from,c.toB).split(g$))})}else r&&(!e.hasFocus&&e.state.facet(hQ)||_$(r,o))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!o.empty&&r&&r.main.empty?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:(XG.mac||XG.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=yH.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:QV.of([n.insert.toString().replace("."," ")])}):n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,o.to))}:e.state.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:e.state.toText(e.inputState.insertingText)}:XG.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=yH.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:QV.of([" "])}),n)return S$(e,n,r,i);if(r&&!_$(r,o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin,"select.pointer"==n&&(r=d$(e.state.facet(SQ).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function S$(e,t,n,r=-1){if(XG.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(XG.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&Dq(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&Dq(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&Dq(e.contentDOM,"Delete",46)))return!0;let i,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>i||(i=function(e,t,n){let r,o=e.state,i=o.selection.main,a=-1;if(t.from==t.to&&t.from<i.from||t.from>i.to){let n=t.from<i.from?-1:1,r=n<0?i.from:i.to,l=u$(o.facet(SQ).map(t=>t(e)),r,n);t.from==l&&(a=l)}if(a>-1)r={changes:t,selection:yH.cursor(t.from+t.insert.length,-1)};else if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.from<t.from?o.sliceDoc(i.from,t.from):"",a=i.to>t.to?o.sliceDoc(t.to,i.to):"";r=o.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+a))}else{let a=o.changes(t),l=n&&n.main.to<=a.newLength?n.main:void 0;if(o.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=i.to+10&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&o$(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to;r=o.changeByRange(n=>{if(n.from==i.from&&n.to==i.to)return{changes:a,range:l||n.map(a)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=s.from&&u<=s.to)return{range:n};let p=o.changes({from:u,to:r,insert:t.insert}),f=n.to-i.to;return{changes:p,range:l?yH.range(Math.max(0,l.anchor+f),Math.max(0,l.head+f)):n.map(p)}})}else r={changes:a,selection:l&&o.selection.replaceRange(l)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:l,scrollIntoView:!0})}(e,t,n));return e.state.facet(rQ).some(n=>n(e,t.from,t.to,a,l))||e.dispatch(l()),!0}function x$(e,t,n,r){let o=Math.min(e.length,t.length),i=0;for(;i<o&&e.charCodeAt(i)==t.charCodeAt(i);)i++;if(i==o&&e.length==t.length)return null;let a=e.length,l=t.length;for(;a>0&&l>0&&e.charCodeAt(a-1)==t.charCodeAt(l-1);)a--,l--;return"end"==r&&(n-=a+Math.max(0,i-Math.min(a,l))-i),a<i&&e.length<t.length?(i-=n<=i&&n>=a?i-n:0,l=i+(l-a),a=i):l<i&&(i-=n<=i&&n>=l?i-n:0,a=i+(a-l),l=i),{from:i,toA:a,toB:l}}function _$(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class C${setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,XG.safari&&e.contentDOM.addEventListener("input",()=>null),XG.gecko&&function(e){K$.has(e)||(K$.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=MQ.get(r))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=P$(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let o=!t[e].handlers.length,i=n[e];i&&o!=!i.handlers.length&&(r.removeEventListener(e,this.handleEvent),i=null),i||r.addEventListener(e,this.handleEvent,{passive:o})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&F$.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),XG.android&&XG.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!XG.ios||e.synthetic||e.altKey||e.metaKey||!((t=A$.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||T$.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,Dq(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!(!/^key/.test(e.type)||e.synthetic)&&(this.composing>0||!!(XG.safari&&!XG.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function D$(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){fQ(n.state,e)}}}function P$(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,o=e&&e.plugin.domEventObservers;if(r)for(let e in r){let o=r[e];o&&n(e).handlers.push(D$(t.value,o))}if(o)for(let e in o){let r=o[e];r&&n(e).observers.push(D$(t.value,r))}}for(let e in N$)n(e).handlers.push(N$[e]);for(let e in j$)n(e).observers.push(j$[e]);return t}const A$=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],T$="dthko",F$=[16,17,18,20,91,92,224,225];function M$(e){return.7*Math.max(0,e)+8}class I${constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t,n,r=e.ownerDocument;for(let o=e.parentNode;o&&!(o==r.body||t&&n);)if(1==o.nodeType)!n&&o.scrollHeight>o.clientHeight&&(n=o),!t&&o.scrollWidth>o.clientWidth&&(t=o),o=o.assignedSlot||o.parentNode;else{if(11!=o.nodeType)break;o=o.host}return{x:t,y:n}}(e.contentDOM),this.atoms=e.state.facet(SQ).map(t=>t(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(oG.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Zq);return n.length?n[0](t):XG.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=dq(e.root);if(!r||0==r.rangeCount)return!0;let o=r.getRangeAt(0).getClientRects();for(let e=0;e<o.length;e++){let n=o[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=G$(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,n=e,Math.max(Math.abs(t.clientX-n.clientX),Math.abs(t.clientY-n.clientY))<10))return;var t,n;this.select(this.lastEvent=e);let r=0,o=0,i=0,a=0,l=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let c=DQ(this.view);e.clientX-c.left<=i+6?r=-M$(i-e.clientX):e.clientX+c.right>=l-6&&(r=M$(e.clientX-l)),e.clientY-c.top<=a+6?o=-M$(a-e.clientY):e.clientY+c.bottom>=s-6&&(o=M$(e.clientY-s)),this.setScrollSpeed(r,o)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=d$(this.atoms,this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}const N$=Object.create(null),j$=Object.create(null),L$=XG.ie&&XG.ie_version<15||XG.ios&&XG.webkit_version<604;function R$(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function B$(e,t){t=R$(e.state,iQ,t);let n,{state:r}=e,o=1,i=r.toText(t),a=i.lines==r.selection.ranges.length;if(null!=Q$&&r.selection.ranges.every(e=>e.empty)&&Q$==i.toString()){let e=-1;n=r.changeByRange(n=>{let l=r.doc.lineAt(n.from);if(l.from==e)return{range:n};e=l.from;let s=r.toText((a?i.line(o++).text:t)+r.lineBreak);return{changes:{from:l.from,insert:s},range:yH.cursor(n.from+s.length)}})}else n=a?r.changeByRange(e=>{let t=i.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:yH.cursor(e.from+t.length)}}):r.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function z$(e,t,n,r){if(1==r)return yH.cursor(t,n);if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),o=e.doc.lineAt(t),i=t-o.from;if(0==o.length)return yH.cursor(t);0==i?n=1:i==o.length&&(n=-1);let a=i,l=i;n<0?a=rH(o.text,i,!1):l=rH(o.text,i);let s=r(o.text.slice(a,l));for(;a>0;){let e=rH(o.text,a,!1);if(r(o.text.slice(e,a))!=s)break;a=e}for(;l<o.length;){let e=rH(o.text,l);if(r(o.text.slice(l,e))!=s)break;l=e}return yH.range(a+o.from,l+o.from)}(e.state,t,n);{let r=e.docView.lineAt(t,n),o=e.state.doc.lineAt(r?r.posAtEnd:t),i=r?r.posAtStart:o.from,a=r?r.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,yH.range(i,a)}}j$.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},N$.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),j$.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},j$.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},N$.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(eQ))if(n=r(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=G$(t),o=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),o=o.map(e.changes))},get(t,i,a){let l,s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c=z$(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!i){let t=z$(e,n.pos,n.assoc,r),o=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=o<c.from?yH.range(o,i):yH.range(i,o)}return i?o.replaceRange(o.main.extend(c.from,c.to)):a&&1==r&&o.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:o}=e.ranges[n];if(r<=t&&o>=t)return yH.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(o,s.pos))?l:a?o.addRange(c):yH.create([c])}}}(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new I$(e,t,n,r)),r&&e.observer.ignore(()=>{_q(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let o=e.inputState.mouseSelection;if(o)return o.start(t),!1===o.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};const W$=XG.ie&&XG.ie_version<=11;let U$=null,V$=0,H$=0;function G$(e){if(!W$)return e.detail;let t=U$,n=H$;return U$=e,H$=Date.now(),V$=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(V$+1)%3:1}function q$(e,t,n,r){if(!(n=R$(e.state,iQ,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,a=r&&i&&function(e,t){let n=e.state.facet(Jq);return n.length?n[0](t):XG.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,l={from:o,insert:n},s=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(o,-1),head:s.mapPos(o,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}N$.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=yH.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",R$(e.state,aQ,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},N$.dragend=e=>(e.inputState.draggedContent=null,!1),N$.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&q$(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=i,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return q$(e,t,n,!0),!0}return!1},N$.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=L$?null:t.clipboardData;return n?(B$(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),B$(e,n.value)},50)}(e),!1)};let Q$=null;N$.copy=N$.cut=(e,t)=>{if(!fq(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:o}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let o=-1;for(let{from:r}of e.selection.ranges){let i=e.doc.lineAt(r);i.number>o&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),o=i.number}r=!0}return{text:R$(e,aQ,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!o)return!1;Q$=o?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=L$?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,n),!1)};const $$=HH.define();function Y$(e,t){let n=[];for(let r of e.facet(oQ)){let o=r(e,t);o&&n.push(o)}return n.length?e.update({effects:n,annotations:$$.of(!0)}):null}function X$(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=Y$(e.state,t);n?e.dispatch(n):e.update([])}},10)}j$.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),X$(e)},j$.blur=e=>{e.observer.clearSelectionRange(),X$(e)},j$.compositionstart=j$.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},j$.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,XG.chrome&&XG.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},j$.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},N$.beforeinput=(e,t)=>{var n,r;if("insertText"!=t.inputType&&"insertCompositionText"!=t.inputType||(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null===(n=t.dataTransfer)||void 0===n?void 0:n.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let t=o[0],n=e.posAtDOM(t.startContainer,t.startOffset),i=e.posAtDOM(t.endContainer,t.endOffset);return S$(e,{from:n,to:i,insert:e.state.toText(r)},null),!0}}let o;if(XG.chrome&&XG.android&&(o=A$.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(r=window.visualViewport)||void 0===r?void 0:r.height)||0;setTimeout(()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return XG.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),XG.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>j$.compositionend(e,t),20),!1};const K$=new Set,Z$=["pre-wrap","normal","pre-line","break-spaces"];let J$=!1;function eY(){J$=!1}class tY{constructor(e){this.lineWrapping=e,this.doc=QV.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Z$.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,o,i){let a=Z$.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=o,l){this.heightSamples={};for(let e=0;e<i.length;e++){let t=i[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return l}}class nY{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class rY{constructor(e,t,n,r,o){this.from=e,this.length=t,this.top=n,this.height=r,this._content=o}get type(){return"number"==typeof this._content?rq.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof lq?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new rY(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var oY=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(oY||(oY={}));const iY=.001;class aY{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>iY&&(J$=!0),this.height=e)}replace(e,t,n){return aY.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let o=this,i=n.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:s,fromB:c,toB:u}=r[a],d=o.lineAt(l,oY.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:o.lineAt(s,oY.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;a>0&&d.from<=r[a-1].toA;)l=r[a-1].fromA,c=r[a-1].fromB,a--,l<d.from&&(d=o.lineAt(l,oY.ByPosNoHeight,n,0,0));c+=d.from-l,l=d.from;let f=hY.build(n.setDoc(i),e,c,u);o=lY(o,o.replace(l,s,f))}return o.updateHeight(n,0)}static empty(){return new uY(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,o=0;for(;;)if(t==n)if(r>2*o){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,r-=o.size}else{if(!(o>2*r))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,o-=t.size}}else if(r<o){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(o+=t.size)}let i=0;return null==e[t-1]?(i=1,t--):null==e[t]&&(i=1,n++),new pY(aY.of(e.slice(0,t)),i,aY.of(e.slice(n)))}}function lY(e,t){return e==t?e:(e.constructor!=t.constructor&&(J$=!0),t)}aY.prototype.size=1;const sY=oq.replace({});class cY extends aY{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new rY(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new rY(r,0,n,this.spaceAbove,sY):this.mainBlock(n,r)}lineAt(e,t,n,r,o){let i=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,n,r,o).join(i):i}forEachLine(e,t,n,r,o,i){e<=o+this.length&&t>=o&&i(this.lineAt(0,oY.ByPos,n,r,o))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class uY extends cY{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new rY(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof uY||r instanceof dY&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof dY?r=new uY(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):aY.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class dY extends aY{constructor(e){super(e,0)}heightMetrics(e,t){let n,r=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,i=o-r+1,a=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(a=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:r,lastLine:o,perLine:n,perChar:a}}blockAt(e,t,n,r){let{firstLine:o,lastLine:i,perLine:a,perChar:l}=this.heightMetrics(t,r);if(t.lineWrapping){let o=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),i=t.doc.lineAt(o),s=a+i.length*l,c=Math.max(n,e-s/2);return new rY(i.from,i.length,c,s,0)}{let r=Math.max(0,Math.min(i-o,Math.floor((e-n)/a))),{from:l,length:s}=t.doc.line(o+r);return new rY(l,s,n+a*r,a,0)}}lineAt(e,t,n,r,o){if(t==oY.ByHeight)return this.blockAt(e,n,r,o);if(t==oY.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new rY(t,r-t,0,0,0)}let{firstLine:i,perLine:a,perChar:l}=this.heightMetrics(n,o),s=n.doc.lineAt(e),c=a+s.length*l,u=s.number-i,d=r+a*u+l*(s.from-o-u);return new rY(s.from,s.length,Math.max(r,Math.min(d,r+this.height-c)),c,0)}forEachLine(e,t,n,r,o,i){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:a,perLine:l,perChar:s}=this.heightMetrics(n,o);for(let c=e,u=r;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-a;u+=l*n+s*(e-o-n)}let r=l+s*t.length;i(new rY(t.from,t.length,u,r,0)),u+=r,c=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof dY?n[n.length-1]=new dY(e.length+r):n.push(null,new dY(r-1))}if(e>0){let t=n[0];t instanceof dY?n[0]=new dY(e+t.length):n.unshift(new dY(e-1),null)}return aY.of(n)}decomposeLeft(e,t){t.push(new dY(e-1),null)}decomposeRight(e,t){t.push(null,new dY(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],i=Math.max(t,r.from),a=-1;for(r.from>t&&n.push(new dY(r.from-t-1).updateHeight(e,t));i<=o&&r.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let o=r.heights[r.index++],l=0;o<0&&(l=-o,o=r.heights[r.index++]),-1==a?a=o:Math.abs(o-a)>=iY&&(a=-2);let s=new uY(t,o,l);s.outdated=!1,n.push(s),i+=t+1}i<=o&&n.push(null,new dY(o-i).updateHeight(e,i));let l=aY.of(n);return(a<0||Math.abs(l.height-this.height)>=iY||Math.abs(a-this.heightMetrics(e,t).perLine)>=iY)&&(J$=!0),lY(this,l)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class pY extends aY{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let o=n+this.left.height;return e<o?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,n,r,o){let i=r+this.left.height,a=o+this.left.length+this.break,l=t==oY.ByHeight?e<i:e<a,s=l?this.left.lineAt(e,t,n,r,o):this.right.lineAt(e,t,n,i,a);if(this.break||(l?s.to<a:s.from>a))return s;let c=t==oY.ByPosNoHeight?oY.ByPosNoHeight:oY.ByPos;return l?s.join(this.right.lineAt(a,c,n,i,a)):this.left.lineAt(a,c,n,r,o).join(s)}forEachLine(e,t,n,r,o,i){let a=r+this.left.height,l=o+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,n,r,o,i),t>=l&&this.right.forEachLine(e,t,n,a,l,i);else{let s=this.lineAt(l,oY.ByPos,n,r,o);e<s.from&&this.left.forEachLine(e,s.from-1,n,r,o,i),s.to>=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,a,l,i)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let o=[];e>0&&this.decomposeLeft(e,o);let i=o.length;for(let e of n)o.push(e);if(e>0&&fY(o,i-1),t<this.length){let e=o.length;this.decomposeRight(t,o),fY(o,e)}return aY.of(o)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?aY.of(this.break?[e,null,t]:[e,t]):(this.left=lY(this.left,e),this.right=lY(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:o,right:i}=this,a=t+o.length+this.break,l=null;return r&&r.from<=t+o.length&&r.more?l=o=o.updateHeight(e,t,n,r):o.updateHeight(e,t,n),r&&r.from<=a+i.length&&r.more?l=i=i.updateHeight(e,a,n,r):i.updateHeight(e,a,n),l?this.balanced(o,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function fY(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof dY&&(r=e[t+1])instanceof dY&&e.splice(t-1,3,new dY(n.length+1+r.length))}class hY{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof uY?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new uY(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,o=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let i=t-e;n.block?this.addBlock(new cY(i,r,n)):(i||o||r>=5)&&this.addLineDeco(r,o,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new uY(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new dY(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof uY)return e;let t=new uY(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof uY||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new uY(0,-1,0));let n=e;for(let e of this.nodes)e instanceof uY&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let o=new hY(n,e);return dG.spans(t,n,r,o,0),o.finish(n)}}class mY{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&cq(e,t,this.changes,5)}}function gY(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,o=r.defaultView||window,i=Math.max(0,n.left),a=Math.min(o.innerWidth,n.right),l=Math.max(0,n.top),s=Math.min(o.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();i=Math.max(i,r.left),a=Math.min(a,r.right),l=Math.max(l,r.top),s=Math.min(t==e.parentNode?o.innerHeight:s,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:i-n.left,right:Math.max(i,a)-n.left,top:l-(n.top+t),bottom:Math.max(l,s)-(n.top+t)}}function vY(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class yY{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return oq.replace({widget:new bY(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class bY extends nq{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class wY{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=SY,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Mq.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(wQ).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new tY(t),this.stateDeco=xY(e),this.heightMap=aY.empty().applyChanges(this.stateDeco,QV.empty,this.heightOracle.setDoc(e.doc),[new AQ(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=oq.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new EY(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?SY:new _Y(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(CY(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=xY(this.state);let r=e.changedRanges,o=AQ.extendWithRanges(r,function(e,t,n){let r=new mY;return dG.compare(e,t,n,r,0),r.changes}(n,this.stateDeco,e?e.changes:uH.empty(this.state.doc.length))),i=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);eY(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=i||J$)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=i);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let s=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(s||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(sQ)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?Mq.RTL:Mq.LTR;let i=this.heightOracle.mustRefreshForWrapping(o)||"refresh"===this.mustMeasureContent,a=t.getBoundingClientRect(),l=i||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let s=0,c=0;if(a.width&&a.height){let{scaleX:e,scaleY:n}=kq(t,a);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,s|=16,i=l=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=16);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=Pq(e.scrollDOM);let f=(this.printing?vY:gY)(t,this.paddingTop),h=f.top-this.pixelViewport.top,m=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}(e.dom))return 0;let v=a.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,s|=16),l){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(i=!0),i||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:a,textHeight:l}=e.docView.measureTextSize();i=n>0&&r.refresh(o,n,a,l,Math.max(5,v/a),t),i&&(e.docView.minWidth=0,s|=16)}h>0&&m>0?c=Math.max(h,m):h<0&&m<0&&(c=Math.min(h,m)),eY();for(let n of this.viewports){let o=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?aY.empty().applyChanges(this.stateDeco,QV.empty,this.heightOracle,[new AQ(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,i,new nY(n.from,o))}J$&&(s|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&s&&(s|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),s|=this.updateForViewport()),(2&s||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:i,visibleBottom:a}=this,l=new EY(r.lineAt(i-1e3*n,oY.ByHeight,o,0,0).from,r.lineAt(a+1e3*(1-n),oY.ByHeight,o,0,0).to);if(t){let{head:e}=t.range;if(e<l.from||e>l.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,oY.ByPos,o,0,0);n="center"==t.y?(a.top+a.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e<l.from?a.top:a.bottom-i,l=new EY(r.lineAt(n-500,oY.ByHeight,o,0,0).from,r.lineAt(n+i+500,oY.ByHeight,o,0,0).to)}}return l}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new EY(this.heightMap.lineAt(n,oY.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,oY.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,oY.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,oY.ByPos,this.heightOracle,0,0),{visibleTop:i,visibleBottom:a}=this;return(0==e||r<=i-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||o>=a+Math.max(10,Math.min(n,250)))&&r>i-2e3&&o<a+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new yY(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,o=r>>1,i=r<<1;if(this.defaultTextDirection!=Mq.LTR&&!n)return[];let a=[],l=(r,i,s,c)=>{if(i-r<o)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<i)return l(r,e-10,s,c),void l(e+10,i,s,c);let p=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=s.from&&e.to<=s.to&&Math.abs(e.from-r)<o&&Math.abs(e.to-i)<o&&!d.some(t=>e.from<t&&e.to>t));if(!p){if(i<s.to&&t&&n&&t.visibleRanges.some(e=>e.from<=i&&e.to>=i)){let e=t.moveToLineBoundary(yH.cursor(i),!1,!0).head;e>r&&(i=e)}let e=this.gapSize(s,r,i,c);p=new yY(r,i,e,n||e<2e6?e:2e6)}a.push(p)},s=t=>{if(t.length<i||t.type!=rq.Text)return;let o=function(e,t,n){let r=[],o=e,i=0;return dG.spans(n,e,t,{span(){},point(e,t){e>o&&(r.push({from:o,to:e}),i+=e-o),o=t}},20),o<t&&(r.push({from:o,to:t}),i+=t-o),{total:i,ranges:r}}(t.from,t.to,this.stateDeco);if(o.total<i)return;let a,s,c=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let r=OY(o,c),a=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-a,n=r+a}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;a=kY(o,e),s=kY(o,n)}else{let n=o.total*this.heightOracle.charWidth,i=r*this.heightOracle.charWidth,l=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+l<this.pixelViewport.left&&(l=n.size-n.displaySize);let u,d,p=this.pixelViewport.left+l,f=this.pixelViewport.right+l;if(null!=c){let e=OY(o,c),t=((f-p)/2+i)/n;u=e-t,d=e+t}else u=(p-i)/n,d=(f+i)/n;a=kY(o,u),s=kY(o,d)}a>t.from&&l(t.from,a,t,o),s<t.to&&l(s,t.to,t,o)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(s):s(e);return a}gapSize(e,t,n,r){let o=OY(r,n)-OY(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){yY.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=oq.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];dG.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let o=this.visibleRanges[t],i=n[t];o.from==i.from&&o.to==i.to||(r|=4,e&&e.mapPos(o.from,-1)==i.from&&e.mapPos(o.to,1)==i.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||CY(this.heightMap.lineAt(e,oY.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||CY(this.heightMap.lineAt(this.scaler.fromDOM(e),oY.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return CY(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class EY{constructor(e,t){this.from=e,this.to=t}}function kY({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:o}=t[e],i=o-n;if(r<=i)return n+r;r-=i}}function OY(e,t){let n=0;for(let{from:r,to:o}of e.ranges){if(t<=o){n+=t-r;break}n+=o-r}return n/e.total}const SY={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function xY(e){let t=e.facet(EQ).filter(e=>"function"!=typeof e),n=e.facet(OQ).filter(e=>"function"!=typeof e);return n.length&&t.push(dG.join(n)),t}class _Y{constructor(e,t,n){let r=0,o=0,i=0;this.viewports=n.map(({from:n,to:o})=>{let i=t.lineAt(n,oY.ByPos,e,0,0).top,a=t.lineAt(o,oY.ByPos,e,0,0).bottom;return r+=a-i,{from:n,to:o,top:i,bottom:a,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=i+(e.top-o)*this.scale,i=e.domBottom=e.domTop+(e.bottom-e.top),o=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-n)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);n=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return n+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);n=o.bottom,r=o.domBottom}}eq(e){return e instanceof _Y&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function CY(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new rY(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>CY(e,t)):e._content)}const DY=EH.define({combine:e=>e.join(" ")}),PY=EH.define({combine:e=>e.indexOf(!0)>-1}),AY=DG.newName(),TY=DG.newName(),FY=DG.newName(),MY={"&light":"."+TY,"&dark":"."+FY};function IY(e,t,n){return new DG(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}const NY=IY("."+AY,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},MY),jY={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},LY=XG.ie&&XG.ie_version<=11;class RY{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Oq,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(XG.ie&&XG.ie_version<=11||XG.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!XG.android||!1===e.constructor.EDIT_CONTEXT||XG.chrome&&XG.chrome_version<126||(this.editContext=new WY(e),e.state.facet(hQ)&&(e.contentDOM.editContext=this.editContext.editContext)),LY&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(hQ)?n.root.activeElement!=this.dom:!fq(this.dom,r))return;let o=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);o&&o.isWidget()&&o.widget.ignoreEvent(e)?t||(this.selectionChanged=!1):(XG.ie&&XG.ie_version<=11||XG.android&&XG.chrome)&&!n.state.selection.main.empty&&r.focusNode&&mq(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=dq(e.root);if(!t)return!1;let n=XG.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return zY(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?zY(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=fq(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,bq(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:(n=e,r=bq(n))}else{if(n==e)return!0;r=gq(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,jY),LY&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),LY&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Dq(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let o of e){let e=this.readMutation(o);e&&(e.typeOver&&(r=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&fq(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new E$(this.view,e,t,n);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=O$(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!_$(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=BY(t,e.previousSibling||e.target.previousSibling,-1),r=BY(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(hQ)!=e.state.facet(hQ)&&(e.view.contentDOM.editContext=e.state.facet(hQ)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function BY(e,t,n){for(;t;){let r=MQ.get(t);if(r&&r.parent==e)return r;let o=t.parentNode;t=o!=e.dom?o:n>0?t.nextSibling:t.previousSibling}return null}function zY(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor,1);return mq(a.node,a.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}class WY{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:o,head:i}=r,a=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:a,drifted:!1});let s=l-a>n.text.length;a==this.from&&o<this.from?a=o:l==this.to&&o>this.to&&(l=o);let c=x$(e.state.sliceDoc(a,l),n.text,(s?r.from:r.to)-a,s?"end":null);if(!c){let t=yH.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void(_$(t,r)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:c.from+a,to:c.toA+a,insert:QV.of(n.text.slice(c.from,c.toB).split("\n"))};if((XG.mac||XG.android)&&u.from==i-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:a,to:l,insert:QV.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);S$(e,u,yH.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],o=null;for(let t=this.toEditorPos(n.rangeStart),i=this.toEditorPos(n.rangeEnd);t<i;t++){let n=e.coordsForChar(t);o=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let o=this.toEditorPos(e.rangeStart),i=this.toEditorPos(e.rangeEnd);if(o<i){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(oq.mark({attributes:{style:e}}).range(o,i))}}}e.dispatch({effects:pQ.of(oq.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=dq(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,i,a,l,s)=>{if(n)return;let c=s.length-(i-o);if(r&&i>=r.to){if(r.from==o&&r.to==i&&r.insert.eq(s))return r=this.pendingContextChange=null,t+=c,void(this.to+=c);r=null,this.revertPending(e.state)}if(o+=t,(i+=t)<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||i>this.to||this.to-this.from+s.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(i),s.toString()),this.to+=c}t+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==r||this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class UY{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new wY(e.state||oG.create(e)),e.scrollTo&&e.scrollTo.is(dQ)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(gQ).map(e=>new yQ(e));for(let e of this.plugins)e.update(this);this.observer=new RY(this),this.inputState=new C$(this),this.inputState.ensureHandlers(this.plugins),this.docView=new n$(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof $H?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,r=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);let i=this.hasFocus,a=0,l=null;e.some(e=>e.annotation($$))?(this.inputState.notifiedFocused=i,a=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,l=Y$(o,i),l||(a=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(oG.phrases)!=this.state.facet(oG.phrases))return this.setState(o);t=TQ.create(this,o,e),t.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new uQ(e.empty?e:yH.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(dQ)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=GY.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(PQ)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(t.startState.facet(DY)!=t.state.facet(DY)&&(this.viewState.mustMeasureContent=!0),(n||r||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(nQ))try{e(t)}catch(e){fQ(this.state,e,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!O$(this,c)&&s.force&&Dq(this.contentDOM,s.key,s.keyCode)})}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new wY(e),this.plugins=e.facet(gQ).map(e=>new yQ(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new n$(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(gQ),n=e.state.facet(gQ);if(t!=n){let r=[];for(let o of n){let n=t.indexOf(o);if(n<0)r.push(new yQ(o));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){fQ(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:i}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(Pq(n))o=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);o=e.from,i=e.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];4&a||([this.measureRequests,l]=[l,this.measureRequests]);let s=l.map(e=>{try{return e.read(this)}catch(e){return fQ(this.state,e),HY}}),c=TQ.create(this,this.state,[]),u=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e<l.length;e++)if(s[e]!=HY)try{let t=l[e];t.write&&t.write(s[e],this)}catch(e){fQ(this.state,e)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,i=-1;continue}{let e=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-i;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(nQ))e(t)}get themeClasses(){return AY+" "+(this.state.facet(PY)?FY:TY)+" "+this.state.facet(DY)}updateAttrs(){let e=qY(this,bQ,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(hQ)?"true":"false",class:"cm-content",style:`${XG.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),qY(this,wQ,t);let n=this.observer.ignore(()=>{let n=eq(this.contentDOM,this.contentAttrs,t),r=eq(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(UY.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(PQ);let e=this.state.facet(UY.cspNonce);DG.mount(this.root,this.styleModules.concat(NY).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return p$(this,e,c$(this,e,t,n))}moveByGroup(e,t){return p$(this,e,c$(this,e,t,t=>function(e,t,n){let r=e.state.charCategorizer(t),o=r(n);return e=>{let t=r(e);return o==tG.Space&&(o=t),o==t}}(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=n[t?n.length-1:0];return yH.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let o=s$(e,t.head,t.assoc||-1),i=r&&o.type==rq.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(o.from),a=e.posAtCoords({x:n==(r==Mq.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=a)return yH.cursor(a,n?-1:1)}return yH.cursor(n?o.to:o.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return p$(this,e,function(e,t,n,r){let o=t.head,i=n?1:-1;if(o==(n?e.state.doc.length:0))return yH.cursor(o,t.assoc);let a,l=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(o,(t.empty?t.assoc:0)||(n?1:-1)),u=e.documentTop;if(c)null==l&&(l=c.left-s.left),a=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(o);null==l&&(l=Math.min(s.right-s.left,e.defaultCharacterWidth*(o-t.from))),a=(i<0?t.top:t.bottom)+u}let d=h$(e,{x:s.left+l,y:a+(null!=r?r:e.viewState.heightOracle.textHeight>>1)*i},!1,i);return yH.cursor(d.pos,d.assoc,void 0,l)}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=h$(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),h$(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),o=this.bidiSpans(r);return wq(n,o[Vq.find(o,e-r.from,-1,t)].dir==Mq.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(lQ)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>VY)return $q(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||Hq(r.isolates,t=_Q(this,e))))return r.order;t||(t=_Q(this,e));let r=function(e,t,n){if(!e)return[new Vq(0,0,t==Nq?1:0)];if(t==Iq&&!n.length&&!Uq.test(e))return $q(e.length);if(n.length)for(;e.length>Gq.length;)Gq[Gq.length]=256;let r=[],o=t==Iq?0:1;return Qq(e,o,o,n,0,e.length,r),r}(e.text,n,t);return this.bidiCache.push(new GY(e.from,e.to,n,t,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||XG.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_q(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return dQ.of(new uQ("number"==typeof e?yH.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return dQ.of(new uQ(yH.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return vQ.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return vQ.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=DG.newName(),r=[DY.of(n),PQ.of(IY(`.${n}`,e))];return t&&t.dark&&r.push(PY.of(!0)),r}static baseTheme(e){return AH.lowest(PQ.of(IY("."+AY,e,MY)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&MQ.get(n)||MQ.get(e);return(null===(t=null==r?void 0:r.root)||void 0===t?void 0:t.view)||null}}UY.styleModule=PQ,UY.inputHandler=rQ,UY.clipboardInputFilter=iQ,UY.clipboardOutputFilter=aQ,UY.scrollHandler=cQ,UY.focusChangeEffect=oQ,UY.perLineTextDirection=lQ,UY.exceptionSink=tQ,UY.updateListener=nQ,UY.editable=hQ,UY.mouseSelectionStyle=eQ,UY.dragMovesSelection=Jq,UY.clickAddsSelectionRange=Zq,UY.decorations=EQ,UY.blockWrappers=kQ,UY.outerDecorations=OQ,UY.atomicRanges=SQ,UY.bidiIsolatedRanges=xQ,UY.scrollMargins=CQ,UY.darkTheme=PY,UY.cspNonce=EH.define({combine:e=>e.length?e[0]:""}),UY.contentAttributes=wQ,UY.editorAttributes=bQ,UY.lineWrapping=UY.contentAttributes.of({class:"cm-lineWrapping"}),UY.announce=QH.define();const VY=4096,HY={};class GY{constructor(e,t,n,r,o,i){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=o,this.order=i}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:Mq.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let i=e[o];i.dir!=r||t.touchesRange(i.from,i.to)||n.push(new GY(t.mapPos(i.from,1),t.mapPos(i.to,-1),i.dir,i.isolates,!1,i.order))}return n}}function qY(e,t,n){for(let r=e.state.facet(t),o=r.length-1;o>=0;o--){let t=r[o],i="function"==typeof t?t(e):t;i&&KG(i,n)}return n}const QY=XG.mac?"mac":XG.windows?"win":XG.linux?"linux":"key";function $Y(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const YY=AH.default(UY.domEventHandlers({keydown:(e,t)=>nX(ZY(t.state),e,t,"editor")})),XY=EH.define({enables:YY}),KY=new WeakMap;function ZY(e){let t=e.facet(XY),n=KY.get(t);return n||KY.set(t,n=function(e,t=QY){let n=Object.create(null),r=Object.create(null),o=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,r,i,a,l)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map(e=>function(e,t){const n=e.split(/-(?!$)/);let r,o,i,a,l=n[n.length-1];"Space"==l&&(l=" ");for(let e=0;e<n.length-1;++e){const l=n[e];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);"mac"==t?a=!0:o=!0}}return r&&(l="Alt-"+l),o&&(l="Ctrl-"+l),a&&(l="Meta-"+l),i&&(l="Shift-"+l),l}(e,t));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");o(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=JY={view:t,prefix:n,scope:e};return setTimeout(()=>{JY==r&&(JY=null)},eX),!0}]})}let p=d.join(" ");o(p,!1);let f=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&f.run.push(i),a&&(f.preventDefault=!0),l&&(f.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:o}=r;for(let t in e)e[t].run.push(e=>o(e,tX))}let o=r[t]||r.key;if(o)for(let t of e)i(t,o,r.run,r.preventDefault,r.stopPropagation),r.shift&&i(t,"Shift-"+o,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}let JY=null;const eX=4e3;let tX=null;function nX(e,t,n,r){tX=t;let o=function(e){var t=!(MG&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||IG&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?FG:TG)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=aH(oH(o,0))==o.length&&" "!=o,a="",l=!1,s=!1,c=!1;JY&&JY.view==n&&JY.scope==r&&(a=JY.prefix+" ",F$.indexOf(t.keyCode)<0&&(s=!0,JY=null));let u,d,p=new Set,f=e=>{if(e){for(let t of e.run)if(!p.has(t)&&(p.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},h=e[r];return h&&(f(h[a+$Y(o,t,!i)])?l=!0:!i||!(t.altKey||t.metaKey||t.ctrlKey)||XG.windows&&t.ctrlKey&&t.altKey||XG.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(u=TG[t.keyCode])||u==o?i&&t.shiftKey&&f(h[a+$Y(o,t,!0)])&&(l=!0):(f(h[a+$Y(u,t,!0)])||t.shiftKey&&(d=FG[t.keyCode])!=o&&d!=u&&f(h[a+$Y(d,t,!1)]))&&(l=!0),!l&&f(h._any)&&(l=!0)),s&&(l=!0),l&&c&&t.stopPropagation(),tX=null,l}class rX{constructor(e,t,n,r,o){this.className=e,this.left=t,this.top=n,this.width=r,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let o=oX(e);return[new rX(t,r.left-o.left,r.top-o.top,null,r.bottom-r.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),o=Math.min(n.to,e.viewport.to),i=e.textDirection==Mq.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),s=oX(e),c=a.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=l.right-(u?parseInt(u.paddingRight):0),f=s$(e,r,1),h=s$(e,o,-1),m=f.type==rq.Text?f:null,g=h.type==rq.Text?h:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=iX(e,r,1,m)),g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=iX(e,o,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(b(n.from,n.to,m));{let t=m?b(n.from,null,m):w(f,!1),r=g?b(null,n.to,g):w(h,!0),o=[];return(m||f).to<(g||h).from-(m&&g?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?o.push(v(d,t.bottom,p,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==rq.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(o).concat(y(r))}function v(e,n,r,o){return new rX(t,e-s.left,n-s.top,Math.max(0,r-e),o-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let o=0;o<n.length;o+=2)r.push(v(n[o],e,n[o+1],t));return r}function b(t,n,r){let o=1e9,a=-1e9,l=[];function s(t,n,s,c,u){let f=e.coordsAtPos(t,t==r.to?-2:2),h=e.coordsAtPos(s,s==r.from?2:-2);f&&h&&(o=Math.min(f.top,h.top,o),a=Math.max(f.bottom,h.bottom,a),u==Mq.LTR?l.push(i&&n?d:f.left,i&&c?p:h.right):l.push(!i&&c?d:h.left,!i&&n?p:f.right))}let c=null!=t?t:r.from,u=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>c&&r.from<u)for(let o=Math.max(r.from,c),i=Math.min(r.to,u);;){let r=e.state.doc.lineAt(o);for(let a of e.bidiSpans(r)){let e=a.from+r.from,l=a.to+r.from;if(e>=i)break;l>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(l,i),null==n&&l>=u,a.dir)}if(o=r.to+1,o>=i)break}return 0==l.length&&s(c,null==t,u,null==n,e.textDirection),{top:o,bottom:a,horizontal:l}}function w(e,t){let n=l.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function oX(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Mq.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function iX(e,t,n,r){let o=e.coordsAtPos(t,2*n);if(!o)return r;let i=e.dom.getBoundingClientRect(),a=(o.top+o.bottom)/2,l=e.posAtCoords({x:i.left+1,y:a}),s=e.posAtCoords({x:i.right-1,y:a});return null==l||null==s?r:{from:Math.max(r.from,Math.min(l,s)),to:Math.min(r.to,Math.max(l,s))}}class aX{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(lX)!=e.state.facet(lX)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(lX);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{return n=e,r=this.drawn[t],!(n.constructor==r.constructor&&n.eq(r));var n,r})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,XG.safari&&XG.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const lX=EH.define();function sX(e){return[vQ.define(t=>new aX(t,e)),lX.of(e)]}const cX=EH.define({combine:e=>iG(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function uX(e){return e.startState.facet(cX)!=e.state.facet(cX)}const dX=sX({above:!0,markers(e){let{state:t}=e,n=t.facet(cX),r=[];for(let o of t.selection.ranges){let i=o==t.selection.main;if(o.empty||n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=o.empty?o:yH.cursor(o.head,o.head>o.anchor?-1:1);for(let o of rX.forRange(e,t,n))r.push(o)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=uX(e);return n&&pX(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){pX(t.state,e)},class:"cm-cursorLayer"});function pX(e,t){t.style.animationDuration=e.facet(cX).cursorBlinkRate+"ms"}const fX=sX({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:rX.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||uX(e),class:"cm-selectionLayer"}),hX=AH.highest(UY.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),mX=QH.define({map:(e,t)=>null==e?null:t.mapPos(e)}),gX=DH.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(mX)?t.value:e,e))}),vX=vQ.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(gX);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(gX)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(gX),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(gX)!=e&&this.view.dispatch({effects:mX.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function yX(e,t,n,r,o){t.lastIndex=0;for(let i,a=e.iterRange(n,r),l=n;!a.next().done;l+=a.value.length)if(!a.lineBreak)for(;i=t.exec(a.value);)o(l+i.index,i)}class bX{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:o,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,o)=>r(o,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,o)=>{let i=n(e,t,r);i&&o(r,r+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,r,o)=>o(r,r+e[0].length,n)}this.boundary=o,this.maxLength=i}createDeco(e){let t=new pG,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:o,to:i}of n)o=Math.max(e.state.doc.lineAt(o).from,o-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),r.length&&r[r.length-1].to>=o?r[r.length-1].to=i:r.push({from:o,to:i});return r}(e,this.maxLength))yX(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,o,i,a)=>{a>=e.view.viewport.from&&i<=e.view.viewport.to&&(n=Math.min(i,n),r=Math.max(a,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let o of e.visibleRanges){let i=Math.max(o.from,n),a=Math.min(o.to,r);if(a>=i){let n=e.state.doc.lineAt(i),r=n.to<a?e.state.doc.lineAt(a):n,l=Math.max(o.from,n.from),s=Math.min(o.to,r.to);if(this.boundary){for(;i>n.from;i--)if(this.boundary.test(n.text[i-1-n.from])){l=i;break}for(;a<r.to;a++)if(this.boundary.test(r.text[a-r.from])){s=a;break}}let c,u=[],d=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=l-n.from;(c=this.regexp.exec(n.text))&&c.index<s-n.from;)this.addMatch(c,e,c.index+n.from,d);else yX(e.state.doc,this.regexp,l,s,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:l,filterTo:s,filter:(e,t)=>e<l||t>s,add:u})}}return t}}const wX=null!=/x/.unicode?"gu":"g",EX=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",wX),kX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let OX=null;const SX=EH.define({combine(e){let t=iG(e,{render:null,specialChars:EX,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==OX&&"undefined"!=typeof document&&document.body){let t=document.body.style;OX=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return OX||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,wX)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,wX)),t}});let xX=null;class _X extends nq{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+(kX[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let o=document.createElement("span");return o.textContent=t,o.title=n,o.setAttribute("aria-label",n),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class CX extends nq{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const DX=oq.line({class:"cm-activeLine"}),PX=vQ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let o=e.lineBlockAt(r.head);o.from>t&&(n.push(DX.range(o.from)),t=o.from)}return oq.set(n)}},{decorations:e=>e.decorations});class AX extends nq{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?hq(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=wq(t[0],"rtl"!=n.direction),o=parseInt(n.lineHeight);return r.bottom-r.top>1.5*o?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}const TX=2e3;function FX(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),o=n-r.from,i=o>TX?-1:o==r.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):OG(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}const MX={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},IX={style:"cursor: crosshair"},NX="-10000px";class jX{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let o=null;this.tooltipViews=this.tooltips.map(e=>o=n(e,o))}update(e,t){var n;let r=e.state.facet(this.facet),o=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],a=t?[]:null;for(let n=0;n<o.length;n++){let r=o[n],l=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(l=e)}if(l<0)i[n]=this.createTooltipView(r,n?i[n-1]:null),a&&(a[n]=!!r.above);else{let r=i[n]=this.tooltipViews[l];a&&(a[n]=t[l]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)i.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(a.forEach((e,n)=>t[n]=e),t.length=a.length),this.input=r,this.tooltips=o,this.tooltipViews=i,!0}}function LX(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const RX=EH.define({combine:e=>{var t,n,r;return{position:XG.ios?"absolute":(null===(t=e.find(e=>e.position))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find(e=>e.parent))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find(e=>e.tooltipSpace))||void 0===r?void 0:r.tooltipSpace)||LX}}}),BX=new WeakMap,zX=vQ.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(RX);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new jX(e,HX,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(RX);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=NX,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(XG.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),o=DQ(this.view);return{visible:{left:r.left+o.left,top:r.top+o.top,right:r.right-o.right,bottom:r.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(RX).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{visible:n,space:r,scaleX:o,scaleY:i}=e,a=[];for(let l=0;l<this.manager.tooltips.length;l++){let s=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,d=e.pos[l],p=e.size[l];if(!d||!1!==s.clip&&(d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1)){u.style.top=NX;continue}let f=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,h=f?7:0,m=p.right-p.left,g=null!==(t=BX.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||VX,y=this.view.textDirection==Mq.LTR,b=p.width>r.right-r.left?y?r.left:r.right-p.width:y?Math.max(r.left,Math.min(d.left-(f?14:0)+v.x,r.right-m)):Math.min(Math.max(r.left,d.left-m+(f?14:0)-v.x),r.right-m),w=this.above[l];!s.strictSide&&(w?d.top-g-h-v.y<r.top:d.bottom+g+h+v.y>r.bottom)&&w==r.bottom-d.bottom>d.top-r.top&&(w=this.above[l]=!w);let E=(w?d.top-r.top:r.bottom-d.bottom)-h;if(E<g&&!1!==c.resize){if(E<this.view.defaultLineHeight){u.style.top=NX;continue}BX.set(c,g),u.style.height=(g=E)/i+"px"}else u.style.height&&(u.style.height="");let k=w?d.top-g-h-v.y:d.bottom+h+v.y,O=b+m;if(!0!==c.overlap)for(let e of a)e.left<O&&e.right>b&&e.top<k+g&&e.bottom>k&&(k=w?e.top-g-2-h:e.bottom+h+2);if("absolute"==this.position?(u.style.top=(k-e.parent.top)/i+"px",WX(u,(b-e.parent.left)/o)):(u.style.top=k/i+"px",WX(u,b/o)),f){let e=d.left+(y?v.x:-v.x)-(b+14-7);f.style.left=e/o+"px"}!0!==c.overlap&&a.push({left:b,top:k,right:O,bottom:k+g}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=NX}},{eventObservers:{scroll(){this.maybeMeasure()}}});function WX(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const UX=UY.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),VX={x:0,y:0},HX=EH.define({enables:[zX,UX]}),GX=EH.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class qX{static create(e){return new qX(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new jX(e,GX,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r)if(void 0===t)t=r;else if(t!==r)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const QX=HX.compute([GX],e=>{let t=e.facet(GX);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos})),create:qX.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class $X{constructor(e,t,n,r,o){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,o=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),null==r)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),a=i&&i.dir==Mq.RTL?-1:1;o=t.x<n.left?-a:a}let i=this.source(e,r,o);if(null==i?void 0:i.then){let t=this.pending={pos:r};i.then(n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>fQ(e.state,t,"hover tooltip"))}else!i||Array.isArray(i)&&!i.length||e.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])})}get tooltip(){let e=this.view.plugin(zX),t=e?e.manager.tooltips.findIndex(e=>e.create==qX.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:o}=this;if(r.length&&o&&!function(e,t){let n,{left:r,right:o,top:i,bottom:a}=e.getBoundingClientRect();if(n=e.querySelector(".cm-tooltip-arrow")){let e=n.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=r-YX&&t.clientX<=o+YX&&t.clientY>=i-YX&&t.clientY<=a+YX}(o.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,i=null!==(n=null===(t=r[0])||void 0===t?void 0:t.end)&&void 0!==n?n:o;(o==i?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,r,o){let i=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(i.left>r||i.right<r||i.top>o||Math.min(i.bottom,a)<o)return!1;let l=e.posAtCoords({x:r,y:o},!1);return l>=t&&l<=n}(this.view,o,i,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const YX=4;function XX(e,t={}){let n=QH.define(),r=DH.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,sH.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),n);o.pos=e,null!=o.end&&(o.end=r.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(ZX)&&(e=[]);return e},provide:e=>GX.from(e)});return{active:r,extension:[r,vQ.define(o=>new $X(o,e,r,n,t.hoverTime||300)),QX]}}function KX(e,t){let n=e.plugin(zX);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const ZX=QH.define(),JX=EH.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function eK(e,t){let n=e.plugin(tK),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const tK=vQ.fromClass(class{constructor(e){this.input=e.state.facet(oK),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(JX);this.top=new nK(e,!0,t.topContainer),this.bottom=new nK(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(JX);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new nK(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new nK(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(oK);if(n!=this.input){let t=n.filter(e=>e),r=[],o=[],i=[],a=[];for(let n of t){let t,l=this.specs.indexOf(n);l<0?(t=n(e.view),a.push(t)):(t=this.panels[l],t.update&&t.update(e)),r.push(t),(t.top?o:i).push(t)}this.specs=t,this.panels=r,this.top.sync(o),this.bottom.sync(i);for(let e of a)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>UY.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class nK{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=rK(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=rK(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function rK(e){let t=e.nextSibling;return e.remove(),t}const oK=EH.define({enables:tK});const iK=DH.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(aK)?e=[n.value].concat(e):n.is(lK)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>oK.computeN([e],t=>t.field(e))}),aK=QH.define(),lK=QH.define();class sK extends aG{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}sK.prototype.elementClass="",sK.prototype.toDOM=void 0,sK.prototype.mapMode=sH.TrackBefore,sK.prototype.startSide=sK.prototype.endSide=-1,sK.prototype.point=!0;const cK=EH.define(),uK=EH.define(),dK={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>dG.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},pK=EH.define();function fK(e){return[mK(),pK.of({...dK,...e})]}const hK=EH.define({combine:e=>e.some(e=>e)});function mK(e){let t=[gK];return e&&!1===e.fixed&&t.push(hK.of(!0)),t}const gK=vQ.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(pK).map(t=>new wK(e,t)),this.fixed=!e.state.facet(hK);for(let e of this.gutters)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<.8*(n.to-n.from))}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(hK)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=dG.iter(this.view.state.facet(cK),this.view.viewport.from),r=[],o=this.gutters.map(e=>new bK(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let i of e.type)if(i.type==rq.Text&&t){yK(n,r,i.from);for(let e of o)e.line(this.view,i,r);t=!1}else if(i.widget)for(let e of o)e.widget(this.view,i)}else if(e.type==rq.Text){yK(n,r,e.from);for(let t of o)t.line(this.view,e,r)}else if(e.widget)for(let t of o)t.widget(this.view,e);for(let e of o)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(pK),n=e.state.facet(pK),r=e.docChanged||e.heightChanged||e.viewportChanged||!dG.eq(e.startState.facet(cK),e.state.facet(cK),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let o=[];for(let r of n){let n=t.indexOf(r);n<0?o.push(new wK(this.view,r)):(this.gutters[n].update(e),o.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),o.indexOf(e)<0&&e.destroy();for(let e of o)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=o}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>UY.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,o=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==Mq.LTR?{left:r,right:o}:{right:r,left:o}})});function vK(e){return Array.isArray(e)?e:[e]}function yK(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class bK{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=dG.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==r.elements.length){let t=new EK(e,i,o,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,i,o,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];yK(this.cursor,r,t.from),n.length&&(r=r.concat(n));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o);let i=this.gutter;(0!=r.length||i.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(uK)){let o=n(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class wK{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let o,i=r.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,a,r)&&r.preventDefault()});this.markers=vK(t.markers(e)),t.initialSpacer&&(this.spacer=new EK(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=vK(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!dG.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class EK{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let o=0,i=0;;){let a=i,l=o<t.length?t[o++]:null,s=!1;if(l){let e=l.elementClass;e&&(n+=" "+e);for(let e=i;e<this.markers.length;e++)if(this.markers[e].compare(l)){a=e,s=!0;break}}else a=this.markers.length;for(;i<a;){let e=this.markers[i++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!l)break;l.toDOM&&(s?r=r.nextSibling:this.dom.insertBefore(l.toDOM(e),r)),s&&i++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const kK=EH.define(),OK=EH.define(),SK=EH.define({combine:e=>iG(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],o=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||o(e,t,n):o}return n}})});class xK extends sK{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function _K(e,t){return e.state.facet(SK).formatNumber(t,e.state)}const CK=pK.compute([SK],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(kK),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new xK(_K(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(OK)){let o=r(e,t,n);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(SK)!=e.state.facet(SK),initialSpacer:e=>new xK(_K(e,DK(e.state.doc.lines))),updateSpacer(e,t){let n=_K(t.view,DK(t.view.state.doc.lines));return n==e.number?e:new xK(n)},domEventHandlers:e.facet(SK).domEventHandlers,side:"before"}));function DK(e){let t=9;for(;t<e;)t=10*t+9;return t}const PK=new class extends sK{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},AK=cK.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.head).from;o>n&&(n=o,t.push(PK.range(o)))}return dG.of(t)});var TK;const FK=new QW;const MK=new QW;class IK{constructor(e,t,n=[],r=""){this.data=e,this.name=r,oG.prototype.hasOwnProperty("tree")||Object.defineProperty(oG.prototype,"tree",{get(){return LK(this)}}),this.parser=t,this.extension=[qK.of(this),oG.languageData.of((e,t,n)=>{let r=NK(e,t,n),o=r.type.prop(FK);if(!o)return[];let i=e.facet(o),a=r.type.prop(MK);if(a){let o=r.resolve(t-r.from,n);for(let t of a)if(t.test(o,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i})].concat(n)}isActiveAt(e,t,n=-1){return NK(e,t,n).type.prop(FK)==this.data}findRegions(e){let t=e.facet(qK);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(FK)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(QW.mounted);if(o){if(o.tree.prop(FK)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(r(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let o=e.children[n];o instanceof tU&&r(o,e.positions[n]+t)}};return r(LK(e),0),n}get allowsNesting(){return!0}}function NK(e,t,n){let r=e.facet(qK),o=LK(e).topNode;if(!r||r.allowsNesting)for(let e=o;e;e=e.enter(t,n,eU.ExcludeBuffers|eU.EnterBracketed))e.type.isTop&&(o=e);return o}IK.setState=QH.define();class jK extends IK{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,EH.define({combine:n?e=>e.concat(n):void 0}));var n;return new jK(t,e.parser.configure({props:[FK.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new jK(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function LK(e){let t=e.field(IK.state,!1);return t?t.tree:tU.empty}class RK{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let BK=null;class zK{constructor(e,t,n=[],r,o,i,a,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=o,this.viewport=i,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new zK(e,t,[],tU.empty,0,n,[],null)}startParse(){return this.parser.startParse(new RK(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=tU.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(wU.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(wU.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=BK;BK=this;try{return e()}finally{BK=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=WK(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:o,viewport:i,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,o)=>t.push({fromA:e,toA:n,fromB:r,toB:o})),n=wU.applyChanges(n,t),r=tU.empty,o=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&a.push({from:n,to:r})}}}return new zK(this.parser,t,n,r,o,i,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=WK(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends EU{createParse(t,n,r){let o=r[0].from,i=r[r.length-1].to;return{parsedPos:o,advance(){let t=BK;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new tU(XW.none,[],[],i-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return BK}}function WK(e,t,n){return wU.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class UK{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new UK(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=zK.create(e.facet(qK).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new UK(n)}}IK.state=DH.define({create:UK.init,update(e,t){for(let e of t.effects)if(e.is(IK.setState))return e.value;return t.startState.facet(qK)!=t.state.facet(qK)?UK.init(t.state):e.apply(t)}});let VK=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(VK=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const HK="undefined"!=typeof navigator&&(null===(TK=navigator.scheduling)||void 0===TK?void 0:TK.isInputPending)?()=>navigator.scheduling.isInputPending():null,GK=vQ.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(IK.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(IK.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=VK(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,o=n.field(IK.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,e&&!HK?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<r&&n.doc.length>r+1e3,l=o.context.work(()=>HK&&HK()||Date.now()>i,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:IK.setState.of(new UK(o.context))})),this.chunkBudget>0&&(!l||a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>fQ(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),qK=EH.define({combine:e=>e.length?e[0]:null,enables:e=>[IK.state,GK,UY.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class QK{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const $K=EH.define(),YK=EH.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function XK(e){let t=e.facet(YK);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function KK(e,t){let n="",r=e.tabSize,o=e.facet(YK)[0];if("\t"==o){for(;t>=r;)n+="\t",t-=r;o=" "}for(let e=0;e<t;e++)n+=o;return n}function ZK(e,t){e instanceof oG&&(e=new JK(e));for(let n of e.state.facet($K)){let r=n(e,t);if(void 0!==r)return r}let n=LK(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),o=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(o!=r.node){let e=[];for(let t=o;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return tZ(r,e,n)}(e,n,t):null}class JK{constructor(e,t={}){this.state=e,this.options=t,this.unit=XK(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return null!=r&&r>=n.from&&r<=n.to?o&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.countColumn(n,e-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(o+=i-this.countColumn(n,n.search(/\S|$/))),o}countColumn(e,t=e.length){return OG(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let e=o(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const eZ=new QW;function tZ(e,t,n){for(let r=e;r;r=r.next){let e=nZ(r.node);if(e)return e(oZ.create(t,n,r))}return 0}function nZ(e){let t=e.type.prop(eZ);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(QW.closedBy))){let t=e.lastChild,r=t&&n.indexOf(t.name)>-1;return e=>function(e,t,n,r,o){let i=e.textAfter,a=i.match(/^\s*/)[0].length,l=r&&i.slice(a,a+r.length)==r||o==e.pos+a,s=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let o=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),a=null==o||o<=i.from?i.to:Math.min(i.to,o);for(let e=n.to;;){let o=t.childAfter(e);if(!o||o==r)return null;if(!o.type.isSkipped){if(o.from>=a)return null;let e=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+e}}e=o.to}}(e):null;return s?l?e.column(s.from):e.column(s.to):e.baseIndent+(l?0:e.unit*n)}(e,!0,1,void 0,r&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?rZ:null}function rZ(){return 0}class oZ extends JK{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new oZ(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(iZ(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return tZ(this.context.next,this.base,this.pos)}}function iZ(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function aZ({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const lZ=EH.define(),sZ=new QW;function cZ(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function uZ(e,t,n){for(let r of e.facet(lZ)){let o=r(e,t,n);if(o)return o}return function(e,t,n){let r=LK(e);if(r.length<n)return null;let o=null;for(let i=r.resolveStack(n,1);i;i=i.next){let a=i.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<t)break;let l=a.type.prop(sZ);if(l&&(a.to<r.length-50||r.length==e.doc.length||!cZ(a))){let r=l(a,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function dZ(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const pZ=QH.define({map:dZ}),fZ=QH.define({map:dZ});function hZ(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}const mZ=DH.define({create:()=>oq.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=gZ(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(pZ)&&!yZ(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(OZ),o=r?oq.replace({widget:new CZ(r(t.state,n.value))}):_Z;e=e.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(fZ)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=gZ(e,t.selection.main.head)),e},provide:e=>UY.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],o=e[n++];if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid JSON for fold state");t.push(_Z.range(r,o))}return oq.set(t,!0)}});function gZ(e,t,n=t){let r=!1;return e.between(t,n,(e,o)=>{e<n&&o>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function vZ(e,t,n){var r;let o=null;return null===(r=e.field(mZ,!1))||void 0===r||r.between(t,n,(e,t)=>{(!o||o.from>e)&&(o={from:e,to:t})}),o}function yZ(e,t,n){let r=!1;return e.between(t,t,(e,o)=>{e==t&&o==n&&(r=!0)}),r}function bZ(e,t){return e.field(mZ,!1)?t:t.concat(QH.appendConfig.of(SZ()))}function wZ(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return UY.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${o}.`)}const EZ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of hZ(e)){let n=uZ(e.state,t.from,t.to);if(n)return e.dispatch({effects:bZ(e.state,[pZ.of(n),wZ(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(mZ,!1))return!1;let t=[];for(let n of hZ(e)){let r=vZ(e.state,n.from,n.to);r&&t.push(fZ.of(r),wZ(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let o=e.lineBlockAt(r),i=uZ(t,o.from,o.to);i&&n.push(pZ.of(i)),r=(i?e.lineBlockAt(i.to):o).to+1}return n.length&&e.dispatch({effects:bZ(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(mZ,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(fZ.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],kZ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},OZ=EH.define({combine:e=>iG(e,kZ)});function SZ(e){let t=[mZ,AZ];return e&&t.push(OZ.of(e)),t}function xZ(e,t){let{state:n}=e,r=n.facet(OZ),o=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=vZ(e.state,n.from,n.to);r&&e.dispatch({effects:fZ.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,o,t);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=o,i}const _Z=oq.replace({widget:new class extends nq{toDOM(e){return xZ(e,null)}}});class CZ extends nq{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return xZ(e,this.value)}}const DZ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class PZ extends sK{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const AZ=UY.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class TZ{constructor(e,t){let n;function r(e){let t=DG.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const o="string"==typeof t.all?t.all:t.all?r(t.all):void 0,i=t.scope;this.scope=i instanceof IK?e=>e.prop(FK)==i.data:i?e=>e==i:void 0,this.style=tV(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:o}).style,this.module=n?new DG(n):null,this.themeType=t.themeType}static define(e,t){return new TZ(e,t||{})}}const FZ=EH.define(),MZ=EH.define({combine:e=>e.length?[e[0]]:null});function IZ(e){let t=e.facet(FZ);return t.length?t:e.facet(MZ)}function NZ(e,t){let n,r=[LZ];return e instanceof TZ&&(e.module&&r.push(UY.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(MZ.of(e)):n?r.push(FZ.computeN([UY.darkTheme],t=>t.facet(UY.darkTheme)==("dark"==n)?[e]:[])):r.push(FZ.of(e)),r}class jZ{constructor(e){this.markCache=Object.create(null),this.tree=LK(e.state),this.decorations=this.buildDeco(e,IZ(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=LK(e.state),n=IZ(e.state),r=n!=IZ(e.startState),{viewport:o}=e.view,i=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!r&&t.type==this.tree.type&&i>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=i):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return oq.none;let n=new pG;for(let{from:r,to:o}of e.visibleRanges)nV(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=oq.mark({class:r})))},r,o);return n.finish()}}const LZ=AH.high(vQ.fromClass(jZ,{decorations:e=>e.decorations})),RZ=TZ.define([{tag:bV.meta,color:"#404740"},{tag:bV.link,textDecoration:"underline"},{tag:bV.heading,textDecoration:"underline",fontWeight:"bold"},{tag:bV.emphasis,fontStyle:"italic"},{tag:bV.strong,fontWeight:"bold"},{tag:bV.strikethrough,textDecoration:"line-through"},{tag:bV.keyword,color:"#708"},{tag:[bV.atom,bV.bool,bV.url,bV.contentSeparator,bV.labelName],color:"#219"},{tag:[bV.literal,bV.inserted],color:"#164"},{tag:[bV.string,bV.deleted],color:"#a11"},{tag:[bV.regexp,bV.escape,bV.special(bV.string)],color:"#e40"},{tag:bV.definition(bV.variableName),color:"#00f"},{tag:bV.local(bV.variableName),color:"#30a"},{tag:[bV.typeName,bV.namespace],color:"#085"},{tag:bV.className,color:"#167"},{tag:[bV.special(bV.variableName),bV.macroName],color:"#256"},{tag:bV.definition(bV.propertyName),color:"#00c"},{tag:bV.comment,color:"#940"},{tag:bV.invalid,color:"#f00"}]),BZ=UY.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),zZ="()[]{}",WZ=EH.define({combine:e=>iG(e,{afterCursor:!0,brackets:zZ,maxScanDistance:1e4,renderMatch:HZ})}),UZ=oq.mark({class:"cm-matchingBracket"}),VZ=oq.mark({class:"cm-nonmatchingBracket"});function HZ(e){let t=[],n=e.matched?UZ:VZ;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const GZ=DH.define({create:()=>oq.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(WZ);for(let e of t.state.selection.ranges){if(!e.empty)continue;let o=XZ(t.state,e.head,-1,r)||e.head>0&&XZ(t.state,e.head-1,1,r)||r.afterCursor&&(XZ(t.state,e.head,1,r)||e.head<t.state.doc.length&&XZ(t.state,e.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,t.state)))}return oq.set(n,!0)},provide:e=>UY.decorations.from(e)}),qZ=[GZ,BZ],QZ=new QW;function $Z(e,t,n){let r=e.prop(t<0?QW.openedBy:QW.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function YZ(e){let t=e.type.prop(QZ);return t?t(e.node):e}function XZ(e,t,n,r={}){let o=r.maxScanDistance||1e4,i=r.brackets||zZ,a=LK(e),l=a.resolveInner(t,n);for(let e=l;e;e=e.parent){let r=$Z(e.type,n,i);if(r&&e.from<e.to){let o=YZ(e);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return KZ(0,0,n,e,o,r,i)}}return function(e,t,n,r,o,i,a){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=a.indexOf(l);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=i;){let i=u.value;n<0&&(e+=i.length);let l=t+e*n;for(let e=n>0?0:i.length-1,t=n>0?i.length:-1;e!=t;e+=n){let t=a.indexOf(i[e]);if(!(t<0||r.resolveInner(l+e,1).type!=o))if(t%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:l+e,to:l+e+1},matched:t>>1==s>>1};d--}}n>0&&(e+=i.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,a,l.type,o,i)}function KZ(e,t,n,r,o,i,a){let l=r.parent,s={from:o.from,to:o.to},c=0,u=null==l?void 0:l.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from<u.to){let e=YZ(u);return{start:s,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if($Z(u.type,n,a))c++;else if($Z(u.type,-n,a)){if(0==c){let e=YZ(u);return{start:s,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:s,matched:!1}}const ZZ=Object.create(null),JZ=[XW.none],eJ=[],tJ=Object.create(null),nJ=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])nJ[e]=oJ(ZZ,t);function rJ(e,t){eJ.indexOf(e)>-1||(eJ.push(e),console.warn(t))}function oJ(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||bV[n];r?"function"==typeof r?t.length?t=t.map(r):rJ(n,`Modifier ${n} used at start of tag`):t.length?rJ(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:rJ(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),o=r+" "+n.map(e=>e.id),i=tJ[o];if(i)return i.id;let a=tJ[o]=XW.define({id:JZ.length,name:r,props:[ZU({[r]:n})]});return JZ.push(a),a.id}Mq.RTL,Mq.LTR;let iJ=null;function aJ(){if(!iJ&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)"cssText"!=r&&"cssFloat"!=r&&"string"==typeof e[r]&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));iJ=t.sort().map(e=>({type:"property",label:e,apply:e+": "}))}return iJ||[]}const lJ=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),sJ=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),cJ=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),uJ=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(e=>({type:"keyword",label:e})),dJ=/^(\w[\w-]*|-\w[\w-]*|)$/,pJ=/^-(-[\w-]*)?$/,fJ=new bU,hJ=["Declaration"];function mJ(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function gJ(e,t,n){if(t.to-t.from>4096){let r=fJ.get(t);if(r)return r;let o=[],i=new Set,a=t.cursor(eU.IncludeAnonymous);if(a.firstChild())do{for(let t of gJ(e,a.node,n))i.has(t.label)||(i.add(t.label),o.push(t))}while(a.nextSibling());return fJ.set(t,o),o}{let r=[],o=new Set;return t.cursor().iterate(t=>{var i;if(n(t)&&t.matchContext(hJ)&&":"==(null===(i=t.node.nextSibling)||void 0===i?void 0:i.name)){let n=e.sliceString(t.from,t.to);o.has(n)||(o.add(n),r.push({label:n,type:"variable"}))}}),r}}const vJ=e=>t=>{let{state:n,pos:r}=t,o=LK(n).resolveInner(r,-1),i=o.type.isError&&o.from==o.to-1&&"-"==n.doc.sliceString(o.from,o.to);if("PropertyName"==o.name||(i||"TagName"==o.name)&&/^(Block|Styles)$/.test(o.resolve(o.to).name))return{from:o.from,options:aJ(),validFor:dJ};if("ValueName"==o.name)return{from:o.from,options:sJ,validFor:dJ};if("PseudoClassName"==o.name)return{from:o.from,options:lJ,validFor:dJ};if(e(o)||(t.explicit||i)&&function(e,t){var n;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let r=null===(n=e.parent)||void 0===n?void 0:n.firstChild;return"Callee"==(null==r?void 0:r.name)&&"var"==t.sliceString(r.from,r.to)}(o,n.doc))return{from:e(o)||i?o.from:r,options:gJ(n.doc,mJ(o),e),validFor:pJ};if("TagName"==o.name){for(let{parent:e}=o;e;e=e.parent)if("Block"==e.name)return{from:o.from,options:aJ(),validFor:dJ};return{from:o.from,options:cJ,validFor:dJ}}if("AtKeyword"==o.name)return{from:o.from,options:uJ,validFor:dJ};if(!t.explicit)return null;let a=o.resolve(r),l=a.childBefore(r);return l&&":"==l.name&&"PseudoClassSelector"==a.name?{from:r,options:lJ,validFor:dJ}:l&&":"==l.name&&"Declaration"==a.name||"ArgList"==a.name?{from:r,options:sJ,validFor:dJ}:"Block"==a.name||"Styles"==a.name?{from:r,options:aJ(),validFor:dJ}:null},yJ=vJ(e=>"VariableName"==e.name),bJ=jK.define({name:"css",parser:NV.configure({props:[eZ.add({Declaration:aZ()}),sZ.add({"Block KeyframeList":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});class wJ{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class EJ{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(NJ).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new pG,a=[],l=0,s=n.doc.iter(),c=0,u=n.doc.length;for(let e=0;;){let t,n,r=e==o.length?null:o[e];if(!r&&!a.length)break;if(a.length)t=l,n=a.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if(t=r.from,t>u)break;n=r.to,a.push(r),e++}for(;e<o.length;){let r=o[e];if(r.from!=t||!(r.to>r.from||r.to==t)){n=Math.min(r.from,n);break}a.push(r),e++,n=Math.min(r.to,n)}n=Math.min(n,u);let d=!1;if(a.some(e=>e.from==t&&(e.to==n||n==u))&&(d=t==n,!d&&n-t<10)){let e=t-(c+s.value.length);e>0&&(s.next(e),c=t);for(let e=t;;){if(e>=n){d=!0;break}if(!s.lineBreak&&c+s.value.length>e)break;e=c+s.value.length,c+=s.value.length,s.next()}}let p=QJ(a);if(d)i.add(t,t,oq.widget({widget:new zJ(p),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(t,n,oq.mark({class:"cm-lintRange cm-lintRange-"+p+e,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>n)}))}if(l=n,l==u)break;for(let e=0;e<a.length;e++)a[e].to<=l&&a.splice(e--,1)}let d=i.finish();return new EJ(d,t,kJ(d))}}function kJ(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(r){if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new wJ(r.from,n,r.diagnostic)}else r=new wJ(e,n,t||o.diagnostics[0])}),r}function OJ(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(NJ).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(xJ))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}function SJ(e,t){return e.field(DJ,!1)?t:t.concat(QH.appendConfig.of(t0))}const xJ=QH.define(),_J=QH.define(),CJ=QH.define(),DJ=DH.define({create:()=>new EJ(oq.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=kJ(n,e.selected.diagnostic,o)||kJ(n,null,o)}!n.size&&o&&t.state.facet(NJ).autoPanel&&(o=null),e=new EJ(n,o,r)}for(let n of t.effects)if(n.is(xJ)){let r=t.state.facet(NJ).autoPanel?n.value.length?UJ.open:null:e.panel;e=EJ.init(n.value,r,t.state)}else n.is(_J)?e=new EJ(e.diagnostics,n.value?UJ.open:null,e.selected):n.is(CJ)&&(e=new EJ(e.diagnostics,e.panel,n.value));return e},provide:e=>[oK.from(e,e=>e.panel),UY.decorations.from(e,e=>e.diagnostics)]}),PJ=oq.mark({class:"cm-lintRange cm-lintRange-active"});function AJ(e,t,n){let r,{diagnostics:o}=e.state.field(DJ),i=-1,a=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(e,o,{spec:l})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return r=l.diagnostics,i=e,a=o,!1});let l=e.state.facet(NJ).tooltipFilter;return r&&l&&(r=l(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:TJ(e,r)})}:null}function TJ(e,t){return LG("ul",{class:"cm-tooltip-lint"},t.map(t=>BJ(e,t,!1)))}const FJ=e=>{let t=e.state.field(DJ,!1);return!(!t||!t.panel||(e.dispatch({effects:_J.of(!1)}),0))},MJ=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(DJ,!1);t&&t.panel||e.dispatch({effects:SJ(e.state,[_J.of(!0)])});let n=eK(e,UJ.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(DJ,!1);if(!t)return!1;let n=e.state.selection.main,r=kJ(t.diagnostics,null,n.to+1);return!(!r&&(r=kJ(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],IJ=vQ.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(NJ);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(NJ);t.length&&function(e,t,n){let r=[],o=-1;for(let i of e)i.then(n=>{r.push(n),clearTimeout(o),r.length==e.length?t(r):o=setTimeout(()=>t(r),200)},n)}(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:SJ(e,[xJ.of(t)])}}(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{fQ(this.view.state,e)})}}update(e){let t=e.state.facet(NJ);(e.docChanged||t!=e.startState.facet(NJ)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),NJ=EH.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...iG(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:jJ,tooltipFilter:jJ,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,o)=>e(n,r,o)||t(n,r,o):e:t,autoPanel:(e,t)=>e||t})})});function jJ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function LJ(e,t={}){return[NJ.of({source:e,config:t}),IJ,t0]}function RJ(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function BJ(e,t,n){var r;let o=n?RJ(t.actions):[];return LG("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},LG("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,a=r=>{if(r.preventDefault(),i)return;i=!0;let o=kJ(e.state.field(DJ).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:l}=n,s=o[r]?l.indexOf(o[r]):-1,c=s<0?l:[l.slice(0,s),LG("u",l.slice(s,s+1)),l.slice(s+1)];return LG("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:a,onmousedown:a,"aria-label":` Action: ${l}${s<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&LG("div",{class:"cm-diagnosticSource"},t.source))}class zJ extends nq{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return LG("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class WJ{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=BJ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class UJ{constructor(e){this.view=e,this.items=[],this.list=LG("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)FJ(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=RJ(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=kJ(this.view.state.field(DJ).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=LG("div",{class:"cm-panel-lint"},this.list,LG("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>FJ(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(DJ).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(DJ),n=0,r=!1,o=null,i=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:l})=>{for(let e of l.diagnostics){if(i.has(e))continue;i.add(e);let a,l=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){l=t;break}l<0?(a=new WJ(this.view,e),this.items.splice(n,0,a),r=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),o=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new WJ(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=kJ(this.view.state.field(DJ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:CJ.of(t)})}static open(e){return new UJ(e)}}function VJ(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function HJ(e){return VJ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const GJ=UY.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:HJ("#d11")},".cm-lintRange-warning":{backgroundImage:HJ("orange")},".cm-lintRange-info":{backgroundImage:HJ("#999")},".cm-lintRange-hint":{backgroundImage:HJ("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function qJ(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function QJ(e){let t="hint",n=1;for(let r of e){let e=qJ(r.severity);e>n&&(n=e,t=r.severity)}return t}class $J extends sK{constructor(e){super(),this.diagnostics=e,this.severity=QJ(e)}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(n0).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>function(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:ZJ.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:TJ(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=r=>{let o=t.getBoundingClientRect();if(!(r.clientX>o.left-10&&r.clientX<o.right+10&&r.clientY>o.top-10&&r.clientY<o.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),e.state.field(JJ)&&e.dispatch({effects:ZJ.of(null)})}};window.addEventListener("mousemove",n)}(e,t)}let{hoverTime:o}=e.state.facet(n0),i=setTimeout(r,o);t.onmouseout=()=>{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(r,o)}}(e,t,n)),t}}function YJ(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new $J(n[e]).range(+e));return dG.of(r,!0)}const XJ=fK({class:"cm-gutter-lint",markers:e=>e.state.field(KJ),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(KJ).between(n.from,n.to,(e,t,o)=>{e>n.from&&e<n.to&&r.push(...o.diagnostics)}),r.length?new $J(r):null}}),KJ=DH.define({create:()=>dG.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(n0).markerFilter;for(let r of t.effects)if(r.is(xJ)){let o=r.value;n&&(o=n(o||[],t.state)),e=YJ(t.state.doc,o.slice(0))}return e}}),ZJ=QH.define(),JJ=DH.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=OJ(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(ZJ)?t.value:e,e)),provide:e=>HX.from(e)}),e0=UY.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:VJ('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:VJ('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:VJ('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),t0=[DJ,UY.decorations.compute([DJ],e=>{let{selected:t,panel:n}=e.field(DJ);return t&&n&&t.from!=t.to?oq.set([PJ.range(t.from,t.to)]):oq.none}),XX(AJ,{hideOn:OJ}),GJ],n0=EH.define({combine:e=>iG(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function r0(e={}){return[n0.of(e),KJ,XJ,e0,JJ]}function o0(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(r(n.update(o)),!0)}}const i0=o0(d0,0),a0=o0(u0,0),l0=o0((e,t)=>u0(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let i=t.length-1;i>=0&&t[i].to>r.from?t[i].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}(t)),0);function s0(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const c0=50;function u0(e,t,n=t.selection.ranges){let r=n.map(e=>s0(t,e.from).block);if(!r.every(e=>e))return null;let o=n.map((e,n)=>function(e,{open:t,close:n},r,o){let i,a,l=e.sliceDoc(r-c0,r),s=e.sliceDoc(o,o+c0),c=/\s*$/.exec(l)[0].length,u=/^\s*/.exec(s)[0].length,d=l.length-c;if(l.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:o+u,margin:u&&1}};o-r<=2*c0?i=a=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+c0),a=e.sliceDoc(o-c0,o));let p=/^\s*/.exec(i)[0].length,f=/\s*$/.exec(a)[0].length,h=a.length-f-n.length;return i.slice(p,p+t.length)==t&&a.slice(h,h+n.length)==n?{open:{pos:r+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:o-f-n.length,margin:/\s/.test(a.charAt(h-1))?1:0}}:null}(t,r[n],e.from,e.to));if(2!=e&&!o.every(e=>e))return{changes:t.changes(n.map((e,t)=>o[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&o.some(e=>e)){let e=[];for(let t,n=0;n<o.length;n++)if(t=o[n]){let o=r[n],{open:i,close:a}=t;e.push({from:i.pos-o.open.length,to:i.pos+i.margin},{from:a.pos-a.margin,to:a.pos+o.close.length})}return{changes:e}}return null}function d0(e,t,n=t.selection.ranges){let r=[],o=-1;e:for(let{from:e,to:i}of n){let n,a=r.length,l=1e9;for(let a=e;a<=i;){let s=t.doc.lineAt(a);if(null==n&&(n=s0(t,s.from).line,!n))continue e;if(s.from>o&&(e==i||i>s.from)){o=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+n.length)==n?e:-1;e<s.text.length&&e<l&&(l=e),r.push({line:s,comment:i,token:n,indent:e,empty:t,single:!1})}a=s.to+1}if(l<1e9)for(let e=a;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=l);r.length==a+1&&(r[a].single=!0)}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:o,empty:i,single:a}of r)!a&&i||e.push({from:t.from+o,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:o}of r)if(n>=0){let r=t.from+n,i=r+o.length;" "==t.text[i-t.from]&&i++,e.push({from:r,to:i})}return{changes:e}}return null}const p0=HH.define(),f0=HH.define(),h0=EH.define(),m0=EH.define({combine:e=>iG(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),g0=DH.define({create:()=>F0.empty,update(e,t){let n=t.state.facet(m0),r=t.annotation(p0);if(r){let o=k0.fromTransaction(t,r.selection),i=r.side,a=0==i?e.undone:e.done;return a=o?O0(a,a.length,n.minDepth,o):C0(a,t.startState.selection),new F0(0==i?r.rest:a,0==i?a:r.rest)}let o=t.annotation(f0);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation($H.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=k0.fromTransaction(t),a=t.annotation($H.time),l=t.annotation($H.userEvent);return i?e=e.addChanges(i,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new F0(e.done.map(k0.fromJSON),e.undone.map(k0.fromJSON))});function v0(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(g0,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}const y0=v0(0,!1),b0=v0(1,!1),w0=v0(0,!0),E0=v0(1,!0);class k0{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new k0(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new k0(e.changes&&uH.fromJSON(e.changes),[],e.mapped&&cH.fromJSON(e.mapped),e.startSelection&&yH.fromJSON(e.startSelection),e.selectionsAfter.map(yH.fromJSON))}static fromTransaction(e,t){let n=x0;for(let t of e.startState.facet(h0)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new k0(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,x0)}static selection(e){return new k0(void 0,x0,void 0,void 0,e)}}function O0(e,t,n,r){let o=t+1>n+20?t-n-1:0,i=e.slice(o,t);return i.push(r),i}function S0(e,t){return e.length?t.length?e.concat(t):e:t}const x0=[],_0=200;function C0(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_0));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),O0(e,e.length-1,1e9,n.setSelAfter(r)))}return[k0.selection([t])]}function D0(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function P0(e,t){if(!e.length)return e;let n=e.length,r=x0;for(;n;){let o=A0(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let t=e.slice(0,n);return t[n-1]=o,t}t=o.mapped,n--,r=o.selectionsAfter}return r.length?[k0.selection(r)]:x0}function A0(e,t,n){let r=S0(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):x0,n);if(!e.changes)return k0.selection(r);let o=e.changes.map(t),i=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(i):i;return new k0(o,QH.mapEffects(e.effects,t),a,e.startSelection.map(i),r)}const T0=/^(input\.type|delete)($|\.)/;class F0{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new F0(this.done,this.undone):this}addChanges(e,t,n,r,o){let i=this.done,a=i[i.length-1];return i=a&&a.changes&&!a.changes.empty&&e.changes&&(!n||T0.test(n))&&(!a.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,function(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,o,i)=>{for(let e=0;e<n.length;){let t=n[e++],a=n[e++];i>=t&&o<=a&&(r=!0)}}),r}(a.changes,e.changes))||"input.type.compose"==n)?O0(i,i.length-1,r.minDepth,new k0(e.changes.compose(a.changes),S0(QH.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,x0)):O0(i,i.length,r.minDepth,e),new F0(i,x0,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:x0;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],a=e,i.ranges.length==a.ranges.length&&0===i.ranges.filter((e,t)=>e.empty!=a.ranges[t].empty).length)?this:new F0(C0(this.done,e),this.undone,t,n);var i,a}addMapping(e){return new F0(P0(this.done,e),P0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let o=r[r.length-1],i=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):t.selection);if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:p0.of({side:e,rest:D0(r),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let n=1==r.length?x0:r.slice(0,r.length-1);return o.mapped&&(n=P0(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:p0.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}F0.empty=new F0(x0,x0);const M0=[{key:"Mod-z",run:y0,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:b0,preventDefault:!0},{linux:"Ctrl-Shift-z",run:b0,preventDefault:!0},{key:"Mod-u",run:w0,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:E0,preventDefault:!0}];function I0(e,t){return yH.create(e.ranges.map(t),e.mainIndex)}function N0(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function j0({state:e,dispatch:t},n){let r=I0(e.selection,n);return!r.eq(e.selection,!0)&&(t(N0(e,r)),!0)}function L0(e,t){return yH.cursor(t?e.to:e.from)}function R0(e,t){return j0(e,n=>n.empty?e.moveByChar(n,t):L0(n,t))}function B0(e){return e.textDirectionAt(e.state.selection.main.head)==Mq.LTR}const z0=e=>R0(e,!B0(e)),W0=e=>R0(e,B0(e));function U0(e,t){return j0(e,n=>n.empty?e.moveByGroup(n,t):L0(n,t))}function V0(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function H0(e,t,n){let r,o,i=LK(e).resolveInner(t.head),a=n?QW.closedBy:QW.openedBy;for(let r=t.head;;){let t=n?i.childAfter(r):i.childBefore(r);if(!t)break;V0(e,t,a)?i=t:r=n?t.to:t.from}return o=i.type.prop(a)&&(r=n?XZ(e,i.from,1):XZ(e,i.to,-1))&&r.matched?n?r.end.to:r.end.from:n?i.to:i.from,yH.cursor(o,n?-1:1)}function G0(e,t){return j0(e,n=>{if(!n.empty)return L0(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const q0=e=>G0(e,!1),Q0=e=>G0(e,!0);function $0(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,o=0;if(n){for(let t of e.state.facet(UY.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(r=Math.max(null==n?void 0:n.top,r)),(null==n?void 0:n.bottom)&&(o=Math.max(null==n?void 0:n.bottom,o))}t=e.scrollDOM.clientHeight-r-o}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:o,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function Y0(e,t){let n,r=$0(e),{state:o}=e,i=I0(o.selection,n=>n.empty?e.moveVertically(n,t,r.height):L0(n,t));if(i.eq(o.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(o.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+r.marginTop,s=a.bottom-r.marginBottom;t&&t.top>l&&t.bottom<s&&(n=UY.scrollIntoView(i.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(N0(o,i),{effects:n}),!0}const X0=e=>Y0(e,!1),K0=e=>Y0(e,!0);function Z0(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(o=yH.cursor(r.from+n))}return o}function J0(e,t){let n=I0(e.state.selection,e=>{let n=t(e);return yH.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(N0(e.state,n)),!0)}function e1(e,t){return J0(e,n=>e.moveByChar(n,t))}const t1=e=>e1(e,!B0(e)),n1=e=>e1(e,B0(e));function r1(e,t){return J0(e,n=>e.moveByGroup(n,t))}function o1(e,t){return J0(e,n=>e.moveVertically(n,t))}const i1=e=>o1(e,!1),a1=e=>o1(e,!0);function l1(e,t){return J0(e,n=>e.moveVertically(n,t,$0(e).height))}const s1=e=>l1(e,!1),c1=e=>l1(e,!0),u1=({state:e,dispatch:t})=>(t(N0(e,{anchor:0})),!0),d1=({state:e,dispatch:t})=>(t(N0(e,{anchor:e.doc.length})),!0),p1=({state:e,dispatch:t})=>(t(N0(e,{anchor:e.selection.main.anchor,head:0})),!0),f1=({state:e,dispatch:t})=>(t(N0(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function h1(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head);if(t?i.to<e.state.doc.length:i.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<i.from||r.head>i.to){o.some(e=>e.head==r.head)||o.push(r);break}if(r.head==n.head)break;n=r}}return o.length!=r.ranges.length&&(e.dispatch(N0(n,yH.create(o,o.length-1))),!0)}function m1(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange(r=>{let{from:o,to:i}=r;if(o==i){let a=t(r);a<o?(n="delete.backward",a=g1(e,a,!1)):a>o&&(n="delete.forward",a=g1(e,a,!0)),o=Math.min(o,a),i=Math.max(i,a)}else o=g1(e,o,!1),i=g1(e,i,!0);return o==i?{range:r}:{changes:{from:o,to:i},range:yH.cursor(o,o<r.head?-1:1)}});return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?UY.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function g1(e,t,n){if(e instanceof UY)for(let r of e.state.facet(UY.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}const v1=(e,t,n)=>m1(e,r=>{let o,i,a=r.from,{state:l}=e,s=l.doc.lineAt(a);if(n&&!t&&a>s.from&&a<s.from+200&&!/[^ \t]/.test(o=s.text.slice(0,a-s.from))){if("\t"==o[o.length-1])return a-1;let e=OG(o,l.tabSize)%XK(l)||XK(l);for(let t=0;t<e&&" "==o[o.length-1-t];t++)a--;i=a}else i=rH(s.text,a-s.from,t,t)+s.from,i==a&&s.number!=(t?l.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(i-s.from,a-s.from))&&(i=rH(s.text,i-s.from,!1,!1)+s.from);return i}),y1=e=>v1(e,!1,!0),b1=e=>v1(e,!0,!1),w1=(e,t)=>m1(e,n=>{let r=n.head,{state:o}=e,i=o.doc.lineAt(r),a=o.charCategorizer(r);for(let e=null;;){if(r==(t?i.to:i.from)){r==n.head&&i.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let l=rH(i.text,r-i.from,t)+i.from,s=i.text.slice(Math.min(r,l)-i.from,Math.max(r,l)-i.from),c=a(s);if(null!=e&&c!=e)break;" "==s&&r==n.head||(e=c),r=l}return r}),E1=e=>w1(e,!1);function k1(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),i=e.doc.lineAt(r.to);if(r.empty||r.to!=i.from||(i=e.doc.lineAt(r.to-1)),n>=o.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(r)}else t.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return t}function O1(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let t of k1(e)){if(n?t.to==e.doc.length:0==t.from)continue;let i=e.doc.lineAt(n?t.to+1:t.from-1),a=i.length+1;if(n){r.push({from:t.to,to:i.to},{from:t.from,insert:i.text+e.lineBreak});for(let n of t.ranges)o.push(yH.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)))}else{r.push({from:i.from,to:t.from},{from:t.to,insert:e.lineBreak+i.text});for(let e of t.ranges)o.push(yH.range(e.anchor-a,e.head-a))}}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:yH.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function S1(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of k1(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let o=e.changes(r);return t(e.update({changes:o,selection:e.selection.map(o,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const x1=_1(!1);function _1(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:o}=n,i=t.doc.lineAt(r),a=!e&&r==o&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=LK(e).resolveInner(t),o=r.childBefore(t),i=r.childAfter(t);return o&&i&&o.to<=t&&i.from>=t&&(n=o.type.prop(QW.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(o.to,i.from))?{from:o.to,to:i.from}:null}(t,r);e&&(r=o=(o<=i.to?i:t.doc.lineAt(o)).to);let l=new JK(t,{simulateBreak:r,simulateDoubleBreak:!!a}),s=ZK(l,r);for(null==s&&(s=OG(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<i.to&&/\s/.test(i.text[o-i.from]);)o++;a?({from:r,to:o}=a):r>i.from&&r<i.from+100&&!/\S/.test(i.text.slice(0,r))&&(r=i.from);let c=["",KK(t,s)];return a&&c.push(KK(t,l.lineIndent(i.from,-1))),{changes:{from:r,to:o,insert:QV.of(c)},range:yH.cursor(r+1+c[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function C1(e,t){let n=-1;return e.changeByRange(r=>{let o=[];for(let i=r.from;i<=r.to;){let a=e.doc.lineAt(i);a.number>n&&(r.empty||r.to>a.from)&&(t(a,o,r),n=a.number),i=a.to+1}let i=e.changes(o);return{changes:o,range:yH.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const D1=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(C1(e,(t,n)=>{n.push({from:t.from,insert:e.facet(YK)})}),{userEvent:"input.indent"})),!0),P1=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(C1(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=OG(r,e.tabSize),i=0,a=KK(e,Math.max(0,o-XK(e)));for(;i<r.length&&i<a.length&&r.charCodeAt(i)==a.charCodeAt(i);)i++;n.push({from:t.from+i,to:t.from+r.length,insert:a.slice(i)})}),{userEvent:"delete.dedent"})),!0),A1=[{key:"Ctrl-b",run:z0,shift:t1,preventDefault:!0},{key:"Ctrl-f",run:W0,shift:n1},{key:"Ctrl-p",run:q0,shift:i1},{key:"Ctrl-n",run:Q0,shift:a1},{key:"Ctrl-a",run:e=>j0(e,t=>yH.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>J0(e,t=>yH.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>j0(e,t=>yH.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>J0(e,t=>yH.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:b1},{key:"Ctrl-h",run:y1},{key:"Ctrl-k",run:e=>m1(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:E1},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:QV.of(["",""])},range:yH.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),o=n==r.from?n-1:rH(r.text,n-r.from,!1)+r.from,i=n==r.to?n+1:rH(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(o,n))},range:yH.cursor(i)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:K0}],T1=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>j0(e,t=>H0(e.state,t,!B0(e))),shift:e=>J0(e,t=>H0(e.state,t,!B0(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>j0(e,t=>H0(e.state,t,B0(e))),shift:e=>J0(e,t=>H0(e.state,t,B0(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>O1(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>S1(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>O1(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>S1(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>h1(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>h1(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=yH.create([n.main]):n.main.empty||(r=yH.create([yH.cursor(n.main.head)])),!!r&&(t(N0(e,r)),!0)}},{key:"Mod-Enter",run:_1(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=k1(e).map(({from:t,to:n})=>yH.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:yH.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=I0(e.selection,t=>{let n=LK(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return yH.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(N0(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:P1},{key:"Mod-]",run:D1},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new JK(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=C1(e,(t,o,i)=>{let a=ZK(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],s=KK(e,a);(l!=s||i.from<t.from+l.length)&&(n[t.from]=a,o.push({from:t.from,to:t.from+l.length,insert:s}))});return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(k1(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=I0(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),o=e.coordsAtPos(t.head,t.assoc||1);o&&(n=r.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let r=!1,o=I0(e.selection,t=>{let o=XZ(e,t.head,-1)||XZ(e,t.head,1)||t.head>0&&XZ(e,t.head-1,1)||t.head<e.doc.length&&XZ(e,t.head+1,-1);if(!o||!o.end)return t;r=!0;let i=o.start.from==t.head?o.end.to:o.end.from;return n?yH.range(t.anchor,i):yH.cursor(i)});return!!r&&(t(N0(e,o)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=s0(e.state,n.from);return r.line?i0(e):!!r.block&&l0(e)}},{key:"Alt-A",run:a0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:z0,shift:t1,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>U0(e,!B0(e)),shift:e=>r1(e,!B0(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>j0(e,t=>Z0(e,t,!B0(e))),shift:e=>J0(e,t=>Z0(e,t,!B0(e))),preventDefault:!0},{key:"ArrowRight",run:W0,shift:n1,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>U0(e,B0(e)),shift:e=>r1(e,B0(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>j0(e,t=>Z0(e,t,B0(e))),shift:e=>J0(e,t=>Z0(e,t,B0(e))),preventDefault:!0},{key:"ArrowUp",run:q0,shift:i1,preventDefault:!0},{mac:"Cmd-ArrowUp",run:u1,shift:p1},{mac:"Ctrl-ArrowUp",run:X0,shift:s1},{key:"ArrowDown",run:Q0,shift:a1,preventDefault:!0},{mac:"Cmd-ArrowDown",run:d1,shift:f1},{mac:"Ctrl-ArrowDown",run:K0,shift:c1},{key:"PageUp",run:X0,shift:s1},{key:"PageDown",run:K0,shift:c1},{key:"Home",run:e=>j0(e,t=>Z0(e,t,!1)),shift:e=>J0(e,t=>Z0(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:u1,shift:p1},{key:"End",run:e=>j0(e,t=>Z0(e,t,!0)),shift:e=>J0(e,t=>Z0(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:d1,shift:f1},{key:"Enter",run:x1,shift:x1},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:y1,shift:y1,preventDefault:!0},{key:"Delete",run:b1,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:E1,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>w1(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>m1(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>m1(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(A1.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),F1={key:"Tab",run:D1,shift:P1},M1="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class I1{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(M1(e)):M1,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return oH(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=iH(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=aH(e);let r=this.normalize(t);if(r.length)for(let e=0,o=n;;e++){let i=r.charCodeAt(e),a=this.match(i,o,this.bufferPos+this.bufferStart);if(e==r.length-1){if(a)return this.value=a,this;break}o==n&&e<t.length&&t.charCodeAt(e)==i&&o++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let o=this.matches[t],i=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,i=!0)),i||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(I1.prototype[Symbol.iterator]=function(){return this});const N1={from:-1,to:-1,match:/.*/.exec("")},j1="gm"+(null==/x/.unicode?"":"u");class L1{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=N1,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new z1(e,t,n,r,o);this.re=new RegExp(t,j1+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=W1(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=W1(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const R1=new WeakMap;class B1{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=R1.get(e);if(!r||r.from>=n||r.to<=t){let r=new B1(t,e.sliceString(t,n));return R1.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),R1.set(e,new B1(i,o)),new B1(t,o.slice(t-i,n-i))}}class z1{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=N1,this.matchPos=W1(e,r),this.re=new RegExp(t,j1+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=B1.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=W1(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=B1.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function W1(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}"undefined"!=typeof Symbol&&(L1.prototype[Symbol.iterator]=z1.prototype[Symbol.iterator]=function(){return this});const U1={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},V1=EH.define({combine:e=>iG(e,U1,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),H1=oq.mark({class:"cm-selectionMatch"}),G1=oq.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function q1(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==tG.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==tG.Word)}const Q1=vQ.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(V1),{state:n}=e,r=n.selection;if(r.ranges.length>1)return oq.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return oq.none;let e=n.wordAt(i.head);if(!e)return oq.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return oq.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!q1(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==tG.Word&&e(t.sliceDoc(r-1,r))==tG.Word}(a,n,i.from,i.to))return oq.none}else if(o=n.sliceDoc(i.from,i.to),!o)return oq.none}let l=[];for(let r of e.visibleRanges){let e=new I1(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||q1(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?l.push(G1.range(r,o)):(r>=i.to||o<=i.from)&&l.push(H1.range(r,o)),l.length>t.maxMatches))return oq.none}}return oq.set(l)}},{decorations:e=>e.decorations}),$1=UY.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Y1=EH.define({combine:e=>iG(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new S2(e),scrollToMatch:e=>UY.scrollIntoView(e)})});class X1{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,j1),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new r2(this):new J1(this)}getCursor(e,t=0,n){let r=e.doc?e:oG.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?e2(this,r,t,n):Z1(this,r,t,n)}}class K1{constructor(e){this.spec=e}}function Z1(e,t,n,r){let o;return e.wholeWord&&(o=function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(t2(o,n-i))==tG.Word&&t(n2(o,n-i))==tG.Word||t(n2(o,r-i))==tG.Word&&t(t2(o,r-i))==tG.Word))}(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i,a)=>{if(n&&!n(r,o,i,a))return!1;let l=r>=a&&o<=a+i.length?i.slice(r-a,o-a):t.doc.sliceString(r,o);return e(l,t,r,o)}}(e.test,t,o)),new I1(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),o)}class J1 extends K1{constructor(e){super(e)}nextMatch(e,t,n){let r=Z1(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Z1(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=Z1(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!r||r.from==t&&r.to==n?null:r}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Z1(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Z1(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function e2(e,t,n,r){let o;var i;return e.wholeWord&&(i=t.charCategorizer(t.selection.main.head),o=(e,t,n)=>!n[0].length||(i(t2(n.input,n.index))!=tG.Word||i(n2(n.input,n.index))!=tG.Word)&&(i(n2(n.input,n.index+n[0].length))!=tG.Word||i(t2(n.input,n.index+n[0].length))!=tG.Word)),e.test&&(o=function(e,t,n){return(r,o,i)=>(!n||n(r,o,i))&&e(i[0],t,r,o)}(e.test,t,o)),new L1(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function t2(e,t){return e.slice(rH(e,t,!1),t)}function n2(e,t){return e.slice(t,rH(e,t))}class r2 extends K1{nextMatch(e,t,n){let r=e2(this.spec,e,n,e.doc.length).next();return r.done&&(r=e2(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=e2(this.spec,e,o,n),a=null;for(;!i.next().done;)a=i.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=e2(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=e2(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const o2=QH.define(),i2=QH.define(),a2=DH.define({create:e=>new l2(y2(e).create(),null),update(e,t){for(let n of t.effects)n.is(o2)?e=new l2(n.value.create(),e.panel):n.is(i2)&&(e=new l2(e.query,n.value?v2:null));return e},provide:e=>oK.from(e,e=>e.panel)});class l2{constructor(e,t){this.query=e,this.panel=t}}const s2=oq.mark({class:"cm-searchMatch"}),c2=oq.mark({class:"cm-searchMatch cm-searchMatch-selected"}),u2=vQ.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(a2))}update(e){let t=e.state.field(a2);(t!=e.startState.field(a2)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return oq.none;let{view:n}=this,r=new pG;for(let t=0,o=n.visibleRanges,i=o.length;t<i;t++){let{from:a,to:l}=o[t];for(;t<i-1&&l>o[t+1].from-500;)l=o[++t].to;e.highlight(n.state,a,l,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?c2:s2)})}return r.finish()}},{decorations:e=>e.decorations});function d2(e){return t=>{let n=t.state.field(a2,!1);return n&&n.query.spec.valid?e(t,n):E2(t)}}const p2=d2((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=yH.single(r.from,r.to),i=e.state.facet(Y1);return e.dispatch({selection:o,effects:[D2(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),w2(e),!0}),f2=d2((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=yH.single(o.from,o.to),a=e.state.facet(Y1);return e.dispatch({selection:i,effects:[D2(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),w2(e),!0}),h2=d2((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:yH.create(n.map(e=>yH.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),m2=d2((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let a,l,s=i,c=[],u=[];s.from==r&&s.to==o&&(l=n.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:l}),s=t.nextMatch(n,s.from,s.to),u.push(UY.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let d=e.state.changes(c);return s&&(a=yH.single(s.from,s.to).map(d),u.push(D2(e,s)),u.push(n.facet(Y1).scrollToMatch(a.main,e))),e.dispatch({changes:d,selection:a,effects:u,userEvent:"input.replace"}),!0}),g2=d2((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:UY.announce.of(r),userEvent:"input.replace.all"}),!0});function v2(e){return e.state.facet(Y1).createPanel(e)}function y2(e,t){var n,r,o,i,a;let l=e.selection.main,s=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!s)return t;let c=e.facet(Y1);return new X1({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function b2(e){let t=eK(e,v2);return t&&t.dom.querySelector("[main-field]")}function w2(e){let t=b2(e);t&&t==e.root.activeElement&&t.select()}const E2=e=>{let t=e.state.field(a2,!1);if(t&&t.panel){let n=b2(e);if(n&&n!=e.root.activeElement){let r=y2(e.state,t.query.spec);r.valid&&e.dispatch({effects:o2.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[i2.of(!0),t?o2.of(y2(e.state,t.query.spec)):QH.appendConfig.of(A2)]});return!0},k2=e=>{let t=e.state.field(a2,!1);if(!t||!t.panel)return!1;let n=eK(e,v2);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:i2.of(!1)}),!0},O2=[{key:"Mod-f",run:E2,scope:"editor search-panel"},{key:"F3",run:p2,shift:f2,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:p2,shift:f2,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:k2,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],a=0;for(let t=new I1(e.doc,e.sliceDoc(r,o));!t.next().done;){if(i.length>1e3)return!1;t.value.from==r&&(a=i.length),i.push(yH.range(t.value.from,t.value.to))}return t(e.update({selection:yH.create(i,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:o}=function(e,t){let n,r=new Promise(e=>n=e),o=e=>function(e,t,n){let r=t.content?t.content(e,()=>a(null)):null;if(!r){if(r=LG("form"),t.input){let e=LG("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),r.appendChild(LG("label",(t.label||"")+": ",e))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(LG("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let o="FORM"==r.nodeName?[r]:r.querySelectorAll("form");for(let e=0;e<o.length;e++){let t=o[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),a(null)):13==e.keyCode&&(e.preventDefault(),a(t))}),t.addEventListener("submit",e=>{e.preventDefault(),a(t)})}let i=LG("div",r,LG("button",{onclick:()=>a(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));function a(t){i.contains(i.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(i.className=t.class),i.classList.add("cm-dialog"),{dom:i,top:t.top,mount:()=>{if(t.focus){let e;e="string"==typeof t.focus?r.querySelector(t.focus):r.querySelector("input")||r.querySelector("button"),e&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}}(e,t,n);e.state.field(iK,!1)?e.dispatch({effects:aK.of(o)}):e.dispatch({effects:QH.appendConfig.of(iK.init(()=>[o]))});let i=lK.of(o);return{close:i,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(iK).indexOf(o)>-1&&e.dispatch({effects:i})}),t))}}(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return o.then(n=>{let o=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!o)return void e.dispatch({effects:r});let i=t.doc.lineAt(t.selection.main.head),[,a,l,s,c]=o,u=s?+s.slice(1):0,d=l?+l:i.number;if(l&&c){let e=d/100;a&&(e=e*("-"==a?-1:1)+i.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else l&&a&&(d=d*("-"==a?-1:1)+i.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),f=yH.cursor(p.from+Math.max(0,Math.min(u,p.length)));e.dispatch({effects:[r,UY.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=yH.create(n.ranges.map(t=>e.wordAt(t.head)||yH.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let n=!1,o=new I1(e.doc,t,r[r.length-1].to);;){if(o.next(),!o.done){if(n&&r.some(e=>e.from==o.value.from))continue;if(i){let t=e.wordAt(o.value.from);if(!t||t.from!=o.value.from||t.to!=o.value.to)continue}return o.value}if(n)return null;o=new I1(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(yH.range(o.from,o.to),!1),effects:UY.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class S2{constructor(e){this.view=e;let t=this.query=e.state.field(a2).query.spec;function n(e,t,n){return LG("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=LG("input",{value:t.search,placeholder:x2(e,"Find"),"aria-label":x2(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=LG("input",{value:t.replace,placeholder:x2(e,"Replace"),"aria-label":x2(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=LG("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=LG("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=LG("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=LG("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>p2(e),[x2(e,"next")]),n("prev",()=>f2(e),[x2(e,"previous")]),n("select",()=>h2(e),[x2(e,"all")]),LG("label",null,[this.caseField,x2(e,"match case")]),LG("label",null,[this.reField,x2(e,"regexp")]),LG("label",null,[this.wordField,x2(e,"by word")]),...e.state.readOnly?[]:[LG("br"),this.replaceField,n("replace",()=>m2(e),[x2(e,"replace")]),n("replaceAll",()=>g2(e),[x2(e,"replace all")])],LG("button",{name:"close",onclick:()=>k2(e),"aria-label":x2(e,"close"),type:"button"},["×"])])}commit(){let e=new X1({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:o2.of(e)}))}keydown(e){var t,n;t=this.view,n=e,nX(ZY(t.state),n,t,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?f2:p2)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),m2(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(o2)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Y1).top}}function x2(e,t){return e.state.phrase(t)}const _2=30,C2=/[\s\.,:;?!]/;function D2(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-_2),a=Math.min(o,n+_2),l=e.state.sliceDoc(i,a);if(i!=r.from)for(let e=0;e<_2;e++)if(!C2.test(l[e+1])&&C2.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-_2;e--)if(!C2.test(l[e-1])&&C2.test(l[e])){l=l.slice(0,e);break}return UY.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}const P2=UY.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),A2=[a2,AH.low(u2),P2];class T2{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=LK(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),o=r.search(N2(e,!1));return o<0?null:{from:n+o,to:this.pos,text:r.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function F2(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class M2{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function I2(e){return e.selection.main.from}function N2(e,t){var n;let{source:r}=e,o=t&&"^"!=r[0],i="$"!=r[r.length-1];return o||i?new RegExp(`${o?"^":""}(?:${r})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const j2=HH.define();function L2(e,t,n,r){let{main:o}=e.selection,i=n-o.from,a=r-o.from;return{...e.changeByRange(l=>{if(l!=o&&n!=r&&e.sliceDoc(l.from+i,l.from+a)!=e.sliceDoc(n,r))return{range:l};let s=e.toText(t);return{changes:{from:l.from+i,to:r==o.from?l.to:l.from+a,insert:s},range:yH.cursor(l.from+i+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const R2=new WeakMap;function B2(e){if(!Array.isArray(e))return e;let t=R2.get(e);return t||R2.set(e,t=function(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=F2(t)+F2(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}(t);return e=>{let o=e.matchBefore(r);return o||e.explicit?{from:o?o.from:e.pos,options:t,validFor:n}:null}}(e)),t}const z2=QH.define(),W2=QH.define();class U2{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=oH(e,t),r=aH(n);this.chars.push(n);let o=e.slice(t,t+r),i=o.toUpperCase();this.folded.push(oH(i==o?o.toLowerCase():i,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:o,byWord:i}=this;if(1==t.length){let r=oH(e,0),o=aH(r),i=o==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;i+=-200}return this.ret(i,[0,o])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,s=0;if(a<0){for(let o=0,i=Math.min(e.length,200);o<i&&s<l;){let i=oH(e,o);i!=t[s]&&i!=n[s]||(r[s++]=o),o+=aH(i)}if(s<l)return null}let c=0,u=0,d=!1,p=0,f=-1,h=-1,m=/[a-z]/.test(e),g=!0;for(let r=0,s=Math.min(e.length,200),v=0;r<s&&u<l;){let s=oH(e,r);a<0&&(c<l&&s==t[c]&&(o[c++]=r),p<l&&(s==t[p]||s==n[p]?(0==p&&(f=r),h=r+1,p++):p=0));let y,b=s<255?s>=48&&s<=57||s>=97&&s<=122?2:s>=65&&s<=90?1:0:(y=iH(s))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!r||1==b&&m||0==v&&0!=b)&&(t[u]==s||n[u]==s&&(d=!0)?i[u++]=r:i.length&&(g=!1)),v=b,r+=aH(s)}return u==l&&0==i[0]&&g?this.result((d?-200:0)-100,i,e):p==l&&0==f?this.ret(-200-e.length+(h==e.length?0:-100),[0,h]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[f,h]):u==l?this.result((d?-200:0)-100-700+(g?0:-1100),i,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}result(e,t,n){let r=[],o=0;for(let e of t){let t=e+(this.astral?aH(oH(n,e)):1);o&&r[o-1]==e?r[o-1]=t:(r[o++]=e,r[o++]=t)}return this.ret(e-n.length,r)}}class V2{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const H2=EH.define({combine:e=>iG(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:q2,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>G2(e(n),t(n)),optionClass:(e,t)=>n=>G2(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function G2(e,t){return e?t?e+" "+t:e:t}function q2(e,t,n,r,o,i){let a,l,s=e.textDirection==Mq.RTL,c=s,u=!1,d="top",p=t.left-o.left,f=o.right-t.right,h=r.right-r.left,m=r.bottom-r.top;if(c&&p<Math.min(h,f)?c=!1:!c&&f<Math.min(h,p)&&(c=!0),h<=(c?p:f))a=Math.max(o.top,Math.min(n.top,o.bottom-m))-t.top,l=Math.min(400,c?p:f);else{u=!0,l=Math.min(400,(s?t.right:o.right-t.left)-30);let e=o.bottom-t.bottom;e>=m||e>t.top?a=n.bottom-t.top:(d="bottom",a=t.bottom-n.top)}return{style:`${d}: ${a/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${l/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function Q2(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class $2{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:o,selected:i}=r.open,a=e.state.facet(H2);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let i=e.displayLabel||e.label,a=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>a&&o.appendChild(document.createTextNode(i.slice(a,t)));let l=o.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(i.slice(t,n))),l.className="cm-completionMatchedText",a=n}return a<i.length&&o.appendChild(document.createTextNode(i.slice(a))),o},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=Q2(o.length,i,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t,o=n.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(t=/-(\d+)$/.exec(o.id))&&+t[1]<r.length)return this.applyCompletion(e,r[+t[1]]),void n.preventDefault()}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(H2).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:W2.of(null)})}),this.showOptions(o,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:o,selected:i,disabled:a}=n.open;r.open&&r.open.options==o||(this.range=Q2(o.length,i,e.state.facet(H2).maxRenderedOptions),this.showOptions(o,n.id)),this.updateSel(),a!=(null===(t=r.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Q2(t.options.length,t.selected,this.view.state.facet(H2).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:o}=r;if(!o)return;let i="string"==typeof o?document.createTextNode(o):o(r);if(!i)return;"then"in i?i.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>fQ(this.view.state,e,"completion info")):(this.addInfoPane(i,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)"LI"==n.nodeName&&n.id?r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby")):r--;return t&&function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/o:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/o)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),o=this.space;if(!o){let e=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(o.bottom,t.bottom)-10||r.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(H2).positionInfo(this.view,t,r,n,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let o=null;for(let i=n.from;i<n.to;i++){let{completion:a,match:l}=e[i],{section:s}=a;if(s){let e="string"==typeof s?s:s.name;e!=o&&(i>n.from||0==n.from)&&(o=e,"string"!=typeof s&&s.header?r.appendChild(s.header(s)):r.appendChild(document.createElement("completion-section")).textContent=e)}const c=r.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(a);u&&(c.className=u);for(let e of this.optionContent){let t=e(a,this.view.state,this.view,l);t&&c.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Y2(e,t){return n=>new $2(n,e,t)}function X2(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class K2{constructor(e,t,n,r,o,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=o,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new K2(this.options,t3(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,o,i){if(r&&!i&&e.some(e=>e.isPending))return r.setDisabled();let a=function(e,t){let n=[],r=null,o=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},a=t.facet(H2);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)i(new M2(t,r.source,e?e(t):[],1e9-n.length));else{let n,l=t.sliceDoc(r.from,r.to),s=a.filterStrict?new V2(l):new U2(l);for(let t of r.result.options)if(n=s.match(t.label)){let a=t.displayLabel?e?e(t,n.matched):[]:n.matched,l=n.score+(t.boost||0);if(i(new M2(t,r.source,a,l)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;o||(o=Object.create(null)),o[e]=Math.max(l,o[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,i=(e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?o[t.name]-o[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(i))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let l=[],s=null,c=a.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||c(e.completion,t.completion))){let t=e.completion;!s||s.label!=t.label||s.detail!=t.detail||null!=s.type&&null!=t.type&&s.type!=t.type||s.apply!=t.apply||s.boost!=t.boost?l.push(e):X2(e.completion)>X2(s)&&(l[l.length-1]=e),s=e.completion}return l}(e,t);if(!a.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let l=t.facet(H2).selectOnOpen?0:-1;if(r&&r.selected!=l&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<a.length;t++)if(a[t].completion==e){l=t;break}}return new K2(a,t3(n,l),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:u3,above:o.aboveCursor},r?r.timestamp:Date.now(),l,!1)}map(e){return new K2(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new K2(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Z2{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Z2(n3,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(H2),r=(n.override||t.languageDataAt("autocomplete",I2(t)).map(B2)).map(t=>(this.active.find(e=>e.source==t)||new o3(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let o=this.open,i=e.effects.some(e=>e.is(a3));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let o=n==e.length,i=r==t.length;if(o||i)return o==i;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||i?o=K2.build(r,t,this.id,o,n,i):o&&o.disabled&&!r.some(e=>e.isPending)&&(o=null),!o&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new o3(e.source,0):e));for(let t of e.effects)t.is(l3)&&(o=o&&o.setSelected(t.value,this.id));return r==this.active&&o==this.open?this:new Z2(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?J2:e3}}const J2={"aria-autocomplete":"list"},e3={};function t3(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const n3=[];function r3(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(j2);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class o3{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=r3(e,t),r=this;(8&n||16&n&&this.touches(e))&&(r=new o3(r.source,0)),4&n&&0==r.state&&(r=new o3(this.source,1)),r=r.updateFor(e,n);for(let t of e.effects)if(t.is(z2))r=new o3(r.source,1,t.value);else if(t.is(W2))r=new o3(r.source,0);else if(t.is(a3))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(I2(e.state))}}class i3 extends o3{constructor(e,t,n,r,o,i){super(e,3,t),this.limit=n,this.result=r,this.from=o,this.to=i}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let o=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),a=I2(e.state);if(a>i||!r||2&t&&(I2(e.startState)==this.from||a<this.limit))return new o3(this.source,4&t?1:0);let l=e.changes.mapPos(this.limit);return function(e,t,n,r){if(!e)return!1;let o=t.sliceDoc(n,r);return"function"==typeof e?e(o,n,r,t):N2(e,!0).test(o)}(r.validFor,e.state,o,i)?new i3(this.source,this.explicit,l,r,o,i):r.update&&(r=r.update(r,o,i,new T2(e.state,a,!1)))?new i3(this.source,this.explicit,l,r,r.from,null!==(n=r.to)&&void 0!==n?n:I2(e.state)):new o3(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new i3(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new o3(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const a3=QH.define({map:(e,t)=>e.map(e=>e.map(t))}),l3=QH.define(),s3=DH.define({create:()=>Z2.start(),update:(e,t)=>e.update(t),provide:e=>[HX.from(e,e=>e.tooltip),UY.contentAttributes.from(e,e=>e.attrs)]});function c3(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(s3).active.find(e=>e.source==t.source);return r instanceof i3&&("string"==typeof n?e.dispatch({...L2(e.state,n,r.from,r.to),annotations:j2.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}const u3=Y2(s3,c3);function d3(e,t="option"){return n=>{let r=n.state.field(s3,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(H2).interactionDelay)return!1;let o,i=1;"page"==t&&(o=KX(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,l=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),n.dispatch({effects:l3.of(l)}),!0}}const p3=e=>!!e.state.field(s3,!1)&&(e.dispatch({effects:z2.of(!0)}),!0);class f3{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const h3=vQ.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(s3).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(s3),n=e.state.facet(H2);if(!e.selectionSet&&!e.docChanged&&e.startState.field(s3)==t)return;let r=e.transactions.some(e=>{let t=r3(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){fQ(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(z2)))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),o):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(s3);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(H2).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=I2(t),r=new T2(t,n,e.explicit,this.view),o=new f3(e,r);this.running.push(o),Promise.resolve(e.source(r)).then(e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:W2.of(null)}),fQ(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(H2).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(H2),r=this.view.state.field(s3);for(let o=0;o<this.running.length;o++){let i=this.running[o];if(void 0===i.done)continue;if(this.running.splice(o--,1),i.done){let r=I2(i.updates.length?i.updates[0].startState:this.view.state),o=Math.min(r,i.done.from+(i.active.explicit?0:1)),a=new i3(i.active.source,i.active.explicit,o,i.done,i.done.from,null!==(e=i.done.to)&&void 0!==e?e:r);for(let e of i.updates)a=a.update(e,n);if(a.hasResult()){t.push(a);continue}}let a=r.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(null==i.done){let e=new o3(i.active.source,0);for(let t of i.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(a)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:a3.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(s3,!1);if(t&&t.tooltip&&this.view.state.facet(H2).closeOnBlur){let n=t.open&&KX(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:W2.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:z2.of(!1)}),20),this.composing=0}}}),m3="object"==typeof navigator&&/Win/.test(navigator.platform),g3=AH.highest(UY.domEventHandlers({keydown(e,t){let n=t.state.field(s3,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!m3||!e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],o=n.active.find(e=>e.source==r.source),i=r.completion.commitCharacters||o.result.commitCharacters;return i&&i.indexOf(e.key)>-1&&c3(t,r),!1}})),v3=UY.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),y3={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},b3=QH.define({map(e,t){let n=t.mapPos(e,-1,sH.TrackAfter);return null==n?void 0:n}}),w3=new class extends aG{};w3.startSide=1,w3.endSide=-1;const E3=DH.define({create:()=>dG.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(b3)&&(e=e.update({add:[w3.range(n.value,n.value+1)]}));return e}}),k3="()[]{}<>«»»«[]{}";function O3(e){for(let t=0;t<16;t+=2)if(k3.charCodeAt(t)==e)return k3.charAt(t+1);return iH(e<128?e:e+1)}function S3(e,t){return e.languageDataAt("closeBrackets",t)[0]||y3}const x3="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),_3=UY.inputHandler.of((e,t,n,r)=>{if((x3?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==aH(oH(r,0))||t!=o.from||n!=o.to)return!1;let i=function(e,t){let n=S3(e,e.selection.main.head),r=n.brackets||y3.brackets;for(let o of r){let i=O3(oH(o,0));if(t==o)return i==o?F3(e,o,r.indexOf(o+o+o)>-1,n):A3(e,o,i,n.before||y3.before);if(t==i&&D3(e,e.selection.main.from))return T3(e,0,i)}return null}(e.state,r);return!!i&&(e.dispatch(i),!0)}),C3=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=S3(e,e.selection.main.head).brackets||y3.brackets,r=null,o=e.changeByRange(t=>{if(t.empty){let r=function(e,t){let n=e.sliceString(t-2,t);return aH(oH(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==r&&P3(e.doc,t.head)==O3(oH(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:yH.cursor(t.head-o.length)}}return{range:r=t}});return r||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function D3(e,t){let n=!1;return e.field(E3).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function P3(e,t){let n=e.sliceString(t,t+2);return n.slice(0,aH(oH(n,0)))}function A3(e,t,n,r){let o=null,i=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:b3.of(i.to+t.length),range:yH.range(i.anchor+t.length,i.head+t.length)};let a=P3(e.doc,i.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:i.head},effects:b3.of(i.head+t.length),range:yH.cursor(i.head+t.length)}:{range:o=i}});return o?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function T3(e,t,n){let r=null,o=e.changeByRange(t=>t.empty&&P3(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:yH.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function F3(e,t,n,r){let o=r.stringPrefixes||y3.stringPrefixes,i=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:b3.of(r.to+t.length),range:yH.range(r.anchor+t.length,r.head+t.length)};let a,l=r.head,s=P3(e.doc,l);if(s==t){if(M3(e,l))return{changes:{insert:t+t,from:l},effects:b3.of(l+t.length),range:yH.cursor(l+t.length)};if(D3(e,l)){let r=n&&e.sliceDoc(l,l+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+r.length,insert:r},range:yH.cursor(l+r.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(a=I3(e,l-2*t.length,o))>-1&&M3(e,a))return{changes:{insert:t+t+t+t,from:l},effects:b3.of(l+t.length),range:yH.cursor(l+t.length)};if(e.charCategorizer(l)(s)!=tG.Word&&I3(e,l,o)>-1&&!function(e,t,n,r){let o=LK(e).resolveInner(t,-1),i=r.reduce((e,t)=>Math.max(e,t.length),0);for(let a=0;a<5;a++){let a=e.sliceDoc(o.from,Math.min(o.to,o.from+n.length+i)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let t=o.firstChild;for(;t&&t.from==o.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=o.to==t&&o.parent;if(!s)break;o=s}return!1}(e,l,t,o))return{changes:{insert:t+t,from:l},effects:b3.of(l+t.length),range:yH.cursor(l+t.length)}}return{range:i=r}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function M3(e,t){let n=LK(e).resolveInner(t+1);return n.parent&&n.from==t}function I3(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=tG.Word)return t;for(let o of n){let n=t-o.length;if(e.sliceDoc(n,t)==o&&r(e.sliceDoc(n-1,n))!=tG.Word)return n}return-1}const N3=[{key:"Ctrl-Space",run:p3},{mac:"Alt-`",run:p3},{mac:"Alt-i",run:p3},{key:"Escape",run:e=>{let t=e.state.field(s3,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:W2.of(null)}),0))}},{key:"ArrowDown",run:d3(!0)},{key:"ArrowUp",run:d3(!1)},{key:"PageDown",run:d3(!0,"page")},{key:"PageUp",run:d3(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(s3,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(H2).interactionDelay)&&c3(e,t.open.options[t.open.selected])}}],j3=AH.highest(XY.computeN([H2],e=>e.facet(H2).defaultKeymap?[N3]:[]));var L3=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(C3)),!1!==e.defaultKeymap&&(n=n.concat(T1)),!1!==e.searchKeymap&&(n=n.concat(O2)),!1!==e.historyKeymap&&(n=n.concat(M0)),!1!==e.foldKeymap&&(n=n.concat(EZ)),!1!==e.completionKeymap&&(n=n.concat(N3)),!1!==e.lintKeymap&&(n=n.concat(MJ));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[SK.of(e),mK(),CK]}()),!1!==e.highlightActiveLineGutter&&r.push(AK),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[SX.of(e),xX||(xX=vQ.fromClass(class{constructor(e){this.view=e,this.decorations=oq.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(SX)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new bX({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:o}=n.state,i=oH(t[0],0);if(9==i){let e=o.lineAt(r),t=n.state.tabSize,i=OG(e.text,t,r-e.from);return oq.replace({widget:new CX((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=oq.replace({widget:new _X(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(SX);e.startState.facet(SX)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[g0,m0.of(e),UY.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?y0:"historyRedo"==e.inputType?b0:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...DZ,...e},n=new PZ(t,!0),r=new PZ(t,!1),o=vQ.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(qK)!=e.state.facet(qK)||e.startState.field(mZ,!1)!=e.state.field(mZ,!1)||LK(e.startState)!=LK(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new pG;for(let o of e.viewportLineBlocks){let i=vZ(e.state,o.from,o.to)?r:uZ(e.state,o.from,o.to)?n:null;i&&t.add(o.from,o.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[o,fK({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||dG.empty},initialSpacer:()=>new PZ(t,!1),domEventHandlers:{...i,click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let r=vZ(e.state,t.from,t.to);if(r)return e.dispatch({effects:fZ.of(r)}),!0;let o=uZ(e.state,t.from,t.to);return!!o&&(e.dispatch({effects:pZ.of(o)}),!0)}}}),SZ()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[cX.of(e),dX,fX,hX,sQ.of(!0)]}()),!1!==e.dropCursor&&r.push([gX,vX]),!1!==e.allowMultipleSelections&&r.push(oG.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(oG.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,o=n.lineAt(r);if(r>o.from+200)return e;let i=n.sliceString(o.from,r);if(!t.some(e=>e.test(i)))return e;let{state:a}=e,l=-1,s=[];for(let{head:e}of a.selection.ranges){let t=a.doc.lineAt(e);if(t.from==l)continue;l=t.from;let n=ZK(a,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],o=KK(a,n);r!=o&&s.push({from:t.from,to:t.from+r.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),!1!==e.syntaxHighlighting&&r.push(NZ(RZ,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[WZ.of(e),qZ]}()),!1!==e.closeBrackets&&r.push([_3,E3]),!1!==e.autocompletion&&r.push(function(e={}){return[g3,s3,H2.of(e),h3,j3,v3]}()),!1!==e.rectangularSelection&&r.push(function(){let e=e=>e.altKey&&0==e.button;return UY.mouseSelectionStyle.of((t,n)=>e(n)?function(e,t){let n=FX(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),o=e.state.doc.lineAt(t);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(e.changes)}},get(t,o,i){let a=FX(e,t);if(!a)return r;let l=function(e,t,n){let r=Math.min(t.line,n.line),o=Math.max(t.line,n.line),i=[];if(t.off>TX||n.off>TX||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=r;t<=o;t++){let n=e.doc.line(t);n.length<=l&&i.push(yH.range(n.from+a,n.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=r;t<=o;t++){let n=e.doc.line(t),r=SG(n.text,a,e.tabSize,!0);if(r<0)i.push(yH.cursor(n.to));else{let t=SG(n.text,l,e.tabSize);i.push(yH.range(n.from+r,n.from+t))}}}return i}(e.state,n,a);return l.length?i?yH.create(l.concat(r.ranges)):yH.create(l):r}}:null}(t,n):null)}()),!1!==t&&r.push(function(e={}){let[t,n]=MX[e.key||"Alt"],r=vQ.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,UY.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?IX:null})]}()),!1!==e.highlightActiveLine&&r.push(PX),!1!==e.highlightSelectionMatches&&r.push(function(){let e=[$1,Q1];return e}()),e.tabSize&&"number"==typeof e.tabSize&&r.push(YK.of(" ".repeat(e.tabSize))),r.concat([XY.of(n.flat())]).filter(Boolean)};const R3="#e06c75",B3="#abb2bf",z3="#7d8799",W3="#d19a66",U3="#2c313a",V3="#282c34",H3="#353a42",G3="#528bff",q3=[UY.theme({"&":{color:B3,backgroundColor:V3},".cm-content":{caretColor:G3},".cm-cursor, .cm-dropCursor":{borderLeftColor:G3},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:B3},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:V3,color:z3,border:"none"},".cm-activeLineGutter":{backgroundColor:U3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:H3},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:H3,borderBottomColor:H3},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:U3,color:B3}}},{dark:!0}),NZ(TZ.define([{tag:bV.keyword,color:"#c678dd"},{tag:[bV.name,bV.deleted,bV.character,bV.propertyName,bV.macroName],color:R3},{tag:[bV.function(bV.variableName),bV.labelName],color:"#61afef"},{tag:[bV.color,bV.constant(bV.name),bV.standard(bV.name)],color:W3},{tag:[bV.definition(bV.name),bV.separator],color:B3},{tag:[bV.typeName,bV.className,bV.number,bV.changed,bV.annotation,bV.modifier,bV.self,bV.namespace],color:"#e5c07b"},{tag:[bV.operator,bV.operatorKeyword,bV.url,bV.escape,bV.regexp,bV.link,bV.special(bV.string)],color:"#56b6c2"},{tag:[bV.meta,bV.comment],color:z3},{tag:bV.strong,fontWeight:"bold"},{tag:bV.emphasis,fontStyle:"italic"},{tag:bV.strikethrough,textDecoration:"line-through"},{tag:bV.link,color:z3,textDecoration:"underline"},{tag:bV.heading,fontWeight:"bold",color:R3},{tag:[bV.atom,bV.bool,bV.special(bV.variableName)],color:W3},{tag:[bV.processingInstruction,bV.string,bV.inserted],color:"#98c379"},{tag:bV.invalid,color:"#ffffff"}]))];var Q3=UY.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$3=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:o="light",placeholder:i="",basicSetup:a=!0}=e,l=[];switch(t&&l.unshift(XY.of([F1])),a&&("boolean"==typeof a?l.unshift(L3()):l.unshift(L3(a))),i&&l.unshift(function(e){let t=vQ.fromClass(class{constructor(t){this.view=t,this.placeholder=e?oq.set([oq.widget({widget:new AX(e),side:1}).range(0)]):oq.none}get decorations(){return this.view.state.doc.length?oq.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,UY.contentAttributes.of({"aria-placeholder":e})]:t}(i)),o){case"light":l.push(Q3);break;case"dark":l.push(q3);break;case"none":break;default:l.push(o)}return!1===n&&l.push(UY.editable.of(!1)),r&&l.push(oG.readOnly.of(!0)),[...l]};class Y3{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class X3{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var K3=null,Z3=HH.define(),J3=[];var e5=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],t5=(0,pe.forwardRef)((e,t)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:a,onStatistics:l,onCreateEditor:s,onUpdate:c,autoFocus:u,theme:d="light",height:p,minHeight:f,maxHeight:h,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:E,readOnly:k,root:O,initialState:S}=e,x=Rt(e,e5),_=(0,pe.useRef)(null),{state:C,view:D,container:P,setContainer:A}=function(e){var{value:t,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:a,extensions:l=J3,autoFocus:s,theme:c="light",height:u=null,minHeight:d=null,maxHeight:p=null,width:f=null,minWidth:h=null,maxWidth:m=null,placeholder:g="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:w=!0,root:E,initialState:k}=e,[O,S]=(0,pe.useState)(),[x,_]=(0,pe.useState)(),[C,D]=(0,pe.useState)(),P=(0,pe.useState)(()=>({current:null}))[0],A=(0,pe.useState)(()=>({current:null}))[0],T=UY.theme({"&":{height:u,minHeight:d,maxHeight:p,width:f,minWidth:h,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),F=UY.updateListener.of(e=>{if(e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(Z3))){P.current?P.current.reset():(P.current=new Y3(()=>{if(A.current){var e=A.current;A.current=null,e()}P.current=null},200),("undefined"==typeof window?new X3:(K3||(K3=new X3),K3)).add(P.current));var t=e.state.doc.toString();r(t,e)}o&&o((e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}))(e))}),M=[F,T,...$3({theme:c,editable:v,readOnly:y,placeholder:g,indentWithTab:b,basicSetup:w})];return a&&"function"==typeof a&&M.push(UY.updateListener.of(a)),M=M.concat(l),(0,pe.useLayoutEffect)(()=>{if(O&&!C){var e={doc:t,selection:n,extensions:M},r=k?oG.fromJSON(k.json,e,k.fields):oG.create(e);if(D(r),!x){var o=new UY({state:r,parent:O,root:E});_(o),i&&i(o,r)}}return()=>{x&&(D(void 0),_(void 0))}},[O,C]),(0,pe.useEffect)(()=>{e.container&&S(e.container)},[e.container]),(0,pe.useEffect)(()=>()=>{x&&(x.destroy(),_(void 0)),P.current&&(P.current.cancel(),P.current=null)},[x]),(0,pe.useEffect)(()=>{s&&x&&x.focus()},[s,x]),(0,pe.useEffect)(()=>{x&&x.dispatch({effects:QH.reconfigure.of(M)})},[c,l,u,d,p,f,h,m,g,v,y,b,w,r,a]),(0,pe.useEffect)(()=>{if(void 0!==t){var e=x?x.state.doc.toString():"";if(x&&t!==e){var n=()=>{x&&t!==x.state.doc.toString()&&x.dispatch({changes:{from:0,to:x.state.doc.toString().length,insert:t||""},annotations:[Z3.of(!0)]})};P.current&&!P.current.isDone?A.current=n:n()}}},[t,x]),{state:C,setState:D,view:x,setView:_,container:O,setContainer:S}}({root:O,value:r,autoFocus:u,theme:d,height:p,minHeight:f,maxHeight:h,width:m,minWidth:g,maxWidth:v,basicSetup:y,placeholder:b,indentWithTab:w,editable:E,readOnly:k,selection:o,onChange:a,onStatistics:l,onCreateEditor:s,onUpdate:c,extensions:i,initialState:S});(0,pe.useImperativeHandle)(t,()=>({editor:_.current,state:C,view:D}),[_,P,C,D]);var T=(0,pe.useCallback)(e=>{_.current=e,A(e)},[A]);if("string"!=typeof r)throw new Error("value must be typeof string but got "+typeof r);var F="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,KP.jsx)("div",re({ref:T,className:F+(n?" "+n:"")},x))});t5.displayName="CodeMirror";const n5=t5,r5=0,o5=1,i5=2,a5=3,l5=4,s5=5,c5=7,u5=9,d5=10,p5=11,f5=12,h5=13,m5=14,g5=15,v5=16,y5=17,b5=18,w5=19,E5=20,k5=21,O5=22,S5=23,x5=24,_5=25,C5=0;function D5(e){return e>=48&&e<=57}function P5(e){return D5(e)||e>=65&&e<=70||e>=97&&e<=102}function A5(e){return e>=65&&e<=90}function T5(e){return function(e){return A5(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function F5(e){return T5(e)||D5(e)||45===e}function M5(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function I5(e){return 10===e||13===e||12===e}function N5(e){return I5(e)||32===e||9===e}function j5(e,t){return 92===e&&!I5(t)&&t!==C5}function L5(e,t,n){return 45===e?T5(t)||45===t||j5(t,n):!!T5(e)||92===e&&j5(e,t)}function R5(e,t,n){return 43===e||45===e?D5(t)?2:46===t&&D5(n)?3:0:46===e?D5(t)?2:0:D5(e)?1:0}function B5(e){return 65279===e||65534===e?1:0}const z5=new Array(128),W5=130;for(let e=0;e<z5.length;e++)z5[e]=(N5(e)?W5:D5(e)&&131)||T5(e)&&132||M5(e)&&133||e||128;function U5(e){return e<128?z5[e]:132}function V5(e,t){return t<e.length?e.charCodeAt(t):0}function H5(e,t,n){return 13===n&&10===V5(e,t+1)?2:1}function G5(e,t,n){let r=e.charCodeAt(t);return A5(r)&&(r|=32),r===n}function q5(e,t,n,r){if(n-t!==r.length)return!1;if(t<0||n>e.length)return!1;for(let o=t;o<n;o++){const n=r.charCodeAt(o-t);let i=e.charCodeAt(o);if(A5(i)&&(i|=32),i!==n)return!1}return!0}function Q5(e,t){for(;t<e.length&&N5(e.charCodeAt(t));t++);return t}function $5(e,t){for(;t<e.length&&D5(e.charCodeAt(t));t++);return t}function Y5(e,t){if(P5(V5(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&P5(V5(e,t));t++);const n=V5(e,t);N5(n)&&(t+=H5(e,t,n))}return t}function X5(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!F5(n)){if(!j5(n,V5(e,t+1)))break;t=Y5(e,t)-1}}return t}function K5(e,t){let n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),D5(n)&&(t=$5(e,t+1),n=e.charCodeAt(t)),46===n&&D5(e.charCodeAt(t+1))&&(t=$5(e,t+=2)),G5(e,t,101)){let r=0;n=e.charCodeAt(t+1),45!==n&&43!==n||(r=1,n=e.charCodeAt(t+2)),D5(n)&&(t=$5(e,t+1+r+1))}return t}function Z5(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}j5(n,V5(e,t+1))&&(t=Y5(e,t))}return t}function J5(e){if(1===e.length&&!P5(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(0===t||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const e4=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function t4(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function n4(e){const t=e.source,n=t.length,r=t.length>0?B5(t.charCodeAt(0)):0,o=t4(e.lines,n),i=t4(e.columns,n);let a=e.startLine,l=e.startColumn;for(let e=r;e<n;e++){const r=t.charCodeAt(e);o[e]=a,i[e]=l++,10!==r&&13!==r&&12!==r||(13===r&&e+1<n&&10===t.charCodeAt(e+1)&&(e++,o[e]=a,i[e]=l),a++,l=1)}o[n]=a,i[n]=l,e.lines=o,e.columns=i,e.computed=!0}class r4{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e="",t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||n4(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||n4(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}}const o4=16777215,i4=24,a4=new Uint8Array(32);function l4(e){return 0!==a4[e]}a4[i5]=O5,a4[k5]=O5,a4[w5]=E5,a4[S5]=x5;class s4{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){const n=(e=String(e||"")).length,r=t4(this.offsetAndType,e.length+1),o=t4(this.balance,e.length+1);let i=0,a=-1,l=0,s=e.length;this.offsetAndType=null,this.balance=null,o.fill(0),t(e,(e,t,n)=>{const c=i++;if(r[c]=e<<i4|n,-1===a&&(a=t),o[c]=s,e===l){const e=o[s];o[s]=c,s=e,l=a4[r[e]>>i4]}else l4(e)&&(s=c,l=a4[e])}),r[i]=r5<<i4|n,o[i]=i;for(let e=0;e<i;e++){const t=o[e];if(t<=e){const n=o[t];n!==e&&(o[e]=n)}else t>i&&(o[e]=i)}this.source=e,this.firstCharOffset=-1===a?0:a,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e]>>i4:r5}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>i4;if(n!==h5&&n!==_5&&0===e--)return n}return r5}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&o4:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>i4;if(n!==h5&&n!==_5&&0===e--)return t-this.tokenIndex}return r5}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&q5(this.source,this.offsetAndType[e-1]&o4,this.offsetAndType[e]&o4,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&o4:this.offsetAndType[this.tokenCount]&o4:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===u5&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===u5&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&o4,t=this.offsetAndType[t],this.tokenType=t>>i4,this.tokenEnd=t&o4):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>i4,this.tokenEnd=e&o4):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=r5,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===h5||this.tokenType===_5;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,o=0;e:for(;n<this.tokenCount&&(r=this.balance[n],!(r<e));n++)switch(o=n>0?this.offsetAndType[n-1]&o4:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:l4(this.offsetAndType[n]>>i4)&&(n=r)}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,o=this.offsetAndType[t],i=o&o4;n=i,e(o>>i4,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:e4[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}}function c4(e,t){function n(t){return t<a?e.charCodeAt(t):0}function r(){return c=K5(e,c),L5(n(c),n(c+1),n(c+2))?(l=f5,void(c=X5(e,c))):37===n(c)?(l=p5,void c++):void(l=d5)}function o(){const t=c;return c=X5(e,c),q5(e,t,c,"url")&&40===n(c)?(c=Q5(e,c+1),34===n(c)||39===n(c)?(l=i5,void(c=t+4)):void function(){for(l=c5,c=Q5(e,c);c<e.length;c++){const t=e.charCodeAt(c);switch(U5(t)){case 41:return void c++;case W5:return c=Q5(e,c),41===n(c)||c>=e.length?void(c<e.length&&c++):(c=Z5(e,c),void(l=8));case 34:case 39:case 40:case 133:return c=Z5(e,c),void(l=8);case 92:if(j5(t,n(c+1))){c=Y5(e,c)-1;break}return c=Z5(e,c),void(l=8)}}}()):40===n(c)?(l=i5,void c++):void(l=o5)}function i(t){for(t||(t=n(c++)),l=s5;c<e.length;c++){const r=e.charCodeAt(c);switch(U5(r)){case t:return void c++;case W5:if(I5(r))return c+=H5(e,c,r),void(l=6);break;case 92:if(c===e.length-1)break;const o=n(c+1);I5(o)?c+=H5(e,c+1,o):j5(r,o)&&(c=Y5(e,c)-1)}}}const a=(e=String(e||"")).length;let l,s=B5(n(0)),c=s;for(;c<a;){const a=e.charCodeAt(c);switch(U5(a)){case W5:l=h5,c=Q5(e,c+1);break;case 34:i();break;case 35:F5(n(c+1))||j5(n(c+1),n(c+2))?(l=l5,c=X5(e,c+1)):(l=u5,c++);break;case 39:i();break;case 40:l=k5,c++;break;case 41:l=O5,c++;break;case 43:R5(a,n(c+1),n(c+2))?r():(l=u5,c++);break;case 44:l=b5,c++;break;case 45:R5(a,n(c+1),n(c+2))?r():45===n(c+1)&&62===n(c+2)?(l=g5,c+=3):L5(a,n(c+1),n(c+2))?o():(l=u5,c++);break;case 46:R5(a,n(c+1),n(c+2))?r():(l=u5,c++);break;case 47:42===n(c+1)?(l=_5,c=e.indexOf("*/",c+2),c=-1===c?e.length:c+2):(l=u5,c++);break;case 58:l=v5,c++;break;case 59:l=y5,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(l=m5,c+=4):(l=u5,c++);break;case 64:L5(n(c+1),n(c+2),n(c+3))?(l=a5,c=X5(e,c+1)):(l=u5,c++);break;case 91:l=w5,c++;break;case 92:j5(a,n(c+1))?o():(l=u5,c++);break;case 93:l=E5,c++;break;case 123:l=S5,c++;break;case 125:l=x5,c++;break;case 131:r();break;case 132:o();break;default:l=u5,c++}t(l,s,s=c)}}let u4=null;class d4{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return d4.createItem(e)}allocateCursor(e,t){let n;return null!==u4?(n=u4,u4=u4.cursor,n.prev=e,n.next=t,n.cursor=this.cursor):n={prev:e,next:t,cursor:this.cursor},this.cursor=n,n}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=u4,u4=e}updateCursors(e,t,n,r){let{cursor:o}=this;for(;null!==o;)o.prev===e&&(o.prev=t),o.next===n&&(o.next=r),o=o.cursor}*[Symbol.iterator](){for(let e=this.head;null!==e;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;null!==t;t=t.next)e++;return e}get isEmpty(){return null===this.head}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let t=null;this.head=null;for(let n of e){const e=d4.createItem(n);null!==t?t.next=e:this.head=e,e.prev=t,t=e}return this.tail=t,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){const n=this.allocateCursor(null,this.head);for(;null!==n.next;){const r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){const n=this.allocateCursor(this.tail,null);for(;null!==n.prev;){const r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r,o=this.allocateCursor(null,this.head),i=t;for(;null!==o.next;)r=o.next,o.next=r.next,i=e.call(n,i,r.data,r,this);return this.releaseCursor(),i}reduceRight(e,t,n=this){let r,o=this.allocateCursor(this.tail,null),i=t;for(;null!==o.prev;)r=o.prev,o.prev=r.prev,i=e.call(n,i,r.data,r,this);return this.releaseCursor(),i}some(e,t=this){for(let n=this.head;null!==n;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(e,t=this){const n=new d4;for(let r=this.head;null!==r;r=r.next)n.appendData(e.call(t,r.data,r,this));return n}filter(e,t=this){const n=new d4;for(let r=this.head;null!==r;r=r.next)e.call(t,r.data,r,this)&&n.appendData(r.data);return n}nextUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(null,e);for(;null!==r.next;){const e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(null===e)return;const r=this.allocateCursor(e,null);for(;null!==r.prev;){const e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new d4;for(let t of this)e.appendData(t);return e}prepend(e){return this.updateCursors(null,e,this.head,e),null!==this.head?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(d4.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(d4.createItem(e))}insert(e,t=null){if(null!==t)if(this.updateCursors(t.prev,e,t,e),null===t.prev){if(this.head!==t)throw new Error("before doesn't belong to list");this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t;else this.updateCursors(this.tail,e,null,e),null!==this.tail?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,t){return this.insert(d4.createItem(e),t)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),null!==e.prev)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(null!==e.next)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(d4.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(d4.createItem(e))}shift(){return null!==this.head?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return null===e.head||(null!=t?(this.updateCursors(t.prev,e.tail,t,e.head),null!==t.prev?(t.prev.next=e.head,e.head.prev=t.prev):this.head=e.head,t.prev=e.tail,e.tail.next=t):(this.updateCursors(this.tail,e.tail,null,e.head),null!==this.tail?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null),this}replace(e,t){"head"in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}}function p4(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}\n`)}})}function f4({source:e,line:t,column:n,baseLine:r,baseColumn:o},i){function a(e,t){return l.slice(e,t).map((t,n)=>String(e+n+1).padStart(u)+" |"+t).join("\n")}const l=("\n".repeat(Math.max(r-1,0))+" ".repeat(Math.max(o-1,0))+e).split(/\r\n?|\n|\f/),s=Math.max(1,t-i)-1,c=Math.min(t+i,l.length+1),u=Math.max(4,String(c).length)+1;let d=0;(n+=3*(l[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(d=n-60+3,n=58);for(let e=s;e<=c;e++)e>=0&&e<l.length&&(l[e]=l[e].replace(/\t/g," "),l[e]=(d>0&&l[e].length>d?"…":"")+l[e].substr(d,98)+(l[e].length>d+100-1?"…":""));return[a(s,t),new Array(n+u+2).join("-")+"^",a(t,c)].filter(Boolean).join("\n").replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function h4(e,t,n,r,o,i=1,a=1){return Object.assign(p4("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment:e=>f4({source:t,line:r,column:o,baseLine:i,baseColumn:a},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+f4({source:t,line:r,column:o,baseLine:i,baseColumn:a},2)}})}function m4(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case _5:this.next();continue;case h5:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(void 0===o)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}const g4=()=>{};function v4(e){return function(){return this[e]()}}function y4(e){const t=Object.create(null);for(const n of Object.keys(e)){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}var b4=a(1527);const w4=new Set(["Atrule","Selector","Declaration"]),E4=(e,t)=>{if(e===u5&&(e=t),"string"==typeof e){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},k4=[[o5,o5],[o5,i5],[o5,c5],[o5,8],[o5,"-"],[o5,d5],[o5,p5],[o5,f5],[o5,g5],[o5,k5],[a5,o5],[a5,i5],[a5,c5],[a5,8],[a5,"-"],[a5,d5],[a5,p5],[a5,f5],[a5,g5],[l5,o5],[l5,i5],[l5,c5],[l5,8],[l5,"-"],[l5,d5],[l5,p5],[l5,f5],[l5,g5],[f5,o5],[f5,i5],[f5,c5],[f5,8],[f5,"-"],[f5,d5],[f5,p5],[f5,f5],[f5,g5],["#",o5],["#",i5],["#",c5],["#",8],["#","-"],["#",d5],["#",p5],["#",f5],["#",g5],["-",o5],["-",i5],["-",c5],["-",8],["-","-"],["-",d5],["-",p5],["-",f5],["-",g5],[d5,o5],[d5,i5],[d5,c5],[d5,8],[d5,d5],[d5,p5],[d5,f5],[d5,"%"],[d5,g5],["@",o5],["@",i5],["@",c5],["@",8],["@","-"],["@",g5],[".",d5],[".",p5],[".",f5],["+",d5],["+",p5],["+",f5],["/","*"]],O4=k4.concat([[o5,l5],[f5,l5],[l5,l5],[a5,k5],[a5,s5],[a5,v5],[p5,p5],[p5,f5],[p5,i5],[p5,"-"],[O5,o5],[O5,i5],[O5,p5],[O5,f5],[O5,l5],[O5,"-"]]);function S4(e){const t=new Set(e.map(([e,t])=>E4(e)<<16|E4(t)));return function(e,n,r){const o=E4(n,r),i=r.charCodeAt(0);return(45===i&&n!==o5&&n!==i5&&n!==g5||43===i?t.has(e<<16|i<<8):t.has(e<<16|o))&&this.emit(" ",h5,!0),o}}const x4=S4(k4),_4=S4(O4);function C4(e,t){if("function"==typeof t){let n=null;return void e.children.forEach(e=>{null!==n&&t.call(this,n),this.node(e),n=e})}e.children.forEach(this.node,this)}function D4(e){c4(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}const{hasOwnProperty:P4}=Object.prototype,A4=function(){};function T4(e){return"function"==typeof e?e:A4}function F4(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function M4(e,t){const n=t.structure,r=[];for(const e in n){if(!1===P4.call(n,e))continue;let t=n[e];const o={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?o.nullable=!0:"string"==typeof e?o.type="node":Array.isArray(e)&&(o.type="list");o.type&&r.push(o)}return r.length?{context:t.walkContext,fields:r}:null}function I4(e,t){const n=e.fields.slice(),r=e.context,o="string"==typeof r;return t&&n.reverse(),function(e,i,a,l){let s;o&&(s=i[r],i[r]=e);for(const r of n){const n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(l,!1):n.reduce(l,!1))return!0}else if(a(n))return!0}o&&(i[r]=s)}}function N4({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function j4(e){return e}function L4(e,t,n,r){let o;switch(e.type){case"Group":o=function(e,t,n,r){const o=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(e=>L4(e,t,n,r)).join(o);return e.explicit||n?(r||","===i[0]?"[":"[ ")+i+(r?"]":" ]"):i}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return L4(e.term,t,n,r)+t(function(e){const{min:t,max:n,comma:r}=e;return 0===t&&0===n?r?"#?":"*":0===t&&1===n?"?":1===t&&0===n?r?"#":"+":1===t&&1===n?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(0!==n?n:"")+"}")}(e),e);case"Boolean":o="<boolean-expr["+L4(e.term,t,n,r)+"]>";break;case"Type":o="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function R4(e,t){let n=j4,r=!1,o=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),o=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),L4(e,n,r,o)}const B4={offset:0,line:1,column:1};function z4(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?W4(n):n:null}function W4({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=e.length-1,o.column=1===e.length?o.column+r.length:e.pop().length+1}return o}const U4=function(e,t){const n=p4("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},V4=function(e,t,n,r){const o=p4("SyntaxMatchError",e),{css:i,mismatchOffset:a,mismatchLength:l,start:s,end:c}=function(e,t){const n=e.tokens,r=e.longestMatch,o=r<n.length&&n[r].node||null,i=o!==t?o:null;let a,l,s=0,c=0,u=0,d="";for(let e=0;e<n.length;e++){const t=n[e].value;e===r&&(c=t.length,s=d.length),null!==i&&n[e].node===i&&(e<=r?u++:u=0),d+=t}return r===n.length||u>1?(a=z4(i||t,"end")||W4(B4,d),l=W4(a)):(a=z4(i,"start")||W4(z4(t,"start")||B4,d.slice(0,s)),l=z4(i,"end")||W4(a,d.substr(s,c))),{css:d,mismatchOffset:s,mismatchLength:c,start:a,end:l}}(r,n);return o.rawMessage=e,o.syntax=t?R4(t):"<generic>",o.css=i,o.mismatchOffset=a,o.mismatchLength=l,o.message=e+"\n syntax: "+o.syntax+"\n value: "+(i||"<empty string>")+"\n --------"+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,s),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:s,end:c},o},H4=new Map,G4=new Map,q4=45,Q4=function(e){if(H4.has(e))return H4.get(e);const t=e.toLowerCase();let n=H4.get(t);if(void 0===n){const e=Y4(t,0),r=e?"":X4(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return H4.set(e,n),n},$4=function(e){if(G4.has(e))return G4.get(e);let t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");const r=Y4(t,n.length);if(!r&&(t=t.toLowerCase(),G4.has(t))){const n=G4.get(t);return G4.set(e,n),n}const o=r?"":X4(t,n.length),i=t.substr(0,n.length+o.length),a=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return G4.set(e,a),a};function Y4(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===q4&&e.charCodeAt(t+1)===q4}function X4(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===q4&&e.charCodeAt(t+1)!==q4){const n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}const K4=["initial","inherit","unset","revert","revert-layer"],Z4=45,J4=!0;function e6(e,t){return null!==e&&e.type===u5&&e.value.charCodeAt(0)===t}function t6(e,t,n){for(;null!==e&&(e.type===h5||e.type===_5);)e=n(++t);return t}function n6(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(43===o||o===Z4){if(n)return 0;t++}for(;t<e.value.length;t++)if(!D5(e.value.charCodeAt(t)))return 0;return r+1}function r6(e,t,n){let r=!1,o=t6(e,t,n);if(null===(e=n(o)))return t;if(e.type!==d5){if(!e6(e,43)&&!e6(e,Z4))return t;if(r=!0,o=t6(n(++o),o,n),null===(e=n(o))||e.type!==d5)return 0}if(!r){const t=e.value.charCodeAt(0);if(43!==t&&t!==Z4)return 0}return n6(e,r?0:1,r,o)}function o6(e,t){return null!==e&&e.type===u5&&e.value.charCodeAt(0)===t}function i6(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(45===i&&n&&0!==r)return i6(e,t+r+1,!1),6;if(!P5(i))return 0;if(++r>6)return 0}return r}function a6(e,t,n){if(!e)return 0;for(;o6(n(t),63);){if(++e>6)return 0;t++}return t}const l6=["calc(","-moz-calc(","-webkit-calc("],s6=new Map([[i5,O5],[k5,O5],[w5,E5],[S5,x5]]);function c6(e,t){return t<e.length?e.charCodeAt(t):0}function u6(e,t){return q5(e,0,e.length,t)}function d6(e,t){for(let n=0;n<t.length;n++)if(u6(e,t[n]))return!0;return!1}function p6(e,t){return t===e.length-2&&92===c6(e,t)&&D5(c6(e,t+1))}function f6(e,t,n){if(e&&"Range"===e.type){const r=Number(void 0!==n&&n!==t.length?t.substr(0,n):t);if(isNaN(r))return!0;if(null!==e.min&&r<e.min&&"string"!=typeof e.min)return!0;if(null!==e.max&&r>e.max&&"string"!=typeof e.max)return!0}return!1}function h6(e){return function(t,n,r){return null===t?0:t.type===i5&&d6(t.value,l6)?function(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case x5:case O5:case E5:if(e.type!==n)break e;if(n=r.pop(),0===r.length){o++;break e}break;case i5:case k5:case w5:case S5:r.push(n),n=s6.get(e.type)}o++}while(e=t(o));return o}(t,n):e(t,n,r)}}function m6(e){return function(t){return null===t||t.type!==e?0:1}}function g6(e){return null===e||e.type!==o5||45!==c6(e.value,0)||45!==c6(e.value,1)?0:1}function v6(e){return e&&(e=new Set(e)),function(t,n,r){if(null===t||t.type!==f5)return 0;const o=K5(t.value,0);if(null!==e){const n=t.value.indexOf("\\",o),r=-1!==n&&p6(t.value,n)?t.value.substring(o,n):t.value.substr(o);if(!1===e.has(r.toLowerCase()))return 0}return f6(r,t.value,o)?0:1}}function y6(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===d5&&0===Number(t.value)?1:e(t,n,r)}}const b6={"ident-token":m6(o5),"function-token":m6(i5),"at-keyword-token":m6(a5),"hash-token":m6(l5),"string-token":m6(s5),"bad-string-token":m6(6),"url-token":m6(c5),"bad-url-token":m6(8),"delim-token":m6(u5),"number-token":m6(d5),"percentage-token":m6(p5),"dimension-token":m6(f5),"whitespace-token":m6(h5),"CDO-token":m6(m5),"CDC-token":m6(g5),"colon-token":m6(v5),"semicolon-token":m6(y5),"comma-token":m6(b5),"[-token":m6(w5),"]-token":m6(E5),"(-token":m6(k5),")-token":m6(O5),"{-token":m6(S5),"}-token":m6(x5)},w6={string:m6(s5),ident:m6(o5),percentage:h6(function(e,t,n){return null===e||e.type!==p5||f6(n,e.value,e.value.length-1)?0:1}),zero:y6(),number:h6(function(e,t,n){if(null===e)return 0;const r=K5(e.value,0);return r===e.value.length||p6(e.value,r)?f6(n,e.value,r)?0:1:0}),integer:h6(function(e,t,n){if(null===e||e.type!==d5)return 0;let r=43===c6(e.value,0)||45===c6(e.value,0)?1:0;for(;r<e.value.length;r++)if(!D5(c6(e.value,r)))return 0;return f6(n,e.value,r)?0:1}),"custom-ident":function(e){if(null===e||e.type!==o5)return 0;const t=e.value.toLowerCase();return d6(t,K4)||u6(t,"default")?0:1},"dashed-ident":g6,"custom-property-name":function(e){return g6(e)?"--"===e.value?0:1:0},"hex-color":function(e){if(null===e||e.type!==l5)return 0;const t=e.value.length;if(4!==t&&5!==t&&7!==t&&9!==t)return 0;for(let n=1;n<t;n++)if(!P5(c6(e.value,n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==l5?0:L5(c6(e.value,1),c6(e.value,2),c6(e.value,3))?1:0},"an-plus-b":function(e,t){let n=0;if(!e)return 0;if(e.type===d5)return n6(e,0,!1,n);if(e.type===o5&&e.value.charCodeAt(0)===Z4){if(!G5(e.value,1,110))return 0;switch(e.value.length){case 2:return r6(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Z4?0:(n=t6(t(++n),n,t),n6(e=t(n),0,J4,n));default:return e.value.charCodeAt(2)!==Z4?0:n6(e,3,J4,n)}}else if(e.type===o5||e6(e,43)&&t(n+1).type===o5){if(e.type!==o5&&(e=t(++n)),null===e||!G5(e.value,0,110))return 0;switch(e.value.length){case 1:return r6(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Z4?0:(n=t6(t(++n),n,t),n6(e=t(n),0,J4,n));default:return e.value.charCodeAt(1)!==Z4?0:n6(e,2,J4,n)}}else if(e.type===f5){let r=e.value.charCodeAt(0),o=43===r||r===Z4?1:0,i=o;for(;i<e.value.length&&D5(e.value.charCodeAt(i));i++);return i===o?0:G5(e.value,i,110)?i+1===e.value.length?r6(t(++n),n,t):e.value.charCodeAt(i+1)!==Z4?0:i+2===e.value.length?(n=t6(t(++n),n,t),n6(e=t(n),0,J4,n)):n6(e,i+2,J4,n):0}return 0},urange:function(e,t){let n=0;if(null===e||e.type!==o5||!G5(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(o6(e,43))return null===(e=t(++n))?0:e.type===o5?a6(i6(e,0,!0),++n,t):o6(e,63)?a6(1,++n,t):0;if(e.type===d5){const r=i6(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===f5||e.type===d5?function(e){return 45===e.value.charCodeAt(0)}(e)&&i6(e,1,!1)?n+1:0:a6(r,n,t)}return e.type===f5?a6(i6(e,1,!0),++n,t):0},"declaration-value":function(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case x5:case O5:case E5:if(e.type!==n)break e;n=r.pop();break;case y5:if(0===n)break e;break;case u5:if(0===n&&"!"===e.value)break e;break;case i5:case k5:case w5:case S5:r.push(n),n=s6.get(e.type)}o++}while(e=t(o));return o},"any-value":function(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case x5:case O5:case E5:if(e.type!==n)break e;n=r.pop();break;case i5:case k5:case w5:case S5:r.push(n),n=s6.get(e.type)}o++}while(e=t(o));return o}};function E6(e){const{angle:t,decibel:n,frequency:r,flex:o,length:i,resolution:a,semitones:l,time:s}=e||{};return{dimension:h6(v6(null)),angle:h6(v6(t)),decibel:h6(v6(n)),frequency:h6(v6(r)),flex:h6(v6(o)),length:h6(y6(v6(i))),resolution:h6(v6(a)),semitones:h6(v6(l)),time:h6(v6(s))}}const k6=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],O6=["deg","grad","rad","turn"],S6=["s","ms"],x6=["hz","khz"],_6=["dpi","dpcm","dppx","x"],C6=["fr"],D6=["db"],P6=["st"];function A6(e,t,n){return Object.assign(p4("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+"\n "+t+"\n--"+new Array((n||t.length)+1).join("-")+"^"})}const T6=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0);class F6{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(e=this.charCode()){return e<128&&1===T6[e]}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(13!==t&&10!==t&&12!==t&&32!==t&&9!==t)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new A6(e,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t>=128||0===T6[t])break}return this.pos===e&&this.error("Expect a keyword"),this.substringToPos(e)}scanNumber(){let e=this.pos;for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t<48||t>57)break}return this.pos===e&&this.error("Expect a number"),this.substringToPos(e)}scanString(){const e=this.str.indexOf("'",this.pos+1);return-1===e&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(e+1)}}const M6=123,I6={" ":1,"&&":2,"||":3,"|":4};function N6(e){let t=null,n=null;return e.eat(M6),e.skipWs(),t=e.scanNumber(e),e.skipWs(),44===e.charCode()?(e.pos++,e.skipWs(),125!==e.charCode()&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function j6(e,t){const n=function(e){let t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,e.charCode()===M6?t=N6(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case M6:t=N6(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,35===e.charCode()&&43===e.charCodeAt(e.pos-1)?j6(e,n):n):t}function L6(e){const t=e.peek();return""===t?null:j6(e,{type:"Token",value:t})}function R6(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((e,t)=>I6[e]-I6[t]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){const t=e[o];"Combinator"===t.type&&(t.value===r?(-1===i&&(i=o-1),e.splice(o,1),o--):(-1!==i&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}-1!==i&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function B6(e,t){const n=Object.create(null),r=[];let o,i=null,a=e.pos;for(;e.charCode()!==t&&(o=z6(e,t));)"Spaces"!==o.type&&("Combinator"===o.type?(null!==i&&"Combinator"!==i.type||(e.pos=a,e.error("Unexpected combinator")),n[o.value]=!0):null!==i&&"Combinator"!==i.type&&(n[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(o),i=o,a=e.pos);return null!==i&&"Combinator"===i.type&&(e.pos-=a,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:R6(r,n)||" ",disallowEmpty:!1,explicit:!1}}function z6(e,t){let n=e.charCode();switch(n){case 93:break;case 91:return j6(e,function(e,t){let n;return e.eat(91),n=B6(e,t),e.eat(93),n.explicit=!0,33===e.charCode()&&(e.pos++,n.disallowEmpty=!0),n}(e,t));case 60:return 39===e.nextCharCode()?function(e){let t;return e.eat(60),e.eat(39),t=e.scanWord(),e.eat(39),e.eat(62),j6(e,{type:"Property",name:t})}(e):function(e){let t,n=null;if(e.eat(60),t=e.scanWord(),"boolean-expr"===t){e.eat(91);const t=B6(e,93);return e.eat(93),e.eat(62),j6(e,{type:"Boolean",term:1===t.terms.length?t.terms[0]:t})}return 40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(e.skipWs(),n=function(e){let t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():(t=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(44),e.skipWs(),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(93),{type:"Range",min:t,max:n}}(e)),e.eat(62),j6(e,{type:"Type",name:t,opts:n})}(e);case 124:return{type:"Combinator",value:e.substringToPos(e.pos+(124===e.nextCharCode()?2:1))};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return j6(e,{type:"String",value:e.scanString()});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:e.scanSpaces()};case 64:return n=e.nextCharCode(),e.isNameCharCode(n)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):L6(e);case 42:case 43:case 63:case 35:case 33:break;case M6:if(n=e.nextCharCode(),n<48||n>57)return L6(e);break;default:return e.isNameCharCode(n)?function(e){const t=e.scanWord();return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):j6(e,{type:"Keyword",name:t})}(e):L6(e)}}function W6(e){const t=new F6(e),n=B6(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type?n.terms[0]:n}const U6=function(){};const V6={decorator(e){const t=[];let n=null;return{...e,node(t){const r=n;n=t,e.node.call(this,t),n=r},emit(e,r,o){t.push({type:r,value:e,node:o?null:n})},result:()=>t}}};const H6={type:"Match"},G6={type:"Mismatch"},q6={type:"DisallowEmpty"};function Q6(e,t,n){return t===H6&&n===G6||e===H6&&t===H6&&n===H6?e:("If"===e.type&&e.else===G6&&t===H6&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function $6(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function Y6(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&$6(e.name)}function X6(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function K6(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=K6(e.match,t,n),e.then=K6(e.then,t,n),e.else=K6(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function Z6(e,t,n){switch(e){case" ":{let e=H6;for(let n=t.length-1;n>=0;n--)e=Q6(t[n],e,G6);return e}case"|":{let e=G6,n=null;for(let r=t.length-1;r>=0;r--){let o=t[r];if(Y6(o)&&(null===n&&r>0&&Y6(t[r-1])&&(n=Object.create(null),e=Q6({type:"Enum",map:n},H6,e)),null!==n)){const e=($6(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(e in n==0){n[e]=o;continue}}n=null,e=Q6(o,H6,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=G6;for(let r=t.length-1;r>=0;r--){const o=t[r];let i;i=t.length>1?Z6(e,t.filter(function(e){return e!==o}),!1):H6,n=Q6(o,i,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?H6:G6;for(let n=t.length-1;n>=0;n--){const o=t[n];let i;i=t.length>1?Z6(e,t.filter(function(e){return e!==o}),!0):H6,r=Q6(o,i,r)}return r}}}function J6(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Z6(e.combinator,e.terms.map(J6),!1);return e.disallowEmpty&&(t=Q6(t,q6,G6)),t}case"Multiplier":return function(e){let t=H6,n=J6(e.term);if(0===e.max)n=Q6(n,q6,G6),t=Q6(n,null,G6),t.then=Q6(H6,H6,t),e.comma&&(t.then.else=Q6({type:"Comma",syntax:e},t,G6));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==H6&&(t=Q6({type:"Comma",syntax:e},t,G6)),t=Q6(n,Q6(H6,H6,t),G6);if(0===e.min)t=Q6(H6,H6,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==H6&&(t=Q6({type:"Comma",syntax:e},t,G6)),t=Q6(n,t,G6);return t}(e);case"Boolean":{const t=J6(e.term),n=J6(X6([X6([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),X6([{type:"Type",name:"!boolean-group"},X6([{type:"Multiplier",comma:!1,min:0,max:0,term:X6([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:X6([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),r=J6(X6([{type:"Type",name:"!term"},X6([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return K6(r,{"!term":t,"!self":n}),K6(n,{"!boolean-group":r}),n}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return 3===e.value.length?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function e8(e,t){return"string"==typeof e&&(e=W6(e)),{type:"MatchGraph",match:J6(e),syntax:t||null,source:e}}const{hasOwnProperty:t8}=Object.prototype,n8="Match";let r8=0;function o8(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=t.charCodeAt(n);let o=e.charCodeAt(n);if(o>=65&&o<=90&&(o|=32),o!==r)return!1}return!0}function i8(e){return null===e||e.type===b5||e.type===i5||e.type===k5||e.type===w5||e.type===S5||function(e){return e.type===u5&&"?"!==e.value}(e)}function a8(e){return null===e||e.type===O5||e.type===E5||e.type===x5||e.type===u5&&"/"===e.value}function l8(e,t,n){const r=function(e,t,n){function r(){do{y++,v=y<e.length?e[y]:null}while(null!==v&&(v.type===h5||v.type===_5))}function o(t){const n=y+t;return n<e.length?e[n]:null}function i(e,t){return{nextState:e,matchStack:w,syntaxStack:d,thenStack:p,tokenIndex:y,prev:t}}function a(e){p={nextState:e,matchStack:w,syntaxStack:d,prev:p}}function l(e){f=i(e,f)}function s(){w={type:1,syntax:t.syntax,token:v,prev:w},r(),h=null,y>b&&(b=y)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||null!==d&&d.opts||null,prev:d},w={type:2,syntax:t.syntax,token:w.token,prev:w}}function u(){w=2===w.type?w.prev:{type:3,syntax:d.syntax,token:w.token,prev:w},d=d.prev}let d=null,p=null,f=null,h=null,m=0,g=null,v=null,y=-1,b=0,w={type:0,syntax:null,token:null,prev:null};for(r();null===g&&++m<15e3;)switch(t.type){case"Match":if(null===p){if(null!==v&&(y!==e.length-1||"\\0"!==v.value&&"\\9"!==v.value)){t=G6;break}g=n8;break}if((t=p.nextState)===q6){if(p.matchStack===w){t=G6;break}t=H6}for(;p.syntaxStack!==d;)u();p=p.prev;break;case"Mismatch":if(null!==h&&!1!==h)(null===f||y>f.tokenIndex)&&(f=h,h=!1);else if(null===f){g="Mismatch";break}t=f.nextState,p=f.thenStack,d=f.syntaxStack,w=f.matchStack,y=f.tokenIndex,v=y<e.length?e[y]:null,f=f.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==G6&&l(t.else),t.then!==H6&&a(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const e=t.syntax.terms;if(t.index===e.length){if(0===t.mask||t.syntax.all){t=G6;break}t=H6;break}if(t.mask===(1<<e.length)-1){t=H6;break}for(;t.index<e.length;t.index++){const n=1<<t.index;if(0===(t.mask&n)){l(t),a({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|n}),t=e[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(null!==v){let e=v.value.toLowerCase();if(-1!==e.indexOf("\\")&&(e=e.replace(/\\[09].*$/,"")),t8.call(t.map,e)){t=t.map[e];break}}t=G6;break;case"Generic":{const e=null!==d?d.opts:null,n=y+Math.floor(t.fn(v,o,e));if(!isNaN(n)&&n>y){for(;y<n;)s();t=H6}else t=G6;break}case"Type":case"Property":{const e="Type"===t.type?"types":"properties",r=t8.call(n,e)?n[e][t.name]:null;if(!r||!r.match)throw new Error("Bad syntax reference: "+("Type"===t.type?"<"+t.name+">":"<'"+t.name+"'>"));if(!1!==h&&null!==v&&"Type"===t.type&&("custom-ident"===t.name&&v.type===o5||"length"===t.name&&"0"===v.value)){null===h&&(h=i(t,f)),t=G6;break}c(),t=r.matchRef||r.match;break}case"Keyword":{const e=t.name;if(null!==v){let n=v.value;if(-1!==n.indexOf("\\")&&(n=n.replace(/\\[09].*$/,"")),o8(n,e)){s(),t=H6;break}}t=G6;break}case"AtKeyword":case"Function":if(null!==v&&o8(v.value,t.name)){s(),t=H6;break}t=G6;break;case"Token":if(null!==v&&v.value===t.value){s(),t=H6;break}t=G6;break;case"Comma":null!==v&&v.type===b5?i8(w.token)?t=G6:(s(),t=a8(v)?G6:H6):t=i8(w.token)||a8(v)?H6:G6;break;case"String":let r="",m=y;for(;m<e.length&&r.length<t.value.length;m++)r+=e[m].value;if(o8(r,t.value)){for(;y<m;)s();t=H6}else t=G6;break;default:throw new Error("Unknown node type: "+t.type)}switch(r8+=m,g){case null:console.warn("[csstree-match] BREAK after 15000 iterations"),g="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",w=null;break;case n8:for(;null!==d;)u();break;default:w=null}return{tokens:e,reason:g,iterations:m,match:w,longestMatch:b}}(e,t,n||{});if(null===r.match)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]};const a=[i];for(o=function(e){let t=null,n=null,r=e;for(;null!==r;)n=r.prev,r.prev=t,t=r,r=n;return t}(o).prev;null!==o;){switch(o.type){case 2:i.match.push(i={syntax:o.syntax,match:[]}),a.push(i);break;case 3:a.pop(),i=a[a.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}function s8(e){function t(e){return null!==e&&("Type"===e.type||"Property"===e.type||"Keyword"===e.type)}let n=null;return null!==this.matched&&function r(o){if(Array.isArray(o.match)){for(let e=0;e<o.match.length;e++)if(r(o.match[e]))return t(o.syntax)&&n.unshift(o.syntax),!0}else if(o.node===e)return n=t(o.syntax)?[o.syntax]:[],!0;return!1}(this.matched),n}function c8(e,t){return p8(this,e,e=>"Type"===e.type&&e.name===t)}function u8(e,t){return p8(this,e,e=>"Property"===e.type&&e.name===t)}function d8(e){return p8(this,e,e=>"Keyword"===e.type)}function p8(e,t,n){const r=s8.call(e,t);return null!==r&&r.some(n)}function f8(e){return"node"in e?e.node:f8(e.match[0])}function h8(e){return"node"in e?e.node:h8(e.match[e.match.length-1])}function m8(e,t,n,r,o){const i=[];return null!==n.matched&&function n(a){if(null!==a.syntax&&a.syntax.type===r&&a.syntax.name===o){const n=f8(a),r=h8(a);e.syntax.walk(t,function(e,t,o){if(e===n){const e=new d4;do{if(e.appendData(t.data),t.data===r)break;t=t.next}while(null!==t);i.push({parent:o,nodes:e})}})}Array.isArray(a.match)&&a.match.forEach(n)}(n.matched),i}const{hasOwnProperty:g8}=Object.prototype;function v8(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function y8(e){return Boolean(e)&&v8(e.offset)&&v8(e.line)&&v8(e.column)}function b8(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(let o in n){let i=!0;if(!1!==g8.call(n,o)){if("type"===o)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===o){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)o+=".source";else if(y8(n.loc.start)){if(y8(n.loc.end))continue;o+=".end"}else o+=".start";i=!1}else if(t.hasOwnProperty(o)){i=!1;for(let e=0;!i&&e<t[o].length;e++){const r=t[o][e];switch(r){case String:i="string"==typeof n[o];break;case Boolean:i="boolean"==typeof n[o];break;case null:i=null===n[o];break;default:"string"==typeof r?i=n[o]&&n[o].type===r:Array.isArray(r)&&(i=n[o]instanceof d4)}}}else r(n,"Unknown field `"+o+"` for "+e+" node type");i||r(n,"Bad value for `"+e+"."+o+"`")}}for(const o in t)g8.call(t,o)&&!1===g8.call(n,o)&&r(n,"Field `"+e+"."+o+"` is missed")}}function w8(e,t){const n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o===String||o===Boolean)n.push(o.name.toLowerCase());else if(null===o)n.push("null");else if("string"==typeof o)n.push(o);else{if(!Array.isArray(o))throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition");n.push("List<"+(w8(o,t)||"any")+">")}}return n.join(" | ")}function E8(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const t in n){if(!1===g8.call(n,t))continue;const i=r[t]=Array.isArray(n[t])?n[t].slice():[n[t]];o[t]=w8(i,e+"."+t)}return{docs:o,check:b8(e,r)}}function k8(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:R4(e[o].syntax,{compact:t}));return r}function O8(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:R4(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&k8(i.descriptors,t,n)};return r}function S8(e,t,r){return{matched:e,iterations:r,error:t,...n}}function x8(e,t,n,r){const o=function(e,t){return"string"==typeof e?function(e){const t=[];return c4(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}(e):t.generate(e,V6)}(n,e.syntax);let i;return function(e){for(let t=0;t<e.length;t++)if("var("===e[t].value.toLowerCase())return!0;return!1}(o)?S8(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=l8(o,e.cssWideKeywordsSyntax,e)),r&&i.match||(i=l8(o,t.match,e),i.match)?S8(i.match,null,i.iterations):S8(null,new V4(i.reason,t.syntax,n,i),i.iterations))}class _8{constructor(e,n,r){if(this.cssWideKeywords=K4,this.syntax=n,this.generic=!1,this.units={...t},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=r||function(e){const t={};if(e.node)for(const n in e.node)if(g8.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=E8(n,r)}return t}(e),e){if(e.cssWideKeywords&&(this.cssWideKeywords=e.cssWideKeywords),e.units)for(const n of Object.keys(t))Array.isArray(e.units[n])&&(this.units[n]=e.units[n]);if(e.types)for(const[t,n]of Object.entries(e.types))this.addType_(t,n);if(e.generic){this.generic=!0;for(const[e,t]of Object.entries((o=this.units,{...b6,...w6,...E6(o)})))this.addType_(e,t)}if(e.atrules)for(const[t,n]of Object.entries(e.atrules))this.addAtrule_(t,n);if(e.properties)for(const[t,n]of Object.entries(e.properties))this.addProperty_(t,n)}var o;this.cssWideKeywordsSyntax=e8(this.cssWideKeywords.join(" | "))}checkStructure(e){function t(e,t){r.push({node:e,message:t})}const n=this.structure,r=[];return this.syntax.walk(e,function(e){n.hasOwnProperty(e.type)?n[e.type].check(e,t):t(e,"Unknown node type `"+e.type+"`")}),!!r.length&&r}createDescriptor(e,t,n,r=null){const o={type:t,name:n},i={type:t,name:n,parent:r,serializable:"string"==typeof e||e&&"string"==typeof e.type,syntax:null,match:null,matchRef:null};return"function"==typeof e?i.match=e8(e,o):("string"==typeof e?Object.defineProperty(i,"syntax",{get:()=>(Object.defineProperty(i,"syntax",{value:W6(e)}),i.syntax)}):i.syntax=e,Object.defineProperty(i,"match",{get:()=>(Object.defineProperty(i,"match",{value:e8(i.syntax,o)}),i.match)}),"Property"===t&&Object.defineProperty(i,"matchRef",{get(){const e=i.syntax,t=function(e){const t=e.terms[0];return!1===e.explicit&&1===e.terms.length&&"Multiplier"===t.type&&!0===t.comma}(e)?e8({...e,terms:[e.terms[0].term]},o):null;return Object.defineProperty(i,"matchRef",{value:t}),t}})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new U4("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):!r.prelude||t||x8(this,r.prelude,"",!1).matched?void 0:new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=Q4(t);return r.descriptors?r.descriptors[o.name]||r.descriptors[o.basename]?void 0:new U4("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new U4("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return S8(null,n);const r=this.getAtrule(e);return r.prelude?x8(this,r.prelude,t||"",!1):S8(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return S8(null,r);const o=this.getAtrule(e),i=Q4(t);return x8(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?S8(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if($4(e).custom)return S8(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?S8(null,n):x8(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?x8(this,n,t,!1):S8(null,new U4("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),x8(this,e,t,!1)):S8(null,new U4("Bad syntax"))}findValueFragments(e,t,n,r){return m8(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return m8(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:e=>{r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}}),r}getAtrule(e,t=!0){const n=Q4(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=$4(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(e,t){return t?`<${e}>`:`<'${e}'>`}function t(i,a,l,s){if(l.has(a))return l.get(a);l.set(a,!1),null!==s.syntax&&function(e,t,n){let r=U6,o=U6;if(r=t,r===U6&&o===U6)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":case"Boolean":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}o.call(n,t)}(e)}(s.syntax,function(s){if("Type"!==s.type&&"Property"!==s.type)return;const c="Type"===s.type?i.types:i.properties,u="Type"===s.type?r:o;hasOwnProperty.call(c,s.name)?t(i,s.name,u,c[s.name])&&(n.push(`${e(a,l===r)} used broken syntax definition ${e(s.name,"Type"===s.type)}`),l.set(a,!0)):(n.push(`${e(a,l===r)} used missed syntax definition ${e(s.name,"Type"===s.type)}`),l.set(a,!0))},this)}const n=[];let r=new Map,o=new Map;for(const e in this.types)t(this,e,r,this.types[e]);for(const e in this.properties)t(this,e,o,this.properties[e]);const i=[...r.keys()].filter(e=>r.get(e)),a=[...o.keys()].filter(e=>o.get(e));return i.length||a.length?{errors:n,types:i,properties:a}:null}dump(e,t){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:k8(this.types,!t,e),properties:k8(this.properties,!t,e),atrules:O8(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}}function C8(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function D8(e,t){const n=Object.create(null);for(const[r,o]of Object.entries(e))if(o){n[r]={};for(const e of Object.keys(o))t.includes(e)&&(n[r][e]=o[e])}return n}function P8(e,t){const n={...e};for(const[r,o]of Object.entries(t))switch(r){case"generic":n[r]=Boolean(o);break;case"cssWideKeywords":n[r]=e[r]?[...e[r],...o]:o||[];break;case"units":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=Array.isArray(t)?t:[];break;case"atrules":n[r]={...e[r]};for(const[e,t]of Object.entries(o)){const o=n[r][e]||{},i=n[r][e]={prelude:o.prelude||null,descriptors:{...o.descriptors}};if(t){i.prelude=t.prelude?C8(i.prelude,t.prelude):i.prelude||null;for(const[e,n]of Object.entries(t.descriptors||{}))i.descriptors[e]=n?C8(i.descriptors[e],n):null;Object.keys(i.descriptors).length||(i.descriptors=null)}}break;case"types":case"properties":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=C8(n[r][e],t);break;case"scope":case"features":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]={...n[r][e],...t};break;case"parseContext":n[r]={...e[r],...o};break;case"atrule":case"pseudo":n[r]={...e[r],...D8(o,["parse"])};break;case"node":n[r]={...e[r],...D8(o,["name","structure","parse","generate","walkContext"])}}return n}function A8(t){const n=function(e){let t="",n="<unknown>",r=!1,o=g4,i=!1;const a=new r4,l=Object.assign(new s4,function(e){const t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:y4(e.atrule),pseudo:y4(e.pseudo),node:y4(e.node)};for(const[n,r]of Object.entries(e.parseContext))switch(typeof r){case"function":t.context[n]=r;break;case"string":t.context[n]=v4(r)}return{config:t,...t,...t.node}}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:m4,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new d4,createSingleNodeList:e=>(new d4).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(i)throw e;this.skip(n-this.tokenIndex);const r=t.call(this);return i=!0,o(e,r),i=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==h5&&t!==_5)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&e<t.length?t.charCodeAt(e):0,substring:(e,n)=>t.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>G5(t,e,n),cmpStr:(e,n,r)=>q5(t,e,n,r),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(i5),e},consumeNumber(e){const n=t.substring(this.tokenStart,K5(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=e4[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case o5:this.tokenType===i5||this.tokenType===c5?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case l5:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case p5:this.tokenType===d5&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){this.tokenType===o5&&!1!==this.lookupValue(0,e)||this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>r?a.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){const t=this.getFirstListNode(e),r=this.getLastListNode(e);return a.getLocationRange(null!==t?t.loc.start.offset-a.startOffset:this.tokenStart,null!==r?r.loc.end.offset-a.startOffset:this.tokenStart,n)}return null},error(e,n){const r=void 0!==n&&n<t.length?a.getLocation(n):this.eof?a.getLocation(function(e,t){for(;t>=0&&N5(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):a.getLocation(this.tokenStart);throw new h4(e||"Unexpected input",t,r.offset,r.line,r.column,a.startLine,a.startColumn)}});return Object.assign(function(e,s){t=e,s=s||{},l.setSource(t,c4),a.setSource(t,s.offset,s.line,s.column),n=s.filename||"<unknown>",r=Boolean(s.positions),o="function"==typeof s.onParseError?s.onParseError:g4,i=!1,l.parseAtrulePrelude=!("parseAtrulePrelude"in s)||Boolean(s.parseAtrulePrelude),l.parseRulePrelude=!("parseRulePrelude"in s)||Boolean(s.parseRulePrelude),l.parseValue=!("parseValue"in s)||Boolean(s.parseValue),l.parseCustomProperty="parseCustomProperty"in s&&Boolean(s.parseCustomProperty);const{context:c="default",onComment:u}=s;if(c in l.context==0)throw new Error("Unknown context `"+c+"`");"function"==typeof u&&l.forEachToken((e,n,r)=>{if(e===_5){const e=l.getLocation(n,r),o=q5(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);u(o,e)}});const d=l.context[c].call(l,s);return l.eof||l.error(),d},{SyntaxError:h4,config:l.config})}(t),r=function(e){const t=function(e){const t={};for(const n in e.node)if(P4.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=M4(0,r)}return t}(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const e in t)P4.call(t,e)&&null!==t[e]&&(n[e]=I4(t[e],!1),r[e]=I4(t[e],!0));const a=N4(n),l=N4(r),s=function(e,s){function c(e,t,n){const r=u.call(h,e,t,n);return r===o||r!==i&&(!(!p.hasOwnProperty(e.type)||!p[e.type](e,h,c,f))||d.call(h,e,t,n)===o)}let u=A4,d=A4,p=n,f=(e,t,n,r)=>e||c(t,n,r);const h={break:o,skip:i,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof s)u=s;else if(s&&(u=T4(s.enter),d=T4(s.leave),s.reverse&&(p=r),s.visit)){if(a.hasOwnProperty(s.visit))p=s.reverse?l[s.visit]:a[s.visit];else if(!t.hasOwnProperty(s.visit))throw new Error("Bad value `"+s.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");u=F4(u,s.visit),d=F4(d,s.visit)}if(u===A4&&d===A4)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");c(e)};return s.break=o,s.skip=i,s.find=function(e,t){let n=null;return s(e,function(e,r,i){if(t.call(this,e,r,i))return n=e,o}),n},s.findLast=function(e,t){let n=null;return s(e,{reverse:!0,enter(e,r,i){if(t.call(this,e,r,i))return n=e,o}}),n},s.findAll=function(e,t){const n=[];return s(e,function(e,r,o){t.call(this,e,r,o)&&n.push(e)}),n},s}(t),o=function(t){const n=new Map;for(let[e,r]of Object.entries(t.node))"function"==typeof(r.generate||r)&&n.set(e,r.generate||r);return function(t,r){let o="",i=0,a={node(e){if(!n.has(e.type))throw new Error("Unknown node type: "+e.type);n.get(e.type).call(l,e)},tokenBefore:_4,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),e===u5&&92===t.charCodeAt(0)&&this.emit("\n",h5,!0)},emit(e){o+=e},result:()=>o};r&&("function"==typeof r.decorator&&(a=r.decorator(a)),r.sourceMap&&(a=function(e){const t=new b4.x,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let a=1,l=0,s=!1;const c=e.node;e.node=function(e){if(e.loc&&e.loc.start&&w4.has(e.type)){const c=e.loc.start.line,u=e.loc.start.column-1;r.line===c&&r.column===u||(r.line=c,r.column=u,n.line=a,n.column=l,s&&(s=!1,n.line===o.line&&n.column===o.column||t.addMapping(i)),s=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}c.call(this,e),s&&w4.has(e.type)&&(o.line=a,o.column=l)};const u=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)10===e.charCodeAt(t)?(a++,l=0):l++;u(e,t,n)};const d=e.result;return e.result=function(){return s&&t.addMapping(i),{css:d(),map:t}},e}(a)),r.mode in e&&(a.tokenBefore=e[r.mode]));const l={node:e=>a.node(e),children:C4,token:(e,t)=>a.token(e,t),tokenize:D4};return a.node(t),a.result()}}(t),{fromPlainObject:i,toPlainObject:a}=function(e){return{fromPlainObject:t=>(e(t,{enter(e){e.children&&e.children instanceof d4==0&&(e.children=(new d4).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof d4&&(e.children=e.children.toArray())}}),t)}}(r),l={lexer:null,createLexer:e=>new _8(e,l,l.lexer.structure),tokenize:c4,parse:n,generate:o,walk:r,find:r.find,findLast:r.findLast,findAll:r.findAll,fromPlainObject:i,toPlainObject:a,fork(e){const n=P8({},t);return A8("function"==typeof e?e(n):P8(n,e))}};return l.lexer=new _8({generic:t.generic,cssWideKeywords:t.cssWideKeywords,units:t.units,types:t.types,atrules:t.atrules,properties:t.properties,node:t.node},l),l}const T8=43,F8=45,M8=110,I8=!0,N8=!1;function j8(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for(r!==T8&&r!==F8||(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)D5(this.charCodeAt(n))||this.error("Integer is expected",n)}function L8(e){return j8.call(this,0,e)}function R8(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case M8:n="N is expected";break;case F8:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function B8(){let e=0,t=0,n=this.tokenType;for(;n===h5||n===_5;)n=this.lookupType(++e);if(n!==d5){if(!this.isDelim(T8,e)&&!this.isDelim(F8,e))return null;t=this.isDelim(T8,e)?T8:F8;do{n=this.lookupType(++e)}while(n===h5||n===_5);n!==d5&&(this.skip(e),L8.call(this,I8))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==T8&&n!==F8&&this.error("Number sign is expected")),L8.call(this,0!==t),t===F8?"-"+this.consume(d5):this.consume(d5)}const z8="AnPlusB",W8={a:[String,null],b:[String,null]};function U8(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===d5)L8.call(this,N8),n=this.consume(d5);else if(this.tokenType===o5&&this.cmpChar(this.tokenStart,F8))switch(t="-1",R8.call(this,1,M8),this.tokenEnd-this.tokenStart){case 2:this.next(),n=B8.call(this);break;case 3:R8.call(this,2,F8),this.next(),this.skipSC(),L8.call(this,I8),n="-"+this.consume(d5);break;default:R8.call(this,2,F8),j8.call(this,3,I8),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===o5||this.isDelim(T8)&&this.lookupType(1)===o5){let r=0;switch(t="1",this.isDelim(T8)&&(r=1,this.next()),R8.call(this,0,M8),this.tokenEnd-this.tokenStart){case 1:this.next(),n=B8.call(this);break;case 2:R8.call(this,1,F8),this.next(),this.skipSC(),L8.call(this,I8),n="-"+this.consume(d5);break;default:R8.call(this,1,F8),j8.call(this,2,I8),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===f5){const r=this.charCodeAt(this.tokenStart),o=r===T8||r===F8;let i=this.tokenStart+o;for(;i<this.tokenEnd&&D5(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),R8.call(this,i-this.tokenStart,M8),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=B8.call(this)):(R8.call(this,i-this.tokenStart+1,F8),i+2===this.tokenEnd?(this.next(),this.skipSC(),L8.call(this,I8),n="-"+this.consume(d5)):(j8.call(this,i-this.tokenStart+2,I8),this.next(),n=this.substrToCursor(i+1)))}else this.error();return null!==t&&t.charCodeAt(0)===T8&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===T8&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function V8(e){if(e.a){const t=("+1"===e.a||"1"===e.a?"n":"-1"===e.a&&"-n")||e.a+"n";if(e.b){const n="-"===e.b[0]||"+"===e.b[0]?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}function H8(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function G8(){for(let e,t=1;e=this.lookupType(t);t++){if(e===x5)return!0;if(e===S5||e===a5)return!1}return!1}const q8="Atrule",Q8="atrule",$8={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function Y8(e=!1){const t=this.tokenStart;let n,r,o=null,i=null;switch(this.eat(a5),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==S5&&this.tokenType!==y5&&(o=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),H8):H8.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case y5:this.next();break;case S5:i=hasOwnProperty.call(this.atrule,r)&&"function"==typeof this.atrule[r].block?this.atrule[r].block.call(this,e):this.Block(G8.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:o,block:i}}function X8(e){this.token(a5,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(y5,";")}const K8="AtrulePrelude",Z8="atrulePrelude",J8={children:[[]]};function e7(e){let t=null;return null!==e&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&"function"==typeof this.atrule[e].prelude?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),!0!==this.eof&&this.tokenType!==S5&&this.tokenType!==y5&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function t7(e){this.children(e)}const n7=36,r7=42,o7=61,i7=94,a7=124,l7=126;function s7(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(r7)?(t=!0,this.next()):this.isDelim(a7)||this.eat(o5),this.isDelim(a7)?this.charCodeAt(this.tokenStart+1)!==o7?(this.next(),this.eat(o5)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function c7(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==o7&&t!==l7&&t!==i7&&t!==n7&&t!==r7&&t!==a7&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==o7&&(this.isDelim(o7)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const u7="AttributeSelector",d7={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function p7(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(w5),this.skipSC(),t=s7.call(this),this.skipSC(),this.tokenType!==E5&&(this.tokenType!==o5&&(n=c7.call(this),this.skipSC(),r=this.tokenType===s5?this.String():this.Identifier(),this.skipSC()),this.tokenType===o5&&(o=this.consume(o5),this.skipSC())),this.eat(E5),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function f7(e){this.token(u5,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(o5,e.flags),this.token(u5,"]")}const h7=38;function m7(){return this.Raw(null,!0)}function g7(){return this.parseWithFallback(this.Rule,m7)}function v7(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function y7(){if(this.tokenType===y5)return v7.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,v7);return this.tokenType===y5&&this.next(),e}const b7="Block",w7="block",E7={children:[["Atrule","Rule","Declaration"]]};function k7(e){const t=e?y7:g7,n=this.tokenStart;let r=this.createList();this.eat(S5);e:for(;!this.eof;)switch(this.tokenType){case x5:break e;case h5:case _5:this.next();break;case a5:r.push(this.parseWithFallback(this.Atrule.bind(this,e),m7));break;default:e&&this.isDelim(h7)?r.push(g7.call(this)):r.push(t.call(this))}return this.eof||this.eat(x5),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function O7(e){this.token(S5,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(y5,";")}),this.token(x5,"}")}const S7="Brackets",x7={children:[[]]};function _7(e,t){const n=this.tokenStart;let r=null;return this.eat(w5),r=e.call(this,t),this.eof||this.eat(E5),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function C7(e){this.token(u5,"["),this.children(e),this.token(u5,"]")}const D7="CDC",P7=[];function A7(){const e=this.tokenStart;return this.eat(g5),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function T7(){this.token(g5,"--\x3e")}const F7="CDO",M7=[];function I7(){const e=this.tokenStart;return this.eat(m5),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function N7(){this.token(m5,"\x3c!--")}const j7=46,L7="ClassSelector",R7={name:String};function B7(){return this.eatDelim(j7),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(o5)}}function z7(e){this.token(u5,"."),this.token(o5,e.name)}const W7=43,U7=47,V7=62,H7=126,G7="Combinator",q7={name:String};function Q7(){const e=this.tokenStart;let t;switch(this.tokenType){case h5:t=" ";break;case u5:switch(this.charCodeAt(this.tokenStart)){case V7:case W7:case H7:this.next();break;case U7:this.next(),this.eatIdent("deep"),this.eatDelim(U7);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function $7(e){this.tokenize(e.name)}const Y7=42,X7=47,K7="Comment",Z7={value:String};function J7(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(_5),t-e+2>=2&&this.charCodeAt(t-2)===Y7&&this.charCodeAt(t-1)===X7&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function e9(e){this.token(_5,"/*"+e.value+"*/")}const t9=new Set([v5,O5,r5]),n9="Condition",r9={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function o9(e){return this.lookupTypeNonSC(1)===o5&&t9.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const i9={media:o9,container:o9,supports(){return this.SupportsDeclaration()}};function a9(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case _5:case h5:this.next();continue;case o5:t.push(this.Identifier());break;case k5:{let n=this.parseWithFallback(()=>i9[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(k5);const t=this.Condition(e);return this.eat(O5),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case i5:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function l9(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(k5,"("),this.node(e),this.token(O5,")")):this.node(e)})}const s9=33,c9=35,u9=36,d9=38,p9=42,f9=43,h9=47;function m9(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function g9(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function v9(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==y5&&!1===this.isDelim(s9)&&!1===this.isBalanceEdge(e)&&this.error(),t}const y9="Declaration",b9="declaration",w9={important:[Boolean,String],property:String,value:["Value","Raw"]};function E9(){const e=this.tokenStart,t=this.tokenIndex,n=O9.call(this),r=Y4(n),o=r?this.parseCustomProperty:this.parseValue,i=r?g9:m9;let a,l=!1;this.skipSC(),this.eat(v5);const s=this.tokenIndex;if(r||this.skipSC(),a=o?this.parseWithFallback(v9,i):i.call(this,this.tokenIndex),r&&"Value"===a.type&&a.children.isEmpty)for(let e=s-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===h5){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(s9)&&(l=S9.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==y5&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:a}}function k9(e){this.token(o5,e.property),this.token(v5,":"),this.node(e.value),e.important&&(this.token(u5,"!"),this.token(o5,!0===e.important?"important":e.important))}function O9(){const e=this.tokenStart;if(this.tokenType===u5)switch(this.charCodeAt(this.tokenStart)){case p9:case u9:case f9:case c9:case d9:this.next();break;case h9:this.next(),this.isDelim(h9)&&this.next()}return this.tokenType===l5?this.eat(l5):this.eat(o5),this.substrToCursor(e)}function S9(){this.eat(u5),this.skipSC();const e=this.consume(o5);return"important"===e||e}const x9=38;function _9(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const C9="DeclarationList",D9={children:[["Declaration","Atrule","Rule"]]};function P9(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case h5:case _5:case y5:this.next();break;case a5:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),_9));break;default:this.isDelim(x9)?e.push(this.parseWithFallback(this.Rule,_9)):e.push(this.parseWithFallback(this.Declaration,_9))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function A9(e){this.children(e,e=>{"Declaration"===e.type&&this.token(y5,";")})}const T9="Dimension",F9={value:String,unit:String};function M9(){const e=this.tokenStart,t=this.consumeNumber(f5);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function I9(e){this.token(f5,e.value+e.unit)}const N9=47,j9="Feature",L9={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function R9(e){const t=this.tokenStart;let n,r=null;if(this.eat(k5),this.skipSC(),n=this.consume(o5),this.skipSC(),this.tokenType!==O5){switch(this.eat(v5),this.skipSC(),this.tokenType){case d5:r=this.lookupNonWSType(1)===u5?this.Ratio():this.Number();break;case f5:r=this.Dimension();break;case o5:r=this.Identifier();break;case i5:r=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(N9)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(O5),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function B9(e){this.token(k5,"("),this.token(o5,e.name),null!==e.value&&(this.token(v5,":"),this.node(e.value)),this.token(O5,")")}const z9="FeatureFunction",W9={kind:String,feature:String,value:["Declaration","Selector"]};function U9(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function V9(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),r=U9.call(this,e,n.toLowerCase());this.skipSC();const o=this.parseWithFallback(()=>{const e=this.tokenIndex,t=r.call(this);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(O5),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:o}}function H9(e){this.token(i5,e.feature+"("),this.node(e.value),this.token(O5,")")}const G9=47,q9=60,Q9=61,$9=62,Y9="FeatureRange",X9={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function K9(){switch(this.skipSC(),this.tokenType){case d5:return this.isDelim(G9,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case f5:return this.Dimension();case o5:return this.Identifier();case i5:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(G9)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function Z9(e){if(this.skipSC(),this.isDelim(q9)||this.isDelim($9)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(Q9)?(this.next(),e+"="):e}if(this.isDelim(Q9))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function J9(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(k5);const n=K9.call(this),r=Z9.call(this,"Identifier"===n.type),o=K9.call(this);let i=null,a=null;return this.lookupNonWSType(0)!==O5&&(i=Z9.call(this),a=K9.call(this)),this.skipSC(),this.eat(O5),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:o,rightComparison:i,right:a}}function eee(e){this.token(k5,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(O5,")")}const tee="Function",nee="function",ree={name:String,children:[[]]};function oee(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(O5),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function iee(e){this.token(i5,e.name+"("),this.children(e),this.token(O5,")")}const aee="GeneralEnclosed",lee={kind:String,function:[String,null],children:[[]]};function see(e){const t=this.tokenStart;let n=null;this.tokenType===i5?n=this.consumeFunctionName():this.eat(k5);const r=this.parseWithFallback(()=>{const e=this.tokenIndex,t=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(e)&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(O5),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function cee(e){e.function?this.token(i5,e.function+"("):this.token(k5,"("),this.children(e),this.token(O5,")")}const uee="XXX",dee="Hash",pee={value:String};function fee(){const e=this.tokenStart;return this.eat(l5),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function hee(e){this.token(l5,"#"+e.value)}const mee="Identifier",gee={name:String};function vee(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(o5)}}function yee(e){this.token(o5,e.name)}const bee="IdSelector",wee={name:String};function Eee(){const e=this.tokenStart;return this.eat(l5),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function kee(e){this.token(u5,"#"+e.name)}const Oee=46,See="Layer",xee={name:String};function _ee(){let e=this.tokenStart,t=this.consume(o5);for(;this.isDelim(Oee);)this.eat(u5),t+="."+this.consume(o5);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Cee(e){this.tokenize(e.name)}const Dee="LayerList",Pee={children:[["Layer"]]};function Aee(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===b5);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Tee(e){this.children(e,()=>this.token(b5,","))}const Fee="MediaQuery",Mee={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function Iee(){const e=this.tokenStart;let t=null,n=null,r=null;if(this.skipSC(),this.tokenType===o5&&this.lookupTypeNonSC(1)!==k5){const e=this.consume(o5),o=e.toLowerCase();switch("not"===o||"only"===o?(this.skipSC(),t=o,n=this.consume(o5)):n=e,this.lookupTypeNonSC(0)){case o5:this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break;case S5:case y5:case b5:case r5:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case o5:case k5:case i5:r=this.Condition("media");break;case S5:case y5:case r5:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function Nee(e){e.mediaType?(e.modifier&&this.token(o5,e.modifier),this.token(o5,e.mediaType),e.condition&&(this.token(o5,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const jee="MediaQueryList",Lee={children:[["MediaQuery"]]};function Ree(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===b5);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Bee(e){this.children(e,()=>this.token(b5,","))}const zee=38,Wee="NestingSelector",Uee={};function Vee(){const e=this.tokenStart;return this.eatDelim(zee),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Hee(){this.token(u5,"&")}const Gee="Nth",qee={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function Qee(){this.skipSC();const e=this.tokenStart;let t,n=e,r=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:r}}function $ee(e){this.node(e.nth),null!==e.selector&&(this.token(o5,"of"),this.node(e.selector))}const Yee="Number",Xee={value:String};function Kee(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(d5)}}function Zee(e){this.token(d5,e.value)}const Jee="Operator",ete={value:String};function tte(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function nte(e){this.tokenize(e.value)}const rte="Parentheses",ote={children:[[]]};function ite(e,t){const n=this.tokenStart;let r=null;return this.eat(k5),r=e.call(this,t),this.eof||this.eat(O5),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function ate(e){this.token(k5,"("),this.children(e),this.token(O5,")")}const lte="Percentage",ste={value:String};function cte(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(p5)}}function ute(e){this.token(p5,e.value+"%")}const dte="PseudoClassSelector",pte="function",fte={name:String,children:[["Raw"],null]};function hte(){const e=this.tokenStart;let t,n,r=null;return this.eat(v5),this.tokenType===i5?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==O5?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(O5)):t=this.consume(o5),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function mte(e){this.token(v5,":"),null===e.children?this.token(o5,e.name):(this.token(i5,e.name+"("),this.children(e),this.token(O5,")"))}const gte="PseudoElementSelector",vte="function",yte={name:String,children:[["Raw"],null]};function bte(){const e=this.tokenStart;let t,n,r=null;return this.eat(v5),this.eat(v5),this.tokenType===i5?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==O5?r=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(O5)):t=this.consume(o5),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function wte(e){this.token(v5,":"),this.token(v5,":"),null===e.children?this.token(o5,e.name):(this.token(i5,e.name+"("),this.children(e),this.token(O5,")"))}const Ete=47;function kte(){switch(this.skipSC(),this.tokenType){case d5:return this.Number();case i5:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const Ote="Ratio",Ste={left:["Number","Function"],right:["Number","Function",null]};function xte(){const e=this.tokenStart,t=kte.call(this);let n=null;return this.skipSC(),this.isDelim(Ete)&&(this.eatDelim(Ete),n=kte.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function _te(e){this.node(e.left),this.token(u5,"/"),e.right?this.node(e.right):this.node(d5,1)}function Cte(){return this.tokenIndex>0&&this.lookupType(-1)===h5?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Dte="Raw",Pte={value:String};function Ate(e,t){const n=this.getTokenStart(this.tokenIndex);let r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?Cte.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function Tte(e){this.tokenize(e.value)}function Fte(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Mte(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==S5&&this.error(),e}const Ite="Rule",Nte="rule",jte={prelude:["SelectorList","Raw"],block:["Block"]};function Lte(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(Mte,Fte):Fte.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function Rte(e){this.node(e.prelude),this.node(e.block)}const Bte="Scope",zte={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Wte(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===k5&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(O5)),this.lookupNonWSType(0)===o5&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(k5),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(O5)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function Ute(e){e.root&&(this.token(k5,"("),this.node(e.root),this.token(O5,")")),e.limit&&(this.token(o5,"to"),this.token(k5,"("),this.node(e.limit),this.token(O5,")"))}const Vte="Selector",Hte={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function Gte(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function qte(e){this.children(e)}const Qte="SelectorList",$te="selector",Yte={children:[["Selector","Raw"]]};function Xte(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===b5);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function Kte(e){this.children(e,()=>this.token(b5,","))}const Zte=92,Jte=34,ene=39;function tne(e){const t=e.length,n=e.charCodeAt(0),r=n===Jte||n===ene?1:0,o=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let n=r;n<=o;n++){let r=e.charCodeAt(n);if(r===Zte){if(n===o){n!==t-1&&(i=e.substr(n+1));break}if(r=e.charCodeAt(++n),j5(Zte,r)){const t=n-1,r=Y5(e,t);n=r-1,i+=J5(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else i+=e[n]}return i}const nne="String",rne={value:String};function one(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:tne(this.consume(s5))}}function ine(e){this.token(s5,function(e){const t=Jte;let n="",r=!1;for(let o=0;o<e.length;o++){const i=e.charCodeAt(o);0!==i?i<=31||127===i?(n+="\\"+i.toString(16),r=!0):i===t||i===Zte?(n+="\\"+e.charAt(o),r=!1):(r&&(P5(i)||N5(i))&&(n+=" "),n+=e.charAt(o),r=!1):n+="�"}return'"'+n+'"'}(e.value))}const ane=33;function lne(){return this.Raw(null,!1)}const sne="StyleSheet",cne="stylesheet",une={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function dne(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case h5:this.next();continue;case _5:if(this.charCodeAt(this.tokenStart+2)!==ane){this.next();continue}n=this.Comment();break;case m5:n=this.CDO();break;case g5:n=this.CDC();break;case a5:n=this.parseWithFallback(this.Atrule,lne);break;default:n=this.parseWithFallback(this.Rule,lne)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function pne(e){this.children(e)}const fne="SupportsDeclaration",hne={declaration:"Declaration"};function mne(){const e=this.tokenStart;this.eat(k5),this.skipSC();const t=this.Declaration();return this.eof||this.eat(O5),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function gne(e){this.token(k5,"("),this.node(e.declaration),this.token(O5,")")}const vne=42,yne=124;function bne(){this.tokenType!==o5&&!1===this.isDelim(vne)&&this.error("Identifier or asterisk is expected"),this.next()}const wne="TypeSelector",Ene={name:String};function kne(){const e=this.tokenStart;return this.isDelim(yne)?(this.next(),bne.call(this)):(bne.call(this),this.isDelim(yne)&&(this.next(),bne.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function One(e){this.tokenize(e.name)}const Sne=43,xne=45,_ne=63;function Cne(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===xne&&t&&0!==n)return Cne.call(this,e+n+1,!1),-1;P5(o)||this.error(t&&0!==n?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function Dne(e){let t=0;for(;this.isDelim(_ne);)++t>e&&this.error("Too many question marks"),this.next()}function Pne(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Sne?"Plus sign":"Hyphen minus")+" is expected")}function Ane(){let e=0;switch(this.tokenType){case d5:if(e=Cne.call(this,1,!0),this.isDelim(_ne)){Dne.call(this,6-e);break}if(this.tokenType===f5||this.tokenType===d5){Pne.call(this,xne),Cne.call(this,1,!1);break}break;case f5:e=Cne.call(this,1,!0),e>0&&Dne.call(this,6-e);break;default:if(this.eatDelim(Sne),this.tokenType===o5){e=Cne.call(this,0,!0),e>0&&Dne.call(this,6-e);break}if(this.isDelim(_ne)){this.next(),Dne.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Tne="UnicodeRange",Fne={value:String};function Mne(){const e=this.tokenStart;return this.eatIdent("u"),Ane.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Ine(e){this.tokenize(e.value)}const Nne=32,jne=92,Lne=34,Rne=39,Bne=40,zne=41,Wne="Url",Une={value:String};function Vne(){const e=this.tokenStart;let t;switch(this.tokenType){case c5:t=function(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===zne?t-2:t-1,o="";for(;n<r&&N5(e.charCodeAt(n));)n++;for(;n<r&&N5(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let n=e.charCodeAt(i);if(n===jne){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(n=e.charCodeAt(++i),j5(jne,n)){const t=i-1,n=Y5(e,t);i=n-1,o+=J5(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(i+1)&&i++}else o+=e[i]}return o}(this.consume(c5));break;case i5:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(i5),this.skipSC(),t=tne(this.consume(s5)),this.skipSC(),this.eof||this.eat(O5);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function Hne(e){this.token(c5,function(e){let t="",n=!1;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);0!==o?o<=31||127===o?(t+="\\"+o.toString(16),n=!0):o===Nne||o===jne||o===Lne||o===Rne||o===Bne||o===zne?(t+="\\"+e.charAt(r),n=!1):(n&&P5(o)&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return"url("+t+")"}(e.value))}const Gne="Value",qne={children:[[]]};function Qne(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function $ne(e){this.children(e)}const Yne=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),Xne="WhiteSpace",Kne={value:String};function Zne(){return this.eat(h5),Yne}function Jne(e){this.token(h5,e.value)}const ere={generic:!0,cssWideKeywords:K4,generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>|<timeline-range-name> <percentage>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [[<angle>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list> )","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( [<length [0,∞]>|none] )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )","polar-color-space":"hsl|hwb|lch|oklch",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pow()":"pow( <calc-sum> , <calc-sum> )","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rectangular-color-space":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( <number-percentage> )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scroll()":"scroll( [<axis>||<scroller>]? )",scroller:"root|nearest|self","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","sign()":"sign( <calc-sum> )","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","absolute-color-base":"<hex-color>|<absolute-color-function>|<named-color>|transparent","absolute-color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>",age:"child|young|old","anchor-name":"<dashed-ident>","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text",bottom:"<length>|auto","container-name":"<custom-ident>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont",left:"<length>|auto","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>","custom-color-space":"<dashed-ident>",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","palette-identifier":"<dashed-ident>",right:"<length>|auto","scope-start":"<forgiving-selector-list>","scope-end":"<forgiving-selector-list>","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","selector-list":"<complex-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","single-animation-composition":"replace|add|accumulate","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","predefined-rgb":"srgb|srgb-linear|display-p3|a98-rgb|prophoto-rgb|rec2020","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","xyz-space":"xyz|xyz-d50|xyz-d65","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","offset-path":"<ray()>|<url>|<basic-shape>","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","style-feature":"<declaration>","style-query":"<style-condition>|<style-feature>","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","anchor()":"anchor( <anchor-element>?&&<anchor-side> , <length-percentage>? )","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size()":"anchor-size( [<anchor-element>||<anchor-size>]? , <length-percentage>? )","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-element":"<dashed-ident>","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","font-variant-css2":"normal|small-caps","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto||<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end",caret:"<'caret-color'>||<'caret-shape'>","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",d:"none|path( <string> )",cx:"<length>|<percentage>",cy:"<length>|<percentage>",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none|preserve-parent-color",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-width'>||<'outline-style'>||<'outline-color'>]","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-timeline":"[<'scroll-timeline-name'>||<'scroll-timeline-axis'>]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start|trim-both|trim-all|auto","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"auto|wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> <'view-timeline-axis'>?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"none|<dashed-ident>#","view-transition-name":"none|<custom-ident>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces|[<'white-space-collapse'>||<'text-wrap'>||<'white-space-trim'>]","white-space-collapse":"collapse|discard|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|never|always","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,∞]>","font-family":"<family-name>#","override-colors":"[<integer [0,∞]> <absolute-color-base>]#"}},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<declaration-value>?"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},nest:{prelude:"<complex-selector-list>",descriptors:null}},node:J};function tre(e){switch(this.tokenType){case l5:return this.Hash();case b5:return this.Operator();case k5:return this.Parentheses(this.readSequence,e.recognizer);case w5:return this.Brackets(this.readSequence,e.recognizer);case s5:return this.String();case f5:return this.Dimension();case p5:return this.Percentage();case d5:return this.Number();case i5:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case c5:return this.Url();case o5:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case u5:{const e=this.charCodeAt(this.tokenStart);if(47===e||42===e||43===e||45===e)return this.Operator();35===e&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}const nre={getNode:tre},rre={onWhiteSpace:function(e,t){null!==t.last&&"Combinator"!==t.last.type&&null!==e&&"Combinator"!==e.type&&t.push({type:"Combinator",loc:null,name:" "})},getNode:function(){switch(this.tokenType){case w5:return this.AttributeSelector();case l5:return this.IdSelector();case v5:return this.lookupType(1)===v5?this.PseudoElementSelector():this.PseudoClassSelector();case o5:return this.TypeSelector();case d5:case p5:return this.Percentage();case f5:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case u5:switch(this.charCodeAt(this.tokenStart)){case 43:case 62:case 126:case 47:return this.Combinator();case 46:return this.ClassSelector();case 42:case 124:return this.TypeSelector();case 35:return this.IdSelector();case 38:return this.NestingSelector()}}}};function ore(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}const ire={getNode:tre,onWhiteSpace(e,t){ore(e)&&(e.value=" "+e.value),ore(t.last)&&(t.last.value+=" ")},expression:function(){return this.createSingleNodeList(this.Raw(null,!1))},var:function(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===b5){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if("Value"===n.type&&n.children.isEmpty)for(let e=t-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===h5){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}},are=new Set(["none","and","not","or"]),lre={parse:{prelude(){const e=this.createList();if(this.tokenType===o5){const t=this.substring(this.tokenStart,this.tokenEnd);are.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},sre={parse:{prelude:null,block(){return this.Block(!0)}}};function cre(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==O5&&this.error()}},t||(()=>this.Raw(null,!0)))}const ure={layer(){this.skipSC();const e=this.createList(),t=cre.call(this,this.Layer);return"Raw"===t.type&&""===t.value||e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=cre.call(this,this.Declaration,()=>cre.call(this,()=>this.Condition("supports")));return"Raw"===t.type&&""===t.value||e.push(t),e}},dre={container:lre,"font-face":sre,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case s5:e.push(this.String());break;case c5:case i5:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===o5&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===i5&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,ure)),this.skipSC(),this.tokenType===i5&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,ure)),this.lookupNonWSType(0)!==o5&&this.lookupNonWSType(0)!==k5||e.push(this.MediaQueryList()),e},block:null}},layer:{parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}},media:{parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}},nest:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},page:{parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}},scope:{parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}},"starting-style":{parse:{prelude:null,block(e=!1){return this.Block(e)}}},supports:{parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}},pre={parse(){return this.createSingleNodeList(this.SelectorList())}},fre={parse(){return this.createSingleNodeList(this.Selector())}},hre={parse(){return this.createSingleNodeList(this.Identifier())}},mre={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case o5:e.push(this.Identifier());break;case s5:e.push(this.String());break;case b5:e.push(this.Operator());break;case O5:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},gre={parse(){return this.createSingleNodeList(this.Nth())}},vre={dir:hre,has:pre,lang:mre,matches:pre,is:pre,"-moz-any":pre,"-webkit-any":pre,where:pre,not:pre,"nth-child":gre,"nth-last-child":gre,"nth-last-of-type":gre,"nth-of-type":gre,slotted:fre,host:fre,"host-context":fre},yre={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:ee,atrule:dre,pseudo:vre,node:te},bre=(e=>A8(P8({},e)))({...ere,...yre,node:J}),{tokenize:wre,parse:Ere,generate:kre,lexer:Ore,createLexer:Sre,walk:xre,find:_re,findLast:Cre,findAll:Dre,toPlainObject:Pre,fromPlainObject:Are,fork:Tre}=bre;function Fre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ire=gn(function(e,t){var n,r,o,i,a,l,s=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",c=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[s])&&void 0!==r?r:{},u=null!==(i=null!==(a=e.settingsPage.customCSS)&&void 0!==a?a:null===(l=e.settingsPage)||void 0===l||null===(l=l.settings)||void 0===l?void 0:l.customCSS)&&void 0!==i?i:"";return Mre(Mre({},t),{},{platform:s,settings:c,code:u})},function(e){return{setCode:function(t){return e(function(e){return{type:pi.SET_CUSTOM_CSS,customCSS:e}}(t))}}})(function(e){var t=e.code,n=e.setCode,r=(0,pe.useCallback)(function(e,t){n(e)},[]);return React.createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-custom-css"},React.createElement(n5,{value:t,height:"300px",theme:"light",onChange:r,extensions:[new QK(bJ,bJ.data.of({autocomplete:yJ})),r0(),LJ(function(e){var t=[],n=e.state.doc.toString();try{Ere(n,{positions:!0,onParseError:function(n){var r=n.line,o=n.column,i=e.state.doc.line(r);t.push({from:i.from+o-1,to:i.from+o,severity:"error",message:n.formattedMessage||n.message})}})}catch(e){console.error("CSSTree parse failed:",e)}return t})]}))});var Nre=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function jre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rre=function(e,t){var n=e.id,r=e.onChange,o=void 0===r?null:r,i=e.onBlur,a=void 0===i?null:i,l=e.name,s=e.placeholder,c=void 0===s?null:s,u=e.type,d=void 0===u?"text":u,p=(e.withP,e.label),f=e.icon,h=e.typeChange,m=void 0===h?void 0:h,g=e.error,v=Wn(e,Nre),y=ce((0,pe.useState)(d),2),b=y[0],w=y[1],E=null!=n?n:l,k={type:b,name:l,id:E};return(0,pe.useEffect)(function(){m&&w(d)},[]),null!=c&&(k=Lre(Lre({},k),{},{placeholder:c})),null!=a&&(k=Lre(Lre({},k),{},{onBlur:a})),null!=o&&(k=Lre(Lre({},k),{},{onChange:o})),he().createElement("div",{className:"templately-setting-input templately-setting-input-".concat(null!=d?d:"text")},p&&"checkbox"!==d&&"radio"!==d?he().createElement("label",{htmlFor:E,className:"templately-setting-input-label"},p):"",he().createElement("div",{className:"".concat(m?"has-change-button":""," ").concat(f?"has-icon":""," ").concat(null!=g&&g.hasError?"has-error":"")},null!=f?f:"",he().createElement("input",re({ref:t},k,v)),m?he().createElement("button",{onClick:function(){w(b===d?null==m?void 0:m.type:d)}},b===d?null==m?void 0:m.primaryText:null==m?void 0:m.secondaryText):""),!p||"checkbox"!==d&&"radio"!==d?"":he().createElement("label",{htmlFor:E,className:"templately-setting-input-label"},p),(null==g?void 0:g.hasError)&&he().createElement("div",{className:"templately-setting-error-message"},he().createElement(Bn,null),null==g?void 0:g.errorMessage))};const Bre=he().forwardRef(Rre);function zre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Ure=gn(function(e,t){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y,b,w=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",E=null!==(r=null===(o=e.settingsPage)||void 0===o?void 0:o[w])&&void 0!==r?r:{},k=(null===(i=e.settingsPage.settings)||void 0===i?void 0:i[w],null!==(a=null!==(l=null===(s=e.settingsPage)||void 0===s?void 0:s.siteTitle)&&void 0!==l?l:null===(c=e.settingsPage)||void 0===c||null===(c=c.settings)||void 0===c?void 0:c.siteTitle)&&void 0!==a?a:""),O=null!==(u=null!==(d=null===(p=e.settingsPage)||void 0===p?void 0:p.siteTagline)&&void 0!==d?d:null===(f=e.settingsPage)||void 0===f||null===(f=f.settings)||void 0===f?void 0:f.siteTagline)&&void 0!==u?u:"",S=null!==(h=null!==(m=null===(g=e.settingsPage)||void 0===g?void 0:g.logoImage)&&void 0!==m?m:null===(v=e.settingsPage)||void 0===v||null===(v=v.settings)||void 0===v?void 0:v.site_logo)&&void 0!==h?h:null;return S||(S={url:"",id:"",size:211}),S.size||(S.size=211),Wre(Wre({},t),{},{platform:w,settings:E,siteTitle:k,siteTagline:O,logoImage:S,templatelySettings:null!==(y=null===(b=e.settingsPage)||void 0===b?void 0:b.settings)&&void 0!==y?y:{}})},function(e){return{setSiteTitle:function(t){return e(function(e){return{type:pi.SET_SITE_TITLE,siteTitle:e}}(t))},setSiteTagline:function(t){return e(function(e){return{type:pi.SET_SITE_TAGLINE,siteTagline:e}}(t))},setLogoImage:function(t){return e(function(e){return{type:pi.SET_LOGO_IMAGE,logoImage:e}}(t))}}})(function(e){e.platform;var t=e.siteTitle,n=e.setSiteTitle,r=e.siteTagline,o=e.setSiteTagline,i=e.logoImage,a=e.setLogoImage,l=(e.templatelySettings,function(e){e.preventDefault(),e.stopPropagation(),a({url:"",id:"",size:i.size})});return React.createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-general"},React.createElement(Bre,{type:"text",label:(0,At.__)("Site Title","templately"),value:t,onChange:function(e){return n(e.target.value)}}),React.createElement(Bre,{type:"text",label:(0,At.__)("Site Tagline","templately"),value:r,onChange:function(e){return o(e.target.value)}}),React.createElement("div",{className:"templately-setting-file-uploader-wrapper"},React.createElement("h4",{className:"templately-title"},"Upload a logo"),React.createElement("p",{className:"templately-info"},"Upload a logo for your site. You can upload/update it anytime later."),React.createElement(ZF.MediaUpload,{onSelect:function(e){var t,n;a(Wre(Wre({},i),{},{url:null!==(t=null==e?void 0:e.url)&&void 0!==t?t:"",id:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:""}))},allowedTypes:["image"],value:i.url,render:function(e){var t=e.open;return React.createElement("button",{onClick:t,className:"templately-setting-file-uploader"},React.createElement("span",{className:"icon"},i.url&&React.createElement(React.Fragment,null,React.createElement("span",{className:"templately-setting-file-remove-button",onClick:l},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 -0.5 21 21"},React.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},React.createElement("g",{fill:"#fff",transform:"translate(-179 -360)"},React.createElement("g",{transform:"translate(56 160)"},React.createElement("path",{d:"M130.35 216h2.1v-8h-2.1v8zm4.2 0h2.1v-8h-2.1v8zm-6.3 2h10.5v-12h-10.5v12zm2.1-14h6.3v-2h-6.3v2zm8.4 0v-4h-10.5v4H123v2h3.15v14h14.7v-14H144v-2h-5.25z"})))))),React.createElement("img",{src:i.url,alt:""})),!i.url&&React.createElement(oj,null)),React.createElement("span",{className:"content"},React.createElement("span",{className:"title"},React.createElement("span",{className:"highlighted"},"Click to upload")," logo"),React.createElement("span",{className:"info"},"SVG, PNG, JPG or GIF (max. 800x400 px)")))}})))}),Vre=function(e){return he().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},he().createElement("path",{fillRule:"evenodd",d:"M12 22c-4.714 0-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12s0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22zM8.97 8.97a.75.75 0 011.06 0L12 10.94l1.97-1.97a.75.75 0 011.06 1.06L13.06 12l1.97 1.97a.75.75 0 11-1.06 1.06L12 13.06l-1.97 1.97a.75.75 0 11-1.06-1.06L10.94 12l-1.97-1.97a.75.75 0 010-1.06z",clipRule:"evenodd"}))},Hre=function(){var e=ce((0,pe.useState)(!1),2),t=e[0],n=e[1],r=function(){Sl.close()};return he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-display-condition-modal-header"},he().createElement("div",{className:"templately-logo"}),he().createElement("button",{className:"close-button",onClick:r},he().createElement(Vre,null))),he().createElement("div",{className:"templately-display-condition-modal-body"},!t&&he().createElement("div",{className:"normal"},he().createElement("h2",null,(0,At.__)("Are you sure you want to revert to your old website?","templately")),he().createElement("div",{className:"warning-text"},(0,At.__)("Warning: This will remove your existing settings and content with the previous one.","templately"))),he().createElement("div",{className:"reverting",style:{display:t?"":"none"}},he().createElement(El,null),he().createElement("div",null,he().createElement("p",null,(0,At.__)("Restoring previous version of your website. This usually takes a few moments. Please wait…","templately"))))),he().createElement("div",{className:"templately-display-condition-modal-footer"},he().createElement(pl,{className:"confirm-revert",disabled:t,onClick:function(e){var t;n(!0);var r=null===(t=e.target.closest(".templately-sweetalert"))||void 0===t?void 0:t.querySelector(".swal2-icon");r&&(r.style.display="none");var o=(0,vi.addQueryArgs)(ajaxurl,{action:"templately_pack_import_revert",nonce:window.templately.nonce});fa(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?Sl.close({success:!1,error:r}):(Sl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),he().createElement(pl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))};function Gre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Qre=gn(function(e,t){var n,r,o=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return qre(qre({},t),{},{platform:o,hasRevert:null!==(r=e.settingsPage.settings.has_revert)&&void 0!==r&&r})},function(e){return{}})(function(e){var t=e.hasRevert,n=(0,pe.useMemo)(function(){return{key:"success",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately"),args:{timer:null,showCloseButton:!0,showCancelButton:!0,cancelButtonText:"Close"}},success:{title:(0,At.__)("Successfully Reverted","templately"),content:(0,At.__)("Old website has been successfully restored.","templately"),args:{timer:null,showCloseButton:!0,showConfirmButton:!0,confirmButtonText:"Visit Site"}}}},[]);return he().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-miscellaneous"},he().createElement("div",{className:"templately-setting-miscellaneous-panel"},he().createElement("h3",{className:"templately-title"},"Revert to previous website"),he().createElement("p",{className:"templately-sub-title"},"Here you can revert back to your old website. We will restore previous settings, posts, pages, menus, etc."),he().createElement("button",{onClick:function(e){e.preventDefault(),xl({icon:"warning",onConfirm:function(e){var t;if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.site_url){var r=e.data.site_url;n.success.args.confirmButtonText='<a href="'.concat(r,'" target="_blank">Visit Site</a>'),n.success.args.didDestroy=function(t){e.success&&e.data.redirect&&setTimeout(function(){window.location.reload()},500)}}_l(n,e)},html:he().createElement(Hre,null),didDestroy:function(){}},!0).then(function(e){e.success})},className:"templately-button",disabled:!t,title:t?"templately":"Nothing to revert"},he().createElement("span",null,"Revert Now"))))}),$re=function(e){var t,n=e.title,r=e.children,o=e.current,i=e.setCurrent,a=e.id,l=ce((0,pe.useState)(null!==(t=e.initialCollapsed)&&void 0!==t&&t),2),s=l[0],c=l[1];return(0,pe.useEffect)(function(){null!=o&&null!=a&&c(o!=a)},[o]),he().createElement("div",{className:"templately-setting-new-collapser"},he().createElement("div",{className:"templately-setting-new-collapser-header ".concat(s?"collapsed":"show"),onClick:function(){null!=o&&null!=a?i(s?a:-1):c(!s)}},he().createElement("h4",{className:"templately-setting-title"},n),he().createElement("div",{className:"templately-setting-icon"},he().createElement(Cn,null))),he().createElement("div",{className:"templately-setting-new-collapser-body ".concat(s?"collapsed":"show")},he().createElement("div",{className:"templately-setting-new-collapser-body-inner"},r)))};function Yre(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Kre=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],Zre=function(e,t){if(e&&"Default"!==e&&!Kre.includes(e)){var n={ru_RU:"cyrillic",uk:"cyrillic",bg_BG:"cyrillic",vi:"vietnamese",el:"greek",he_IL:"hebrew"},r="https://fonts.googleapis.com/css?family="+e+":100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic";n[t]&&(r+="&subset="+n[t]);var o='link[href="'+r+'"]',i=document.createElement("link");if(i.href=r,i.rel="stylesheet",i.type="text/css",i.crossOrigin="anonymous",!document.querySelector(o)){var a=document.querySelectorAll("link"),l=a[a.length-1];l?l.after(i):document.body.appendChild(i)}}},Jre=["options","children","maxHeight","getValue","loadedFonts"];function eoe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function toe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var noe=he().createContext({}),roe=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=he().useContext(noe),i=o.setSize,a=o.windowWidth,l=o.loadedFonts,s=o.options,c=he().useRef(),u=s[n];return(0,pe.useEffect)(function(){r||!u.value||l.current.includes(u.value)||(Zre(u.value,window.templately.locale),l.current=[].concat(Nl(l.current),[u.value]))},[]),(0,pe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),he().createElement("div",{ref:c},t)};function ooe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ioe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ooe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ooe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const aoe=function(e){var t,n,r=e.label,o=e.title,i=void 0===o?"":o,a=e.screen,l=e.setScreen,s=e.field,c=e.typography,u=e.setTypography,d=null!==(t=c[s][a].value)&&void 0!==t?t:"",p=null!==(n=c[s][a].unit)&&void 0!==n?n:"px",f=function(e,t){var n=t[e]||{};return Xre(Xre({},{px:{min:0,max:100,step:1},em:{min:.1,max:10,step:.1},rem:{min:.1,max:10,step:.1},vh:{min:0,max:100,step:1},vw:{min:0,max:100,step:1}}[e]),n)}(p,{selectedSize:{px:{min:1,max:200},em:{max:20},rem:{max:20},vw:{min:.1,max:10,step:.1}},selectedLetterSpacing:{px:{min:-5,max:10,step:.1},em:{min:0,max:1,step:.01},rem:{min:0,max:1,step:.01}},selectedLineHeight:{px:{min:1}}}[s]),h=f.min,m=f.max,g=f.step,v=Math.max(h,Math.min(m,d)),y=function(e){u("".concat(s,".").concat(a,".value"),e),c[s][a].unit||u("".concat(s,".").concat(a,".unit"),p)},b=function(e){l(e)};return(0,pe.useEffect)(function(){c[s][a].unit||u("".concat(s,".").concat(a,".unit"),"px")},[]),he().createElement("div",{className:"templately-setting-typography-picker-field"},he().createElement("label",{className:"templately-setting-typography-picker-field-label"},he().createElement("span",{title:i},r),he().createElement("div",{className:"templately-setting-device-dropdown"},he().createElement("button",{className:"templately-setting-device-dropdown-selected"},"desktop"===a?he().createElement("span",{className:"dashicons dashicons-desktop"}):"tablet"===a?he().createElement("span",{className:"dashicons dashicons-tablet"}):he().createElement("span",{className:"dashicons dashicons-smartphone"})),he().createElement("ul",{className:"templately-setting-device-dropdown-menu"},he().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("desktop"===a?"active":""),onClick:function(){return b("desktop")}},he().createElement("span",{className:"dashicons dashicons-desktop"})),he().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("tablet"===a?"active":""),onClick:function(){return b("tablet")}},he().createElement("span",{className:"dashicons dashicons-tablet"})),he().createElement("li",{className:"templately-setting-device-dropdown-menu-item ".concat("mobile"===a?"active":""),onClick:function(){return b("mobile")}},he().createElement("span",{className:"dashicons dashicons-smartphone"}))))),he().createElement("div",{className:"templately-setting-typography-picker-field-inner"},he().createElement(tj.TextControl,{min:h,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(tj.SelectControl,{value:p||defaultUnit,onChange:function(e){u("".concat(s,".").concat(a),{unit:e,value:null})},options:[{label:"PX",value:"px"},{label:"EM",value:"em"},{label:"REM",value:"rem"},{label:"VW",value:"vw"},{label:"VH",value:"vh"}],label:"Select Option",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(lj.Range,{values:[v],step:g,min:h,max:m,onChange:function(e){return y(e[0])},renderTrack:function(e){var t=e.props,n=e.children;return he().createElement("div",{onMouseDown:t.onMouseDown,onTouchStart:t.onTouchStart,style:ioe(ioe({},t.style),{},{height:"12px",display:"flex",width:"100%"})},he().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,lj.getTrackBackground)({values:[v],colors:["#798294","#798294"],min:h,max:m}),alignSelf:"center"}},n))},renderThumb:function(e){var t=e.props,n=e.isDragged;return he().createElement("div",re({},t,{key:t.key,style:ioe(ioe({},t.style),{},{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:"#D0D5DD",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px rgba(16, 24, 40, 0.059)"})}),he().createElement("div",{style:{height:"12px",width:"12px",borderRadius:"12px",backgroundColor:n?"#548BF4":"#D0D5DD"}}))}})))};function loe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function soe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?loe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):loe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const coe=function(e){e.normalizedTypography;var t=e.setShowPicker,n=e.typography,r=e.setTypography,o=e.fontList,i=e.reset,a=e.screen,l=e.setScreen,s=e.closeRef,c=[{label:"Default",value:""},{label:"Uppercase",value:"uppercase"},{label:"Lowercase",value:"lowercase"},{label:"Capitalize",value:"capitalize"},{label:"Normal",value:"none"}],u=[{label:"Default",value:""},{label:"Overline",value:"overline"},{label:"Line Through",value:"line-through"},{label:"Underline",value:"underline"},{label:"Underline Overline",value:"underline overline"},{label:"Initial",value:"initial"},{label:"None",value:"none"}],d=[{value:"100",label:"100 (Thin)"},{value:"200",label:"200 (Extra Light)"},{value:"300",label:"300 (Light)"},{value:"400",label:"400 (Normal)"},{value:"500",label:"500 (Medium)"},{value:"600",label:"600 (Semi Bold)"},{value:"700",label:"700 (Bold)"},{value:"800",label:"800 (Extra Bold)"},{value:"900",label:"900 (Black)"},{value:"",label:"Default"},{value:"normal",label:"Normal"},{value:"bold",label:"Bold"}];return(0,pe.useEffect)(function(){Zre(n.selectedFont,window.templately.locale)},[n.selectedFont]),he().createElement("td",{className:"templately-setting-typography-picker-wrapper"},he().createElement("div",{className:"templately-setting-typography-picker",ref:s},he().createElement("div",{className:"templately-setting-typography-picker-title-wrapper"},he().createElement("div",{className:"templately-setting-typography-picker-title-inner"},he().createElement("h4",{className:"templately-setting-typography-picker-title"},null==n?void 0:n.title),he().createElement("button",{className:"templately-setting-typography-picker-reset-button",onClick:i},he().createElement(YN,null))),he().createElement("button",{className:"templately-setting-typography-picker-close-button",onClick:function(){return t(!1)}},he().createElement(rj,null))),he().createElement("div",{className:"templately-setting-typography-picker-preview",style:{fontFamily:n.selectedFont,fontSize:"40px",lineHeight:"1.5"}},"Ag"),he().createElement("div",{className:"templately-setting-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Family"),he().createElement("div",{className:"templately-setting-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",value:o.find(function(e){return e.value===n.selectedFont}),options:o,onChange:function(e){return r("selectedFont",e.value)},components:{MenuList:function(t){return function(e){var t,n=e.options,r=e.children,o=e.maxHeight,i=e.getValue,a=e.loadedFonts,l=(Wn(e,Jre),ce(i(),1)[0]),s=null!==(t=n.indexOf(l))&&void 0!==t?t:0,c=he().useRef(),u=he().useRef({}),d=he().useCallback(function(e,t){var n;u.current=toe(toe({},u.current),{},Pt({},e,t)),null===(n=c.current)||void 0===n||n.resetAfterIndex(e)},[]),p=function(){var e=ce((0,pe.useState)([0,0]),2),t=e[0],n=e[1];return(0,pe.useLayoutEffect)(function(){function e(){n([window.innerWidth,window.innerHeight])}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}},[]),t}(),f=ce(p,1)[0];return(0,pe.useEffect)(function(){var e;null===(e=c.current)||void 0===e||e.scrollToItem(s,"center")},[]),he().createElement(noe.Provider,{value:{setSize:d,windowWidth:f,loadedFonts:a,options:n,listRef:c}},he().createElement("div",null,he().createElement(Lj,{useIsScrolling:!0,height:o,itemSize:function(e){return u.current[e]||35},itemCount:r.length,ref:c},function(e){var t=e.index,o=e.style,i=(e.data,e.isScrolling);return he().createElement("div",{style:toe(toe({},o),{},{fontFamily:n[t].value})},he().createElement(roe,{index:t,style:o,isScrolling:i},r[t]))})))}(soe(soe({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),he().createElement(aoe,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),he().createElement(aoe,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),he().createElement(aoe,{label:"Letter",title:"Letter Spacing",screen:a,setScreen:l,field:"selectedLetterSpacing",typography:n,setTypography:r}),he().createElement("div",{className:"templately-setting-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Weight"),he().createElement("div",{className:"templately-setting-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",value:d.find(function(e){return e.value===n.selectedFontWeight}),options:d,onChange:function(e){return r("selectedFontWeight",e.value)},className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),he().createElement("div",{className:"templately-setting-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Transform"),he().createElement("div",{className:"templately-setting-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",defaultValue:c.find(function(e){return e.value==n.transform}),onChange:function(e){return r("transform",e.value)},options:c,className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),he().createElement("div",{className:"templately-setting-typography-picker-field"},he().createElement("label",{htmlFor:"",className:"templately-setting-typography-picker-field-label"},"Decoration"),he().createElement("div",{className:"templately-setting-typography-picker-field-inner"},he().createElement(Dg,{isSearchable:!0,menuPlacement:"top",defaultValue:u.find(function(e){return e.value==n.decoration}),onChange:function(e){return r("decoration",e.value)},options:u,className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"})))))};var uoe=function(e){var t=e.setTypographyPickerOpen,n=e.normalizedTypography,r=e.typography,o=e.setTypography,i=e.fontList,a=e.reset,l=e.screen,s=e.setScreen,c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1],p=(0,pe.useRef)(null);return null!=r&&r.selectedFont?r.selectedFont:(0,At.__)("Default","templately"),(0,pe.useEffect)(function(){t(u)},[u]),function(e){(0,pe.useEffect)(function(){var t=function(t){e.current&&!e.current.contains(t.target)&&d(!1)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}},[e])}(p),(0,pe.useEffect)(function(){Zre(r.selectedFont,window.templately.locale)},[r.selectedFont]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-setting-typography-panel-item",key:null==r?void 0:r._id},he().createElement("div",{className:"templately-setting-typography-mini-preview",style:{fontFamily:r.selectedFont}},"Ag"),he().createElement("div",{className:"templately-setting-typography-title"},r.title),he().createElement("div",{className:"templately-setting-typography-popup-button",onClick:function(){return d(!u)}},he().createElement(Nn,null)),u&&he().createElement(coe,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts,closeRef:p})))};function doe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function poe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?doe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):doe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const foe=gn(function(e,t){var n,r,o,i,a,l,s,c=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return poe(poe({},t),{},{platform:c,settings:null!==(r=null===(o=e.settingsPage.settings)||void 0===o?void 0:o[c])&&void 0!==r?r:{},screen:null!==(i=null===(a=e.settingsPage)||void 0===a||null===(a=a[c])||void 0===a?void 0:a.screen)&&void 0!==i?i:"desktop",selectedTypography:null!==(l=null===(s=e.settingsPage)||void 0===s||null===(s=s[c])||void 0===s?void 0:s.selectedTypography)&&void 0!==l?l:{}})},function(e){return{setScreen:function(t){return e(function(e){return{type:pi.SET_SCREEN,screen:e}}(t))},setSelectedTypography:function(t){return e((n=t,{type:pi.SET_SELECTED_TYPOGRAPHY,typography:n}));var n}}})(function(e){e.settings;var t=e.platform,n=e.screen,r=e.setScreen,o=e.selectedTypography,i=e.setSelectedTypography,a=ce((0,pe.useState)(0),2),l=a[0],s=a[1],c=ce((0,pe.useState)(!1),2),u=c[0],d=c[1],p=(0,pe.useRef)([]),f=ce((0,pe.useState)([]),2),h=f[0],m=f[1],g=pe.useContext(ot),v=g.normalizedTypography,y=g.groupedData,b=(0,pe.useMemo)(function(){var e=Kre.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Nl(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Nl(h))},[h]);return(0,pe.useEffect)(function(){s(0),(0,Ea.isEmpty)(o)&&i(v)},[t]),(0,pe.useEffect)(function(){var e={action:"templately_pack_google_font",nonce:window.templately.nonce,page:0},t=(0,vi.addQueryArgs)(window.ajaxurl,e);fa(t,{}).then(function(e){var t,n=e.response,r=e.error;r?console.error("Error fetching Google fonts:",r):(null==n||null===(t=n.data)||void 0===t?void 0:t.length)>0&&m(n.data.map(function(e){return{value:e.family,label:e.family,variants:e.variants.map(function(e){return{value:e,label:e}})}}))})},[]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-setting-tab-panel templately-setting-tab-panel-typography"},he().createElement("div",{className:"templately-setting-typography-picker-section"},he().createElement("div",{className:"templately-setting-typography-picker-section-label-wrapper"},he().createElement("div",{style:{display:"flex",alignItems:"center",gap:10}},he().createElement("label",{className:"templately-setting-typography-picker-section-label"},"Typography"),he().createElement("div",{className:"templately-setting-device-tab"},he().createElement("button",{className:"templately-setting-device-tab-button ".concat("desktop"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("desktop")}},he().createElement("span",{className:"dashicons dashicons-desktop"})),he().createElement("button",{className:"templately-setting-device-tab-button ".concat("tablet"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("tablet")}},he().createElement("span",{className:"dashicons dashicons-tablet"})),he().createElement("button",{className:"templately-setting-device-tab-button ".concat("mobile"===n?"active":""),style:{padding:"7px",margin:"5px"},onClick:function(){return r("mobile")}},he().createElement("span",{className:"dashicons dashicons-smartphone"})))),he().createElement("button",{className:"templately-setting-typography-picker-reset-button",onClick:function(){i(v)}},he().createElement(YN,null))),he().createElement("div",{className:"templately-setting-typography-panel-wrapper"},y.map(function(e,t){var a=e.key,c=e.items;return he().createElement($re,{title:a,key:a,initialCollapsed:!0,current:l,setCurrent:s,id:t},he().createElement("div",{className:"templately-setting-typography-panel"},c&&c.map(function(e){var t=e._id;return o[t]?he().createElement(uoe,{key:t,setTypographyPickerOpen:d,reset:function(){return function(e){i(poe(poe({},o),{},Pt({},e,v[e])))}(t)},normalizedTypography:v,typography:o[t],setTypography:function(e,n){return function(e,t,n){var r=Ra(o,"".concat(e,".").concat(t),n);i(r)}(t,e,n)},fontList:b,screen:n,setScreen:r,loadedFonts:p}):null})))})))),u&&he().createElement("div",{className:"templately-setting-overlay"}))});function hoe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function moe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const goe=gn(function(e,t){var n,r,o,i,a;return moe(moe({},t),{},{settingsPlatform:null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor",isLoggedIn:null!==e.profile.data,user:null!==(r=e.profile)&&void 0!==r&&r,redirect:null===(o=e.general)||void 0===o?void 0:o.redirect,isGloballySigned:null!==(i=null===(a=e.profile)||void 0===a?void 0:a.is_globally_signed)&&void 0!==i&&i})},function(e){return{setPlatform:function(t){return e(av(t))},resetFilter:function(){return e(sv())},isVerifiedProfile:function(t){return e(Ri(t))}}})(function(e){var t=ce(Ct(),1)[0],n=rt(),r=tt(),o=(it(),En()),i=ce(he().useState(0),2),a=(i[0],i[1]);return(0,pe.useEffect)(function(){return(0,ae.addAction)("templately.settings.routes.updated","templately/routes",function(){a(function(e){return e+1})}),function(){(0,ae.removeAction)("templately.settings.routes.updated","templately/routes")}},[]),(0,pe.useEffect)(function(){var t,r,i;null!==e.redirect&&(o(Fi({trying_logout:!0,isGloballySigned:null==e?void 0:e.isGloballySigned,global_user:null!==(t=null===(r=e.redirect)||void 0===r?void 0:r.user)&&void 0!==t?t:void 0})),n(nb(null===(i=e.redirect)||void 0===i?void 0:i.url)))},[e.redirect]),(0,pe.useEffect)(function(){if(null!=e&&e.platform&&e.setPlatform(e.platform),"templately_settings"!==(null==t?void 0:t.get("page"))||null!=t&&t.get("path")){if(e.route){var r={};null!=e&&e.platform&&(r={platform:null==e?void 0:e.platform}),n(nb(e.route,r))}else t.get("path")&&"/"!==(null==t?void 0:t.get("path"))||("gutenberg"===(null==e?void 0:e.platform)&&n(nb("gutenberg/packs",{platform:"gutenberg",isGutenbergEditor:!0})),"elementor"!==(null==e?void 0:e.platform)&&void 0!==(null==e?void 0:e.platform)||n(nb("elementor/packs")));return function(){if(void 0!==e.route){var t,r=tb(),o=null===(t=r.path)||void 0===t?void 0:t.startsWith("clouds/save-template");n(nb(o?"":r.path,{closing:!0}))}}}n(nb("settings/".concat(e.settingsPlatform,"/general")))},[]),(0,pe.useEffect)(function(){var t;!1!==(null==r||null===(t=r.state)||void 0===t?void 0:t.resetFilter)&&e.resetFilter()},[r]),(0,pe.useEffect)(function(){var e=function(e){var r;if(!e.metaKey&&!e.ctrlKey){var o=e.target.closest("a");if(o){var i=o.getAttribute("href");if(i){var a=new URLSearchParams(null===(r=i.split("?"))||void 0===r?void 0:r[1]).get("page"),l=null;if("templately"===a)l=nb("elementor/packs");else if("templately_settings"===a){var s,c=Ha("/settings/:platform/:tab",t.get("path"));l=nb(["settings",null!=c&&c.platform||null!==(s=window.templately)&&void 0!==s&&null!==(s=s.settings)&&void 0!==s&&s.has_elementor?"elementor":"gutenberg","general"])}l&&(e.preventDefault(),n(l),document.querySelectorAll("#toplevel_page_templately li").forEach(function(e){return e.classList.remove("current")}),o.parentNode.classList.add("current"))}}}},r=document.querySelector("#toplevel_page_templately");if(r){var o;r.addEventListener("click",e);var i=null!==(o=t.get("path"))&&void 0!==o?o:"",a=null;if("elementor/packs"===i?a="admin.php?page=templately":i.startsWith("settings/")&&(a="admin.php?page=templately_settings"),i&&a){r.querySelectorAll("li.current").forEach(function(e){return e.classList.remove("current")});var l=r.querySelector('ul.wp-submenu a[href="'.concat(a,'"]'));l&&l.parentNode.classList.add("current")}}return function(){r&&r.removeEventListener("click",e)}},[n]),lt([{element:he().createElement(_W,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/sign-in",index:!0,exact:!0,element:he().createElement(HD,null)}]},{path:"/settings",exact:!0,element:he().createElement(BW,null),children:(0,ae.applyFilters)("templately.settings.routes",[{index:!0,element:he().createElement(gt,{to:"elementor/general",replace:!0})},{path:":platform/general",element:he().createElement(Ure,null)},{path:":platform/miscellaneous",element:he().createElement(Qre,null)},{path:":platform/custom_css",element:he().createElement(Ire,null)},{path:":platform/typography",element:he().createElement(foe,null)},{path:":platform/colors",element:he().createElement(VW,null)}])},{element:he().createElement(_W,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/:platform/:type",exact:!0,element:he().createElement(FW,re({},Ha("/:platform/:type",t.get("path")),{query:t.get("q")}))},{path:"/:platform/:type/:slug",exact:!0,element:he().createElement(Zz,{params:Ha("/:platform/:type/:slug",t.get("path"))})},{path:"/:platform/templates",exact:!0,element:he().createElement(DW,null)}]},{element:he().createElement(_W,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"clouds",exact:!0,element:he().createElement(CW,null),children:[{path:"workspace",element:he().createElement(wD,null)},{path:"workspace/:slug",element:he().createElement(rD,Ha("/clouds/workspace/:slug",t.get("path")))},{path:"shared-workspace",element:he().createElement(wD,{shared:!0})},{path:"shared-workspace/:slug",element:he().createElement(rD,re({shared:!0},Ha("/clouds/shared-workspace/:slug",t.get("path"))))},{path:"save-template",element:he().createElement(bD,e)},{index:!0,element:he().createElement(yD,{title:"My Clouds",q:t.get("q")})}]},{element:he().createElement(CW,null),children:[{exact:!0,path:"downloads",element:he().createElement(aD,null)},{exact:!0,path:"favourites",element:he().createElement(cD,null)},{exact:!0,path:"purchased-items",element:he().createElement(hD,null)}]}]},{path:"*",element:he().createElement(gt,{to:nb("elementor/packs")})}])});function voe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const yoe=function(e){var t,n=function(e,t){var r=e.find(function(e){return t==e.value});if(r)return r;var o,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return voe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?voe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a.options){var l=n(a.options,t);if(l)return l}}}catch(e){i.e(e)}finally{i.f()}},r=0===(null===(t=e.value)||void 0===t?void 0:t.length)?e.options[0]:n(e.options,e.value);return he().createElement(Dg,re({isSearchable:!1,classNamePrefix:"templately-condition"},e,{className:"".concat(e.className," templately-condition"),value:r}))};var boe=["update"];const woe=function(e){var t=e.update,n=Wn(e,boe),r=[{value:"include",label:(0,At.__)("Include","templately")},{value:"exclude",label:(0,At.__)("Exclude","templately")}];return he().createElement(yoe,{options:r,onChange:function(e){return t(n.id,{type:e.value,name:"general",sub_name:"",sub_id:""})},value:n.type,className:"templately-condition-type"})};var Eoe=["update"];const koe=function(e){var t=e.update,n=Wn(e,Eoe);return he().createElement(yoe,{options:n.options,onChange:function(e){return t(n.id,{name:e.value,sub_name:"",sub_id:""})},value:n.name,className:"templately-condition-name"})};var Ooe=["update"];const Soe=function(e){var t=e.update,n=Wn(e,Ooe);return"general"!==n.name&&n.subOptions.length?he().createElement(yoe,{options:n.subOptions,onChange:function(e){return t(n.id,{sub_name:e.value,sub_id:""})},value:n.sub_name,className:"templately-condition-sub-name"}):""};var xoe=["update"];const _oe=function(e){var t=e.update,n=Wn(e,xoe);if(!n.sub_name||null==n||!n.subIdAutocomplete||!Object.keys(null==n?void 0:n.subIdAutocomplete).length)return"";var r=ce(vO(n.subIdAutocomplete,n.sub_id),2),o=r[0],i=r[1];return he().createElement(yoe,{value:n.sub_id,options:o,onInputChange:function(e){return i(e)},onChange:function(e){var r;return t(n.id,{sub_id:null!==(r=null==e?void 0:e.value)&&void 0!==r?r:""})},className:"templately-condition-id",isSearchable:!0,isClearable:!0})},Coe=function(){var e,t=AO(),n=t.conditions,r=t.updateCondition,o=t.createCondition,i=t.removeCondition,a=(t.isSaving,null===(e=Object.values(n))||void 0===e?void 0:e.map(function(e){return he().createElement("div",{className:"templately-display-condition-wrapper",key:e.id},he().createElement("div",{className:"templately-display-condition"},he().createElement(woe,re({},e,{update:r})),he().createElement(koe,re({},e,{update:r})),he().createElement(Soe,re({},e,{update:r})),he().createElement(_oe,re({},e,{update:r}))),he().createElement("button",{onClick:function(){return i(e.id)},className:"delete-button"},he().createElement(Vre,null)))}));return he().createElement("div",{className:"templately-display-conditions"},a,he().createElement(pl,{onClick:o,label:(0,At.__)("Add New Condition","templately")}))},Doe=function(){var e=AO(),t=e.saveConditions,n=e.isSaving;return he().createElement("div",{className:"templately-display-condition-modal-footer"},he().createElement(pl,{disabled:n,onClick:t,label:n?(0,At.__)("Saving...","templately"):(0,At.__)("Save & Close","templately")}))},Poe=function(){return he().createElement("div",{className:"templately-display-condition-modal-header"},he().createElement("div",{className:"templately-logo"},he().createElement(Fn,{width:"37.66px",className:"vector-logo"}),he().createElement(Mn,{className:"text-logo"})),he().createElement("button",{className:"close-button",onClick:function(){window.TemplatelyAppManager.close("templately-edit-conditions-app")}},he().createElement(Vre,null)))};function Aoe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Toe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Foe=gn(function(e,t){var n,r,o,i;return Toe(Toe({},t),{},{isLoading:null!==(n=e.conditions.isLoading)&&void 0!==n&&n,conditions:null!==(r=e.conditions.conditions)&&void 0!==r?r:[],conditionsByTemplate:null!==(o=null===(i=e.conditions.conditionsByTemplate)||void 0===i?void 0:i[null==t?void 0:t.templateID])&&void 0!==o?o:[]})},function(e){return{getConditions:function(t){return e(function(e){return{type:Br,template_id:e}}(t))}}})(function(e){var t;if((0,pe.useEffect)(function(){e.getConditions(e.templateID)},[]),e.isLoading)return he().createElement("div",{className:"templately-display-condition-loader"},he().createElement(El,null));var n={id:e.templateID,conditions:[]};return(null===(t=e.conditionsByTemplate)||void 0===t?void 0:t.length)>0&&(n.conditions=e.conditionsByTemplate),he().createElement(he().Fragment,null,he().createElement(PO,{template:n},he().createElement("div",{className:"templately-display-condition-modal-wrapper"},he().createElement(Poe,null),he().createElement("div",{className:"templately-display-condition-modal-body"},he().createElement("h1",null,"Where Do You Want to Display This Template"),he().createElement("p",null,"Set the conditions that determine where your Template is used throughout your site.",he().createElement("br",null),"For example, choose 'Entire Site' to display the template across your site."),he().createElement(Coe,null)),he().createElement(Doe,null))))});function Moe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return Ioe(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,p.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=p.p,h=i[2];n>3?(o=h===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(l=0,p.v=r,p.n=i[1]):f<h&&(o=n<3||i[0]>r||r>h)&&(i[4]=n,i[5]=r,p.n=h,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,h),l=u,s=h;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(p.n=-1),f(l,s)):p.n=s:p.v=s);try{if(c=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(d=p.n<0)?s:n.call(r,p))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ioe(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ioe(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Ioe(d,"constructor",c),Ioe(c,"constructor",s),s.displayName="GeneratorFunction",Ioe(c,o,"GeneratorFunction"),Ioe(d),Ioe(d,o,"Generator"),Ioe(d,r,function(){return this}),Ioe(d,"toString",function(){return"[object Generator]"}),(Moe=function(){return{w:i,m:p}})()}function Ioe(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ioe=function(e,t,n,r){function i(t,n){Ioe(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Ioe(e,t,n,r)}function Noe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function joe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Noe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Noe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Loe=function(){var e,t,n=ce((0,pe.useState)(!1),2),r=n[0],o=n[1],i=ce((0,pe.useState)({platform:"elementor",type:"",title:""}),2),a=i[0],l=i[1],s=function(){var e=hi(Moe().m(function e(){var t,n,r,i;return Moe().w(function(e){for(;;)switch(e.n){case 0:return o(!0),e.n=1,ha("/templately/v1/create-template",joe({nonce:templately.nonce},a));case 1:t=e.v,n=t.response,r=t.error,n&&(i=new URL(n))&&(window.location.href=i.href),r&&console.error("Error: Template Creation",r),o(!1);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();return he().createElement("div",{className:"templately-theme-builder-modal-html-body-inner"},he().createElement(tj.RadioControl,{className:"templately-theme-builder__choose-platform",selected:null==a?void 0:a.platform,options:[{label:"Elementor",value:"elementor"},{label:"Gutenberg",value:"gutenberg"}],onChange:function(e){return l(joe(joe({},a),{},{platform:e}))}}),he().createElement("div",{className:"templately-theme-builder__choose-type-wrapper"},he().createElement("label",null,"Chose the type of template you want to work on"),he().createElement(Dg,{isSearchable:!1,className:"templately-theme-builder__choose-type",classNamePrefix:"templately-theme-builder__choose-type",placeholder:(0,At.__)("Select template type","templately"),required:!0,noOptionsMessage:function(){return(0,At.__)("No type Found","templately")},options:null===(e=templately)||void 0===e?void 0:e.types,onChange:function(e){return l(joe(joe({},a),{},{type:null==e?void 0:e.value}))}})),he().createElement(tj.TextControl,{className:"templately-theme-builder__choose-title",label:"Name your template",value:null===(t=templately)||void 0===t?void 0:t.title,placeholder:"Enter template name (optional)",onChange:function(e){return l(joe(joe({},a),{},{title:e}))}}),he().createElement("button",{className:"submit-button ".concat(""===(null==a?void 0:a.type)||r?"disabled":""),onClick:s,disabled:r||!(null!=a&&a.type)},(0,At.__)("Create Template","templately")))},Roe=function(){return he().createElement("span",{onClick:function(){xl({showConfirmButton:!1,showDenyButton:!1,icon:!1,title:!1,showCloseButton:!0,customClass:{container:"templately-theme-builder-modal-container",popup:"templately-theme-builder-modal-popup",closeButton:"templately-theme-builder-modal-close-button",htmlContainer:"templately-theme-builder-modal-html"},html:he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-theme-builder-modal-html-header"},he().createElement("h3",{className:"templately-title"},(0,At.__)("Templates Make your Work More Efficient","templately")),he().createElement("p",{className:"templately-details"},(0,At.__)("Templates help you create different sections of your site, and with just a single click, you can reuse them whenever needed","templately"))),he().createElement("div",{className:"templately-theme-builder-modal-html-body"},he().createElement(Loe,null)))},!0).then(function(e){})}},(0,At.__)("Add New Template","templately"))},Boe=function(e){return he().createElement(Roe,null)},zoe=function(){var e=ce((0,pe.useState)(!1),2),t=e[0],n=e[1],r=function(){Sl.close()};return he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-display-condition-modal-header"},he().createElement("div",{className:"templately-logo"}),he().createElement("button",{className:"close-button",onClick:r},he().createElement(Vre,null))),he().createElement("div",{className:"templately-display-condition-modal-body"},!t&&he().createElement("div",{className:"normal"},he().createElement("h2",null,(0,At.__)("Are you sure you want to revert to your old website?","templately")),he().createElement("div",{className:"warning-text"},(0,At.__)("Warning: This will remove your existing settings and content with the previous one.","templately"))),he().createElement("div",{className:"reverting",style:{display:t?"":"none"}},he().createElement(El,null),he().createElement("div",null,he().createElement("p",null,(0,At.__)("Restoring previous version of your website. This usually takes a few moments. Please wait…","templately"))))),he().createElement("div",{className:"templately-display-condition-modal-footer"},he().createElement(pl,{className:"confirm-revert",disabled:t,onClick:function(e){var t;n(!0);var r=null===(t=e.target.closest(".templately-sweetalert"))||void 0===t?void 0:t.querySelector(".swal2-icon");r&&(r.style.display="none");var o=(0,vi.addQueryArgs)(ajaxurl,{action:"templately_pack_import_revert",nonce:window.templately.nonce});fa(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?Sl.close({success:!1,error:r}):(Sl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),he().createElement(pl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))},Woe=function(e){var t=(0,pe.useMemo)(function(){return{key:"success",error:{title:(0,At.__)("Something went wrong.","templately"),content:(0,At.__)("Something went wrong while creating workspace for you. Try Later or Contact support.","templately"),args:{timer:null,showCloseButton:!0,showCancelButton:!0,cancelButtonText:"Close"}},success:{title:(0,At.__)("Successfully Reverted","templately"),content:(0,At.__)("Old website has been successfully restored.","templately"),args:{timer:null,showCloseButton:!0,showConfirmButton:!0,confirmButtonText:"Visit Site"}}}},[]);return he().createElement("span",{onClick:function(e){e.preventDefault(),xl({icon:"warning",onConfirm:function(e){var n;if(null!=e&&null!==(n=e.data)&&void 0!==n&&n.site_url){var r=e.data.site_url;t.success.args.confirmButtonText='<a href="'.concat(r,'" target="_blank">Visit Site</a>'),t.success.args.didDestroy=function(t){e.success&&e.data.redirect&&setTimeout(function(){window.location=e.data.redirect},500)}}_l(t,e)},html:he().createElement(zoe,null),didDestroy:function(){}},!0).then(function(e){e.success})}},(0,At.__)("Revert Now","templately"))},Uoe=function(e){var t=ce((0,pe.useState)({action:eb.action,location:eb.location}),2),n=t[0],r=t[1];return(0,pe.useLayoutEffect)(function(){return eb.listen(function(e,t){r({action:t,location:e})})},[eb]),he().createElement(he().StrictMode,null,he().createElement(Gy,{value:{store:Yx,history:eb}},he().createElement(Lt,{displayName:"ReduxProvider",store:Yx,context:Tt},(null==e?void 0:e.conditions)&&he().createElement(Foe,e),(null==e?void 0:e.revert)&&he().createElement(Woe,e),!(null!=e&&e.settings)&&!(null!=e&&e.conditions)&&!(null!=e&&e.revert)&&!e.addNewTemplate&&he().createElement(yt,{location:n.location,basename:"/",navigator:eb,navigationType:n.action},he().createElement(goe,e)))))};window.wp.domReady,(0,ae.addFilter)("templately_before_content_header","templately",function(e){return React.createElement(GD,e)});var Voe=function(e){return React.createElement("div",{className:"templately-gutenberg"},React.createElement(Uoe,re({platform:"gutenberg"},e)))};if(null!=document.getElementById("templatelyAdmin")&&(document.querySelectorAll(".toplevel_page_templately #wpbody-content > .notice, #ehe-admin-cb").forEach(function(e){return e.remove()}),ie().render(React.createElement(Uoe,{root:!0}),document.getElementById("templatelyAdmin"))),null!=document.getElementById("templatelyAdminSetting")&&(document.querySelectorAll(".templately_page_templately_settings #wpbody-content > .notice, #ehe-admin-cb").forEach(function(e){return e.remove()}),ie().render(React.createElement(Uoe,{isSettings:!0}),document.getElementById("templatelyAdminSetting"))),null!=document.getElementById("templately-theme-builder-admin-header")){var Hoe=document.querySelector(".post-type-templately_library a.page-title-action");Hoe&&(ie().render(React.createElement(Boe,{platform:"elementor"}),Hoe),Hoe.classList.add("rendered"),Hoe.addEventListener("click",function(e){e.preventDefault()}))}window.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".templately-edit-conditions").forEach(function(e){e.addEventListener("click",function(t){t.preventDefault();var n=e.getAttribute("data-template_id");window.TemplatelyAppManager.open({templateID:n},"templately-edit-conditions-app","conditions"),document.querySelector(".templately-edit-conditions-app-wrapper.open").addEventListener("click",function(e){e.target.matches(".templately-edit-conditions-app-wrapper.open")&&window.TemplatelyAppManager.close("templately-edit-conditions-app")})})})}),function(e){e.TemplatelyAppManager={open:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"elementor",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return this.id=t,this.platform=n,null===r&&"elementor"===n&&(r=React.createElement(Uoe,re({platform:"elementor"},e))),null===r&&"gutenberg"===n&&(t=document.getElementById(t),r=React.createElement(Voe,e)),null===r&&"conditions"===n&&(t=document.getElementById(t),r=React.createElement(Uoe,re({conditions:!0,root:!0},e)),t.parentElement.classList.add("open")),ie().render(r,t)},close:function(t){var n,r;if(null!==(r=t=null!==(n=this.id)&&void 0!==n?n:t)&&void 0!==r&&r.tagName||(t=document.getElementById(t)),t.parentElement.classList.contains("open")&&t.parentElement.classList.remove("open"),"elementor"!==this.platform)return ie().unmountComponentAtNode(t);e.TemplatelyModal.hide()}}}(window);var Goe=function(){var e=document.getElementById("templatelyAdmin");if("templatelyAdmin"===(null==e?void 0:e.id)){if(window.scrollY+window.innerHeight===document.documentElement.scrollHeight){var t=document.querySelector(".templately-sidebar-filter-buttons");t&&(t.style.bottom="40px")}var n=document.querySelector("#adminmenuwrap"),r=document.querySelector("body"),o=document.querySelector(".toplevel_page_templately");(null==n?void 0:n.offsetHeight)>(null==r?void 0:r.offsetHeight)?"object"==ne(o)&&"BODY"===(null==o?void 0:o.nodeName)&&(o.style.height=(null==n?void 0:n.offsetHeight)+"px"):o.style.height="100%"}};if(window.addEventListener("DOMContentLoaded",Goe),window.addEventListener("resize",Goe),window.addEventListener("scroll",function(){var e=document.getElementById("templatelyAdmin");if("templatelyAdmin"===(null==e?void 0:e.id)){var t=document.querySelector(".templately-sidebar-filter-buttons");if(null!=t){var n=window.scrollY+window.innerHeight,r=document.documentElement.scrollHeight,o=r-40;t.style.bottom=n>=o?n-o+"px":"0px",n===r?t.classList.add("tsfb-scroll-end"):t.classList.remove("tsfb-scroll-end")}}}),"undefined"!=typeof window&&(window.TemplatelyLibrary={components:{CustomizerIsolated:AB,ImageReplacePanelIsolated:wI},hooks:{useCustomizerData:MB,useImageReplacePanel:MI,useFullSiteImport:hO},utils:{initializeImageMappings:YF,executeAIContentWorkflow:HF,templatelyApiFormData:wa,isFieldSkippable:DP,isAutomaticSkipText:PP}},window.TemplatelyCustomizerIsolated=AB,window.TemplatelyImageReplacePanelIsolated=wI),null!=document.getElementById("templately-fsi-revert-wrapper")){var qoe=document.getElementById("templately-fsi-revert-wrapper"),Qoe=qoe.getElementsByTagName("button");if(Qoe&&Qoe[0]){ie().render(React.createElement(Woe,null),Qoe[0]);var $oe=qoe.parentNode.querySelector(".subsubsub"),Yoe=qoe.parentNode.parentNode.querySelector("#posts-filter");qoe.style.display="block",$oe.style.display="none",Yoe.style.display="none"}}})()})();