File: //home/swifizcd/buyease.com.ng/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={},j="undefined"!=typeof Uint8Array&&_?_(Uint8Array):r,F={__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%":j,"%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 M=_(_(e));F["%Error.prototype%"]=M}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 F[t]=n,n},I={__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"]},R=n(6743),L=n(9957),B=R.call(A,Array.prototype.concat),z=R.call(P,Array.prototype.splice),W=R.call(A,String.prototype.replace),U=R.call(A,String.prototype.slice),V=R.call(A,RegExp.prototype.exec),H=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(e,t){var n,r=e;if(L(I,r)&&(r="%"+(n=I[r])[0]+"%"),L(F,r)){var o=F[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),L(F,i="%"+(r+="."+f)+"%"))a=F[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=L(a,f),a=a[f];p&&!l&&(F[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,j=Object.prototype.propertyIsEnumerable,F=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function M(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),I=N.custom,R=G(I)?I:null,L={__proto__:null,double:'"',single:"'"},B={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(e,t,n){var r=n.quoteStyle||t,o=L[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]"===Q(e)&&U(e)}function H(e){return"[object RegExp]"===Q(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($(l,"quoteStyle")&&!$(L,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($(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=!$(l,"customInspect")||l.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($(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($(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 Y(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return m?M(t,w):w}if("bigint"==typeof t){var k=String(t)+"n";return m?M(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,I=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(X(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 $(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 I&&!function(e){for(var t=0;t<e.length;t++)if(X(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,I)+"]":"[ "+S.call(le,", ")+" ]"}if(function(e){return"[object Error]"===Q(e)&&U(e)}(t)){var se=ne(t,B);return"cause"in Error.prototype||!("cause"in t)||j.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(R&&"function"==typeof t[R]&&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,I)}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,I)}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]"===Q(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]"===Q(e)&&U(e)}(t))return Z(h.call(t));if(function(e){return"[object String]"===Q(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]"===Q(e)&&U(e)}(t)&&!H(t)){var de=ne(t,B),pe=F?F(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(Q(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+"{}":I?me+"{"+te(de,I)+"}":me+"{ "+S.call(de,", ")+" }"}return String(t)};var q=Object.prototype.hasOwnProperty||function(e){return e in this};function $(e,t){return q.call(e,t)}function Q(e){return m.call(e)}function X(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 Y(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Y(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]=$(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)$(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++)j.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,j=[];if(void 0===_)return j;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 F=Object.keys(_);T=v?F.sort(v):F}var M=p?String(n).replace(/\./g,"%2E"):String(n),N=a&&s(_)&&1===_.length?M+"[]":M;if(l&&s(_)&&0===_.length)return N+"[]";for(var I=0;I<T.length;++I){var R=T[I],L="object"==typeof R&&R&&void 0!==R.value?R.value:_[R];if(!d||null!==L){var B=y&&p?String(R).replace(/\./g,"%2E"):String(R),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(j,e(L,z,i,a,l,c,d,p,"comma"===i&&k&&s(_)?null:m,g,v,y,b,w,E,k,O,W))}}return j};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:()=>F});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},j=function(){return"undefined"==typeof window?0:window.scrollY||window.pageYOffset};const F=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:j()}},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:j()}})}},{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 M(e){return M="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},M(e)}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},N(e,t)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}var R=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=I(o);if(i){var n=I(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===M(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"!==M(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===M(o)?o:String(o)),r)}var o}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),l}(t().Component);const L=F(R);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(L,{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 $(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 Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$(Object(n),!0).forEach(function(t){X(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function X(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 Y(){return Y=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},Y.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",Y({},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",Y({className:l+" lazy-load-image-background "+r+u,style:Q(Q({},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),j=()=>_(k["progress-steps"]),F=()=>_(k["validation-message"]),M=()=>x(".".concat(k.actions," .").concat(k.confirm)),N=()=>x(".".concat(k.actions," .").concat(k.deny)),I=()=>x(".".concat(k.loader)),R=()=>x(".".concat(k.actions," .").concat(k.cancel)),L=()=>_(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=()=>$(document.body,k.shown)&&!$(document.body,k["toast-shown"])&&!$(document.body,k["no-backdrop"]),H=()=>C()&&$(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)})}},$=(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},Q=(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])}},X=(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))}},Y=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($(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=L(),r=I();t.showConfirmButton||t.showDenyButton||t.showCancelButton?ne(n):re(n),Q(n,t,"actions"),function(e,t,n){const r=M(),o=N(),i=R();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),Q(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],Q(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),Q(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(()=>{Y(n)})},_e=(e,t)=>{const n=X(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=X(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 je=(e,t)=>{const n=A();Q(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)},Fe=(e,t)=>{for(const n in O)t.icon!==n&&J(e,O[n]);Z(e,O[t.icon]),Ie(e,t),Me(),Q(e,t,"icon")},Me=()=>{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,Re(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,Re({question:"?",warning:"!",info:"i"}[t.icon]))},Ie=(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)}},Re=e=>'<div class="'.concat(k["icon-content"],'">').concat(e,"</div>"),Le=(e,t)=>{const n=j();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),Q(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(I(),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(F()),Be(r,t)})(0,t),ke(0,t),Le(0,t),((e,t)=>{const n=Oe.innerParams.get(e),r=D();n&&t.icon===n.icon?(Ne(r,t),Fe(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),Fe(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,Q(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),Q(n,t,"title")})(0,t),((e,t)=>{const n=W();q(n,t.closeButtonHtml),Q(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)})(0,t),je(e,t),we(0,t),((e,t)=>{const n=B();ie(n,t.footer),t.footer&&ge(t.footer,n),Q(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},$e=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},Qe=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},Xe=(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},Ye=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)&&!$(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=I();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=L(),r=I();!t&&ae(M())&&(t=M()),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(M()),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(M())&&!ae(N())&&!ae(R())&&re(e.actions)};var St={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const xt=()=>M()&&M().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?jt(t,r):[...Dt,...Pt].includes(t.key)?Ft(t.key):"Escape"===t.key&&Mt(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()}},jt=(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()},Ft=e=>{if(![M(),N(),R()].includes(document.activeElement))return;const t=Dt.includes(e)?"nextElementSibling":"previousElementSibling";let n=document.activeElement;for(let e=0;e<L().children.length;e++){if(n=n[t],!n)return;if(ae(n)&&n instanceof HTMLButtonElement)break}n instanceof HTMLButtonElement&&n.focus()},Mt=(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($(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 It(e){e=Bt(e);const t=St.swalPromiseResolve.get(this),n=Rt(this);this.isAwaitingPromise()?e.isDismissed||(Lt(this),t(e)):n&&t(e)}const Rt=e=>{const t=C();if(!t)return!1;const n=Oe.innerParams.get(e);if(!n||$(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 Lt=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=>{$t(e),delete e.params,delete de.keydownHandler,delete de.keydownTarget,delete de.currentInstance},$t=e=>{e.isAwaitingPromise()?(Qt(Oe,e),Oe.awaitingPromise.set(e,!0)):(Qt(St,e),Qt(Oe,e))},Qt=(e,t)=>{for(const n in e)e[n].delete(t)};var Xt=Object.freeze({hideLoading:kt,disableLoading:kt,getInput:function(e){const t=Oe.innerParams.get(e||this),n=Oe.domCache.get(e||this);return n?X(n.popup,t.input):null},close:It,isAwaitingPromise:function(){return!!Oe.awaitingPromise.get(this)},rejectPromise:function(e){const t=St.swalPromiseReject.get(this);Lt(this),t&&t(e)},handleAwaitingPromise:Lt,closePopup:It,closeModal:It,closeToast:It,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"]),Y(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||$(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)):$t(this)}});const Yt=(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(),Lt(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(F())||!1===n?(e.hideLoading(),Lt(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:()=>R()&&R().click(),getContainer:S,getPopup:C,getTitle:P,getHtmlContainer:A,getImage:T,getIcon:D,getInputLabel:()=>_(k["input-label"]),getCloseButton:W,getActions:L,getConfirmButton:M,getDenyButton:N,getCancelButton:R,getLoader:I,getFooter:B,getTimerProgressBar:z,getFocusableElements:U,getValidationMessage:F,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?Yt(e,"confirm"):tn(e,!0)})(e),t.denyButton.onclick=()=>(e=>{const t=Oe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Yt(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(M()),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 Ye(n),Object.assign(He(n),Ge(n),qe(n),$e(n),Qe(n),Xe(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:L(),confirmButton:M(),denyButton:N(),cancelButton:R(),loader:I(),closeButton:W(),validationMessage:F(),progressSteps:j()};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),Q(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,Xt),Object.assign(vn,mn),Object.keys(Xt).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:()=>p,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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,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){u(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 u(e,t,n){return(t=function(e){var t=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)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return e&&e.map((e,t)=>r.createElement(e.tag,c({key:t},e.attr),d(e.child)))}function p(e){return t=>r.createElement(f,l({attr:c({},e.attr)},t),d(e.child))}function f(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({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))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],-1===t.indexOf(n)&&{}.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:()=>j,__classPrivateFieldIn:()=>M,__classPrivateFieldSet:()=>F,__createBinding:()=>g,__decorate:()=>l,__disposeResources:()=>R,__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:()=>L,__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 j(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 F(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 M(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 I="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 R(e){function t(t){e.error=e.hasError?new I(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 L(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:j,__classPrivateFieldSet:F,__classPrivateFieldIn:M,__addDisposableResource:N,__disposeResources:R,__rewriteRelativeImportExtension:L}}},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:()=>D4,spec:()=>C4});var t={};a.r(t),a.d(t,{angle:()=>F6,decibel:()=>L6,flex:()=>R6,frequency:()=>N6,length:()=>j6,resolution:()=>I6,semitones:()=>B6,time:()=>M6});var n={};a.r(n),a.d(n,{getTrace:()=>b8,isKeyword:()=>k8,isProperty:()=>E8,isType:()=>w8});var r={};a.r(r),a.d(r,{generate:()=>t7,name:()=>Z8,parse:()=>e7,structure:()=>J8});var o={};a.r(o),a.d(o,{generate:()=>s7,name:()=>o7,parse:()=>l7,structure:()=>a7,walkContext:()=>i7});var i={};a.r(i),a.d(i,{generate:()=>f7,name:()=>c7,parse:()=>p7,structure:()=>d7,walkContext:()=>u7});var l={};a.r(l),a.d(l,{generate:()=>x7,name:()=>k7,parse:()=>S7,structure:()=>O7});var s={};a.r(s),a.d(s,{generate:()=>N7,name:()=>T7,parse:()=>M7,structure:()=>F7,walkContext:()=>j7});var c={};a.r(c),a.d(c,{generate:()=>B7,name:()=>I7,parse:()=>L7,structure:()=>R7});var u={};a.r(u),a.d(u,{generate:()=>V7,name:()=>z7,parse:()=>U7,structure:()=>W7});var d={};a.r(d),a.d(d,{generate:()=>$7,name:()=>H7,parse:()=>q7,structure:()=>G7});var p={};a.r(p),a.d(p,{generate:()=>Z7,name:()=>X7,parse:()=>K7,structure:()=>Y7});var f={};a.r(f),a.d(f,{generate:()=>a9,name:()=>r9,parse:()=>i9,structure:()=>o9});var h={};a.r(h),a.d(h,{generate:()=>p9,name:()=>c9,parse:()=>d9,structure:()=>u9});var m={};a.r(m),a.d(m,{generate:()=>b9,name:()=>h9,parse:()=>y9,structure:()=>m9});var g={};a.r(g),a.d(g,{generate:()=>M9,name:()=>A9,parse:()=>F9,structure:()=>j9,walkContext:()=>T9});var v={};a.r(v),a.d(v,{generate:()=>U9,name:()=>B9,parse:()=>W9,structure:()=>z9});var y={};a.r(y),a.d(y,{generate:()=>q9,name:()=>V9,parse:()=>G9,structure:()=>H9});var b={};a.r(b),a.d(b,{generate:()=>K9,name:()=>Q9,parse:()=>Y9,structure:()=>X9});var w={};a.r(w),a.d(w,{generate:()=>nee,name:()=>Z9,parse:()=>tee,structure:()=>J9});var E={};a.r(E),a.d(E,{generate:()=>pee,name:()=>lee,parse:()=>dee,structure:()=>see});var k={};a.r(k),a.d(k,{generate:()=>vee,name:()=>fee,parse:()=>gee,structure:()=>mee,walkContext:()=>hee});var O={};a.r(O),a.d(O,{generate:()=>Eee,name:()=>yee,parse:()=>wee,structure:()=>bee});var S={};a.r(S),a.d(S,{generate:()=>_ee,name:()=>Oee,parse:()=>xee,structure:()=>See,xxx:()=>kee});var x={};a.r(x),a.d(x,{generate:()=>Aee,name:()=>Cee,parse:()=>Pee,structure:()=>Dee});var _={};a.r(_),a.d(_,{generate:()=>Mee,name:()=>Tee,parse:()=>Fee,structure:()=>jee});var C={};a.r(C),a.d(C,{generate:()=>Bee,name:()=>Iee,parse:()=>Lee,structure:()=>Ree});var D={};a.r(D),a.d(D,{generate:()=>Vee,name:()=>zee,parse:()=>Uee,structure:()=>Wee});var P={};a.r(P),a.d(P,{generate:()=>$ee,name:()=>Hee,parse:()=>qee,structure:()=>Gee});var A={};a.r(A),a.d(A,{generate:()=>Kee,name:()=>Qee,parse:()=>Yee,structure:()=>Xee});var T={};a.r(T),a.d(T,{generate:()=>nte,name:()=>Jee,parse:()=>tte,structure:()=>ete});var j={};a.r(j),a.d(j,{generate:()=>ate,name:()=>rte,parse:()=>ite,structure:()=>ote});var F={};a.r(F),a.d(F,{generate:()=>ute,name:()=>lte,parse:()=>cte,structure:()=>ste});var M={};a.r(M),a.d(M,{generate:()=>hte,name:()=>dte,parse:()=>fte,structure:()=>pte});var N={};a.r(N),a.d(N,{generate:()=>yte,name:()=>mte,parse:()=>vte,structure:()=>gte});var I={};a.r(I),a.d(I,{generate:()=>kte,name:()=>bte,parse:()=>Ete,structure:()=>wte});var R={};a.r(R),a.d(R,{generate:()=>Cte,name:()=>Ote,parse:()=>_te,structure:()=>xte,walkContext:()=>Ste});var L={};a.r(L),a.d(L,{generate:()=>jte,name:()=>Dte,parse:()=>Tte,structure:()=>Ate,walkContext:()=>Pte});var B={};a.r(B),a.d(B,{generate:()=>Lte,name:()=>Nte,parse:()=>Rte,structure:()=>Ite});var z={};a.r(z),a.d(z,{generate:()=>Vte,name:()=>zte,parse:()=>Ute,structure:()=>Wte});var W={};a.r(W),a.d(W,{generate:()=>Yte,name:()=>qte,parse:()=>Xte,structure:()=>Qte,walkContext:()=>$te});var U={};a.r(U),a.d(U,{generate:()=>ene,name:()=>Kte,parse:()=>Jte,structure:()=>Zte});var V={};a.r(V),a.d(V,{generate:()=>one,name:()=>tne,parse:()=>rne,structure:()=>nne});var H={};a.r(H),a.d(H,{generate:()=>cne,name:()=>ine,parse:()=>sne,structure:()=>lne,walkContext:()=>ane});var G={};a.r(G),a.d(G,{generate:()=>vne,name:()=>hne,parse:()=>gne,structure:()=>mne});var q={};a.r(q),a.d(q,{generate:()=>Sne,name:()=>wne,parse:()=>One,structure:()=>kne,walkContext:()=>Ene});var $={};a.r($),a.d($,{generate:()=>Dne,name:()=>xne,parse:()=>Cne,structure:()=>_ne});var Q={};a.r(Q),a.d(Q,{generate:()=>Nne,name:()=>jne,parse:()=>Mne,structure:()=>Fne});var X={};a.r(X),a.d(X,{generate:()=>qne,name:()=>Vne,parse:()=>Gne,structure:()=>Hne});var Y={};a.r(Y),a.d(Y,{generate:()=>nre,name:()=>Jne,parse:()=>tre,structure:()=>ere});var K={};a.r(K),a.d(K,{generate:()=>are,name:()=>rre,parse:()=>ire,structure:()=>ore});var Z={};a.r(Z),a.d(Z,{generate:()=>dre,name:()=>sre,parse:()=>ure,structure:()=>cre});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:()=>j,Number:()=>F,Operator:()=>M,Parentheses:()=>N,Percentage:()=>I,PseudoClassSelector:()=>R,PseudoElementSelector:()=>L,Ratio:()=>B,Raw:()=>z,Rule:()=>W,Scope:()=>U,Selector:()=>V,SelectorList:()=>H,String:()=>G,StyleSheet:()=>q,SupportsDeclaration:()=>$,TypeSelector:()=>Q,UnicodeRange:()=>X,Url:()=>Y,Value:()=>K,WhiteSpace:()=>Z});var ee={};a.r(ee),a.d(ee,{AtrulePrelude:()=>hre,Selector:()=>mre,Value:()=>vre});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:()=>e7,Atrule:()=>l7,AtrulePrelude:()=>p7,AttributeSelector:()=>S7,Block:()=>M7,Brackets:()=>L7,CDC:()=>U7,CDO:()=>q7,ClassSelector:()=>K7,Combinator:()=>i9,Comment:()=>d9,Condition:()=>y9,Declaration:()=>F9,DeclarationList:()=>W9,Dimension:()=>G9,Feature:()=>Y9,FeatureFunction:()=>tee,FeatureRange:()=>dee,Function:()=>gee,GeneralEnclosed:()=>wee,Hash:()=>xee,IdSelector:()=>Fee,Identifier:()=>Pee,Layer:()=>Lee,LayerList:()=>Uee,MediaQuery:()=>qee,MediaQueryList:()=>Yee,NestingSelector:()=>tte,Nth:()=>ite,Number:()=>cte,Operator:()=>fte,Parentheses:()=>vte,Percentage:()=>Ete,PseudoClassSelector:()=>_te,PseudoElementSelector:()=>Tte,Ratio:()=>Rte,Raw:()=>Ute,Rule:()=>Xte,Scope:()=>Jte,Selector:()=>rne,SelectorList:()=>sne,String:()=>gne,StyleSheet:()=>One,SupportsDeclaration:()=>Cne,TypeSelector:()=>Mne,UnicodeRange:()=>Gne,Url:()=>tre,Value:()=>ire,WhiteSpace:()=>ure});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=Me(("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=Fe(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=je({path:l.relativePath,caseSensitive:l.caseSensitive,end:s},c),d=l.route;if(!u&&s&&n&&!r[r.length-1].route.index&&(u=je({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 je(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 Fe(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 Me(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 Ie(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("/")?Re(r.substring(1),"/"):Re(r,t)}else n=t;var a;return{pathname:n,search:Ve(o),hash:He(i)}}function Re(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 Le(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("?"),Le("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Le("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Le("#","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=Ie(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 $e(){return $e=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},$e.apply(this,arguments)}new Set(qe),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const Qe=pe.createContext(null),Xe=pe.createContext(null),Ye=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(Ye).static||pe.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=pe.useContext(Ze);return e?function(){let{router:e}=function(){let e=pe.useContext(Qe);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,$e({fromRouteId:t},o)))},[e,t]);return r}():function(){et()||ge(!1);let e=pe.useContext(Qe),{basename:t,future:n,navigator:r}=pe.useContext(Ye),{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(Ye),{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(Ye),{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:$e({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(Xe);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(Qe);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(Ye),{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:$e({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=Me(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(Ye.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(Ye),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=Me(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(Ye),{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),jt=function(e){e()},Ft=function(){return jt},Mt={notify:function(){},get:function(){return[]}};function Nt(e,t){var n,r=Mt;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=Ft(),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=Mt)},getListeners:function(){return r}};return a}var It="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?pe.useLayoutEffect:pe.useEffect;const Rt=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]);It(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 Lt(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 $t(e,t,n){It(function(){return e.apply(void 0,t)},n)}function Qt(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function Xt(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 Yt=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=Lt(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=Lt(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,Yt),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]);$t(Qt,[S,O,_,l,C,x,v]),$t(Xt,[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=Lt(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=Lt(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 It(function(){s.current=e,c.current=d,u.current=o,l.current=void 0}),It(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,jt=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 jn=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"}))},Fn=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 Mn=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"})))},In=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"})))},Rn=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"})))},Ln=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=Lt(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 $n(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 Qn(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 Xn(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 Yn(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",jr="APPLICATION_LOAD_TYPES_SUCCESS",Fr="APPLICATION_LOAD_PRICING_SUCCESS",Mr="APPLICATION_LOAD_PRICING_FAILED",Nr="APPLICATION_LOAD_CATEGORIES",Ir="APPLICATION_LOAD_CATEGORIES_SUCCESS",Rr="APPLICATION_LOAD_CATEGORIES_FAILED",Lr="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",$r="PROFILE_LOAD",Qr="LOAD_FAVOURITES",Xr="LOAD_FAVOURITES_SUCCESS",Yr="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",jo="TEMPLATES_RELATED_TEMPLATES_SUCCESS",Fo="TEMPLATES_RELATED_TEMPLATES_FAILED",Mo="SAVED_TEMPLATES_LOAD",No="SAVED_TEMPLATES_LOADED",Io="SAVED_TEMPLATES_LOAD_SUCCESS",Ro="SAVED_TEMPLATES_SET_PAGE",Lo="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",$o="FULL_SITE_IMPORT_SET_FORMDATA",Qo="FULL_SITE_IMPORT_SET_CACHE_DATA",Xo="FULL_SITE_IMPORT_RESET_FULL_SITE_IMPORT",Yo="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)},ji=function(e){return Pi({type:vr},e)},Fi=function(e){return Pi({type:br},e)},Mi=function(e){return Pi({type:wr},e)},Ni=function(e){return Pi({type:kr},e)},Ii=function(e){return Pi({type:Or},e)},Ri=function(e){return Pi({type:pr},e)},Li=function(e){return Pi({type:qr},e)},Bi=function(e){return Pi({type:fr},e)},zi=function(e){return Pi({type:mr},e)},Wi=function(e){return Pi({type:Qr},e)},Ui=function(e){return Pi({type:Xr},e)},Vi=function(e){return Pi({type:Yr},e)},Hi=function(e){return Pi({type:fo},e)},Gi=function(e){return Pi({type:po},e)},qi=function(e){return Pi({type:ho},e)},$i=function(e){return Pi({type:mo},e)},Qi=function(e){return Pi({type:Jr},e)},Xi=function(e){return Pi({type:eo},e)},Yi=function(e){return Pi({type:to},e)},Ki=function(e){return Pi({type:no},e)},Zi=function(e){return Pi({type:ro},e)},Ji=function(e){return Pi({type:io},e)},ea=function(e){return Pi({type:ao},e)},ta=function(e){return Pi({type:lo},e)},na=function(e){return Pi({type:so},e)},ra=function(e){return Pi({type:co},e)},oa=["path"];function ia(){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 aa(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]())):(aa(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,aa(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,aa(d,"constructor",c),aa(c,"constructor",s),s.displayName="GeneratorFunction",aa(c,o,"GeneratorFunction"),aa(d),aa(d,o,"Generator"),aa(d,r,function(){return this}),aa(d,"toString",function(){return"[object Generator]"}),(ia=function(){return{w:i,m:p}})()}function aa(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}aa=function(e,t,n,r){function i(t,n){aa(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))},aa(e,t,n,r)}function la(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 sa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?la(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ca=window.templately.rest_args,ua=(window.templatelyDeveloper||{}).log,da=void 0!==ua&&ua,pa=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 fa(e,t)})};function fa(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})}ca&&(gi().use(gi().createNonceMiddleware(null==ca?void 0:ca.nonce)),gi().use(gi().createRootURLMiddleware(null==ca?void 0:ca.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 ha=function(){var e=hi(ia().m(function e(t,n){var r,o=arguments;return ia().w(function(e){for(;;)switch(e.n){case 0:return r=o.length>2&&void 0!==o[2]?o[2]:{},e.n=1,ma(t,n,sa(sa({},r),{},{method:"GET"}));case 1:return e.a(2,e.v)}},e)}));return function(_x,t){return e.apply(this,arguments)}}(),ma=function(){var e=hi(ia().m(function e(t,n){var r,o,i,a=arguments;return ia().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,ba(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,ba(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)}}(),ga=function(e){if(e&&e.headers&&Vx&&Vx.dispatch)try{var t=e.headers.get("X-Templately-Verified");t&&["true","1","yes","on"].includes(t.toLowerCase())&&(Vx.dispatch(Bi({is_verified:!0})),da&&console.log("User verification status updated via X-Templately-Verified header"))}catch(e){da&&console.error("Error checking verification header:",e)}},va=function(e){if(e&&e.headers&&Vx&&Vx.dispatch)try{var t=e.headers.get("X-Templately-Disconnected");t&&["true","1","yes","on"].includes(t.toLowerCase())&&(Vx.dispatch(zi({is_disconnected:!0})),da&&console.log("Site disconnection detected via X-Templately-Disconnected header"))}catch(e){da&&console.error("Error checking disconnection header:",e)}},ya=function(){var e=hi(ia().m(function e(t){var n,r,o;return ia().w(function(e){for(;;)switch(e.n){case 0:if(n=t.path,r=Wn(t,oa),n){e.n=1;break}throw new Error('secureApiFetch: Request options must include a "path" property.');case 1:return o=sa(sa({},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 ga(e),va(e),Promise.resolve(e).then(function(e){if(e.status>=200&&e.status<300)return e;throw e}).catch(function(e){return fa(e,!0)}).then(function(e){return pa(e,!0)})}).catch(function(e){return va(e),Promise.reject(e).catch(function(e){return fa(e,!0)}).then(function(e){return pa(e,!0)})}))}},e)}));return function(t){return e.apply(this,arguments)}}(),ba=function(){var e=hi(ia().m(function e(t,n){var r,o,i,a,l,s,c=arguments;return ia().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=sa({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,ya(i);case 1:return e.a(2,e.v);case 2:return e.p=2,e.n=3,ya(i);case 3:l=e.v,o=sa(sa({},o),{},{response:l}),e.n=5;break;case 4:e.p=4,s=e.v,o=sa(sa({},o),{},{error:s});case 5:return da&&console.log("Templately API Return: ",t,o),e.a(2,o)}},e,null,[[2,4]])}));return function(t,n){return e.apply(this,arguments)}}(),wa=function(){var e=hi(ia().m(function e(t){var n,r,o;return ia().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)}}(),Ea=function(){var e=hi(ia().m(function e(t,n){var r,o,i,a,l,s,c,u,d,p,f=arguments;return ia().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=sa({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,ga(i),va(i),i.ok){e.n=6;break}return e.n=5,wa(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,da&&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,da&&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,va(p),va(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 ka=window.lodash,Oa=a.p+"images/ratting.png",Sa=a.p+"images/trending.png",xa=a.p+"images/new.png",_a=a.p+"images/featured.png",Ca=a.p+"images/popular.png",Da=a.p+"images/exclusive.png";var Pa,Aa;function Ta(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 ja(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(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},Na=function(e){return null!==e&&"object"===ne(e)&&!Ia(e)},Ia=function(e){return null!==e&&"object"===ne(e)&&Array.isArray(e)},Ra=function(e,t){return t?e+"_"+t.toUpperCase():e},La=function(e,t,n,r){void 0===r&&(r=0);for(var o=(0,ka.toPath)(t);e&&r<o.length;)e=e[o[r++]];return void 0===e?n:e},Ba=function(e,t,n){for(var r=(0,ka.clone)(e),o=r,i=0,a=(0,ka.toPath)(t);i<a.length-1;i++){var l=a[i],s=La(e,a.slice(0,i+1));if(s&&(Na(s)||Array.isArray(s)))o=o[l]=(0,ka.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)},za=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())},Wa=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||"")},Ua=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},Va=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?Ua(e,r):ja({},e),l=!1;o.indexOf(a[n])>-1&&(l=!0),i.push(ja(ja({},a),{},{value:a[n],label:a.name,shared:t,isDisabled:l}))}),i},Ha=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},Ga=function(e,t){var n,r;if((null==t?void 0:t.length)>0)return null!==(n=null===(r=je(e,"/"+t))||void 0===r?void 0:r.params)&&void 0!==n?n:void 0},qa=function(e){return e.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},$a=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=ja(ja({},r),{},{type:"one_time"})),r=ja(ja({},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"},Xa=null!==(Pa=window.templatelyDeveloper)&&void 0!==Pa&&Pa.log?window.console.log.bind(window.console):function(){},Ya=(null!==(Aa=window.templatelyDeveloper)&&void 0!==Aa&&Aa.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}),Ka=[{key:"top_rated",title:"Top Rated",image:Oa,class:"ratting"},{key:"trending",title:"Trending",image:Sa,class:"trending"},{key:"popular",title:"Popular",image:Ca,class:"popular"},{key:"new_arrival",title:"New Arrival",image:xa,class:"new"},{key:"exclusive",title:"Exclusive",image:Da,class:"exclusive"},{key:"featured",title:"Featured",image:_a,class:"featured"}],Za=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)&&za(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")):Wa(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")):Wa(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}},Ja=a(8465),el=a.n(Ja),tl=a(9644),nl=a.n(tl);const rl=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))},ol=function(e){var t=e.children;return he().createElement("div",{className:"templately-sweetalert-body"},t)},il=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(rl,{className:c,header:l}),he().createElement(ol,null,r)))},al=function(e){var t=e.children,n=e.className,r=void 0===n?"":n;return he().createElement("div",{className:"templately-row ".concat(r)},t)},ll=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)},sl=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 cl=["code","message","platform"];const ul=function(e){var t=e.code,n=e.message,r=e.platform,o=Wn(e,cl),i=rt();return(0,pe.useEffect)(function(){"invalid_api_key"!==t&&"is_signed_failed"!==t||(o.logout({isGloballySigned:o.isGloballySigned}),i(Yy("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)))},dl=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(Yy(t,e),{replace:!0}),c(!1)),"reset"===s&&(u(Yy(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(ml,{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(fl,{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 pl=["label","onClick","className","children"];const fl=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,pl);return he().createElement("button",re({},s,{className:"templately-button ".concat(a),onClick:function(e){return o(e)}}),n,l)};var hl=["wrapper","className"];const ml=function(e){var t=e.wrapper,n=void 0===t||t,r=e.className,o=Wn(e,hl);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 gl=["href","name","wrapper","children"];const vl=function(e){var t,n=e.href,r=e.name,o=e.wrapper,i=void 0!==o&&o,a=e.children,l=Wn(e,gl),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 yl={animation:"spin 2s linear infinite"};const bl=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:yl},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 wl=["style","template","text","description","className","isWhiteLabel"],El=window.templately.loadingImage;const kl=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,wl),Vn()("templately-preloader",u,"templately-preloader-".concat(n)));return he().createElement("div",{className:f},"logo"===n&&(p?he().createElement(bl,null):he().createElement("img",{src:El,alt:"Templately"})),"placeholder"===n&&he().createElement(sl,{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 Ol(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 Sl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ol(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xl=nl()(el()),_l=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(kl,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!={}?Sl(Sl({},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(Rt,{store:Vx},a.html)),xl.fire(a).then(function(e){var t,n;return e.isDismissed?((null===(n=a)||void 0===n?void 0:n.dispatch)&&a.dispatch((0,dy.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})},Cl=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=Sl({},e.success);t.message&&(i.content=t.message),r=null!==(o=null==i?void 0:i.args)&&void 0!==o?o:null,n=Sl(Sl({},n),{},{html:he().createElement(Z_,re({},i,{contentArgs:null==t?void 0:t.contentArgs}))})}else if(!1===(null==t?void 0:t[e.key])){var a,l=Sl({},e.error);t.message&&(l.content=t.message),r=null!==(a=null==l?void 0:l.args)&&void 0!==a?a:null,n=Sl(Sl({},n),{},{icon:"error",html:he().createElement(Z_,re({},l,{contentArgs:null==t?void 0:t.contentArgs}))})}null!=r&&(n=Sl(Sl({},n),r)),null!=n.html&&_l(n)},Dl=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=xl.getCloseButton();e?(t.classList.add("is-disabled"),t.setAttribute("disabled",!0)):(t.removeAttribute("disabled"),t.classList.remove("is-disabled"))};function Pl(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 Al=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Tl=()=>Math.random().toString(36).substring(7).split("").join("."),jl={INIT:`@@redux/INIT${Tl()}`,REPLACE:`@@redux/REPLACE${Tl()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Tl()}`};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(Pl(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Pl(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Pl(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(Pl(3));return o}function d(e){if("function"!=typeof e)throw new Error(Pl(4));if(s)throw new Error(Pl(5));let t=!0;c();const n=l++;return a.set(n,e),function(){if(t){if(s)throw new Error(Pl(6));t=!1,c(),a.delete(n),i=null}}}function p(e){if(!Fl(e))throw new Error(Pl(7));if(void 0===e.type)throw new Error(Pl(8));if("string"!=typeof e.type)throw new Error(Pl(17));if(s)throw new Error(Pl(9));try{s=!0,o=r(o,e)}finally{s=!1}return(i=a).forEach(e=>{e()}),e}return p({type:jl.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Pl(10));r=e,p({type:jl.REPLACE})},[Al]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Pl(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Al](){return this}}}}}function Nl(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:jl.INIT}))throw new Error(Pl(12));if(void 0===n(void 0,{type:jl.PROBE_UNKNOWN_ACTION()}))throw new Error(Pl(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(Pl(14));a[l]=u,i=i||u!==c}return i=i||r.length!==Object.keys(e).length,i?a:e}}function Il(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 Rl,Ll,Bl,zl,Wl=["type"];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={isLoading:!0,items:[],error:null},Gl={isLoading:!0,items:[],error:null},ql={dependencies:{include:[],exclude:[]},tags:[],results:{},doQuery:!1,prevQuery:!1},$l={platform:"elementor",has_elementor:null!==(Rl=Boolean(window.templately.has_elementor))&&void 0!==Rl&&Rl,has_elementor_pro:null!==(Ll=Boolean(window.templately.has_elementor_pro))&&void 0!==Ll&&Ll,current_screen:null!==(Bl=window.templately.current_screen)&&void 0!==Bl?Bl:"templately",ui_theme:null!==(zl=window.templately.theme)&&void 0!==zl?zl:"light",plan:"all",headerHeight:0,categories:{isLoading:!0,lists:[]},templateTypes:{isLoading:!0,lists:[]},dependencies:{},tags:[],pricing:{isLoading:!0,error:null,data:[]},error:null,filter:ql,counts:null,featured:Hl,trending:Gl,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"],Xl=["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 Kl(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 Zl=window.templately.is_signed.user,Jl=null!=Zl?Zl:{},es=Jl.meta,ts=void 0===es?null:es,ns=Wn(Jl,["meta"]),rs={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(ns).length>0&&(rs=Kl(Kl({},rs),{},{data:ns})),null!=ts&&(rs=Kl(Kl({},rs),ts));var os=["search"],is=["type"],as=["type"],ls=["type"];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 cs(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 us={isLoading:!0,limit:0,usage:0,error:null},ds={status:us,isLoading:!0,view:"list",error:null,items:{},search:{},push2cloud:{isLoading:!1}};var ps=["type"];function fs(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 hs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ms={isLoading:!0,currentPage:1,totalPage:1,error:null,view:"grid",lists:[],search:{keyword:"",context:"",data:[]}};function gs(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 vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gs(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ys={isLoading:!0,currentPage:1,totalPage:1,view:"list",error:null,lists:[],search:{keyword:"",context:"",data:[]}};var bs=["type"];function ws(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 Es(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ws(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ks={isLoading:!1,keyword:"",context:"",data:{currentPage:1,totalPage:1,1:[]}},Os={isLoading:!0,isFilesLoading:!0,view:"list",error:null,search:ks};var Ss=["type","platform","currentPage","totalPage","data"];function xs(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 _s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xs(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Cs={isLoading:!0,elementor:{currentPage:1,totalPage: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 As(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 Ts={platform:"elementor",isLoading:!1,conditions:[],conditionsByTemplate:{},conditionsForSave:{}};var js,Fs,Ms,Ns,Is=["type"];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 Ls(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}var Bs=(0,ka.cloneDeep)(null!==(js=null===(Fs=window.templately)||void 0===Fs?void 0:Fs.settings)&&void 0!==js?js:{}),zs={settings:Bs,platform:(null==Bs?void 0:Bs.imported_platform)||(null!=Bs&&Bs.has_elementor?"elementor":"gutenberg"),logoImage:null!==(Ms=null==Bs?void 0:Bs.site_logo)&&void 0!==Ms?Ms:null,customCSS:null!==(Ns=null==Bs?void 0:Bs.customCSS)&&void 0!==Ns?Ns:null};var Ws=Symbol.for("immer-nothing"),Us=Symbol.for("immer-draftable"),Vs=Symbol.for("immer-state");function Hs(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gs=Object,qs=Gs.getPrototypeOf,$s="constructor",Qs="prototype",Xs="configurable",Ys="enumerable",Ks="writable",Zs="value",Js=e=>!!e&&!!e[Vs];function ec(e){return!!e&&(rc(e)||cc(e)||!!e[Us]||!!e[$s]?.[Us]||uc(e)||dc(e))}var tc=Gs[Qs][$s].toString(),nc=new WeakMap;function rc(e){if(!e||!pc(e))return!1;const t=qs(e);if(null===t||t===Gs[Qs])return!0;const n=Gs.hasOwnProperty.call(t,$s)&&t[$s];if(n===Object)return!0;if(!fc(n))return!1;let r=nc.get(n);return void 0===r&&(r=Function.toString.call(n),nc.set(n,r)),r===tc}function oc(e,t,n=!0){0===ic(e)?(n?Reflect.ownKeys(e):Gs.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ic(e){const t=e[Vs];return t?t.type_:cc(e)?1:uc(e)?2:dc(e)?3:0}var ac=(e,t,n=ic(e))=>2===n?e.has(t):Gs[Qs].hasOwnProperty.call(e,t),lc=(e,t,n=ic(e))=>2===n?e.get(t):e[t],sc=(e,t,n,r=ic(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},cc=Array.isArray,uc=e=>e instanceof Map,dc=e=>e instanceof Set,pc=e=>"object"==typeof e,fc=e=>"function"==typeof e,hc=e=>"boolean"==typeof e,mc=e=>e.copy_||e.base_,gc=e=>e.modified_?e.copy_:e.base_;function vc(e,t){if(uc(e))return new Map(e);if(dc(e))return new Set(e);if(cc(e))return Array[Qs].slice.call(e);const n=rc(e);if(!0===t||"class_only"===t&&!n){const t=Gs.getOwnPropertyDescriptors(e);delete t[Vs];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i[Ks]&&(i[Ks]=!0,i[Xs]=!0),(i.get||i.set)&&(t[o]={[Xs]:!0,[Ks]:!0,[Ys]:i[Ys],[Zs]:e[o]})}return Gs.create(qs(e),t)}{const t=qs(e);if(null!==t&&n)return{...e};const r=Gs.create(t);return Gs.assign(r,e)}}function yc(e,t=!1){return wc(e)||Js(e)||!ec(e)||(ic(e)>1&&Gs.defineProperties(e,{set:bc,add:bc,clear:bc,delete:bc}),Gs.freeze(e),t&&oc(e,(e,t)=>{yc(t,!0)},!1)),e}var bc={[Zs]:function(){Hs(2)}};function wc(e){return null===e||!pc(e)||Gs.isFrozen(e)}var Ec="MapSet",kc="Patches",Oc="ArrayMethods",Sc={};function xc(e){const t=Sc[e];return t||Hs(0),t}var _c,Cc=e=>!!Sc[e],Dc=()=>_c;function Pc(e,t){t&&(e.patchPlugin_=xc(kc),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ac(e){Tc(e),e.drafts_.forEach(Fc),e.drafts_=null}function Tc(e){e===_c&&(_c=e.parent_)}var jc=e=>_c={drafts_:[],parent_:_c,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Cc(Ec)?xc(Ec):void 0,arrayMethodsPlugin_:Cc(Oc)?xc(Oc):void 0};function Fc(e){const t=e[Vs];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[Vs].modified_&&(Ac(t),Hs(4)),ec(e)&&(e=Nc(t,e));const{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Vs].base_,e,t)}else e=Nc(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&yc(t,n)}(t,e,!0),Ac(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ws?e:void 0}function Nc(e,t){if(wc(t))return t;const n=t[Vs];if(!n)return Wc(t,e.handledSet_,e);if(!Rc(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);zc(n,e)}return n.copy_}function Ic(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Rc=(e,t)=>e.scope_===t,Lc=[];function Bc(e,t,n,r){const o=mc(e),i=e.type_;if(void 0!==r&&lc(o,r,i)===t)return void sc(o,r,n,i);if(!e.draftLocations_){const t=e.draftLocations_=new Map;oc(o,(e,n)=>{if(Js(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)sc(o,e,n,i)}function zc(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)}Ic(e)}}function Wc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Js(e)||t.has(e)||!ec(e)||wc(e)||(t.add(e),oc(e,(r,o)=>{if(Js(o)){const t=o[Vs];if(Rc(t,n)){const n=gc(t);sc(e,r,n,e.type_),Ic(t)}}else ec(o)&&Wc(o,t,n)})),e}var Uc={get(e,t){if(t===Vs)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=mc(e);if(!ac(o,t,e.type_))return function(e,t,n){const r=Gc(t,n);return r?Zs in r?r[Zs]:r.get?.call(e.draft_):void 0}(e,o,t);const i=o[t];if(e.finalized_||!ec(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===Hc(e.base_,t)){$c(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 mc(e),ownKeys:e=>Reflect.ownKeys(mc(e)),set(e,t,n){const r=Gc(mc(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Hc(mc(e),t),a=r?.[Vs];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||ac(e.base_,t,e.type_)))return!0;$c(e),qc(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(Js(n)){const o=n[Vs];Rc(o,r)&&o.callbacks_.push(function(){$c(e);const r=gc(o);Bc(e,n,r,t)})}else ec(n)&&e.callbacks_.push(function(){const o=mc(e);3===e.type_?o.has(n)&&Wc(n,r.handledSet_,r):lc(o,t,e.type_)===n&&r.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&Wc(lc(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n)),!0},deleteProperty:(e,t)=>($c(e),void 0!==Hc(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),qc(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=mc(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[Ks]:!0,[Xs]:1!==e.type_||"length"!==t,[Ys]:r[Ys],[Zs]:n[t]}:r},defineProperty(){Hs(11)},getPrototypeOf:e=>qs(e.base_),setPrototypeOf(){Hs(12)}},Vc={};for(let e in Uc){let t=Uc[e];Vc[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function Hc(e,t){const n=e[Vs];return(n?mc(n):e)[t]}function Gc(e,t){if(!(t in e))return;let n=qs(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=qs(n)}}function qc(e){e.modified_||(e.modified_=!0,e.parent_&&qc(e.parent_))}function $c(e){e.copy_||(e.assigned_=new Map,e.copy_=vc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Qc(e,t,n,r){const[o,i]=uc(t)?xc(Ec).proxyMap_(t,n):dc(t)?xc(Ec).proxySet_(t,n):function(e,t){const n=cc(e),r={type_:n?1:0,scope_:t?t.scope_:Dc(),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=Uc;n&&(o=[r],i=Vc);const{revoke:a,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=a,[l,r]}(t,n);return(n?.scope_??Dc()).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||!Rc(o,r))return;r.mapSetPlugin_?.fixSetContents(o);const i=gc(o);Bc(e,o.draft_??o,i,n),zc(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 Xc(e){if(!ec(e)||wc(e))return e;const t=e[Vs];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=vc(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=vc(e,!0);return oc(n,(e,t)=>{sc(n,e,Xc(t))},r),t&&(t.finalized_=!1),n}Vc.deleteProperty=function(e,t){return Vc.set.call(this,e,t,void 0)},Vc.set=function(e,t,n){return Uc.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(fc(e)&&!fc(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(fc(t)||Hs(6),void 0===n||fc(n)||Hs(7),ec(e)){const o=jc(this),i=Qc(0,e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Ac(o):Tc(o)}return Pc(o,n),Mc(r,o)}if(!e||!pc(e)){if(r=t(e),void 0===r&&(r=e),r===Ws&&(r=void 0),this.autoFreeze_&&yc(r,!0),n){const t=[],o=[];xc(kc).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:o}),n(t,o)}return r}Hs(1)},this.produceWithPatches=(e,t)=>{if(fc(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]},hc(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),hc(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),hc(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ec(e)||Hs(8),Js(e)&&(e=function(e){return Js(e)||Hs(10),Xc(e)}(e));const t=jc(this),n=Qc(0,e,void 0);return n[Vs].isManual_=!0,Tc(t),n}finishDraft(e,t){const n=e&&e[Vs];n&&n.isManual_||Hs(9);const{scope_:r}=n;return Pc(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=xc(kc).applyPatches_;return Js(e)?r(e,t):this.produce(e,e=>r(e,t))}},Kc=Yc.produce;function Zc(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(cu(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 Jc(e){return ec(e)?Kc(e,()=>{}):e}function eu(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tu(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(cu(28));if(r in t)throw new Error(cu(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 nu=Symbol.for("rtk-slice-createasyncthunk");function ru(e,t){return`${e}/${t}`}function ou({creators:e}={}){const t=e?.asyncThunk?.[nu];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(cu(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(cu(12));if(n in a.sliceCaseReducersByType)throw new Error(cu(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?tu(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[i,l,s]=tu(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=()=>Jc(e());else{const n=Jc(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(Js(e)){const r=t(e,n);return void 0===r?e:r}if(ec(e))return Kc(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:ru(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(cu(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Zc(e,a):Zc(e))}(a,i,l):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(cu(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||lu,pending:l||lu,rejected:s||lu,settled:c||lu})}(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=eu(d,r,h)),o}function o(t=c){const r=eu(u,n,()=>new WeakMap);return eu(r,t,()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=iu(i,t,()=>eu(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 iu(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 au=ou();function lu(){}var{assign:su}=Object;function cu(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 uu=au({name:"aiContent",initialState:{},reducers:{}}).reducer;var du=["type","plan","platform"],pu=["itemType","key"],fu=["itemType","key"];function hu(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 mu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gu={isLoading:!0};const vu=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gu,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=n.plan,i=n.platform,a=Wn(n,du),l=null!==a.search;switch(r){case Ra(vo,e):return t=Ba(t,[o,i],La(t,[o,i],{})),Ba(t,["error"],null);case Ra(yo,e):return mu(mu({},t),{},{isLoading:!0});case Ra(Eo,e):var s=[o,i,"currentPage"];return a.filtering&&(s=[o,i,"filteredResults","currentPage"]),Ba(t,s,a.page);case Ra(bo,e):if(t=mu(mu({},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=Ba(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=Ba(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]),Ba(t,d,a.data);case Ra(wo,e):return mu(mu({},t),{},{isLoading:!1,error:null==a?void 0:a.error});case Ra(ko,e):return Ba(t,[i,"itemsDetails","isLoading"],!0);case Ra(Oo,e):var p=a.itemType,f=(a.key,Wn(a,pu));return t=Ba(t,[i,"itemsDetails","isLoading"],!1),Ba(t,[i,"itemsDetails",f.slug],mu(mu({},f),{},{type:p}));case Ra(So,e):var h=a.itemType,m=(a.key,Wn(a,fu));return t=Ba(t,[i,"itemsDetails","isLoading"],!1),Ba(t,[i,"itemsDetails","error"],mu(mu({},m),{},{type:h}))}return t}},yu={profile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rs,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 Kl(Kl({},e),{},{syncing:!0});case"APPLICATION_IS_SIGNED":case Er:case yr:return Kl(Kl({},e),{},{isLoading:!0,error:null});case pr:return Kl(Kl({},e),{},{isLoading:!1,error:null,profile:Kl(Kl({},e.profile),{},{error:null})});case kr:case br:var f=null!=d?Kl(Kl({},e),d):e;return Kl(Kl({},f),{},{isLoading:!1,syncing:!1,data:p,prevData:null,error:null});case hr:return Kl(Kl({},e),{},{isVerifying:!0});case fr:var h=Kl(Kl({},e),{},{isVerifying:!1,data:Kl(Kl({},e.data),{},{is_verified:null==p?void 0:p.is_verified})});return Kl(Kl({},h),{},{isLoading:!1,syncing:!1,prevData:null,error:null});case mr:var m;return Kl(Kl({},e),{},{data:Kl(Kl({},e.data),{},{is_disconnected:null===(m=null==p?void 0:p.is_disconnected)||void 0===m||m})});case vr:var g=Kl(Kl({},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,Xl);g=Kl(Kl({},g),{},{data:b},y)}return null!=p&&p.linking&&(g=Kl(Kl({},g),{},{prevData:e.data})),null!=p&&p.trying_logout&&(g=Kl(Kl({},g),{},{data:null,error:null})),g;case Or:case wr:return Kl(Kl({},e),{},{isLoading:!1,data:null,error:p});case Kr:var w=p.filter;return Kl(Kl({},e),{},{favourites:Kl(Kl({},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=Ba(e,[].concat(Il(k),["currentPage"]),E)),e;case Qr:var O=Kl(Kl({},e.favourites),{},{isLoading:!0,error:null});return Kl(Kl({},e),{},{favourites:O});case Xr:var S=p.plan,x=p.itemType,_=Kl(Kl({},e.favourites),{},{isLoading:!1});return e=Kl(Kl({},e),{},{favourites:_}),o&&(e=Ba(e,["favourites",S,l,x,"currentPage"],o)),a&&(e=Ba(e,["favourites",S,l,x,"totalPage"],a)),c&&(e=Ba(e,["favourites",S,l,x,o],c)),e;case Yr:var C=Kl(Kl({},e.favourites),{},{isLoading:!1,error:null});return C=Ba(C,"error",c),Kl(Kl({},e),{},{favourites:C});case lo:var D=Kl(Kl({},e.downloads),{},{isLoading:!0,error:null});return Kl(Kl({},e),{},{downloads:D});case so:var P=Kl(Kl({},e.downloads),{},{isLoading:!1,error:null});return P=Ba(P,"currentPage",o),P=Ba(P,"totalPage",a),P=Ba(P,o,c),Kl(Kl({},e),{},{downloads:P});case co:var A=Kl(Kl({},e.downloads),{},{isLoading:!1,error:null});return A=Ba(A,"error",c),Kl(Kl({},e),{},{downloads:A});case po:var T=Kl(Kl({},e.purchasedItems),{},{isLoading:!0,error:null});return Kl(Kl({},e),{},{purchasedItems:T});case ho:var j=Kl(Kl({},e.purchasedItems),{},{isLoading:!1,error:null});return j=Ba(j,"currentPage",o),j=Ba(j,"totalPage",a),j=Ba(j,o,c),Kl(Kl({},e),{},{purchasedItems:j});case fo:var F=Kl(Kl({},e.purchasedItems),{},{all:null,isLoading:!1,error:null});return F=Ba(F,"all",c),Kl(Kl({},e),{},{purchasedItems:F});case mo:var M=Kl(Kl({},e.purchasedItems),{},{isLoading:!1,error:null});return M=Ba(M,"error",c),Kl(Kl({},e),{},{purchasedItems:M});case Jr:var N=Kl({},p.starred);return Kl(Kl({},e),{},{starred:N});case eo:var I=Kl({},p.reviews);return Kl(Kl({},e),{},{reviews:I});case to:return Kl(Kl({},e),{},{favourite:{loading:!0,error:null}});case no:return Kl(Kl({},e),{},{favourite:{loading:!1,error:null}});case ro:return Kl(Kl({},e),{},{favourite:{loading:!1,error:p.error||"Failed to update favourite"}});case oo:return Kl(Kl({},e),{},{rating:{loading:!0,error:null}});case io:return Kl(Kl({},e),{},{rating:{loading:!1,error:null}});case ao:return Kl(Kl({},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]:Ts,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Ds);switch(n){case ur:return As(As({},e),{},{platform:r.platform});case Br:return As(As({},e),{},{isLoading:!0});case zr:return As(As({},e),{},{isLoading:!1,conditions:r});case Wr:return As(As({},e),{},{isLoading:!1,conditionsByTemplate:As(As({},e.conditionsByTemplate),{},Pt({},r.id,r.data))});case Vr:return As(As({},e),{},{isLoading:!1,conditionsForSave:null!=r?r:{}})}return e},general:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$l,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,Wl);switch(r){case Yo:return Vl(Vl({},t),{},{has_elementor:o.has_elementor,has_elementor_pro:o.has_elementor_pro});case Vo:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{currentStep:o.step})});case Ho:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{customizerStep:o.step})});case Go:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{fsiClosed:o.payload})});case qo:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{results:o.payload})});case $o:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{formData:o.payload})});case Qo:return t=Ba(t,["fullSiteImport","cache_data","isLoading"],!1),Ba(t,["fullSiteImport","cache_data",o.payload.type],o.payload.value);case"FULL_SITE_IMPORT_RESET_CACHE_DATA":return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{cache_data:null})});case Xo:return Vl(Vl({},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 Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{processId:o.payload})});case Ko:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{availableCredit:o.payload})});case"FULL_SITE_IMPORT_SET_AI_PAGE_IDS":return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{AIPageIDs:o.payload})});case"FULL_SITE_IMPORT_SET_AI_SIDEBAR_CONTEXT":case Zo:case Jo:case ei:case ti:return Ba(t,["fullSiteImport","aiSidebarContext"],Vl(Vl({},t.fullSiteImport.aiSidebarContext),o.payload));case ni:case ri:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{fsiModalContext:o.payload})});case oi:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{packInfo:Vl(Vl({},t.fullSiteImport.packInfo),{},{loading:!0,error:null})})});case ii:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{packInfo:{data:o.payload,loading:!1,error:null}})});case ai:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:o.payload}})});case li:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{googleFonts:Vl(Vl({},t.fullSiteImport.googleFonts),{},{loading:!0,error:null})})});case si:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{googleFonts:{data:o.payload,loading:!1,error:null}})});case ci:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{googleFonts:{data:null,loading:!1,error:o.payload}})});case ui:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{packInfo:{data:null,loading:!1,error:null}})});case di:return Vl(Vl({},t),{},{fullSiteImport:Vl(Vl({},t.fullSiteImport),{},{triggerHandleClick:{id:o.payload.id,isWithAI:o.payload.isWithAI,timestamp:Date.now()}})});case Lr:return Vl(Vl({},t),{},{redirect:Vl({},o)});case ur:return Vl(Vl({},t),{},{platform:o.platform});case dr:return Vl(Vl({},t),{},{plan:o.plan});case Hr:return Vl(Vl({},t),{},{headerHeight:o.height});case"APPLICATION_META_REQUESTED":return Vl(Vl({},t),{},{isLoading:!0,error:null});case"APPLICATION_META_REQUEST_FAILED":return Vl(Vl({},t),{},{error:Vl(Vl({},t.error),o.error)});case xr:return t=Vl({},t),Ba(t,["filter",o.key],o.data);case _r:return Ba(t,["filter"],ql);case Dr:t=Vl(Vl({},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 Ba(t,["dependencies"],{elementor:[].concat(Il(l),Il(d)),gutenberg:[].concat(Il(c),Il(d))});case Ar:return t=Vl(Vl({},t),{},{isLoading:!1}),Ba(t,["tags"],o.tags);case Tr:return Vl(Vl({},t),{},{templateTypes:{isLoading:!0,lists:[]}});case jr:return t=Vl(Vl({},t),{},{templateTypes:{isLoading:!1}}),Ba(t,["templateTypes","lists"],o.types);case"APPLICATION_LOAD_TYPES_FAILED":return t=Ba(t,["templateTypes","isLoading"],!1),Ba(t,["error","templateTypes"],o.error);case"APPLICATION_LOAD_PRICING":return t=Ba(t,["pricing","isLoading"],!0),Ba(t,["pricing","error"],null);case Fr:return t=Ba(t,["pricing","isLoading"],!1),t=Ba(t,["pricing","data"],null!==(e=null==o?void 0:o.data)&&void 0!==e?e:[]),Ba(t,["pricing","error"],null);case Mr:return t=Ba(t,["pricing","isLoading"],!1),t=Ba(t,["pricing","data"],[]),Ba(t,["pricing","error"],null==o?void 0:o.error);case Nr:return Vl(Vl({},t),{},{categories:{isLoading:!0,lists:[]}});case Ir:return t=Ba(t,["categories","isLoading"],!1),Ba(t,["categories","lists"],o.categories);case Rr:return t=Ba(t,["categories","isLoading"],!1),Ba(t,["error","categories"],o.error);case Sr:return Vl(Vl({},t),{},{counts:Vl({},o)});case xo:return Vl(Vl({},t),{},{featured:Vl(Vl({},Hl),{},{isLoading:!0})});case _o:return Vl(Vl({},t),{},{featured:{isLoading:!1,items:n.items}});case Co:return Vl(Vl({},t),{},{featured:{isLoading:!1,items:[],error:n.error}});case Do:return Vl(Vl({},t),{},{trending:Vl(Vl({},Gl),{},{isLoading:!0})});case Po:return Vl(Vl({},t),{},{trending:{isLoading:!1,items:n.items}});case Ao:return Vl(Vl({},t),{},{trending:{isLoading:!1,items:[],error:n.error}});case To:return Vl(Vl({},t),{},{related:Vl(Vl({},o),{},{isLoading:!0})});case jo:return Vl(Vl({},t),{},{related:{isLoading:!1,items:n.items}});case Fo:return Vl(Vl({},t),{},{related:{isLoading:!1,items:[],error:n.error}})}return t},settingsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zs,t=arguments.length>1?arguments[1]:void 0,n=t.type,r=Wn(t,Is);switch(n){case pi.SET_PLATFORM:return Ls(Ls({},e),{},{platform:r.platform});case pi.SET_COLORS:return Ba(e,[e.platform,"colors"],r.colors);case pi.SET_SELECTED_TYPOGRAPHY:return Ba(e,[e.platform,"selectedTypography"],r.typography);case pi.SET_SCREEN:return Ba(e,[e.platform,"screen"],r.screen);case pi.SET_CUSTOM_CSS:return Ba(e,["customCSS"],r.customCSS);case pi.SET_LOGO_IMAGE:return Ba(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]:Cs,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,Ss);switch(n){case Mo:return _s(_s({},e),{},{isLoading:!0});case No:return _s(_s({},e),{},{isLoading:!1});case Ro:return Ba(e,[o,"currentPage"],s.page);case Io:return e=_s(_s({},e),{},{isLoading:!1}),i&&(e=Ba(e,[o,"currentPage"],i)),a&&(e=Ba(e,[o,"totalPage"],a)),l&&(e=Ba(e,[o,i],l)),e}return e},clouds:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ds,t=arguments.length>1?arguments[1]:void 0,n=t.search,r=Wn(t,os),o=null===n?"items":"search";switch(r.type){case Bo.PUSH:return cs(cs({},e),{},{push2cloud:{isLoading:!0}});case Bo.CLEAR_PUSH2CLOUD:return cs(cs({},e),{},{push2cloud:{isLoading:!1}});case Bo.PUSH_SUCCESS:r.type;var i=Wn(r,is);return cs(cs({},e),{},{push2cloud:cs({isLoading:!1},i)});case Bo.PUSH_FAILED:r.type;var a=Wn(r,as);return cs(cs({},e),{},{push2cloud:cs({isLoading:!1},a)});case Bo.SET_VIEW:return cs(cs({},e),{},{view:r.view});case Bo.SET_PAGE:return null!=r&&r.page&&(e=Ba(e,[o,r.platform,"currentPage"],r.page)),e;case Bo.LOAD:case Bo.REQUESTED:return cs(cs({},e),{},{isLoading:!0,error:null});case Bo.LOAD_SUCCESS:return e=cs(cs({},e),{},{isLoading:!1,push2cloud:{isLoading:null},error:null}),null!=r&&r.currentPage&&(e=Ba(e,[o,r.platform,"currentPage"],r.currentPage)),null!=r&&r.totalPage&&(e=Ba(e,[o,r.platform,"totalPage"],r.totalPage)),null!=r&&r.data&&(e=Ba(e,[o,r.platform,r.currentPage],r.data)),e;case Bo.LOAD_FAILED:r.type;var l=Wn(r,ls);return cs(cs({},e),{},{error:l,isLoading:!1});case Bo.STATUS_REQUEST:return cs(cs({},e),{},{status:cs(cs({},us),{},{isLoading:!0,error:null})});case Bo.STATUS_SUCCESS:return cs(cs({},e),{},{status:cs(cs({},us),{},{usage:r.usages,limit:r.limit,isLoading:!1,error:null})});case Bo.STATUS_FAILED:return cs(cs({},e),{},{status:cs(cs({},us),{},{isLoading:!1,error:r.error})});case Bo.SEARCH:return cs(cs({},e),{},{search:cs(cs({},e.search),{},{isLoading:!0,context:null==r?void 0:r.context,keyword:null==r?void 0:r.search})});case Bo.SEARCH_SUCCESS:return e=cs(cs({},e),{},{search:cs(cs({},e.search),{},{isLoading:!1})}),e=Ba(e,["search","context"],r.context),Ba(e,["search","data"],r.data)}return e},workspaces:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ms,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,ps);switch(r){case zo.SET_VIEW:return hs(hs({},t),{},{view:o.view});case zo.LOAD:case zo.LOAD_LISTS:return hs(hs({},t),{},{isLoading:!0});case zo.SET_LISTS:return hs(hs({},t),{},{isLoading:!1,lists:o.payload});case zo.SET_PAGE:return hs(hs({},t),{},{currentPage:o.page});case zo.DELETE_SUCCESS:if((t=hs({},t)).hasOwnProperty(o.page)){var i=Il(t[o.page]).filter(function(e){return e.id!=o.id});t[o.page]=i}return t;case zo.CREATE_SUCCESS:var a=(t=hs(hs({},t),{},{isLoading:!1})).currentPage;if(t.hasOwnProperty(a)){var l=[];l=(e=l=[hs({},o)].concat(Il(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=Ba(t,[a],l)}else t=Ba(t,[a],[hs({},o)]);return t;case zo.LOAD_SUCCESS:return t=hs(hs({},t),{},{isLoading:!1,currentPage:o.currentPage,error:null}),o.totalPage&&(t=hs(hs({},t),{},{totalPage:o.totalPage})),Ba(t,[o.currentPage],o.data);case zo.LOAD_FAILED:return hs(hs({},t),{},{error:o.error,isLoading:!1});case zo.SEARCH:return hs(hs({},t),{},{search:hs(hs({},t.search),{},{isLoading:!0,context:null==o?void 0:o.context,keyword:null==o?void 0:o.search})});case zo.SEARCH_SUCCESS:return t=hs(hs({},t),{},{search:hs(hs({},t.search),{},{isLoading:!1})}),t=Ba(t,["search","context"],o.context),Ba(t,["search","data"],o.data)}return t},sharedWorkspaces:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ys,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Wo.SET_VIEW:return vs(vs({},e),{},{view:t.view});case Wo.LOAD:case Wo.LOAD_LISTS:return vs(vs({},e),{},{isLoading:!0});case Wo.SET_LISTS:return vs(vs({},e),{},{isLoading:!1,lists:t.payload});case Wo.LOAD_SUCCESS:return e=vs(vs({},e),{},{isLoading:!1,currentPage:t.currentPage}),t.totalPage&&(e=vs(vs({},e),{},{totalPage:t.totalPage})),Ba(e,[t.currentPage],t.data);case Wo.LOAD_FAILED:return vs(vs({},e),{},{isLoading:!1,error:t.error||t.payload});case Wo.SEARCH:return vs(vs({},e),{},{search:vs(vs({},e.search),{},{isLoading:!0,context:null==t?void 0:t.context,keyword:null==t?void 0:t.search})});case Wo.SEARCH_SUCCESS:return e=vs(vs({},e),{},{search:vs(vs({},e.search),{},{isLoading:!1})}),e=Ba(e,["search","context"],t.context),Ba(e,["search","data"],t.data)}return e},workspaceDetails:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os,n=arguments.length>1?arguments[1]:void 0,r=n.type,o=Wn(n,bs);switch(r){case Uo.SET_VIEW:return Es(Es({},t),{},{view:o.view});case Uo.REQUESTED:return Es(Es({},t),{},{error:null});case Uo.LOAD:return Es(Es({},t),{},{isLoading:!0,isFilesLoading:!0,error:null});case Uo.SET:return Es(Es({},t),{},Pt({isLoading:!1,isFilesLoading:!0},o.slug,o));case Uo.DELETE:return null!==(e=t=Es({},t))&&void 0!==e&&e[o.slug]&&delete t[o.slug],t;case Uo.SET_PAGE:return t=Es(Es({},t),{},{isFilesLoading:!0}),null!=o&&o.page&&(t=Ba(t,[o.platform,o.slug,"currentPage"],o.page)),t;case Uo.LOAD_SUCCESS:return delete o.files,delete o.platform,delete o.args,Es(Es({},t),{},Pt({isLoading:!1},o.slug,o));case Uo.LOAD_FAILED:return Es(Es({},t),{},{error:o,isLoading:!1,isFilesLoading:!1});case Uo.GET_FILES_REQUESTED:return Es(Es({},t),{},{isFilesLoading:!0});case Uo.SET_FILES:return t=Es(Es({},t),{},{isLoading:!1,isFilesLoading:!1}),null!=o&&o.currentPage&&(t=Ba(t,[o.platform,o.slug,"currentPage"],o.currentPage)),null!=o&&o.totalPage&&(t=Ba(t,[o.platform,o.slug,"totalPage"],o.totalPage)),Ba(t,[o.platform,o.slug,o.currentPage],o.data);case Uo.RESET_SEARCH:return Es(Es({},t),{},{search:Es({},ks)});case Uo.SEARCH:return Es(Es({},t),{},{search:Es(Es({},t.search),{},{isLoading:!0,context:null==n?void 0:n.context,keyword:null==n?void 0:n.search})});case Uo.SEARCH_SUCCESS:t=Es(Es({},t),{},{search:Es(Es({},t.search),{},{isLoading:!1})});var i=n.currentPage,a=n.totalPage;return t=Ba(t,["search","context"],n.context),t=Ba(t,["search","data",i],n.data),t=Ba(t,["search","data","currentPage"],i),Ba(t,["search","data","totalPage"],a)}return t},aiContent:uu};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 wu(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}function Eu(e){return wu(wu({},yu),e)}var ku=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]},Ou=["dispatch"],Su=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")}};_l({showCloseButton:!0,onConfirm:function(e){return Cl(o,e)},html:React.createElement(n,re({},t,r))},!0)},xu=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=Wn(t,Ou),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")}};_l({showCloseButton:!0,onConfirm:function(e){return Cl(a,e)},html:React.createElement(n,re({page:i.workspaces.currentPage},r,{dispatch:o}))},!0)},_u=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:Su,ModalComponent:jg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:xu,ModalComponent:wd}]};const Cu=window.wp.blocks;function Du(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 Pu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Au=gn(null,function(e){return{forceDelete:function(t){return e(yy(Pu(Pu({},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"))))}),Tu=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")))},ju=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(ml,{wrapper:!1,placeholder:(0,At.__)("Type a title here...","templately"),value:c,onChange:function(e){return u(e.target.value)}}),he().createElement(fl,{disabled:a,label:(0,At.__)("Create a Page","templately"),className:"tb-create-page",onClick:function(){return r(t)}})))};var Fu=["name","id","platform"];function Mu(){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 Nu(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]())):(Nu(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,Nu(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Nu(d,"constructor",c),Nu(c,"constructor",s),s.displayName="GeneratorFunction",Nu(c,o,"GeneratorFunction"),Nu(d),Nu(d,o,"Generator"),Nu(d,r,function(){return this}),Nu(d,"toString",function(){return"[object Generator]"}),(Mu=function(){return{w:i,m:p}})()}function Nu(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Nu=function(e,t,n,r){function i(t,n){Nu(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))},Nu(e,t,n,r)}const Iu=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(){if(0!=m&&"elementor"===r){Dl(),l(!0);var e=function(){var e=hi(Mu().m(function e(){var t,n,i,a,s,c,d,p,h,g,v;return Mu().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=null,null===(t=o.pack)||void 0===t||!t.has_settings||null===(n=o.pack)||void 0===n||!n.id){e.n=5;break}return e.p=1,c={id:o.pack.id,action:"templately_pack_import_global_settings",nonce:(null===(a=window.templately)||void 0===a?void 0:a.nonce)||""},d=window.ajaxurl+"?"+new URLSearchParams(c).toString(),e.n=2,fetch(d);case 2:return p=e.v,e.n=3,p.json();case 3:null!=(h=e.v)&&h.success&&null!=h&&null!==(s=h.data)&&void 0!==s&&s.settings&&(i=h.data.settings),e.n=5;break;case 4:e.p=4,e.v;case 5:return e.p=5,e.n=6,pd({id:m,platform:r,settings:i});case 6:g=e.v,Dl(!1),l(!1),u(g),e.n=8;break;case 7:e.p=7,v=e.v,Dl(!1),l(!1),f(v);case 8:return e.a(2)}},e,null,[[5,7],[1,4]])}));return function(){return e.apply(this,arguments)}}();e(),g(!1)}},[m]),(0,pe.useEffect)(function(){if(0!=y){Dl(),l(!0);var e=function(){var e=hi(Mu().m(function e(){var t,n,i,a,s,c,d,p,h,m,g;return Mu().w(function(e){for(;;)switch(e.p=e.n){case 0:if(i=null,null===(t=o.pack)||void 0===t||!t.has_settings||null===(n=o.pack)||void 0===n||!n.id){e.n=5;break}return e.p=1,c={id:o.pack.id,action:"templately_pack_import_global_settings",nonce:(null===(a=window.templately)||void 0===a?void 0:a.nonce)||""},d=window.ajaxurl+"?"+new URLSearchParams(c).toString(),e.n=2,fetch(d);case 2:return p=e.v,e.n=3,p.json();case 3:null!=(h=e.v)&&h.success&&null!=h&&null!==(s=h.data)&&void 0!==s&&s.settings&&(i=h.data.settings),e.n=5;break;case 4:e.p=4,e.v;case 5:return e.p=5,e.n=6,dd({id:y,title:E,platform:r,settings:i});case 6:m=e.v,Dl(!1),l(!1),u(m),e.n=8;break;case 7:e.p=7,g=e.v,Dl(!1),l(!1),f(g);case 8:return e.a(2)}},e,null,[[5,7],[1,4]])}));return function(){return e.apply(this,arguments)}}();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(kl,{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(ju,{id:n,isCreate:y,createPage:b,setPageTitle:k}),"elementor"===r&&he().createElement(Tu,{isImport:m,id:n,setImport:g})),null!=p&&he().createElement(Zu,re({},p,{type:null==o?void 0:o.type,slug:null==o?void 0:o.slug})),0!=c&&null==p&&he().createElement(sd,re({platform:r},c))))};function Ru(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 Lu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ru(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ru(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Bu=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(){zg(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(Il(o),[Lu(Lu({},n),t)])),l(!1)})},[]),(0,pe.useEffect)(function(){p&&(l(!0),u(!1),zg(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=Lu({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(Il(o),[Lu(Lu({},c),t)]))},[c]),he().createElement(he().Fragment,null,a?he().createElement(zu,{className:"t-info-installing",title:(0,At.__)("Installing...","templately")}):null,c?m&&m.errorMessage?he().createElement(zu,{className:"t-info-error",icon:"no",title:m.errorMessage}):he().createElement(fl,{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(zu,{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 zu=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))},Wu=["dependencies"];function Uu(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 Vu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Uu(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Hu=a(6614);const Gu=function(e){var t=e.dependencies,n=void 0===t?[]:t,r=Wn(e,Wu),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,ka.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 Vu(Vu({},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]),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(ml,{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 Vu(Vu({},e),{},Pt({},t,!(null===(n=e[t])||void 0===n||n)))})}}),he().createElement(vl,{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(Bu,{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"),": "),Hu((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(fl,{label:(0,At.__)("Cancel","templately"),className:"tb-rd-btn bg-danger tm-btn-cancel",onClick:function(){return i(!0)},disabled:null!==p}),he().createElement(fl,{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 qu(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 $u(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 Qu(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 Xu=["code","message","title","contentStyles"];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 Ku(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}const Zu=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,Xu);return he().createElement("div",re({className:"tm-import-failed aligncenter"},l),null!=o?o:he().createElement("h4",null,(0,At.__)("Importing Failed","templately")),Ha(n)?he().createElement("p",{dangerouslySetInnerHTML:{__html:n}}):he().createElement("p",{style:Ku({},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(Qu,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($u,null),(0,At.__)("Purchase This Item","templately"))))},Ju=window.wp.data;var ed=["dependencies","origin","hasElementorPro"];function td(){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 nd(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]())):(nd(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,nd(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,nd(d,"constructor",c),nd(c,"constructor",s),s.displayName="GeneratorFunction",nd(c,o,"GeneratorFunction"),nd(d),nd(d,o,"Generator"),nd(d,r,function(){return this}),nd(d,"toString",function(){return"[object Generator]"}),(td=function(){return{w:i,m:p}})()}function nd(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nd=function(e,t,n,r){function i(t,n){nd(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))},nd(e,t,n,r)}function rd(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 od(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rd(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var id=a(6614);const ad=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(Wg(t))}}})(function(e){var t=e.dependencies,n=e.origin,r=void 0===n?"remote":n,o=e.hasElementorPro,i=Wn(e,ed),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,Ju.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}),Wg({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([])})):_l({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(Zu,{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"}},id((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"),qa(null==i||null===(a=i.template_type)||void 0===a?void 0:a.slug))))),message:id((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"),qa(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(td().m(function t(){var n,o,i,a,l,s,c,u,d,p,h,m,g,v,y,b,w,E,k;return td().w(function(t){for(;;)switch(t.p=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:return Dl(),l=fd({id:e.id,postId:null==O?void 0:O.getCurrentPostId(),origin:r,platform:e.platform}),s=null,null!==(n=e.pack)&&void 0!==n&&n.has_settings&&null!==(o=e.pack)&&void 0!==o&&o.id&&(u={id:e.pack.id,action:"templately_pack_import_global_settings",nonce:(null===(c=templately)||void 0===c?void 0:c.nonce)||""},d=window.ajaxurl+"?"+new URLSearchParams(u).toString(),s=fetch(d).then(function(e){return e.json()}).then(function(e){return null!=e&&e.success?null==e?void 0:e.data:null}).catch(function(){return null})),t.n=3,Promise.all([l,s||Promise.resolve(null)]);case 3:if(p=t.v,h=ce(p,2),m=h[0],g=h[1],v=m,null==g||!g.settings||void 0===(null==m?void 0:m.content)){t.n=8;break}return t.p=4,b={action:"templately_pack_merge_settings_with_template",nonce:(null===(y=templately)||void 0===y?void 0:y.nonce)||""},w=window.ajaxurl+"?"+new URLSearchParams(b).toString(),t.n=5,fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:e.platform,template:m,settings:g.settings})});case 5:return E=t.v,t.n=6,E.json();case 6:null!=(k=t.v)&&k.success&&null!=k&&k.data&&(v=k.data),t.n=8;break;case 7:t.p=7,t.v;case 8:void 0===(null===(i=v)||void 0===i?void 0:i.error)&&hd(v,e.platform),Dl(!1),xl.close(od({insertCompleted:void 0===(null===(a=v)||void 0===a?void 0:a.error),platform:e.platform},v));case 9:return t.a(2)}},t,null,[[4,7]])}));return function(){return t.apply(this,arguments)}}();t()}},[b]),(0,pe.useEffect)(function(){l&&(xl.close({isDismissed:!0}),s(!1))},[l]),null!=b&&!0===b?he().createElement(kl,{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(kl,{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(Iu,re({},e,{platform:e.platform})),null===k&&!u&&!g&&he().createElement(he().Fragment,null,null!==f&&he().createElement(Gu,{dependencies:f,clickCancel:function(e){return s(e)},current_screen:e.current_screen,setIsImporting:w,setImportModal:v})))});var ld=["platform"];const sd=function(e){var t=e.platform,n=Wn(e,ld);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 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 ud(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}var dd=function(e){return ma("/templately/v1/import/page",e,{},!0)},pd=function(e){return ma("/templately/v1/import",e,{},!0)},fd=function(e){return ma("/templately/v1/insert",e,{},!0).then(function(t){return ud(ud({},e),t)}).catch(function(t){return ud(ud({},e),t)})},hd=function(e,t){return"elementor"===t?gd(e):"gutenberg"===t&&md(e)},md=function(e){var t=wp.data.dispatch("core/block-editor").insertBlocks;return!(null==e||!e.content||(t((0,Cu.parse)(e.content)),0))},gd=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},vd=function(e,t){var n=e.ModalComponent,r=e.content;r.my_cloud_id&&(r.id=r.my_cloud_id),_l({showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(n,r)},!0).then(function(e){void 0===(null==e?void 0:e.code)?yd(e.platform):_l({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:React.createElement(Zu,e)},!0)})},yd=function(e){"templately"!=window.templately.current_screen&&("gutenberg"!==e&&window.TemplatelyModal.destroy(),"gutenberg"===e&&window.TemplatelyAppManager.close("templately-gutenberg"))},bd=["dispatch","page","slug","id"],wd=function(e){var t=e.dispatch,n=e.page,r=e.slug,o=e.id,i=(Wn(e,bd),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(){xl.hideLoading(),xl.close({isDismissed:!0})}},(0,At.__)("Cancel","templately"))),he().createElement("div",{className:"tm-column"},he().createElement("button",{className:"tm-btn-confirm",onClick:function(){xl.showLoading(),t(ey({id:o,slug:r,delete_files:a,page:n}))}},(0,At.__)("Delete","templately"))))))},Ed=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=Il(x),t=b.toLowerCase();za(t)&&(e.includes(t)||(e.push(t),_(e)),w("")),v(!1)}},[g]),(0,pe.useEffect)(function(){if(!1!==k){var e=Il(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&&(xl.showLoading(),t(Zv({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(ml,{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(ml,{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(fl,{disabled:0===b.length||!za(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(fl,{disabled:o,onClick:function(){return s(!0)},label:(0,At.__)("Create Workspace","templately")})))))};function kd(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 Od(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kd(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Sd=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function xd(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,Sd),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 Od(Od({},h),{},{inputValue:D,menuIsOpen:P,onChange:S,onInputChange:x,onMenuClose:C,onMenuOpen:_,value:A})}function _d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cd(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 Dd(e,t,n){return t&&Cd(e.prototype,t),n&&Cd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pd(e,t){return Pd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pd(e,t)}function Ad(e){return Ad=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ad(e)}function Td(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Td=function(){return!!e})()}function jd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Fd=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}(),Md=Math.abs,Nd=String.fromCharCode,Id=Object.assign;function Rd(e){return e.trim()}function Ld(e,t,n){return e.replace(t,n)}function Bd(e,t){return e.indexOf(t)}function zd(e,t){return 0|e.charCodeAt(t)}function Wd(e,t,n){return e.slice(t,n)}function Ud(e){return e.length}function Vd(e){return e.length}function Hd(e,t){return t.push(e),e}var Gd=1,qd=1,$d=0,Qd=0,Xd=0,Yd="";function Kd(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Gd,column:qd,length:a,return:""}}function Zd(e,t){return Id(Kd("",null,null,"",null,null,0),e,{length:-e.length},t)}function Jd(){return Xd=Qd>0?zd(Yd,--Qd):0,qd--,10===Xd&&(qd=1,Gd--),Xd}function ep(){return Xd=Qd<$d?zd(Yd,Qd++):0,qd++,10===Xd&&(qd=1,Gd++),Xd}function tp(){return zd(Yd,Qd)}function np(){return Qd}function rp(e,t){return Wd(Yd,e,t)}function op(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 ip(e){return Gd=qd=1,$d=Ud(Yd=e),Qd=0,[]}function ap(e){return Yd="",e}function lp(e){return Rd(rp(Qd-1,up(91===e?e+2:40===e?e+1:e)))}function sp(e){for(;(Xd=tp())&&Xd<33;)ep();return op(e)>2||op(Xd)>3?"":" "}function cp(e,t){for(;--t&&ep()&&!(Xd<48||Xd>102||Xd>57&&Xd<65||Xd>70&&Xd<97););return rp(e,np()+(t<6&&32==tp()&&32==ep()))}function up(e){for(;ep();)switch(Xd){case e:return Qd;case 34:case 39:34!==e&&39!==e&&up(Xd);break;case 40:41===e&&up(e);break;case 92:ep()}return Qd}function dp(e,t){for(;ep()&&e+Xd!==57&&(e+Xd!==84||47!==tp()););return"/*"+rp(t,Qd-1)+"*"+Nd(47===e?e:ep())}function pp(e){for(;!op(tp());)ep();return rp(e,Qd)}var fp="-ms-",hp="-moz-",mp="-webkit-",gp="comm",vp="rule",yp="decl",bp="@keyframes";function Ep(e,t){for(var n="",r=Vd(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function kp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case yp:return e.return=e.return||e.value;case gp:return"";case bp:return e.return=e.value+"{"+Ep(e.children,r)+"}";case vp:e.value=e.props.join(",")}return Ud(n=Ep(e.children,r))?e.return=e.value+"{"+n+"}":""}function Op(e){return ap(Sp("",null,null,null,[""],e=ip(e),0,[0],e))}function Sp(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=ep()){case 40:if(108!=h&&58==zd(O,d-1)){-1!=Bd(O+=Ld(lp(y),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=lp(y);break;case 9:case 10:case 13:case 32:O+=sp(h);break;case 92:O+=cp(np()-1,7);continue;case 47:switch(tp()){case 42:case 47:Hd(_p(dp(ep(),np()),t,n),s);break;default:O+="/"}break;case 123*m:l[c++]=Ud(O)*v;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==v&&(O=Ld(O,/\f/g,"")),f>0&&Ud(O)-d&&Hd(f>32?Cp(O+";",r,n,d-1):Cp(Ld(O," ","")+";",r,n,d-2),s);break;case 59:O+=";";default:if(Hd(k=xp(O,t,n,c,u,o,l,b,w=[],E=[],d),i),123===y)if(0===u)Sp(O,t,k,k,w,i,d,l,E);else switch(99===p&&110===zd(O,3)?100:p){case 100:case 108:case 109:case 115:Sp(e,k,k,r&&Hd(xp(e,k,k,0,0,o,l,b,o,w=[],d),E),o,E,d,l,r?w:E);break;default:Sp(O,k,k,k,[""],E,0,l,E)}}c=u=f=0,m=v=1,b=O="",d=a;break;case 58:d=1+Ud(O),f=h;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Jd())continue;switch(O+=Nd(y),y*m){case 38:v=u>0?1:(O+="\f",-1);break;case 44:l[c++]=(Ud(O)-1)*v,v=1;break;case 64:45===tp()&&(O+=lp(ep())),p=tp(),u=d=Ud(b=O+=pp(np())),y++;break;case 45:45===h&&2==Ud(O)&&(m=0)}}return i}function xp(e,t,n,r,o,i,a,l,s,c,u){for(var d=o-1,p=0===o?i:[""],f=Vd(p),h=0,m=0,g=0;h<r;++h)for(var v=0,y=Wd(e,d+1,d=Md(m=a[h])),b=e;v<f;++v)(b=Rd(m>0?p[v]+" "+y:Ld(y,/&\f/g,p[v])))&&(s[g++]=b);return Kd(e,t,n,0===o?vp:l,s,c,u)}function _p(e,t,n){return Kd(e,t,n,gp,Nd(Xd),Wd(e,2,-2),0)}function Cp(e,t,n,r){return Kd(e,t,n,yp,Wd(e,0,r),Wd(e,r+1,-1),r)}var Dp=function(e,t,n){for(var r=0,o=0;r=o,o=tp(),38===r&&12===o&&(t[n]=1),!op(o);)ep();return rp(e,Qd)},Pp=new WeakMap,Ap=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)||Pp.get(n))&&!r){Pp.set(e,!0);for(var o=[],i=function(e,t){return ap(function(e,t){var n=-1,r=44;do{switch(op(r)){case 0:38===r&&12===tp()&&(t[n]=1),e[n]+=Dp(Qd-1,t,n);break;case 2:e[n]+=lp(r);break;case 4:if(44===r){e[++n]=58===tp()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Nd(r)}}while(r=ep());return e}(ip(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]}}},Tp=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function jp(e,t){switch(function(e,t){return 45^zd(e,0)?(((t<<2^zd(e,0))<<2^zd(e,1))<<2^zd(e,2))<<2^zd(e,3):0}(e,t)){case 5103:return mp+"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 mp+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return mp+e+hp+e+fp+e+e;case 6828:case 4268:return mp+e+fp+e+e;case 6165:return mp+e+fp+"flex-"+e+e;case 5187:return mp+e+Ld(e,/(\w+).+(:[^]+)/,mp+"box-$1$2"+fp+"flex-$1$2")+e;case 5443:return mp+e+fp+"flex-item-"+Ld(e,/flex-|-self/,"")+e;case 4675:return mp+e+fp+"flex-line-pack"+Ld(e,/align-content|flex-|-self/,"")+e;case 5548:return mp+e+fp+Ld(e,"shrink","negative")+e;case 5292:return mp+e+fp+Ld(e,"basis","preferred-size")+e;case 6060:return mp+"box-"+Ld(e,"-grow","")+mp+e+fp+Ld(e,"grow","positive")+e;case 4554:return mp+Ld(e,/([^-])(transform)/g,"$1"+mp+"$2")+e;case 6187:return Ld(Ld(Ld(e,/(zoom-|grab)/,mp+"$1"),/(image-set)/,mp+"$1"),e,"")+e;case 5495:case 3959:return Ld(e,/(image-set\([^]*)/,mp+"$1$`$1");case 4968:return Ld(Ld(e,/(.+:)(flex-)?(.*)/,mp+"box-pack:$3"+fp+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+mp+e+e;case 4095:case 3583:case 4068:case 2532:return Ld(e,/(.+)-inline(.+)/,mp+"$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(Ud(e)-1-t>6)switch(zd(e,t+1)){case 109:if(45!==zd(e,t+4))break;case 102:return Ld(e,/(.+:)(.+)-([^]+)/,"$1"+mp+"$2-$3$1"+hp+(108==zd(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Bd(e,"stretch")?jp(Ld(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==zd(e,t+1))break;case 6444:switch(zd(e,Ud(e)-3-(~Bd(e,"!important")&&10))){case 107:return Ld(e,":",":"+mp)+e;case 101:return Ld(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+mp+(45===zd(e,14)?"inline-":"")+"box$3$1"+mp+"$2$3$1"+fp+"$2box$3")+e}break;case 5936:switch(zd(e,t+11)){case 114:return mp+e+fp+Ld(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return mp+e+fp+Ld(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return mp+e+fp+Ld(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return mp+e+fp+e+e}return e}var Fp=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case yp:e.return=jp(e.value,e.length);break;case bp:return Ep([Zd(e,{value:Ld(e.value,"@","@"+mp)})],r);case vp: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 Ep([Zd(e,{props:[Ld(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Ep([Zd(e,{props:[Ld(t,/:(plac\w+)/,":"+mp+"input-$1")]}),Zd(e,{props:[Ld(t,/:(plac\w+)/,":-moz-$1")]}),Zd(e,{props:[Ld(t,/:(plac\w+)/,fp+"input-$1")]})],r)}return""})}}],Mp=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||Fp,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=[kp,(d=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],f=(c=[Ap,Tp].concat(i,p),u=Vd(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){Ep(Op(e),f)}(e?e+"{"+t.styles+"}":t.styles),r&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new Fd({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},Np=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Ip={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 Rp(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Lp=/[A-Z]|^ms/g,Bp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,zp=function(e){return 45===e.charCodeAt(1)},Wp=function(e){return null!=e&&"boolean"!=typeof e},Up=Rp(function(e){return zp(e)?e:e.replace(Lp,"-$&").toLowerCase()}),Vp=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Bp,function(e,t,n){return Gp={name:t,styles:n,next:Gp},t})}return 1===Ip[e]||zp(e)||"number"!=typeof t||0===t?t:t+"px"};function Hp(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 Gp={name:o.name,styles:o.styles,next:Gp},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Gp={name:a.name,styles:a.styles,next:Gp},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+=Hp(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]+"}":Wp(l)&&(r+=Up(i)+":"+Vp(i,l)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=Hp(e,t,a);switch(i){case"animation":case"animationName":r+=Up(i)+":"+s+";";break;default:r+=i+"{"+s+"}"}}else for(var c=0;c<a.length;c++)Wp(a[c])&&(r+=Up(i)+":"+Vp(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var l=Gp,s=n(e);return Gp=l,Hp(e,t,s)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Gp,qp=/label:\s*([^\s;{]+)\s*(;|$)/g;function $p(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="";Gp=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Hp(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Hp(n,t,e[a]),r&&(o+=i[a]);qp.lastIndex=0;for(var l,s="";null!==(l=qp.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:Gp}}var Qp,Xp,Yp=!!pe.useInsertionEffect&&pe.useInsertionEffect,Kp=Yp||function(e){return e()},Zp=(Yp||pe.useLayoutEffect,pe.createContext("undefined"!=typeof HTMLElement?Mp({key:"css"}):null)),Jp=(Zp.Provider,function(e){return(0,pe.forwardRef)(function(t,n){var r=(0,pe.useContext)(Zp);return e(t,r,n)})}),ef=pe.createContext({}),tf={}.hasOwnProperty,nf="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",rf=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Np(t,n,r),Kp(function(){return function(e,t,n){Np(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},of=Jp(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var o=e[nf],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=$p(i,void 0,pe.useContext(ef));a+=t.key+"-"+l.name;var s={};for(var c in e)tf.call(e,c)&&"css"!==c&&c!==nf&&(s[c]=e[c]);return s.className=a,n&&(s.ref=n),pe.createElement(pe.Fragment,null,pe.createElement(rf,{cache:t,serialized:l,isStringTag:"string"==typeof o}),pe.createElement(o,s))}),af=of,lf=function(e,t){var n=arguments;if(null==t||!tf.call(t,"css"))return pe.createElement.apply(void 0,n);var r=n.length,o=new Array(r);o[0]=af,o[1]=function(e,t){var n={};for(var r in t)tf.call(t,r)&&(n[r]=t[r]);return n[nf]=e,n}(e,t);for(var i=2;i<r;i++)o[i]=n[i];return pe.createElement.apply(null,o)};function sf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return $p(t)}Qp=lf||(lf={}),Xp||(Xp=Qp.JSX||(Qp.JSX={}));const cf=["top","right","bottom","left"],uf=Math.min,df=Math.max,pf=Math.round,ff=Math.floor,hf=e=>({x:e,y:e}),mf={left:"right",right:"left",bottom:"top",top:"bottom"};function gf(e,t,n){return df(e,uf(t,n))}function vf(e,t){return"function"==typeof e?e(t):e}function yf(e){return e.split("-")[0]}function bf(e){return e.split("-")[1]}function wf(e){return"x"===e?"y":"x"}function Ef(e){return"y"===e?"height":"width"}function kf(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Of(e){return wf(kf(e))}function Sf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const xf=["left","right"],_f=["right","left"],Cf=["top","bottom"],Df=["bottom","top"];function Pf(e){const t=yf(e);return mf[t]+e.slice(t.length)}function Af(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 Tf(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 jf(e,t,n){let{reference:r,floating:o}=e;const i=kf(t),a=Of(t),l=Ef(a),s=yf(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(bf(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function Ff(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}=vf(t,e),h=Af(f),m=l[p?"floating"===d?"reference":"floating":d],g=Tf(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=Tf(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 Mf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Nf(e){return cf.some(t=>e[t]>=0)}const If=new Set(["left","top"]);function Rf(){return"undefined"!=typeof window}function Lf(e){return Wf(e)?(e.nodeName||"").toLowerCase():"#document"}function Bf(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function zf(e){var t;return null==(t=(Wf(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wf(e){return!!Rf()&&(e instanceof Node||e instanceof Bf(e).Node)}function Uf(e){return!!Rf()&&(e instanceof Element||e instanceof Bf(e).Element)}function Vf(e){return!!Rf()&&(e instanceof HTMLElement||e instanceof Bf(e).HTMLElement)}function Hf(e){return!(!Rf()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Bf(e).ShadowRoot)}function Gf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=th(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function qf(e){return/^(table|td|th)$/.test(Lf(e))}function $f(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Qf=/transform|translate|scale|rotate|perspective|filter/,Xf=/paint|layout|strict|content/,Yf=e=>!!e&&"none"!==e;let Kf;function Zf(e){const t=Uf(e)?th(e):e;return Yf(t.transform)||Yf(t.translate)||Yf(t.scale)||Yf(t.rotate)||Yf(t.perspective)||!Jf()&&(Yf(t.backdropFilter)||Yf(t.filter))||Qf.test(t.willChange||"")||Xf.test(t.contain||"")}function Jf(){return null==Kf&&(Kf="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kf}function eh(e){return/^(html|body|#document)$/.test(Lf(e))}function th(e){return Bf(e).getComputedStyle(e)}function nh(e){return Uf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rh(e){if("html"===Lf(e))return e;const t=e.assignedSlot||e.parentNode||Hf(e)&&e.host||zf(e);return Hf(t)?t.host:t}function oh(e){const t=rh(e);return eh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vf(t)&&Gf(t)?t:oh(t)}function ih(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=oh(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Bf(o);if(i){const e=ah(a);return t.concat(a,a.visualViewport||[],Gf(o)?o:[],e&&n?ih(e):[])}return t.concat(o,ih(o,[],n))}function ah(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lh(e){const t=th(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Vf(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=pf(n)!==i||pf(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function sh(e){return Uf(e)?e:e.contextElement}function ch(e){const t=sh(e);if(!Vf(t))return hf(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=lh(t);let a=(i?pf(n.width):n.width)/r,l=(i?pf(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const uh=hf(0);function dh(e){const t=Bf(e);return Jf()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:uh}function ph(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=sh(e);let a=hf(1);t&&(r?Uf(r)&&(a=ch(r)):a=ch(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Bf(e))&&t}(i,n,r)?dh(i):hf(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=Bf(i),t=r&&Uf(r)?Bf(r):r;let n=e,o=ah(n);for(;o&&r&&t!==n;){const e=ch(o),t=o.getBoundingClientRect(),r=th(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=Bf(o),o=ah(n)}}return Tf({width:u,height:d,x:s,y:c})}function fh(e,t){const n=nh(e).scrollLeft;return t?t.left+n:ph(zf(e)).left+n}function hh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fh(e,n),y:n.top+t.scrollTop}}function mh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Bf(e),r=zf(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=fh(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=zf(e),n=nh(e),r=e.ownerDocument.body,o=df(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=df(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+fh(e);const l=-n.scrollTop;return"rtl"===th(r).direction&&(a+=df(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}(zf(e));else if(Uf(t))r=function(e,t){const n=ph(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Vf(e)?ch(e):hf(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=dh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tf(r)}function gh(e,t){const n=rh(e);return!(n===t||!Uf(n)||eh(n))&&("fixed"===th(n).position||gh(n,t))}function vh(e,t,n){const r=Vf(t),o=zf(t),i="fixed"===n,a=ph(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=hf(0);function c(){s.x=fh(o)}if(r||!r&&!i)if(("body"!==Lf(t)||Gf(o))&&(l=nh(t)),r){const e=ph(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?hf(0):hh(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 yh(e){return"static"===th(e).position}function bh(e,t){if(!Vf(e)||"fixed"===th(e).position)return null;if(t)return t(e);let n=e.offsetParent;return zf(e)===n&&(n=n.ownerDocument.body),n}function wh(e,t){const n=Bf(e);if($f(e))return n;if(!Vf(e)){let t=rh(e);for(;t&&!eh(t);){if(Uf(t)&&!yh(t))return t;t=rh(t)}return n}let r=bh(e,t);for(;r&&qf(r)&&yh(r);)r=bh(r,t);return r&&eh(r)&&yh(r)&&!Zf(r)?n:r||function(e){let t=rh(e);for(;Vf(t)&&!eh(t);){if(Zf(t))return t;if($f(t))return null;t=rh(t)}return null}(e)||n}const Eh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=zf(r),l=!!t&&$f(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},c=hf(1);const u=hf(0),d=Vf(r);if((d||!d&&!i)&&(("body"!==Lf(r)||Gf(a))&&(s=nh(r)),d)){const e=ph(r);c=ch(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?hf(0):hh(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:zf,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=ih(e,[],!1).filter(e=>Uf(e)&&"body"!==Lf(e)),o=null;const i="fixed"===th(e).position;let a=i?rh(e):e;for(;Uf(a)&&!eh(a);){const t=th(a),n=Zf(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Gf(a)&&!n&&gh(e,a))?r=r.filter(e=>e!==a):o=t,a=rh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],l=mh(t,a[0],o);let s=l.top,c=l.right,u=l.bottom,d=l.left;for(let e=1;e<a.length;e++){const n=mh(t,a[e],o);s=df(n.top,s),c=uf(n.right,c),u=uf(n.bottom,u),d=df(n.left,d)}return{width:c-d,height:u-s,x:d,y:s}},getOffsetParent:wh,getElementRects:async function(e){const t=this.getOffsetParent||wh,n=this.getDimensions,r=await n(e.floating);return{reference:vh(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}=lh(e);return{width:t,height:n}},getScale:ch,isElement:Uf,isRTL:function(e){return"rtl"===th(e).direction}};function kh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oh(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=sh(e),u=o||i?[...c?ih(c):[],...t?ih(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=zf(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:-ff(d)+"px "+-ff(o.clientWidth-(u+p))+"px "+-ff(o.clientHeight-(d+f))+"px "+-ff(u)+"px",threshold:df(0,uf(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||kh(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&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?ph(e):null;return s&&function t(){const r=ph(e);m&&!kh(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 Sh=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}=vf(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=yf(o),y=kf(l),b=yf(l)===l,w=await(null==s.isRTL?void 0:s.isRTL(c.floating)),E=p||(b||!m?[Pf(l)]:function(e){const t=Pf(e);return[Sf(e),t,Sf(t)]}(l)),k="none"!==h;!p&&k&&E.push(...function(e,t,n,r){const o=bf(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?_f:xf:t?xf:_f;case"left":case"right":return t?Cf:Df;default:return[]}}(yf(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Sf)))),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=bf(e),o=Of(e),i=Ef(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Pf(a)),[a,Pf(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===kf(t)||_.every(e=>kf(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=kf(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{}}}},xh=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}=vf(e,t)||{};if(null==c)return{};const d=Af(u),p={x:n,y:r},f=Of(o),h=Ef(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,_=uf(d[v],x),C=uf(d[y],x),D=_,P=O-m[h]-C,A=O/2-m[h]/2+S,T=gf(D,A,P),j=!s.arrow&&null!=bf(o)&&A!==T&&i.reference[h]/2-(A<D?_:C)-m[h]/2<0,F=j?A<D?A-D:A-P:0;return{[f]:p[f]+F,data:{[f]:T,centerOffset:A-T-F,...j&&{alignmentOffset:F}},reset:j}}}),_h=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}=vf(e,t),u={x:n,y:r},d=kf(o),p=wf(d);let f=u[p],h=u[d];const m=vf(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(yf(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}}}},Ch=(e,t,n)=>{const r=new Map,o={platform:Eh,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Ff},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}=jf(c,r,s),p=r,f=0;const h={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:g,fn:v}=m,{x:y,y:b,data:w,reset:E}=await v({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,h[g]={...h[g],...w},E&&f<50&&(f++,"object"==typeof E&&(E.placement&&(p=E.placement),E.rects&&(c=!0===E.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):E.rects),({x:u,y:d}=jf(c,p,s))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:i})};var Dh=pe.useLayoutEffect,Ph=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ah=function(){};function Th(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function jh(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(Th(e,a)));return i.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var Fh=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===ne(e)&&null!==e?[e]:[];var t},Mh=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,Od({},Wn(e,Ph))},Nh=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 Ih(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Rh(e){return Ih(e)?window.pageYOffset:e.scrollTop}function Lh(e,t){Ih(e)?window.scrollTo(0,t):e.scrollTop=t}function Bh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ah,o=Rh(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);Lh(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function zh(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?Lh(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&Lh(e,Math.max(t.offsetTop-o,0))}function Wh(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var Uh=!1,Vh={get passive(){return Uh=!0}},Hh="undefined"!=typeof window?window:{};Hh.addEventListener&&Hh.removeEventListener&&(Hh.addEventListener("p",Ah,Vh),Hh.removeEventListener("p",Ah,!1));var Gh=Uh;function qh(e){return null!=e}function $h(e,t,n){return e?t:n}var Qh=["children","innerProps"],Xh=["children","innerProps"];var Yh,Kh=function(e){return"auto"===e?"bottom":e},Zh=(0,pe.createContext)(null),Jh=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)(Zh)||{}).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 Dh(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||Ih(u=s)?window.innerHeight:u.clientHeight,y=Rh(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&&Bh(s,x,C),{placement:"bottom",maxHeight:t};if(!a&&S>=r||a&&k>=r)return i&&Bh(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&&Lh(s,x),{placement:"bottom",maxHeight:t};break;case"top":if(E>=h)return{placement:"top",maxHeight:t};if(O>=h&&!a)return i&&Bh(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&&Bh(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:Od(Od({},e),{},{placement:h||Kh(o),maxHeight:d})})},em=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return Od({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},tm=em,nm=em,rm=["size"],om=["innerProps","isRtl","size"],im={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},am=function(e){var t=e.size,n=Wn(e,rm);return lf("svg",re({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:im},n))},lm=function(e){return lf(am,re({size:20},e),lf("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"}))},sm=function(e){return lf(am,re({size:20},e),lf("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"}))},cm=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return Od({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},um=cm,dm=cm,pm=function(){var e=sf.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_"}}}(Yh||(Yh=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"]))),fm=function(e){var t=e.delay,n=e.offset;return lf("span",{css:sf({animation:"".concat(pm," 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"},"","")})},hm=["data"],mm=["innerRef","isDisabled","isHidden","inputClassName"],gm={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vm={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Od({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},gm)},ym=function(e){return Od({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},gm)},bm=function(e){var t=e.children,n=e.innerProps;return lf("div",n,t)},wm={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return lf("div",re({},Nh(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||lf(lm,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return lf("div",re({ref:o},Nh(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 lf("div",re({},Nh(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||lf(sm,null))},DownChevron:sm,CrossIcon:lm,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 lf("div",re({},Nh(e,"group",{group:!0}),l),lf(i,re({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),lf("div",null,t))},GroupHeading:function(e){var t=Mh(e);t.data;var n=Wn(t,hm);return lf("div",re({},Nh(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return lf("div",re({},Nh(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return lf("span",re({},t,Nh(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=Mh(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=Wn(r,mm);return lf("div",re({},Nh(e,"input",{"input-container":!0}),{"data-value":n||""}),lf("input",re({className:t({input:!0},l),ref:o,style:ym(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,om);return lf("div",re({},Nh(Od(Od({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),lf(fm,{delay:0,offset:n}),lf(fm,{delay:160,offset:!0}),lf(fm,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return lf("div",re({},Nh(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 lf("div",re({},Nh(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)(Kh(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]);Dh(function(){g()},[g]);var v=(0,pe.useCallback)(function(){"function"==typeof s.current&&(s.current(),s.current=null),r&&l.current&&(s.current=Oh(r,l.current,g,{elementResize:"ResizeObserver"in window}))},[r,g]);Dh(function(){v()},[v]);var y=(0,pe.useCallback)(function(e){l.current=e,v()},[v]);if(!t&&"fixed"!==a||!h)return null;var b=lf("div",re({ref:y},Nh(Od(Od({},e),{},{offset:h.offset,position:a,rect:h.rect}),"menuPortal",{"menu-portal":!0}),o),n);return lf(Zh.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,Xh);return lf("div",re({},Nh(Od(Od({},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,Qh);return lf("div",re({},Nh(Od(Od({},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 lf(s,{data:r,innerProps:Od(Od({},Nh(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},lf(c,{data:r,innerProps:Od({},Nh(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),lf(u,{data:r,innerProps:Od(Od({},Nh(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},MultiValueContainer:bm,MultiValueLabel:bm,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return lf("div",re({role:"button"},n),t||lf(lm,{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 lf("div",re({},Nh(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 lf("div",re({},Nh(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return lf("div",re({},Nh(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return lf("div",re({},Nh(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 lf("div",re({},Nh(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},Em=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function km(e,t){return e===t||!(!Em(e)||!Em(t))}function Om(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!km(e[n],t[n]))return!1;return!0}for(var Sm={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"},xm=function(e){return lf("span",re({css:Sm},e))},_m={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:"",".")}},Cm=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 Od(Od({},_m),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=Od({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=lf(pe.Fragment,null,lf("span",{id:"aria-selection"},S),lf("span",{id:"aria-focused"},x),lf("span",{id:"aria-results"},_),lf("span",{id:"aria-guidance"},D));return lf(pe.Fragment,null,lf(xm,{id:s},C&&P),lf(xm,{"aria-live":k,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!C&&P))},Dm=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Pm=new RegExp("["+Dm.map(function(e){return e.letters}).join("")+"]","g"),Am={},Tm=0;Tm<Dm.length;Tm++)for(var jm=Dm[Tm],Fm=0;Fm<jm.letters.length;Fm++)Am[jm.letters[Fm]]=jm.base;var Mm=function(e){return e.replace(Pm,function(e){return Am[e]})},Nm=function(e,t){void 0===t&&(t=Om);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}(Mm),Im=function(e){return e.replace(/^\s+|\s+$/g,"")},Rm=function(e){return"".concat(e.label," ").concat(e.value)},Lm=["innerRef"];function Bm(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,Lm),"onExited","in","enter","exit","appear");return lf("input",re({ref:t},n,{css:sf({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 zm=["boxSizing","height","overflow","paddingRight","position"],Wm={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Um(e){e.cancelable&&e.preventDefault()}function Vm(e){e.stopPropagation()}function Hm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Gm(){return"ontouchstart"in window||navigator.maxTouchPoints}var qm=!("undefined"==typeof window||!window.document||!window.document.createElement),$m=0,Qm={capture:!1,passive:!1},Xm=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Ym={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Km(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=!!Gh&&{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(qm){var t=document.body,n=t&&t.style;if(r&&zm.forEach(function(e){var t=n&&n[e];o.current[e]=t}),r&&$m<1){var i=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,l=window.innerWidth-a+i||0;Object.keys(Wm).forEach(function(e){var t=Wm[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(l,"px"))}t&&Gm()&&(t.addEventListener("touchmove",Um,Qm),e&&(e.addEventListener("touchstart",Hm,Qm),e.addEventListener("touchmove",Vm,Qm))),$m+=1}},[r]),l=(0,pe.useCallback)(function(e){if(qm){var t=document.body,n=t&&t.style;$m=Math.max($m-1,0),r&&$m<1&&zm.forEach(function(e){var t=o.current[e];n&&(n[e]=t)}),t&&Gm()&&(t.removeEventListener("touchmove",Um,Qm),e&&(e.removeEventListener("touchstart",Hm,Qm),e.removeEventListener("touchmove",Vm,Qm)))}},[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 lf(pe.Fragment,null,n&&lf("div",{onClick:Xm,css:Ym}),t(function(e){o(e),i(e)}))}var Zm={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Jm=function(e){var t=e.name,n=e.onFocus;return lf("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Zm,value:"",onChange:function(){}})};function eg(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 tg(){return eg(/^Mac/i)}var ng=function(e){return e.label},rg=function(e){return e.value},og={clearIndicator:dm,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 Od({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:um,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 Od({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 Od({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 Od(Od({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},vm),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 Od({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:nm,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Od((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 Od({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 Od({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 Od({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 Od({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:tm,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Od({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 Od({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 Od({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 Od({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")})}},ig={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}},ag={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Wh(),captureMenuScroll:!Wh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=Od({ignoreCase:!0,ignoreAccents:!0,stringify:Rm,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,l=n.matchFrom,s=a?Im(t):t,c=a?Im(i(e)):i(e);return r&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=Nm(s),c=Mm(c)),"start"===l?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:ng,getOptionValue:rg,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 lg(e,t,n,r){return{type:"option",data:t,isDisabled:mg(e,t,n),isSelected:gg(e,t,n),label:fg(e,t),value:hg(e,t),index:r}}function sg(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(n,r){return lg(e,n,t,r)}).filter(function(t){return dg(e,t)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=lg(e,n,t,r);return dg(e,i)?i:void 0}).filter(qh)}function cg(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,Il(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function ug(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,Il(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 dg(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!yg(e)||!i)&&vg(e,{label:a,value:l,data:o},r)}var pg=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},fg=function(e,t){return e.getOptionLabel(t)},hg=function(e,t){return e.getOptionValue(t)};function mg(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function gg(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=hg(e,t);return n.some(function(t){return hg(e,t)===r})}function vg(e,t,n){return!e.filterOption||e.filterOption(t,n)}var yg=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},bg=1,wg=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&&Pd(e,t)}(n,e);var t=function(e){var t=Td();return function(){var n,r=Ad(e);if(t){var o=Ad(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 jd(e)}(this,n)}}(n);function n(e){var r;if(_d(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(Il(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=$h(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($h(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=$h(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return pg(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return ug(sg(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 jh.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return fg(r.props,e)},r.getOptionValue=function(e){return hg(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=og[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,Od(Od({},wm),e.components);var e},r.buildCategorizedOptions=function(){return sg(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return cg(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:Od({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&&Ih(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 yg(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||++bg),r.state.selectValue=Fh(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=pg(o,i[a])}return r}return Dd(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&&zh(this.menuListRef,this.focusedOptionRef),(tg()||eg(/^iPhone/i)||eg(/^iPad/i)||tg()&&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&&(zh(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(ig):Od(Od({},ig),this.props.theme):ig}},{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 mg(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return gg(this.props,e,t)}},{key:"filterOption",value:function(e,t){return vg(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=Od(Od(Od({"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(Bm,re({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ah,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 j={minMenuHeight:v,maxMenuHeight:y,menuPlacement:w,menuPosition:E,menuShouldScrollIntoView:S},F=pe.createElement(Jh,re({},u,j),function(t){var n=t.ref,r=t.placerProps,a=r.placement,l=r.maxHeight;return pe.createElement(o,re({},u,j,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:m,placement:a}),pe.createElement(Km,{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}),F):F}},{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(Jm,{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(Cm,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=Fh(u),m={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return cg(sg(e,t))}(e,h):[],v=d?ug(sg(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:pg(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:$h(f,h,h[0]||null),options:h,action:"initial-input-focus"},k=!l),"initial-input-focus"===(null==i?void 0:i.action)&&(E=null),Od(Od(Od({},m),w),{},{prevProps:e,ariaSelection:E,prevWasFocused:k})}}]),n}(pe.Component);wg.defaultProps=ag;var Eg=(0,pe.forwardRef)(function(e,t){var n=xd(e);return pe.createElement(wg,re({ref:t},n))}),kg=Eg,Og=["action","dispatch","workspaces","sharedWorkspaces","workspacesLoading","sharedWorkspacesLoading"],Sg=["value"];const xg=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,Og),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(Qv({list_only:!0})),0==o.length&&n(Qv({list_only:!0,shared:!0}))},[]),(0,pe.useEffect)(function(){var e=[];r.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:Va(r)}),o.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Va(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,Sg);xl.showLoading(),"copy"===t?n(jv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})):"move"===t&&n(Mv({my_cloud_id:r,workspace_id:o,action:t,fileContents:l,details:i})),u(!1)}},[c]),he().createElement(il,{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(al,{className:"align-center"},he().createElement(ll,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Item Name","templately"),":")),he().createElement(ll,{column:8,wrapper:!0,wrapperClass:"cloud-item-name"},he().createElement("p",null,he().createElement("strong",null,l.name)))),he().createElement(al,null,he().createElement(ll,{className:"text-right",column:4},he().createElement("p",null,"copy"===t?(0,At.__)("Copy to","templately"):(0,At.__)("Move to","templately"),":")),he().createElement(ll,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(kg,{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(al,{className:"flex-end"},he().createElement(ll,null,he().createElement(fl,{className:"templately-copy-move-btn",disabled:p,onClick:function(){return u(!0)},label:"copy"===t?(0,At.__)("Copy","templately"):(0,At.__)("Move","templately")}))))}),_g=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 xl.close({isDismissed:!0})},className:"templately-button tb-cancel"},(0,At.__)("Cancel","templately")),he().createElement("button",{onClick:function(){xl.showLoading(),e.dispatch(Iv({id:t,source:n,slug:r}))},className:"templately-button tb-delete"},(0,At.__)("Delete","templately"))))};function Cg(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 Dg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cg(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Pg=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(Vv(Dg(Dg({},t),{},{context:"modal"})))},addFiles:function(t){return e(uy(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?Va(e.workspaces,!1,"slug",[],[e.slug]):"shared_workspaces"===E.value&&(null===(n=e.sharedWorkspaces)||void 0===n?void 0:n.length)>0?Va(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(Va(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}),xl.showLoading(),o(!1))},[r]),he().createElement(il,{className:"add-file-to-workspace",headerClass:"text-center",header:(0,At.__)("Add Template to WorkSpace","templately")},he().createElement(al,{className:"align-center"},he().createElement(ll,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Source","templately"),":")),he().createElement(ll,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(kg,{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(al,{className:"align-center"},he().createElement(ll,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Workspace","templately"),":")),he().createElement(ll,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(kg,{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(al,{className:"align-center"},he().createElement(ll,{className:"text-right",column:4},he().createElement("p",null,(0,At.__)("Select Templates","templately"),":")),he().createElement(ll,{column:8,wrapper:!0,wrapperClass:"tm-workspaces-list"},he().createElement(kg,{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(al,{className:"flex-end"},he().createElement(ll,null,he().createElement(fl,{className:"templately-add-templates",disabled:a,onClick:function(){return o(!0)},label:(0,At.__)("Add to WorkSpace","templately")}))))});function Ag(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 Tg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ag(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ag(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const jg=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 Tg(Tg({},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),j=T[0],F=T[1],M=ce((0,pe.useState)([]),2),N=M[0],I=M[1],R=ce((0,pe.useState)([]),2),L=R[0],B=R[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})}})))}),I(r),m(e)),n&&n.length>0){var o=JSON.parse(n),i=[],a=[];o.map(function(e){za(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),I([].concat(r,a)),m([].concat(e,i))}},[]),(0,pe.useEffect)(function(){if(w){var e=Il(L),t=P.toLowerCase();za(t)&&(e.includes(t)||(e.push(t),B(e)),A("")),E(!1)}},[w]),(0,pe.useEffect)(function(){if(!1!==j){var e=Il(L).filter(function(e){return j!=e});B(e),F(!1)}},[j]),(0,pe.useEffect)(function(){if(!1!==O||!1!==_){var e=Il(N),t=Il(V);if(0!=O&&(O.currentTarget.classList.add("removed"),t.push(O.email),e=e.filter(function(e){return O.email!=e}),I(e),H(t),S(!1)),0!=_){_.currentTarget.classList.remove("removed"),e.push(_.email);var n=t.filter(function(e){return _.email!=e});I(e),H(n),C(!1)}}},[O,_]),(0,pe.useEffect)(function(){var e=[];L.length>0&&L.map(function(t,n){return e.push(he().createElement("li",{key:n},t,he().createElement("span",{onClick:function(){return F(t)}})))}),y(e)},[L]),(0,pe.useEffect)(function(){L.length>0||V.length>0?c(!1):c(!0)},[N,L,V]),(0,pe.useEffect)(function(){if(d){var t=L,n=Il(V);xl.showLoading();var o=e.slug,a=e.id;r(ny({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(ml,{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(ml,{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(fl,{disabled:0===P.length||!za(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(fl,{disabled:s,onClick:function(){return p(!0)},label:(0,At.__)("Save Changes","templately")})))))});var Fg=function(e,t){var n=e.ModalComponent,r=e.content,o=t.dispatch,i=t.general;o(Wv({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:""}};_l({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return Cl(a,e)},html:React.createElement(n,null)},!0)},Mg=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))}}};_l({showCloseButton:!1,allowOutsideClick:!0,onConfirm:function(e){return Cl(o,e)},html:React.createElement(n,re({},r,{action:t}))},!0)},Ng=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."}};_l({showCloseButton:!0,onConfirm:function(e){return Cl(a,e)},html:React.createElement(n,re({},r,{source:o,dispatch:i}))},!0)},Ig=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:vd,ModalComponent:ad},{className:"tw-download",name:(0,At.__)("Download","templately"),icon:"",action:Fg,ModalComponent:kl},{name:(0,At.__)("Copy to WorkSpace","templately"),icon:React.createElement(Pn,null),action:function(e,t){return Mg(e,"copy")},ModalComponent:xg},{name:(0,At.__)("Move to WorkSpace","templately"),icon:React.createElement(Mn,null),disabled:e,action:function(e,t){return Mg(e,"move")},ModalComponent:xg},{name:(0,At.__)("Delete","templately"),icon:React.createElement(An,null),disabled:e,action:Ng,ModalComponent:_g}]},Rg=function(e,t){var n;(0,t.dispatch)(yy({id:null==e||null===(n=e.content)||void 0===n?void 0:n.id}))},Lg=function(e,t){var n,r,o=e.ModalComponent,i=e.content;(0,t.dispatch)(Rv({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"))}}};_l({showCloseButton:!1,allowOutsideClick:!1,onConfirm:function(e){return Cl(a,e)},html:React.createElement(o,i)},!0)},Bg=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:vd,ModalComponent:ad,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:Lg,ModalComponent:kl,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:Rg,error:r}]},zg=function(e){var t={requirement:e},n=(0,vi.addQueryArgs)("/templately/v1/dependencies/install",{disable_redirect:!0});return ma(n,t,{},!0)},Wg=function(e){return ma("/templately/v1/dependencies/check",e,{},!0)},Ug=function(e){return!e||!!e.startsWith("clouds/")||["favourites","downloads","clouds","clouds/shared-workspace","clouds/workspace","clouds/save-template","purchased-items"].includes(e)},Vg=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||(_l({icon:!1,showCloseButton:!0,allowOutsideClick:!0,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(Zu,{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://templately.com?support=open")}))},!0),0))};function Hg(){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 Gg(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]())):(Gg(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,Gg(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Gg(d,"constructor",c),Gg(c,"constructor",s),s.displayName="GeneratorFunction",Gg(c,o,"GeneratorFunction"),Gg(d),Gg(d,o,"Generator"),Gg(d,r,function(){return this}),Gg(d,"toString",function(){return"[object Generator]"}),(Hg=function(){return{w:i,m:p}})()}function Gg(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Gg=function(e,t,n,r){function i(t,n){Gg(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))},Gg(e,t,n,r)}function qg(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 $g=function(e,t){var n="elementor"===t,r=e[n?"system_colors":"global_colors"]||[],o=e.custom_colors||[],i={},a=[];return[].concat(Il(r),Il(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}},Qg=function(e,t){return(0,pe.useMemo)(function(){return $g(e,t)},[e,t])},Xg=function(e,t){var n="elementor"===t,r="gutenberg"===t,o=(0,ka.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}},Yg=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?qg(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qg(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,ka.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=Ba(a,h,g)}a._isSystem=l.some(function(e){return e._id===s._id}),t[a._id]=a}),t}([].concat(Il(e),Il(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,ka.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=Ba(s,g,v)}t[a]=s}return t}}},Kg=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://templately.com?support=open");return _l({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 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}function Jg(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}var ev=function(e){return{type:ur,platform:e}},tv=function(e){return Jg({type:xr},e)},nv=function(e){return Jg({type:_r},e)},rv=function(){return tv({key:"doQuery",data:Date.now()})},ov=function(e){return Jg({type:Dr},e)},iv=function(e){return Jg({type:Ar},e)},av=function(e){return Jg({type:jr},e)},lv=function(e){return{type:Fr,data:e}},sv=function(e){return{type:Mr,error:e}},cv=function(e){return Jg({type:Ir},e)},uv=function(e){return Jg({type:Rr},e)},dv=function(e){return Jg({type:Sr},e)},pv=function(e){return Jg({type:Lr},e)},fv=function(e){return Jg({type:zr},e)},hv=function(e,t){return{type:Wr,id:e,data:t}};function mv(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 gv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mv(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var vv=function(e){return gv({type:Ra(Oo,e.key)},e)},yv=function(e){return gv({type:Ra(So,e.key)},e)},bv=function(e){return gv({type:_o},e)},wv=function(e){return gv({type:Co},e)},Ev=function(e){return gv({type:Po},e)},kv=function(e){return gv({type:Ao},e)},Ov=function(e){return gv({type:jo},e)},Sv=function(e){return gv({type:Fo},e)};function xv(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 _v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xv(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Cv=function(e){return _v({type:Bo.LOAD},e)},Dv=function(e){return _v({type:Bo.LOAD_SUCCESS},e)},Pv=function(e){return _v({type:Bo.LOAD_FAILED},e)},Av=function(e){return _v({type:Bo.STATUS_SUCCESS},e)},Tv=function(e){return _v({type:Bo.STATUS_FAILED},e)},jv=function(e){return _v({type:Bo.COPY},e)},Fv=function(e){return _v({type:Bo.COPY_SUCCESS},e)},Mv=function(e){return _v({type:Bo.MOVE},e)},Nv=function(e){return _v({type:Bo.MOVE_SUCCESS},e)},Iv=function(e){return _v({type:Bo.DELETE},e)},Rv=function(e){return _v({type:Bo.PUSH},e)},Lv=function(e){return _v({type:Bo.CLEAR_PUSH2CLOUD},e)},Bv=function(e){return _v({type:Bo.PUSH_SUCCESS},e)},zv=function(e){return _v({type:Bo.PUSH_FAILED},e)},Wv=function(e){return _v({type:Bo.DOWNLOAD},e)},Uv=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}},Vv=function(e){return _v({type:Uv(null==e?void 0:e.source).SEARCH},e)},Hv=function(e){return _v({type:Uv(null==e?void 0:e.source).SEARCH_SUCCESS},e)};function Gv(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 qv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gv(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var $v=function(e){var t;return qv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD:zo.LOAD},e)},Qv=function(e){var t;return qv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_LISTS:zo.LOAD_LISTS},e)},Xv=function(e){var t;return qv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.SET_LISTS:zo.SET_LISTS},e)},Yv=function(e){var t;return qv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_SUCCESS:zo.LOAD_SUCCESS},e)},Kv=function(e){var t;return qv({type:null!==(t=null==e?void 0:e.shared)&&void 0!==t&&t?Wo.LOAD_FAILED:zo.LOAD_FAILED},e)},Zv=function(e){return qv({type:zo.CREATE},e)},Jv=function(e){return qv({type:zo.CREATE_SUCCESS},e)},ey=function(e){return qv({type:zo.DELETE},e)},ty=function(e){return qv({type:zo.DELETE_SUCCESS},e)},ny=function(e){return qv({type:zo.SAVE},e)},ry=function(e){return qv({type:Uo.SET},e)},oy=function(e){return qv({type:Uo.LOAD},e)},iy=function(e){return qv({type:Uo.LOAD_SUCCESS},e)},ay=function(e){return qv({type:Uo.DELETE},e)},ly=function(e){return qv({type:Uo.GET_FILES},e)},sy=function(e){return qv({type:Uo.SET_FILES},e)},cy=function(e){return qv({type:Uo.LOAD_FAILED},e)},uy=function(e){return qv({type:Uo.ADD_FILE},e)},dy=a(4765);function py(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 fy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?py(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var hy=function(e){return fy({type:Mo},e)},my=function(e){return fy({type:No},e)},gy=function(e){return fy({type:Io},e)},vy=function(e){return fy({type:"SAVED_TEMPLATES_LOAD_FAILED"},e)},yy=function(e){return fy({type:Lo},e)};function by(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 wy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?by(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):by(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ey=function(e){return wy({type:Yo},e)},ky=function(e){return{type:Vo,step:e}},Oy=function(e){return{type:Ho,step:e}},Sy=function(e){return{type:Go,payload:e}},xy=function(e){return{type:Xo,payload:e}},_y=function(e){return{type:Ko,payload:e}},Cy=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:Zo,payload:wy({id:null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,show:!0},t)}},Dy=function(){return{type:ni,payload:wy({show:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},Py=function(){return{type:ri,payload:{show:!1,aiTemplates:null}}},Ay=function(e){return{type:oi,payload:{packId:e,isAi:arguments.length>1&&void 0!==arguments[1]&&arguments[1]}}},Ty=function(e){return{type:ii,payload:e}},jy=function(e){return{type:ai,payload:e}},Fy=function(e){return{type:si,payload:e}},My=function(e){return{type:ci,payload:e}},Ny=function(){return{type:ui}},Iy=function(e){return{type:pi.SET_PLATFORM,platform:e}},Ry=(0,pe.createContext)();Ry.displayName="Anonymous";var Ly,By=Ry.Provider;Ry.Consumer,function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(Ly||(Ly={}));var zy="beforeunload";function Wy(e){e.preventDefault(),e.returnValue=""}function Uy(){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 Vy,Hy=a(5373);function Gy(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 qy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gy(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $y(){if(!Vy){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=Ly.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=Ly.Pop,l=o(),s=l[0],c=l[1],u=Uy(),d=Uy();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=Ly.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=Ly.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(zy,Wy),function(){t(),d.length||n.removeEventListener(zy,Wy)}}}}({basename:e.substring(0,e.lastIndexOf("/"))});Vy={get length(){return t.length},get action(){return t.action},get location(){var n=t.location,r=(0,Hy.parse)(n.search.substring(1)).path||"/";return r.startsWith("/")||(r="/"+r),qy(qy({},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 Vy}var Qy=$y();function Xy(){var e=$y().location.search;return e.length&&(0,Hy.parse)(e.substring(1))||{}}var Yy=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=Xy(),l=qy(qy({},a),i);return o.push("templately_open_modal","templately_google_login","templately_error","error_message"),null!=r&&(l=qy(qy({},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=Ua(l,o)),(0,vi.addQueryArgs)($y().location.actualPathname,l)},Ky=function(e){return"@@redux-saga/"+e},Zy=Ky("CANCEL_PROMISE"),Jy=Ky("CHANNEL_END"),eb=Ky("IO"),tb=Ky("MATCH"),nb=Ky("MULTICAST"),rb=Ky("SAGA_ACTION"),ob=Ky("SELF_CANCELLATION"),ib=Ky("TASK"),ab=Ky("TASK_CANCEL"),lb=Ky("TERMINATE"),sb=Ky("LOCATION"),cb=function(e){return null==e},ub=function(e){return null!=e},db=function(e){return"function"==typeof e},pb=function(e){return"string"==typeof e},fb=Array.isArray,hb=function(e){return e&&db(e.then)},mb=function(e){return e&&db(e.next)&&db(e.throw)},gb=function(e){return e&&(pb(e)||bb(e)||db(e)||fb(e)&&e.every(gb))},vb=function(e){return e&&db(e.take)&&db(e.close)},yb=function(e){return db(e)&&e.hasOwnProperty("toString")},bb=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype},wb=function(){return function(){return true}}(),Eb=function(){},kb=function(e){return e},Ob=function(e,t){re(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(function(n){e[n]=t[n]})};function Sb(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var xb=function(e){throw e},_b=function(e){return{value:e,done:!0}};function Cb(e,t,n){void 0===t&&(t=xb),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:_b,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Db(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var Pb=function(e){return Array.apply(null,new Array(e))},Ab=function(e){return function(t){return e(Object.defineProperty(t,rb,{value:!0}))}},Tb=function(e){return e===lb},jb=function(e){return e===ab},Fb=function(e){return Tb(e)||jb(e)};function Mb(e,t){var n,r=Object.keys(e),o=r.length,i=0,a=fb(e)?Pb(o):{},l={};return r.forEach(function(e){var r=function(r,l){n||(l||Fb(r)?(t.cancel(),t(r,l)):(a[e]=r,++i===o&&(n=!0,t(a))))};r.cancel=Eb,l[e]=r}),t.cancel=function(){n||(n=!0,r.forEach(function(e){return l[e].cancel()}))},l}function Nb(e){return{name:e.name||"anonymous",location:Ib(e)}}function Ib(e){return e[sb]}function Rb(){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 Lb=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)},Bb="TAKE",zb="CALL",Wb="FORK",Ub="CANCEL",Vb="SELECT",Hb=function(e,t){var n;return(n={})[eb]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function Gb(e,t){return void 0===e&&(e="*"),gb(e)?(ub(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),Hb(Bb,{pattern:e})):vb(n=e)&&n[nb]&&ub(t)&&gb(t)?Hb(Bb,{channel:e,pattern:t}):vb(e)?(ub(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),Hb(Bb,{channel:e})):void 0;var n}function qb(e,t){return cb(t)&&(t=e,e=void 0),Hb("PUT",{channel:e,action:t})}function $b(e){var t=Hb("ALL",e);return t.combinator=!0,t}function Qb(e,t){var n,r=null;return db(e)?n=e:(fb(e)?(r=e[0],n=e[1]):(r=e.context,n=e.fn),r&&pb(n)&&db(r[n])&&(n=r[n])),{context:r,fn:n,args:t}}function Xb(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 Hb(zb,Qb(e,n))}function Yb(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 Hb(Wb,Qb(e,n))}function Kb(e){void 0===e&&(e=kb);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Hb(Vb,{selector:e,args:n})}var Zb=[],Jb=0;function ew(e){try{rw(),e()}finally{ow()}}function tw(e){Zb.push(e),Jb||(rw(),iw())}function nw(e){try{return rw(),e()}finally{iw()}}function rw(){Jb++}function ow(){Jb--}function iw(){var e;for(ow();!Jb&&void 0!==(e=Zb.shift());)ew(e)}var aw=function(e){return function(t){return e.some(function(e){return dw(e)(t)})}},lw=function(e){return function(t){return e(t)}},sw=function(e){return function(t){return t.type===String(e)}},cw=function(e){return function(t){return t.type===e}},uw=function(){return wb};function dw(e){var t="*"===e?uw:pb(e)?sw:fb(e)?aw:yb(e)?sw:db(e)?lw:bb(e)?cw:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var pw={type:Jy},fw=function(e){return e&&e.type===Jy};function hw(){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(pw)})},(e={})[nb]=!0,e.put=function(e){if(!t)if(fw(e))i();else for(var o=n=r,a=0,l=o.length;a<l;a++){var s=o[a];s[tb](e)&&(s.cancel(),s(e))}},e.take=function(e,n){var i,a;void 0===n&&(n=uw),t?e(pw):(e[tb]=n,o(),r.push(e),e.cancel=(i=function(){o(),Sb(r,e)},a=!1,function(){a||(a=!0,i())}))},e.close=i,e),l=a.put;return a.put=function(e){e[rb]?l(e):tw(function(){l(e)})},a}function mw(e,t){var n=e[Zy];db(n)&&(t.cancel=n),e.then(t,function(e){t(e,!0)})}var gw,vw=0,yw=function(){return++vw};function bw(e){e.isRunning()&&e.cancel()}var ww=((gw={})[Bb]=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):!fw(e)||a?n(e):n(lb)};try{o.take(l,ub(i)?dw(i):null)}catch(e){return void n(e,!0)}n.cancel=l.cancel},gw.PUT=function(e,t,n){var r=t.channel,o=t.action,i=t.resolve;tw(function(){var t;try{t=(r?r.put:e.dispatch)(o)}catch(e){return void n(e,!0)}i&&hb(t)?mw(t,n):n(t)})},gw.ALL=function(e,t,n,r){var o=r.digestEffect,i=vw,a=Object.keys(t);if(0!==a.length){var l=Mb(t,n);a.forEach(function(e){o(t[e],i,l[e],e)})}else n(fb(t)?[]:{})},gw.RACE=function(e,t,n,r){var o=r.digestEffect,i=vw,a=Object.keys(t),l=fb(t)?Pb(a.length):{},s={},c=!1;a.forEach(function(e){var t=function(t,r){c||(r||Fb(t)?(n.cancel(),n(t,r)):(n.cancel(),c=!0,l[e]=t,n(l)))};t.cancel=Eb,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)})},gw[zb]=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(hb(s))return void mw(s,n);if(mb(s))return void Tw(e,s,l.context,vw,Nb(i),!1,n);n(s)}catch(e){n(e,!0)}},gw.CPS=function(e,t,n){var r=t.context,o=t.fn,i=t.args;try{var a=function(e,t){cb(e)?n(t):n(e,!0)};o.apply(r,i.concat(a)),a.cancel&&(n.cancel=a.cancel)}catch(e){n(e,!0)}},gw[Wb]=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(mb(o))return o;var i=!1;return Cb(function(e){return i?{value:e,done:!0}:(i=!0,{value:o,done:!hb(o)})})}catch(e){return Cb(function(){throw e})}}({context:o,fn:i,args:a}),u=function(e,t){return e.isSagaIterator?{name:e.meta.name}:Nb(t)}(c,i);nw(function(){var t=Tw(e,c,s.context,vw,u,l,void 0);l?n(t):t.isRunning()?(s.queue.addTask(t),n(t)):t.isAborted()?s.queue.abort(t.error()):n(t)})},gw.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()&&Sb(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(fb(t)){if(0===t.length)return void n([]);var a=Mb(t,n);t.forEach(function(e,t){i(e,a[t])})}else i(t,n)},gw[Ub]=function(e,t,n,r){var o=r.task;t===ob?bw(o):fb(t)?t.forEach(bw):bw(t),n()},gw[Vb]=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)}},gw.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,o=function(e){void 0===e&&(e=Lb());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(pw):e.isEmpty()?(n.push(r),r.cancel=function(){Sb(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(pw):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])(pw)}}}}(t.buffer),i=dw(r),a=function(t){fw(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)},gw.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},gw.FLUSH=function(e,t,n){t.flush(n)},gw.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},gw.SET_CONTEXT=function(e,t,n,r){var o=r.task;Ob(o.context,t),n()},gw);function Ew(e,t){return e+"?"+t}function kw(e){var t=e.name,n=e.location;return n?t+" "+Ew(n.fileName,n.lineNumber):t}function Ow(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 Sw=null,xw=[],_w=function(e){e.crashedEffect=Sw,xw.push(e)},Cw=function(){Sw=null,xw.length=0},Dw=function(e){Sw=e},Pw=function(){var e=xw[0],t=xw.slice(1),n=e.crashedEffect?function(e){var t=Ib(e);return t?t.code+" "+Ew(t.fileName,t.lineNumber):""}(e.crashedEffect):null;return["The above error occurred in task "+kw(e.meta)+(n?" \n when executing effect "+n:"")].concat(t.map(function(e){return" created by "+kw(e.meta)}),[Ow(xw)]).join("\n")};function Aw(e,t,n,r,o,i,a){var l;void 0===a&&(a=Eb);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||(Sb(o,t),t.cont=Eb,s?a(l):(t===e&&(r=l),o.length||(i=!0,n(r))))}}function s(){i||(i=!0,o.forEach(function(e){e.cont=Eb,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,_w({meta:o,cancelledTasks:p}),g.isRoot){var r=Pw();Cw(),e.onError(t,{sagaStack:r})}c=t,d&&d.reject(t)}else t===ab?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={})[ib]=!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(ab,!1))},l.cont=a,l.end=m,l.setContext=function(e){Ob(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 Tw(e,t,n,r,o,i,a){var l=e.finalizeRunEffect(function(t,n,r){hb(t)?mw(t,r):mb(t)?Tw(e,t,c.context,n,o,!1,r):t&&t[eb]?(0,ww[t.type])(e,t.payload,r,u):r(t)});d.cancel=Eb;var s={meta:o,cancel:function(){0===s.status&&(s.status=1,d(ab))},status:0},c=Aw(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),Cw()):jb(e)?(s.status=1,d.cancel(),o=db(t.return)?t.return(ab):{done:!0,value:ab}):o=Tb(e)?db(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=yw();function s(n,o){i||(i=!0,r.cancel=Eb,e.sagaMonitor&&(o?e.sagaMonitor.effectRejected(a,n):e.sagaMonitor.effectResolved(a,n)),o&&Dw(t),r(n,o))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:a,parentEffectId:n,label:o,effect:t}),s.cancel=Eb,r.cancel=function(){i||(i=!0,s.cancel(),s.cancel=Eb,e.sagaMonitor&&e.sagaMonitor.effectCancelled(a))},l(t,a,s)}}function jw(e,t){for(var n=e.channel,r=void 0===n?hw():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?Db: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=yw();if(s&&(s.rootSagaStarted=s.rootSagaStarted||Eb,s.effectTriggered=s.effectTriggered||Eb,s.effectResolved=s.effectResolved||Eb,s.effectRejected=s.effectRejected||Eb,s.effectCancelled=s.effectCancelled||Eb,s.actionDispatched=s.actionDispatched||Eb,s.rootSagaStarted({effectId:v,saga:t,args:f})),c){var y=Rb.apply(void 0,c);m=function(e){return function(t,n,r){return y(function(t){return e(t,n,r)})(t)}}}else m=kb;var b={channel:r,dispatch:Ab(o),getState:i,sagaMonitor:s,onError:d,finalizeRunEffect:m};return nw(function(){var e=Tw(b,g,l,v,Nb(t),!0,void 0);return s&&s.effectResolved(v,e),e})}var Fw=["context","channel","sagaMonitor"];var Mw,Nw=({dispatch:e,getState:t})=>n=>r=>"function"==typeof r?r(e,t,Mw):n(r),Iw=function(e){return{done:!0,value:e}},Rw={};function Lw(e){return vb(e)?"channel":yb(e)?String(e):db(e)?e.name:String(e)}function Bw(e,t,n){var r,o,i,a=t;function l(t,n){if(a===Rw)return Iw(t);if(n&&!o)throw a=Rw,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===Rw?Iw(t):i}return Cb(l,function(e){return l(null,e)},n)}function zw(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:Gb(e)},l=function(e){return i=e};return Bw({q1:function(){return{nextState:"q2",effect:a,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:(e=i,{done:!1,value:Yb.apply(void 0,[t].concat(r,[e]))})};var e}},"q1","takeEvery("+Lw(e)+", "+t.name+")")}function Ww(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:Gb(e)},s=function(e){return{done:!1,value:Yb.apply(void 0,[t].concat(r,[e]))}},c=function(e){return{done:!1,value:(t=e,void 0===t&&(t=ob),Hb(Ub,t))};var t},u=function(e){return i=e},d=function(e){return a=e};return Bw({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("+Lw(e)+", "+t.name+")")}function Uw(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 Yb.apply(void 0,[zw,e,t].concat(r))}function Vw(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 Yb.apply(void 0,[Ww,e,t].concat(r))}var Hw=["type"],Gw=qw().m(Xw);function qw(){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 $w(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]())):($w(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,$w(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,$w(d,"constructor",c),$w(c,"constructor",s),s.displayName="GeneratorFunction",$w(c,o,"GeneratorFunction"),$w(d),$w(d,o,"Generator"),$w(d,r,function(){return this}),$w(d,"toString",function(){return"[object Generator]"}),(qw=function(){return{w:i,m:p}})()}function $w(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$w=function(e,t,n,r){function i(t,n){$w(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))},$w(e,t,n,r)}function Qw(e){return e.type,Wn(e,Hw),qw().m(function e(){var t,n,r;return qw().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/dependencies");case 1:if(t=e.v,n=t.response,t.error,!n){e.n=2;break}return e.n=2,qb(ov({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 Xw(){return qw().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Cr,Qw);case 1:return e.a(2)}},Gw)}var Yw=["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,Yw),Zw().m(function e(){var t,n;return Zw().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/tags");case 1:if(t=e.v,n=t.response,t.error,!n){e.n=2;break}return e.n=2,qb(iv({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 tE(){return Zw().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Pr,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){e.type;var t=Wn(e,nE);return oE().m(function e(){var n,r,o,i,a,l,s,c,u,d,p,f,h,m,g;return oE().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=Xy(),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,Kb(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,Kb(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=Yy(a.path,a,i),(m=$y().location).actualPathname+m.search!==h&&$y().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 lE(){return oE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(xr,aE);case 1:return e.a(2)}},rE)}var sE=["type"],cE=["type"],uE=dE().m(mE);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 fE(e){e.type;var t=Wn(e,sE);return dE().m(function e(){var n,r;return dE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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,ha("/templately/v1/templateTypes",t);case 3:if(n=e.v,r=n.response,n.error,!r){e.n=4;break}return e.n=4,qb(av({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 hE(e){return e.type,Wn(e,cE),dE().m(function e(){var t,n,r,o;return dE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,ha("/templately/v1/pricing");case 1:if(t=e.v,n=t.response,r=t.error,!n){e.n=3;break}return e.n=2,qb(lv(n));case 2:case 4:return e.a(2);case 3:if(!r){e.n=4;break}return e.n=4,qb(sv({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 mE(){return dE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(ur,hE);case 1:return e.n=2,Vw(Tr,fE);case 2:return e.a(2)}},uE)}var gE=["type"],vE=["type"],yE=["type"],bE=["type"],wE=["type"],EE=kE().m(TE);function kE(){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 OE(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]())):(OE(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,OE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,OE(d,"constructor",c),OE(c,"constructor",s),s.displayName="GeneratorFunction",OE(c,o,"GeneratorFunction"),OE(d),OE(d,o,"Generator"),OE(d,r,function(){return this}),OE(d,"toString",function(){return"[object Generator]"}),(kE=function(){return{w:i,m:p}})()}function OE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}OE=function(e,t,n,r){function i(t,n){OE(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))},OE(e,t,n,r)}function SE(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 xE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?SE(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _E(e){e.type;var t=Wn(e,gE);return kE().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return kE().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,Kb(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,qb(Ui({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,ha("/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,qb(pv(u));case 5:e.n=7;break;case 6:return e.n=7,qb(Ui(xE(xE({},u),{},{platform:n,itemType:r,plan:o})));case 7:if(!d){e.n=8;break}return console.error("Error: P100",d),e.n=8,qb(Vi(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 CE(e){var t=e.type,n=Wn(e,vE);return kE().m(function e(){var r,o,i,a;return kE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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,ha("/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,qb(pv(o));case 4:e.n=6;break;case 5:return e.n=6,qb(na(o));case 6:if(!i){e.n=7;break}return console.error("Error P101: ",i),e.n=7,qb(ra(i));case 7:e.n=9;break;case 8:return e.p=8,a=e.v,console.error("Error P101: ",a),e.n=9,qb(ra(a));case 9:return e.a(2)}},e,null,[[0,8]])})()}function DE(e){return e.type,Wn(e,yE),kE().m(function e(){var t,n,r,o;return kE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/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,qb(Fi(null==n?void 0:n.user));case 2:_l({icon:"success",timer:2e3,html:React.createElement(Z_,{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,qb(Mi({code:"sync_failed",message:n.message}));case 4:if(!r){e.n=5;break}return e.n=5,qb(Mi({code:"sync_failed",message:r}));case 5:e.n=8;break;case 6:return e.p=6,o=e.v,e.n=7,qb(Mi({code:"sync_failed",message:o}));case 7:console.error("Sync Error: ",o);case 8:return e.a(2)}},e,null,[[0,6]])})()}function PE(e){return e.type,Wn(e,bE),kE().m(function e(){var t,n,r,o;return kE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,qb({type:hr});case 1:return e.n=2,ha("/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,qb(Bi({is_verified:n}));case 3:if(!r){e.n=4;break}return console.error("Sync Error: ",r),e.n=4,qb(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,qb(Bi({is_verified:!1}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function AE(e){var t=e.type,n=Wn(e,wE);return kE().m(function e(){var r,o,i,a,l,s;return kE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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=xE(xE({},n),{},{all:!0})),e.n=3,ha("/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,qb(pv(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(Il(null==l?void 0:l[e.type]),[e.item_id])})),e.n=5,qb(Hi({data:l}));case 5:if(!o||"APPLICATION_SET_PLATFORM"==t){e.n=6;break}return e.n=6,qb(qi(o));case 6:if(!i||"APPLICATION_SET_PLATFORM"==t){e.n=7;break}return console.error("Error P103: ",i),e.n=7,qb($i(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,qb($i(s));case 9:return e.a(2)}},e,null,[[0,8]])})()}function TE(){return kE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Qr,_E);case 1:return e.n=2,Vw(lo,CE);case 2:return e.n=3,Vw(Gr,DE);case 3:return e.n=4,Vw(qr,PE);case 4:return e.n=5,Vw(po,AE);case 5:return e.n=6,Vw(ur,AE);case 6:return e.n=7,Vw(ur,CE);case 7:return e.a(2)}},EE)}var jE=["type"],FE=["type","isGloballySigned"],ME=["type"],NE=["type"],IE=RE().m(VE);function RE(){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 LE(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]())):(LE(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,LE(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,LE(d,"constructor",c),LE(c,"constructor",s),s.displayName="GeneratorFunction",LE(c,o,"GeneratorFunction"),LE(d),LE(d,o,"Generator"),LE(d,r,function(){return this}),LE(d,"toString",function(){return"[object Generator]"}),(RE=function(){return{w:i,m:p}})()}function LE(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}LE=function(e,t,n,r){function i(t,n){LE(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))},LE(e,t,n,r)}function BE(e){return e.type,Wn(e,jE),RE().m(function e(){var t,n,r,o,i,a,l,s;return RE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=null,e.n=1,Kb(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,qb(Fi(r));case 2:case 10:return e.a(2);case 3:if(null!=r){e.n=7;break}return e.n=4,ha("/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,qb(Fi(null==a?void 0:a.user));case 5:e.n=7;break;case 6:return e.n=7,qb(Mi({code:"is_signed_failed",message:t}));case 7:if(!t){e.n=8;break}return e.n=8,qb(Mi({code:"is_signed_failed",message:t}));case 8:e.n=10;break;case 9:return e.p=9,s=e.v,e.n=10,qb(Mi({code:"is_signed_failed",message:s}))}},e,null,[[0,9]])})()}function zE(e){e.type;var t=e.isGloballySigned;return Wn(e,FE),RE().m(function e(){var n,r,o,i,a;return RE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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,qb(ji({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,qb(Mi({code:"logout_failed",message:o}));case 4:e.n=6;break;case 5:return e.p=5,a=e.v,e.n=6,qb(Mi({code:"logout_failed",message:a}))}},e,null,[[0,5]])})()}function WE(e){e.type;var t=Wn(e,ME);return RE().m(function e(){var n,r,o,i,a,l;return RE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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,qb(Fi(null==r?void 0:r.user));case 2:if("error"!==(null==r?void 0:r.status)){e.n=3;break}return e.n=3,qb(Mi({code:"login_failed",message:r.message}));case 3:if(!o){e.n=4;break}return e.n=4,qb(Mi({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,qb(Mi({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 UE(e){e.type;var t=Wn(e,NE);return RE().m(function e(){var n,r,o,i,a;return RE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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,qb(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,qb(Ii({code:"signup_failed",message:r.message,additional_errors:r.additional_errors}));case 3:if(!o){e.n=4;break}return e.n=4,qb(Ii({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,qb(Ii({code:"signup_failed",message:a}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function VE(){return RE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Uw(Bo.LOAD,BE);case 1:return e.n=2,Uw($r,BE);case 2:return e.n=3,Vw(yr,WE);case 3:return e.n=4,Vw(Er,UE);case 4:return e.n=5,Vw(gr,zE);case 5:return e.a(2)}},IE)}var HE=["type"],GE=qE().m(XE);function qE(){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 $E(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]())):($E(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,$E(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,$E(d,"constructor",c),$E(c,"constructor",s),s.displayName="GeneratorFunction",$E(c,o,"GeneratorFunction"),$E(d),$E(d,o,"Generator"),$E(d,r,function(){return this}),$E(d,"toString",function(){return"[object Generator]"}),(qE=function(){return{w:i,m:p}})()}function $E(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$E=function(e,t,n,r){function i(t,n){$E(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))},$E(e,t,n,r)}function QE(e){return e.type,Wn(e,HE),qE().m(function e(){var t,n,r,o;return qE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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,ha("/templately/v1/categories");case 3:if(t=e.v,n=t.response,r=t.error,!n){e.n=4;break}return e.n=4,qb(cv({categories:n}));case 4:if(!r){e.n=5;break}return e.n=5,qb(uv({error:r}));case 5:e.n=7;break;case 6:return e.p=6,o=e.v,e.n=7,qb(uv({error:o}));case 7:return e.a(2)}},e,null,[[0,6]])})()}function XE(){return qE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Nr,QE);case 1:return e.a(2)}},GE)}var YE=["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){e.type;var t=Wn(e,YE);return ZE().m(function e(){var n,r,o;return ZE().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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 tk(){return ZE().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw("APPLICATION_CHECK_DEPENDENCIES",ek);case 1:return e.a(2)}},KE)}var nk=["type"],rk=["type"],ok=ik().m(ck);function ik(){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 ak(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]())):(ak(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,ak(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,ak(d,"constructor",c),ak(c,"constructor",s),s.displayName="GeneratorFunction",ak(c,o,"GeneratorFunction"),ak(d),ak(d,o,"Generator"),ak(d,r,function(){return this}),ak(d,"toString",function(){return"[object Generator]"}),(ik=function(){return{w:i,m:p}})()}function ak(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ak=function(e,t,n,r){function i(t,n){ak(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))},ak(e,t,n,r)}function lk(e){e.type;var t=Wn(e,nk);return ik().m(function e(){var n,r,o;return ik().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/templately/v1/conditions",t);case 1:if(n=e.v,r=n.response,n.error,!r){e.n=3;break}return e.n=2,qb(fv(r.config));case 2:if(null==(null==r?void 0:r.template_conditions)){e.n=3;break}return e.n=3,qb(hv(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 sk(e){e.type;var t=Wn(e,rk);return ik().m(function e(){var n,r,o,i,a;return ik().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.id,e.n=1,Kb(function(e){return e.conditions.conditionsForSave[n]});case 1:return r=e.v,e.n=2,ma("/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 ck(){return ik().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Br,lk);case 1:return e.n=2,Vw(Ur,sk);case 2:return e.a(2)}},ok)}var uk=["type"],dk=fk().m(yk),pk=fk().m(Ek);function fk(){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 hk(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]())):(hk(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,hk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,hk(d,"constructor",c),hk(c,"constructor",s),s.displayName="GeneratorFunction",hk(c,o,"GeneratorFunction"),hk(d),hk(d,o,"Generator"),hk(d,r,function(){return this}),hk(d,"toString",function(){return"[object Generator]"}),(fk=function(){return{w:i,m:p}})()}function hk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}hk=function(e,t,n,r){function i(t,n){hk(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))},hk(e,t,n,r)}function mk(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?mk(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vk(e){var t=e.payload;return fk().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return fk().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,Xb(ha,i,{});case 1:if(a=e.v,l=a.response,!(s=a.error)){e.n=3;break}return e.n=2,qb(jy(s.data.message));case 2:e.n=5;break;case 3:return c=l.data,e.n=4,qb(Ty(c));case 4:return u=c.credit_balance,d=c.estimated_cost,e.n=5,qb(_y(gk(gk({},u),{},{estimated_cost:d})));case 5:e.n=7;break;case 6:return e.p=6,p=e.v,e.n=7,qb(jy(p.message));case 7:return e.a(2)}},e,null,[[0,6]])})()}function yk(){var e,t,n,r,o,i;return fk().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,Xb(ha,t,{});case 1:if(n=a.v,r=n.response,!(o=n.error)){a.n=3;break}return a.n=2,qb(My(o));case 2:a.n=4;break;case 3:return a.n=4,qb(Fy(r));case 4:a.n=6;break;case 5:return a.p=5,i=a.v,a.n=6,qb(My(i.message));case 6:return a.a(2)}},dk,null,[[0,5]])}function bk(e){var t=e.payload;return fk().m(function e(){var n,r;return fk().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,qb(Ay(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 wk(e){return e.type,Wn(e,uk),fk().m(function e(){return fk().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)})()}function Ek(){return fk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$b([Vw("FULL_SITE_IMPORT_START",wk),Vw(Zo,bk),Vw(oi,vk),Vw(li,yk)]);case 1:return e.a(2)}},pk)}var kk=["type"],Ok=Sk().m(Ck);function Sk(){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 xk(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]())):(xk(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,xk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,xk(d,"constructor",c),xk(c,"constructor",s),s.displayName="GeneratorFunction",xk(c,o,"GeneratorFunction"),xk(d),xk(d,o,"Generator"),xk(d,r,function(){return this}),xk(d,"toString",function(){return"[object Generator]"}),(Sk=function(){return{w:i,m:p}})()}function xk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xk=function(e,t,n,r){function i(t,n){xk(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))},xk(e,t,n,r)}function _k(e){e.type;var t=Wn(e,kk);return Sk().m(function e(){var n,r,o,i;return Sk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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,qb(Ki());case 2:return e.n=3,qb(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,qb(Zi({error:r.message||"Failed to update favourite"}));case 5:if(!o){e.n=6;break}return console.error("Error P102: ",o),e.n=6,qb(Zi({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,qb(Zi({error:i.message||"Failed to update favourite"}));case 8:return e.a(2)}},e,null,[[0,7]])})()}function Ck(){return Sk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(to,_k);case 1:return e.a(2)}},Ok)}var Dk=["type"],Pk=Ak().m(Fk);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 jk(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,ma("/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,qb(Ji());case 2:return e.n=3,qb(Xi({reviews:r.data.reviews}));case 3:if(!o){e.n=4;break}return console.error("Error P102: ",o),e.n=4,qb(ea({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,qb(ea({error:i.message||"Failed to update rating"}));case 6:return e.a(2)}},e,null,[[0,5]])})()}function Fk(){return Ak().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(oo,jk);case 1:return e.a(2)}},Pk)}var Mk=["type"],Nk=["type"],Ik=["type"],Rk=zk().m(Gk);function Lk(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 Bk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lk(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zk(){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]"}),(zk=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 Uk(e){e.type;var t=Wn(e,Mk);return zk().m(function e(){var n,r,o,i,a,l;return zk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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,qb(my());case 2:return e.a(2);case 3:return e.n=4,ha("/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,qb(gy({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,qb(Ey({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,qb(vy({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 Vk(e){e.type;var t=Wn(e,Nk);return zk().m(function e(){var n,r,o,i,a,l;return zk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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,qb(hy());case 2:if(null!=r&&r.is_kit){e.n=3;break}return _l({icon:"success",timer:1500,html:React.createElement(Z_,re({},i.success,{contentArgs:r}))},!0),e.a(2);case 3:xl.close({isDeleted:!0,message:null==r?void 0:r.message}),e.n=5;break;case 4:return null!=o&&o.message&&_l({icon:"error",timer:1500,html:React.createElement(Z_,{title:o.message})},!0),e.a(2);case 5:"cant_delete_kit"===(null==o?void 0:o.code)?_l({onConfirm:function(e){return Cl(i,e)},html:React.createElement(Au,{id:null==o||null===(a=o.data)||void 0===a?void 0:a.id})},!0):"invalid_permission"===(null==o?void 0:o.code)&&_l({icon:"error",timer:1500,html:React.createElement(Z_,{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 Hk(e){e.type;var t=Wn(e,Ik);return zk().m(function e(){var n,r,o,i;return zk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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 Bk(Bk({},e),{},{is_pushed:e.is_pushed?e.is_pushed:e.id===t.id})}),e.n=2,qb(gy({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 Gk(){return zk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Mo,Uk);case 1:return e.n=2,Vw(Lo,Vk);case 2:return e.n=3,Vw(Bo.PUSHED,Hk);case 3:return e.a(2)}},Rk)}var qk=["type"],$k=Qk().m(Kk);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 Xk(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]())):(Xk(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,Xk(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Xk(d,"constructor",c),Xk(c,"constructor",s),s.displayName="GeneratorFunction",Xk(c,o,"GeneratorFunction"),Xk(d),Xk(d,o,"Generator"),Xk(d,r,function(){return this}),Xk(d,"toString",function(){return"[object Generator]"}),(Qk=function(){return{w:i,m:p}})()}function Xk(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Xk=function(e,t,n,r){function i(t,n){Xk(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))},Xk(e,t,n,r)}function Yk(e){return e.type,Wn(e,qk),Qk().m(function e(){var t,n,r,o,i,a,l,s;return Qk().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,qb({type:Bo.STATUS_REQUEST});case 1:return e.n=2,ha("/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,qb(Tv({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,qb(Av({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,qb(Tv({error:r}));case 5:e.n=7;break;case 6:return e.p=6,s=e.v,e.n=7,qb(Tv({error:s}));case 7:return e.a(2)}},e,null,[[0,6]])})()}function Kk(){return Qk().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(br,Yk);case 1:return e.n=2,Vw(Bo.LOAD,Yk);case 2:return e.n=3,Vw(lo,Yk);case 3:return e.n=4,Vw(Qr,Yk);case 4:return e.n=5,Vw(po,Yk);case 5:return e.n=6,Vw(zo.LOAD,Yk);case 6:return e.n=7,Vw(Wo.LOAD,Yk);case 7:return e.n=8,Vw(Uo.LOAD,Yk);case 8:return e.a(2)}},$k)}const Zk=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 Jk=["action"];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,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 rO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oO(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 iO=0,aO=0,lO=function(){return Dd(function e(t){var n=this;_d(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="+aO+++"&li="+iO).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="+iO).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(iO+=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 sO=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)?rO(rO(rO({},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?rO(rO({},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,rO({status:"processing"},e))}else n.push(rO({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?rO(rO({},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?lO: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=rO(rO({},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,Jk);switch(r){case"error":s.close(),null!=o&&o.retry&&v.current<2?c():(u(!1),g(!0),requestAnimationFrame(function(){y(rO(rO({},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://templately.com?support=open"),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://templately.com?support=open"),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(eO().m(function e(t){var n,r,o,i,a,l,s=arguments;return eO().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,iO=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,Ea(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 cO(){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 uO(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]())):(uO(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,uO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,uO(d,"constructor",c),uO(c,"constructor",s),s.displayName="GeneratorFunction",uO(c,o,"GeneratorFunction"),uO(d),uO(d,o,"Generator"),uO(d,r,function(){return this}),uO(d,"toString",function(){return"[object Generator]"}),(cO=function(){return{w:i,m:p}})()}function uO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}uO=function(e,t,n,r){function i(t,n){uO(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))},uO(e,t,n,r)}const dO=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(cO().m(function t(n){var r,o,i;return cO().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,ha("/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]},pO={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let fO;const hO=new Uint8Array(16);function mO(){if(!fO&&(fO="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!fO))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return fO(hO)}const gO=[];for(let e=0;e<256;++e)gO.push((e+256).toString(16).slice(1));const vO=function(e,t,n){if(pO.randomUUID&&!t&&!e)return pO.randomUUID();const r=(e=e||{}).random||(e.rng||mO)();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 gO[e[t+0]]+gO[e[t+1]]+gO[e[t+2]]+gO[e[t+3]]+"-"+gO[e[t+4]]+gO[e[t+5]]+"-"+gO[e[t+6]]+gO[e[t+7]]+"-"+gO[e[t+8]]+gO[e[t+9]]+"-"+gO[e[t+10]]+gO[e[t+11]]+gO[e[t+12]]+gO[e[t+13]]+gO[e[t+14]]+gO[e[t+15]]}(r)};var yO=function(){return Dd(function e(t){_d(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(Il(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 bO=yO;function wO(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 EO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var kO=he().createContext(),OO=function(e){var t=En(),n=xn(function(e){var t;return null!==(t=e.conditions.conditions)&&void 0!==t?t:[]}),r=new bO(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=vO(),u={};return a&&(u.subIdAutocomplete=r.getSubIdAutocomplete(a)),EO(EO({},e),{},Pt({},c,EO(EO({},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(Il((null==t?void 0:t[e.template.id])||[]),[r]);return EO(EO({},t),{},Pt({},e.template.id,o))},{});t(Jg({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)),EO(EO({},n),{},Pt({},e,EO(EO({},o),t)))})},createCondition:function(e){var t=vO();u(function(e){return EO(EO({},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],EO({},t)})},saveConditions:function(){var n;e.template.id&&(a(!0),t((n=e.template.id,{type:Ur,id:n})))},isSaving:i};return he().createElement(kO.Provider,{value:d},e.children)};const SO=function(){return(0,pe.useContext)(kO)};var xO=["key","type"],_O=["type"],CO=["details","fileContents"],DO=["type","saveTemplate"],PO=["type"],AO=["type"],TO=["type","context"],jO=["source","slug"];function FO(){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 MO(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]())):(MO(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,MO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,MO(d,"constructor",c),MO(c,"constructor",s),s.displayName="GeneratorFunction",MO(c,o,"GeneratorFunction"),MO(d),MO(d,o,"Generator"),MO(d,r,function(){return this}),MO(d,"toString",function(){return"[object Generator]"}),(FO=function(){return{w:i,m:p}})()}function MO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}MO=function(e,t,n,r){function i(t,n){MO(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))},MO(e,t,n,r)}var NO=FO().m(BO),IO=FO().m(GO);function RO(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 LO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BO(e){var t,n,r,o,i,a,l;return FO().w(function(s){for(;;)switch(s.n){case 0:return t=e.key,e.type,n=Wn(e,xO),r=(null==n?void 0:n.search)||null,s.n=1,Kb(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,qb({type:Bo.REQUESTED,platform:o});case 2:return s.n=3,ha("/templately/v1/clouds",LO({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,qb(pv(a));case 4:if(!a){s.n=6;break}if(null==a||!a.files){s.n=5;break}return s.n=5,qb(Dv({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,qb(Dv({data:[],platform:o,currentPage:1,totalPage:0,search:r}));case 6:if(!l){s.n=7;break}return s.n=7,qb(Pv(l));case 7:return s.a(2)}},NO)}function zO(e){e.type;var t=Wn(e,_O);return FO().m(function e(){var n,r,o,i,a,l,s;return FO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n=t.details,r=t.fileContents,o=Wn(t,CO),e.n=1,ma("/templately/v1/clouds/copy-move",o);case 1:if(i=e.v,a=i.response,i.error,xl.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,qb(Fv(LO(LO({},r),{},{slug:s})));case 2:e.n=4;break;case 3:if("move"!==t.action){e.n=4;break}return e.n=4,qb(Nv(LO(LO({},r),{},{slug:s})));case 4:"copy"===t.action?xl.close({isCopied:!0,contentArgs:{title:l}}):"move"===t.action&&xl.close({isMoved:!0,contentArgs:{title:l}}),e.n=6;break;case 5:"error"==a.status&&("copy"===t.action?xl.close({isCopied:!1,contentArgs:{title:l,message:a.message}}):"move"===t.action&&xl.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 WO(e){e.type;var t=e.saveTemplate,n=Wn(e,DO);return FO().m(function e(){var r,o,i,a,l,s,c,u;return FO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(function(e){return{platform:e.general.platform}});case 1:return r=e.v,o=r.platform,e.n=2,ma("/templately/v1/clouds/upload",LO(LO({},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,qb(Bv(LO({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,qb(zv(a));case 5:if(!l){e.n=6;break}return e.n=6,qb(zv(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,qb(LO({type:"CLOUDS_PUSHED"},n));case 7:return e.n=8,qb(Cv({refresh:!0,search:null}));case 8:xl.close({isPushed:!0,contentArgs:{title:"Successfully Pushed!",message:null==a?void 0:a.message}}),e.n=10;break;case 9:xl.close({isPushed:!1,contentArgs:{title:"Something went wrong!",message:null==a?void 0:a.message}});case 10:e.n=12;break;case 11:l&&xl.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 UO(e){e.type;var t=Wn(e,PO);return FO().m(function e(){var n,r,o,i;return FO().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/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(),xl.close({isDownloaded:!0})):xl.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 VO(e){e.type;var t=Wn(e,AO);return FO().m(function e(){var n,r,o,i,a,l,s,c;return FO().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,ha("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,qb(Cv({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,qb(ly({refresh:!0,slug:i}));case 4:xl.hideLoading(),xl.close({isDeleted:!0}),e.n=6;break;case 5:xl.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 HO(e){e.type;var t=e.context,n=void 0===t?"modal":t,r=Wn(e,TO);return FO().m(function e(){var t,o,i,a,l,s,c,u,d,p,f,h,m,g;return FO().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,jO),e.n=1,ha("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,qb(Hv({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 GO(){return FO().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Bo.LOAD,BO);case 1:return e.n=2,Vw(Bo.COPY,zO);case 2:return e.n=3,Vw(Bo.MOVE,zO);case 3:return e.n=4,Vw(Bo.PUSH,WO);case 4:return e.n=5,Vw(Bo.DOWNLOAD,UO);case 5:return e.n=6,Vw(Bo.DELETE,VO);case 6:return e.n=7,Vw(Bo.SEARCH,HO);case 7:return e.n=8,Vw(zo.SEARCH,HO);case 8:return e.n=9,Vw(Wo.SEARCH,HO);case 9:return e.n=10,Vw(Uo.SEARCH,HO);case 10:return e.a(2)}},IO)}var qO=["type"],$O=["shared","key","page"],QO=XO().m(eS);function XO(){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 YO(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]())):(YO(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,YO(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,YO(d,"constructor",c),YO(c,"constructor",s),s.displayName="GeneratorFunction",YO(c,o,"GeneratorFunction"),YO(d),YO(d,o,"Generator"),YO(d,r,function(){return this}),YO(d,"toString",function(){return"[object Generator]"}),(XO=function(){return{w:i,m:p}})()}function YO(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}YO=function(e,t,n,r){function i(t,n){YO(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))},YO(e,t,n,r)}function KO(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 ZO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?KO(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JO(e){var t=e.type,n=Wn(e,qO);return XO().m(function e(){var r,o,i,a,l,s,c,u,d,p;return XO().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,$O),e.n=1,Kb(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,qb({type:o?Wo.REQUESTED:zo.REQUESTED,platform:l,plan:a});case 2:return e.n=3,ha("/templately/v1/workspaces",ZO({},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,qb(Xv({payload:c.data,shared:n.shared}));case 5:return e.a(3,8);case 6:return e.n=7,qb(Yv({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,qb(Kv({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 eS(){return XO().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(zo.LOAD,JO);case 1:return e.n=2,Vw(Wo.LOAD,JO);case 2:return e.n=3,Vw(zo.LOAD_LISTS,JO);case 3:return e.n=4,Vw(Wo.LOAD_LISTS,JO);case 4:return e.a(2)}},QO)}var tS=["type"],nS=rS().m(sS);function rS(){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 oS(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]())):(oS(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,oS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,oS(d,"constructor",c),oS(c,"constructor",s),s.displayName="GeneratorFunction",oS(c,o,"GeneratorFunction"),oS(d),oS(d,o,"Generator"),oS(d,r,function(){return this}),oS(d,"toString",function(){return"[object Generator]"}),(rS=function(){return{w:i,m:p}})()}function oS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}oS=function(e,t,n,r){function i(t,n){oS(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))},oS(e,t,n,r)}function iS(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 aS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iS(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lS(e){e.type;var t=Wn(e,tS);return rS().m(function e(){var n,r,o,i,a,l,s;return rS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/templately/v1/workspaces/create",aS(aS({},t),{},{isCreate:!0}));case 1:if(n=e.v,r=n.response,o=n.error,xl.hideLoading(),"success"!==(null==r?void 0:r.status)){e.n=3;break}return e.n=2,qb(Jv(aS({},null==r?void 0:r.workspace)));case 2:xl.close({isCreated:!0,contentArgs:{title:null!==(i=null==t?void 0:t.title)&&void 0!==i?i:""}}),e.n=4;break;case 3:xl.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 sS(){return rS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(zo.CREATE,lS);case 1:return e.a(2)}},nS)}var cS=["type"],uS=["key","shared","refresh"],dS=["type"],pS=fS().m(bS);function fS(){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 hS(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]())):(hS(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,hS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,hS(d,"constructor",c),hS(c,"constructor",s),s.displayName="GeneratorFunction",hS(c,o,"GeneratorFunction"),hS(d),hS(d,o,"Generator"),hS(d,r,function(){return this}),hS(d,"toString",function(){return"[object Generator]"}),(fS=function(){return{w:i,m:p}})()}function hS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}hS=function(e,t,n,r){function i(t,n){hS(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))},hS(e,t,n,r)}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}function vS(e){e.type;var t=Wn(e,cS);return fS().m(function e(){var n,r,o,i,a,l,s,c,u,d,p;return fS().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,uS),i=o.slug,o.platform,e.n=1,Kb(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,Xb(ha,"/templately/v1/workspaces/"+i,gS({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,qb(iy(gS(gS({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,qb(cy(gS({},d)));case 4:e.n=6;break;case 5:return e.p=5,p=e.v,console.error("Error W104: ",p),e.n=6,qb(cy(p));case 6:return e.a(2)}},e,null,[[0,5]])})()}function yS(e){e.type;var t=Wn(e,dS);return fS().m(function e(){var n,r,o,i,a,l,s;return fS().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,ma("/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 xl.close({isAdded:!0}),e.n=2,qb(ly({slug:o,refresh:!0}));case 2:e.n=4;break;case 3:xl.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 bS(){return fS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Uo.LOAD,vS);case 1:return e.n=2,Vw(Uo.ADD_FILE,yS);case 2:return e.a(2)}},pS)}var wS=["type"],ES=["type"],kS=OS().m(CS);function OS(){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 SS(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]())):(SS(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,SS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,SS(d,"constructor",c),SS(c,"constructor",s),s.displayName="GeneratorFunction",SS(c,o,"GeneratorFunction"),SS(d),SS(d,o,"Generator"),SS(d,r,function(){return this}),SS(d,"toString",function(){return"[object Generator]"}),(OS=function(){return{w:i,m:p}})()}function SS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}SS=function(e,t,n,r){function i(t,n){SS(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))},SS(e,t,n,r)}function xS(e){e.type;var t=Wn(e,wS);return OS().m(function e(){var n,r,o,i,a,l,s;return OS().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,qb(Lv({}));case 1:return e.n=2,qb(sy({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 _S(e){e.type;var t=Wn(e,ES);return OS().m(function e(){var n,r,o,i,a,l,s,c,u,d,p,f,h,m;return OS().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,Kb(function(e){return e.general.platform});case 1:if(s=e.v,!l){e.n=2;break}return e.n=2,qb({type:Uo.GET_FILES_REQUESTED});case 2:return e.n=3,ha("/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,qb(sy({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 CS(){return OS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Uo.LOAD_SUCCESS,xS);case 1:return e.n=2,Vw(Uo.SET,_S);case 2:return e.n=3,Vw(Uo.GET_FILES,_S);case 3:return e.a(2)}},kS)}function DS(){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 PS(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]())):(PS(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,PS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,PS(d,"constructor",c),PS(c,"constructor",s),s.displayName="GeneratorFunction",PS(c,o,"GeneratorFunction"),PS(d),PS(d,o,"Generator"),PS(d,r,function(){return this}),PS(d,"toString",function(){return"[object Generator]"}),(DS=function(){return{w:i,m:p}})()}function PS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}PS=function(e,t,n,r){function i(t,n){PS(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))},PS(e,t,n,r)}var AS=DS().m(NS),TS=DS().m(IS),jS=DS().m(RS);function FS(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 MS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?FS(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NS(e){var t,n,r,o,i,a,l;return DS().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,ma("/templately/v1/workspaces/delete/"+t,MS({},e));case 2:if(o=s.v,i=o.response,a=o.error,xl.hideLoading(),"success"!==i.status){s.n=4;break}return s.n=3,qb(ty({id:t,slug:r,page:n}));case 3:xl.close({isDeleted:!0}),s.n=5;break;case 4:throw xl.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)}},AS,null,[[1,6]])}function IS(e){var t,n;return DS().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,qb(ay({id:t,slug:n}));case 1:return r.a(2)}},TS)}function RS(){return DS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(zo.DELETE,NS);case 1:return e.n=2,Uw(zo.DELETE_SUCCESS,IS);case 2:return e.a(2)}},jS)}function LS(){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 BS(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]())):(BS(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,BS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,BS(d,"constructor",c),BS(c,"constructor",s),s.displayName="GeneratorFunction",BS(c,o,"GeneratorFunction"),BS(d),BS(d,o,"Generator"),BS(d,r,function(){return this}),BS(d,"toString",function(){return"[object Generator]"}),(LS=function(){return{w:i,m:p}})()}function BS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}BS=function(e,t,n,r){function i(t,n){BS(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))},BS(e,t,n,r)}var zS=LS().m(HS),WS=LS().m(GS);function US(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 VS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?US(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):US(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HS(e){var t,n,r,o,i,a,l,s,c;return LS().w(function(u){for(;;)switch(u.p=u.n){case 0:return t=e.slug,u.p=1,u.n=2,Kb(function(e){return{platform:e.general.platform}});case 2:return n=u.v,r=n.platform,u.n=3,ma("/templately/v1/workspaces/"+t,VS(VS({},e),{},{platform:r}));case 3:if(o=u.v,i=o.response,a=o.error,xl.hideLoading(),"success"!==(null==i?void 0:i.status)){u.n=5;break}return u.n=4,qb(ry(VS({slug:t,platform:r},null==i?void 0:i.workspace)));case 4:xl.close({isSaved:!0}),u.n=6;break;case 5:throw xl.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)}},zS,null,[[1,7]])}function GS(){return LS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(zo.SAVE,HS);case 1:return e.a(2)}},WS)}var qS=["type"],$S=QS().m(KS);function QS(){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 XS(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]())):(XS(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,XS(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,XS(d,"constructor",c),XS(c,"constructor",s),s.displayName="GeneratorFunction",XS(c,o,"GeneratorFunction"),XS(d),XS(d,o,"Generator"),XS(d,r,function(){return this}),XS(d,"toString",function(){return"[object Generator]"}),(QS=function(){return{w:i,m:p}})()}function XS(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XS=function(e,t,n,r){function i(t,n){XS(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))},XS(e,t,n,r)}function YS(e){e.type;var t=Wn(e,qS);return QS().m(function e(){var n,r,o;return QS().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/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,qb(dv(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 KS(){return QS().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Ra(ko,"PAGES"),YS);case 1:return e.n=2,Vw(Ra(ko,"SECTIONS"),YS);case 2:return e.n=3,Vw(Ra(ko,"PACKS"),YS);case 3:return e.n=4,Vw(Ra(vo,"PAGES"),YS);case 4:return e.n=5,Vw(Ra(vo,"SECTIONS"),YS);case 5:return e.n=6,Vw(Ra(vo,"PACKS"),YS);case 6:return e.a(2)}},$S)}var ZS=["type","key","slug"],JS=["type"],ex=tx().m(ax);function tx(){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 nx(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]())):(nx(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,nx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,nx(d,"constructor",c),nx(c,"constructor",s),s.displayName="GeneratorFunction",nx(c,o,"GeneratorFunction"),nx(d),nx(d,o,"Generator"),nx(d,r,function(){return this}),nx(d,"toString",function(){return"[object Generator]"}),(tx=function(){return{w:i,m:p}})()}function nx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nx=function(e,t,n,r){function i(t,n){nx(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))},nx(e,t,n,r)}function rx(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 ox(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rx(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ix(e){e.type;var t=e.key,n=e.slug,r=Wn(e,ZS);return tx().m(function e(){var o,i,a,l,s,c,u,d,p;return tx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Kb(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,ha("/templately/v1/items/"+n,ox({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,JS),e.n=3,qb(vv(ox(ox({},d),{},{itemType:u,key:t,platform:a})));case 3:if(!c){e.n=4;break}return console.error("Error ID001: ",c),e.n=4,qb(yv(ox(ox({},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,qb(yv(p));case 6:return e.a(2)}},e,null,[[0,5]])})()}function ax(){return tx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Ra(ko,"PAGES"),ix);case 1:return e.n=2,Vw(Ra(ko,"SECTIONS"),ix);case 2:return e.n=3,Vw(Ra(ko,"PACKS"),ix);case 3:return e.a(2)}},ex)}var lx=["key","type","isFilterableQuery","prevFilterableQuery"];function sx(){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 cx(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]())):(cx(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,cx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,cx(d,"constructor",c),cx(c,"constructor",s),s.displayName="GeneratorFunction",cx(c,o,"GeneratorFunction"),cx(d),cx(d,o,"Generator"),cx(d,r,function(){return this}),cx(d,"toString",function(){return"[object Generator]"}),(sx=function(){return{w:i,m:p}})()}function cx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}cx=function(e,t,n,r){function i(t,n){cx(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))},cx(e,t,n,r)}var ux=sx().m(mx),dx=sx().m(gx),px=sx().m(vx);function fx(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 hx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fx(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mx(e){var t,n,r,o,i,a,l,s,c,u,d,p,f,h,m,g,v,y;return sx().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,lx),o=!1,b.n=1,Kb(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,qb({type:Ra(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,qb({type:Ra(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,qb(tv({key:"prevSearch",data:null==r?void 0:r.search}));case 5:return b.n=6,ha("/templately/v1/items",hx({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,qb({type:Ra(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,qb({type:Ra(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)}},ux,null,[[0,9]])}function gx(){return sx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Ra(yo,"PAGES"),mx);case 1:return e.n=2,Vw(Ra(yo,"SECTIONS"),mx);case 2:return e.n=3,Vw(Ra(yo,"PACKS"),mx);case 3:return e.a(2)}},dx)}function vx(){return sx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$b([gx()]);case 1:return e.a(2)}},px)}var yx=["type"],bx=wx().m(Ox);function wx(){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 Ex(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]())):(Ex(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,Ex(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Ex(d,"constructor",c),Ex(c,"constructor",s),s.displayName="GeneratorFunction",Ex(c,o,"GeneratorFunction"),Ex(d),Ex(d,o,"Generator"),Ex(d,r,function(){return this}),Ex(d,"toString",function(){return"[object Generator]"}),(wx=function(){return{w:i,m:p}})()}function Ex(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ex=function(e,t,n,r){function i(t,n){Ex(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))},Ex(e,t,n,r)}function kx(e){e.type;var t=Wn(e,yx);return wx().m(function e(){var n,r,o,i,a,l,s,c;return wx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/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,qb(bv({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,qb(wv(c));case 5:return e.a(2)}},e,null,[[0,4]])})()}function Ox(){return wx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(xo,kx);case 1:return e.a(2)}},bx)}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,ha("/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,qb(Ov({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,qb(Sv(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,Vw(To,Px);case 1:return e.a(2)}},xx)}var Tx=["type"],jx=Fx().m(Ix);function Fx(){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]"}),(Fx=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)}function Nx(e){e.type;var t=Wn(e,Tx);return Fx().m(function e(){var n,r,o,i,a,l,s,c;return Fx().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ha("/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,qb(Ev({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,qb(kv(c));case 5:return e.a(2)}},e,null,[[0,4]])})()}function Ix(){return Fx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Vw(Do,Nx);case 1:return e.a(2)}},jx)}function Rx(){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 Lx(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]())):(Lx(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,Lx(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Lx(d,"constructor",c),Lx(c,"constructor",s),s.displayName="GeneratorFunction",Lx(c,o,"GeneratorFunction"),Lx(d),Lx(d,o,"Generator"),Lx(d,r,function(){return this}),Lx(d,"toString",function(){return"[object Generator]"}),(Rx=function(){return{w:i,m:p}})()}function Lx(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Lx=function(e,t,n,r){function i(t,n){Lx(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))},Lx(e,t,n,r)}var Bx=Rx().m(zx);function zx(){return Rx().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,$b([Yb(VE),Yb(TE),Yb(tk),Yb(ck),Yb(Ek),Yb(Gk),Yb(KS),Yb(vx),Yb(Ox),Yb(Ix),Yb(Ax),Yb(Ck),Yb(Fk),Yb(ax),Yb(XE),Yb(mE),Yb(Xw),Yb(tE),Yb(lE),Yb(Kk),Yb(GO),Yb(eS),Yb(sS),Yb(bS),Yb(CS),Yb(RS),Yb(GS)]);case 1:return e.a(2)}},Bx)}const Wx=zx;var Ux=function(){var e,t={},n=t.context,r=void 0===n?{}:n,o=t.channel,i=void 0===o?hw():o,a=t.sagaMonitor,l=Lt(t,Fw);function s(t){var n=t.getState,o=t.dispatch;return e=jw.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){Ob(r,e)},s}(),Vx=null;Vx=function(e,t){var n=Eu(),r=Ml(Nl(n),{},t);return r.asyncReducers=null!=n?n:{},r.attachReducer=function(e,t){r.asyncReducers[e]=t,r.replaceReducer(Nl(Eu(r.asyncReducers)))},r}(0,function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(Pl(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}}}(Nw,Ux)),Ux.run(Wx),Vx.attachReducer("sections",vu("SECTIONS")),Vx.attachReducer("packs",vu("PACKS")),Vx.attachReducer("pages",vu("PAGES"));var Hx=["to","query","ignoreKeys","icon","isActive","children","label","hasDropdown","aria-current"],Gx=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,Hx),v=l?m:void 0;return he().createElement(St,re({},g,{"aria-current":v,to:Yy(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(Qn,null)))};Gx.displayName="NavLink";const qx=Gx;var $x=["caseSensitive","end","style","className","activeItemClassName","dropdown","list"],Qx=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,$x),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(qx,re({},f,{isActive:b,hasDropdown:h})),u&&u.length>0&&he().createElement(Kx,{dropdown:!0,className:b?"dropdown-active":"",activeItemClassName:"dropdown-nav-active",routes:u})):he().createElement(qx,re({},f,{ref:t,style:w,className:E,isActive:b}))});Qx.displayName="NavItem";const Xx=Qx;var Yx=["element"];const Kx=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,Yx);return he().createElement(Xx,re({key:t.to,className:i,activeItemClassName:d},t))})))},Zx=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)},Jx=function(e){var t;return he().createElement("div",{className:"templately-table-row ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)};var e_=[{name:"Name",id:"name"},[{name:"Last Modified",id:"last_modified"},{name:"Action",id:"action"}]];const t_=function(e){var t=e.columns,n=void 0===t?e_:t;return he().createElement(Jx,{className:"templately-table-head"},n.map(function(e,t){return Array.isArray(e)?he().createElement(o_,{key:e.id+"-"+t},he().createElement(Jx,null,e.map(function(e,t){return he().createElement(o_,{key:e.id+"-"+t},he().createElement("p",null,e.name))}))):he().createElement(o_,{key:e.id+"-"+t},he().createElement("p",null,e.name))}))};var n_=["data","className","view"];const r_=function(e){var t=e.data,n=e.className,r=e.view,o=Wn(e,n_),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(Jx,{key:Math.random()*t},e.map(function(e,t){return Array.isArray(e)?he().createElement(o_,{key:"".concat(e.id,"-").concat(t)},he().createElement(Jx,null,e.map(function(e,t){return he().createElement(o_,{key:"".concat(e.id,"-").concat(t)},he().isValidElement(e.data)?e.data:he().createElement("p",null,e.data))}))):he().createElement(o_,{key:"".concat(e.id,"-").concat(t)},he().isValidElement(e.data)?e.data:he().createElement("p",null,e.data))}))}))},o_=function(e){var t;return he().createElement("div",{className:"templately-table-column ".concat(null!==(t=e.className)&&void 0!==t?t:"")},e.children)},i_=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))},a_=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)},l_=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(a_,{dependencies:n}))};var s_=["panelKey","title","isActive","onClickItem"],c_=function(e){var t=e.panelKey,n=e.title,r=e.isActive,o=e.onClickItem,i=Wn(e,s_),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(Qn,null)))};const u_=he().memo(c_);var d_=["isActive","children"],p_=function(e){var t=e.isActive,n=e.children,r=Wn(e,d_),o=Vn()("tc-panel-body",r.className,{"tc-content-active":t,"tc-content-hide":!t});return he().createElement("div",{className:o},n)};const f_=he().memo(p_);function h_(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 m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h_(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const g_=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(Il(t),e)})}},[t]);var i=(0,pe.useCallback)(function(e){var t=Il(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=m_(m_({},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 v_=["panelKey","title","children","isActive","onClickItem"],y_=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,v_),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(u_,re({title:n},s)),i&&he().createElement(f_,s,r))};const b_=he().memo(y_),w_=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}})},E_=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 Na(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(Yy("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=w_(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(fl,{"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(qx,{to:"purchased-items"},"PURCHASED"):"FREE"),!y&&he().createElement(fl,{"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(fl,{"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 k_=a(1921);const O_=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(i_,{isPro:+n>0}),he().createElement(k_.LazyLoadImage,{className:"templately-item-image",width:"100%",src:e,alt:t}))})},S_=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(Yy("sign-in"));if(Vg(e.isLoggedIn,k))return;_l({showCloseButton:!0,allowOutsideClick:!1,html:he().createElement(ad,e.content)},!0).then(function(e){void 0===(null==e?void 0:e.code)?e.isDismissed||yd(e.platform):_l({icon:"error",showCloseButton:!0,allowOutsideClick:!1,html:he().createElement(Zu,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(qx,{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(l_,{slug:a,type:i,dependencies:h,platform:e.platform}),he().createElement(O_,{name:r,price:+o,thumbnails:"pack"==i?[f,d,c]:[c]}))),he().createElement("div",{className:"templately-item-details"},he().createElement(E_,{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(qx,{className:"templately-title",to:"".concat(e.platform,"/").concat(i,"s/").concat(a)},he().createElement("h4",null,r)))))};var x_=a(5556),C_=a.n(x_),D_=a(312),P_=a.n(D_);function A_(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 T_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A_(Object(n),!0).forEach(function(t){F_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function j_(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 F_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M_(){return M_=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},M_.apply(this,arguments)}function N_(e){return N_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},N_(e)}function I_(e,t){return I_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I_(e,t)}function R_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L_(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)||z_(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 B_(e){return function(e){if(Array.isArray(e))return W_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z_(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 z_(e,t){if(e){if("string"==typeof e)return W_(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)?W_(e,t):void 0}}function W_(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 U_(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 V_(){return void 0!==globalThis.window?globalThis.window.innerWidth:0}function H_(){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:H_(e.parent)}var G_=300,q_=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&&I_(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=N_(o);if(i){var n=N_(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?R_(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(R_(t)),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(R_(t)),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(R_(t)),t.handleKeyInput=t.handleKeyInput.bind(R_(t)),t.handleMouseUp=t.handleMouseUp.bind(R_(t)),t.handleMouseDown=t.handleMouseDown.bind(R_(t)),t.handleMouseMove=t.handleMouseMove.bind(R_(t)),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(R_(t)),t.handleTouchStart=t.handleTouchStart.bind(R_(t)),t.handleTouchMove=t.handleTouchMove.bind(R_(t)),t.handleTouchEnd=t.handleTouchEnd.bind(R_(t)),t.handlePointerEvent=t.handlePointerEvent.bind(R_(t)),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(R_(t)),t.handleWindowResize=t.handleWindowResize.bind(R_(t)),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(R_(t)),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(R_(t)),t.requestClose=t.requestClose.bind(R_(t)),t.requestMoveNext=t.requestMoveNext.bind(R_(t)),t.requestMovePrev=t.requestMovePrev.bind(R_(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=H_(),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:V_(),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(G_,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=L_(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=L_(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===G_&&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:T_(T_({},t.loadErrorStatus),{},F_({},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:T_(T_({},e.loadErrorStatus),{},F_({},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=T_(T_({},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=T_(T_({},S),l.getTransform(T_(T_({},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",M_({},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:U_("Image"),draggable:!1})))}else{var u=void 0!==g?g:he().createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},B_(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:T_({zIndex:1e3,backgroundColor:"transparent"},p.overlay),content:T_({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},p.content)};return he().createElement(P_(),M_({isOpen:!0,onRequestClose:o?this.requestClose:void 0,onAfterOpen:function(){e.outerEl.current&&e.outerEl.current.focus(),f()},style:P,contentLabel:U_("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(B_(y===G_?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||y===G_,onClick:this.isAnimating()||y===G_?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(B_(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=V_();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&&j_(t.prototype,n),r&&j_(t,r),l}(pe.Component);q_.propTypes={mainSrc:C_().string.isRequired,prevSrc:C_().string,nextSrc:C_().string,mainSrcThumbnail:C_().string,prevSrcThumbnail:C_().string,nextSrcThumbnail:C_().string,onCloseRequest:C_().func.isRequired,onMovePrevRequest:C_().func,onMoveNextRequest:C_().func,onImageLoadError:C_().func,onImageLoad:C_().func,onAfterOpen:C_().func,discourageDownloads:C_().bool,animationDisabled:C_().bool,animationOnKeyInput:C_().bool,animationDuration:C_().number,keyRepeatLimit:C_().number,keyRepeatKeyupBonus:C_().number,imageTitle:C_().node,imageCaption:C_().node,imageCrossOrigin:C_().string,reactModalStyle:C_().shape({}),imagePadding:C_().number,wrapperClassName:C_().string,toolbarButtons:C_().arrayOf(C_().node),clickOutsideToClose:C_().bool,enableZoom:C_().bool,reactModalProps:C_().shape({}),nextLabel:C_().string,prevLabel:C_().string,zoomInLabel:C_().string,zoomOutLabel:C_().string,closeLabel:C_().string,imageLoadErrorMessage:C_().node,loader:C_().node},q_.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 $_=q_,Q_=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($_,{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)}}):"")},X_=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(Il(t.states),["currentPage"]),1),c=La(e,[].concat(Il(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=Ra(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=Ro:"favourites"===e.key?t=Zr:"downloads"===e.key?t=uo:"purchasedItems"===e.key&&(t=go),Jg({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(Xn,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(Yn,null)))}())))});var Y_=["element","isLoading","error","platform"];const K_=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,Y_);return he().createElement(he().Fragment,null,n&&he().createElement(kl,null),!n&&null!=r&&he().createElement(ul,re({},r,{platform:o,isGloballySigned:i.isGloballySigned,logout:i.logout})),!n&&null==r&&("function"==typeof t?t({isLoading:n}):t))});var Z_=function(e){var t=Vn()("tm-message text-center");return React.createElement("div",{className:t},e.icon&&e.icon,e.title&&(Ha(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):Na(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,dy.closeModal)())}}})(function(e){return e.sweetalert.show&&_l(e.sweetalert),null});var J_=["is_verified"],eC=window.templately.no_items;const tC=function(e){var t=e.is_verified;return Wn(e,J_),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:eC,alt:""}))))};function nC(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 rC(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 oC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var iC=[{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(Rn,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(nC,null)}];const aC=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=oC(oC({},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=oC(oC({},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(Kx,{className:"templately-clouds-menu",activeItemClassName:"nav-item-active",routes:iC,sidebar:!0}),he().createElement("div",{className:"templately-clouds-size"},e.isLoading?he().createElement(kl,{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))))))}),lC=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 Jg({type:Tr},e)}(t))},setTypes:function(t){return e(tv({key:"template_type_id",data:t}))},doFilter:function(){return e(rv())}}})(function(e){var t=it();ce(Ct(),1)[0],(0,pe.useEffect)(function(){e.getTypes({itemType:t.type})},[t.type]);var n=Zk(function(t){e.setTypes(t)});return e.isLoading?he().createElement(kl,{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))})))}),sC=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 Jg({type:Nr},e)}(t))},setCategory:function(t){return e(tv({key:"category_id",data:t}))},doFilter:function(){return e(rv())}}})(function(e){(0,pe.useEffect)(function(){e.getCategories()},[]);var t=Zk(function(t){e.setCategory(t)});return e.isLoading?he().createElement(kl,{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))})))}),cC=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(tv({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(kg,{isMulti:!0,placeholder:(0,At.__)("Write a keyword...","templately"),name:"templately_tags",options:e.tags,classNamePrefix:"templately-tags",onChange:n,maxMenuHeight:200,value:t}))}),uC=gn(function(e){return{filter:e.general.filter,doingQuery:e.general.filter.doQuery}},function(e){return{doFilter:function(){return e(rv())},resetFilter:function(t){return e(nv(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,ka.isEqual)(t,n)?i(!0):i(!1)},[e.filter]);var l="";return n.get("path")&&(l=Yy(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 dC=(0,pe.createContext)({includes:[],excludes:[],setIncludes:function(e){return e},setExcludes:function(e){return e}}),pC=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(dC.Provider,{value:{activeFilter:o,setActiveFilter:i,controls:c,activeControls:a,setActiveControls:l,activeState:d,setActiveState:p}},t)};const fC=dC;var hC=["children","className"];function mC(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 gC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const vC=function(e){e.children;var t=e.className,n=Wn(e,hC),r=(0,pe.useContext)(fC),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 gC(gC({},e),{},{action:"include"})})),l("include");break;case"include":i(o.map(function(e){return gC(gC({},e),{},{action:"exclude"})})),l("exclude");break;default:i(o.map(function(e){return gC(gC({},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(Qn,null))))};var yC=["id","content"];function bC(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 wC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const EC=function(e){var t=e.id,n=e.content,r=(Wn(e,yC),(0,pe.useContext)(fC)),o=r.activeControls,i=r.setActiveControls,a=(0,pe.useCallback)(function(){var e=Il(o);e=e.map(function(e){return e.id===t?wC(wC({},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 kC(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 OC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const SC=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(Il(a),Il(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(tv({key:"dependencies",data:t}))},setActiveFilter:function(t){return e(tv({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 OC(OC({},e),{},{action:"none"})})},[o]),h=(0,pe.useMemo)(function(){return l.map(function(e){return OC(OC({},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(pC,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:f,activeControls:d,setActiveControls:p},he().createElement(vC,{filter:"pro",title:(0,At.__)("Pro Plugins Dependencies","templately")}),he().createElement("ul",{className:"t-dependencies-list"},f.map(function(e){return he().createElement(EC,{key:e.id,id:e.id,content:e})})))),h.length>0&&he().createElement("div",{className:g},he().createElement(pC,{isReseted:e.isReseted,activeFilter:t,setActiveFilter:n,dependencies:h,activeControls:c,setActiveControls:u},he().createElement(vC,{filter:"free",title:(0,At.__)("Free Plugins Dependencies","templately")}),he().createElement("ul",{className:"t-dependencies-list"},h.map(function(e){return he().createElement(EC,{key:e.id,id:e.id,content:e})})))))});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}const _C=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(tv({key:"template_type_id",data:t}))},setActiveFilter:function(t){return e(tv({key:"activeFilter",data:t}))},setDependencies:function(t){return e(tv({key:"dependencies",data:t}))},setTags:function(t){return e(tv({key:"tags",data:t}))},setCategory:function(t){return e(tv({key:"category_id",data:t}))},doFilter:function(){return e(rv())}}})(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?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}({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(g_,null,"packs"===(null==t?void 0:t.type)&&he().createElement(b_,{className:"ts-single",isActive:!0,title:(0,At.__)("Categories","templately")},he().createElement(sC,null)),"packs"!==(null==t?void 0:t.type)&&he().createElement(b_,{className:"ts-single",isActive:!0,title:(0,At.__)("Types","templately")},he().createElement(lC,null))),he().createElement(SC,{activeFreeControls:o,setActiveFreeControls:i,activeProControls:l,setActiveProControls:s}),he().createElement(cC,null),he().createElement("div",{className:"templately-sidebar-filter-buttons"},he().createElement(uC,null)))}),CC=function(){var e=ce(Ct(),1)[0];return Ug(e.get("path"))?"clouds/save-template"===e.get("path")?null:he().createElement("div",{className:"templately-sidebar templately-clouds-sidebar"},he().createElement(aC,null)):he().createElement("div",{className:"templately-sidebar templately-templates-sidebar"},he().createElement(_C,null))};var DC=["title","platform"],PC=function(e){var t=e.title,n=e.platform,r=Wn(e,DC);return he().createElement("div",{className:"templatey-cloud-header"},ku(n)?he().createElement("img",{src:ku(n),alt:t}):"",r.thumbnail&&he().createElement("img",{width:"50px",src:r.thumbnail,alt:t}),he().createElement("p",null,t))},AC=["menus","args","open","setWrapperClass"];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}function jC(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}var FC=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(),_l(jC(jC({showCloseButton:!0},y.sweetArgs),{},{html:he().createElement(Zu,y.modalArgs)}),!0)};else if(!u&&!1===b){var S=jC(jC({},i),{},{ModalComponent:p});O.onClick=function(e){void 0===v?(o(S,d),a(!1)):k(Yy(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)))}),MC=he().forwardRef(function(e,t){var n=e.menus,r=e.args,o=e.open,i=e.setWrapperClass,a=Wn(e,AC),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(FC,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(FC,re({isOpen:c,key:e.name},e,{args:r,redux:a}))})))))});MC.displayName="ContextMenu";const NC=gn(function(e){return{clouds:e.clouds,general:e.general,workspaces:e.workspaces,sharedWorkspaces:e.sharedWorkspaces,workspaceDetails:e.workspaceDetails}},null,null,{forwardRef:!0})(MC),IC=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($n,null)))});function RC(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 LC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RC(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const BC=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(Vv(LC(LC({},t),{},{context:"list"})))},resetSearch:function(t){return e(function(e){return _v({type:Uv(null==e?void 0:e.source).RESET_SEARCH},e)}(LC(LC({},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(Qv({list_only:!0})),0==r.length&&t(Qv({list_only:!0,shared:!0}))},[]),(0,pe.useEffect)(function(){var e=[];n.length&&e.push({label:(0,At.__)("My WorkSpace","templately"),options:Va(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Va(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=Yy(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)(Yy($y().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(kg,{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(ml,{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(){_l({customClass:{popup:"tp-large"},onConfirm:function(e){return Cl(y,e)},html:he().createElement(Pg,{slug:e.slug,id:e.id})},!0)},className:"templately-button tb-add"},he().createElement(or,null)),he().createElement(IC,{type:"workspaceDetails"})))});var zC=a(6614);zC.domToReact,zC.htmlToDOM,zC.attributesToProps,zC.Comment,zC.Element,zC.ProcessingInstruction,zC.Text;const WC=zC;var UC=["name","dispatch"];const VC=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,UC),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 WC((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?_l({dispatch:r,showCloseButton:!0,allowOutsideClick:!1,onConfirm:function(e){return Cl(i,e)},html:he().createElement(Ed,{dispatch:r})}):_l({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))))}),HC=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))))},GC=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 qC=["name","slug","addNew","sharedWith","view","shared"];function $C(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 QC=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,qC),rt()),u=En();if(r)return he().createElement(VC,{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?$C(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);delete r.key,u(ry(r)),c(Yy(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(NC,{ref:O,args:{content:e},setWrapperClass:g,menus:_u()}),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(GC,re({key:e.name.toLowerCase().replaceAll(" ","-")},e))}),!s&&he().createElement("button",{ref:S,onClick:function(){return Su({content:e,ModalComponent:jg})}},he().createElement(or,null)))))))};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 YC(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 KC=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(oy(t))},getWorkSpaceFiles:function(t){return e(ly(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(PC,{title:t.name,platform:e.platform})},[{id:"last_modified",data:t.last_modified},{id:"action",data:he().createElement(NC,{args:{content:YC(YC({},t),{},{slug:r,origin:"cloud"}),source:null!=e&&e.shared?"sharedWorkspace":"workspace"},menus:Ig(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(QC,re({shared:e.shared,view:!0,isSinglePage:!0},n)),he().createElement(BC,{id:null==n?void 0:n.id,slug:null==n?void 0:n.slug,shared:null==e?void 0:e.shared}),he().createElement(K_,{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(tC,null):he().createElement("div",{className:"templately-workspaces-files"},he().createElement(Zx,{view:e.view,head:he().createElement(t_,null)},he().createElement(r_,{view:e.view,data:c})),p>1&&he().createElement(X_,{slug:r,type:"workspaceDetails",total:p}))}})))});var ZC=["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:$r},e)}(t))},logout:function(t){return e(Ti(t))},linkAccount:function(){return e(ji({linking:!0}))}}})(function(e){var t=e.user,n=(e.isLoading,e.platform),r=Wn(e,ZC),o=rt();return(0,pe.useEffect)(function(){r.loadProfile()},[]),(0,pe.useEffect)(function(){r.isLoggedIn||o(Yy("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(In,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(qx,{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(fl,{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 JC=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Downloaded At",id:"downloaded_at"}]];const eD=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(ta(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(qx,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},he().createElement(PC,{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(Zx,{view:"list",head:he().createElement(t_,{columns:JC})},he().createElement(r_,{view:"list",data:n})),0===n.length&&!e.isLoading&&he().createElement(tC,{is_verified:e.is_verified})),e.totalPage>1&&he().createElement(X_,{states:["profile","downloads"],type:"downloads",total:e.totalPage}))});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){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(Wi(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,ka.isArray)(e.items)&&e.items.length>0,d=!(0,ka.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(zD,{items:e.items.map(function(e){return nD(nD({},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(tC,{is_verified:e.is_verified}))}),oD=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 iD(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 aD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var lD=[{name:"Name",id:"name"},[{name:"Type",id:"type"},{name:"Actions",id:"actions"},{name:"Purchasd Date",id:"downloaded_at"}]];const sD=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(Gi(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(qx,{className:"templately-downloaded-item",to:"".concat(e.platform,"/").concat(t.type,"s/").concat(t.slug)},he().createElement(PC,{title:t.name,thumbnail:t.thumbnail}))},[{id:"type",data:qa(t.type)},{id:"actions",data:he().createElement(he().Fragment,null,"pack"!=t.type&&he().createElement(fl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?vd({ModalComponent:ad,content:aD(aD({},t),{},{origin:"remote",id:t.item_id})}):o(Yy("sign-in"))},label:he().createElement(he().Fragment,null,he().createElement(Jn,null),(0,At.__)("Insert","templately"))}),"pack"==t.type&&he().createElement(qx,{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(Zx,{view:"list",head:he().createElement(t_,{columns:lD})},he().createElement(r_,{view:"list",data:n})),0===n.length&&!e.isLoading&&he().createElement(tC,{is_verified:e.is_verified})),e.totalPage>1&&he().createElement(X_,{states:["profile","purchasedItems"],type:"purchasedItems",total:e.totalPage}))}),cD=function(e){var t=[];return"clouds"===e.type&&t.push(he().createElement(dl,{key:"search"})),"favourites"===e.type&&t.push(he().createElement(oD,{key:"favourites"})),["favourites","purchasedItems","downloads","profile"].includes(e.type)||t.push(he().createElement(IC,{key:"view_buttons",type:e.type})),0==t.length?null:he().createElement("div",{className:"templately-cloud-actions tca-".concat(e.type)},t)};function uD(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?uD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const pD=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(Cv(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(PC,{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(fl,{className:"tb-import tb-import-secondary",onClick:function(){e.isLoggedIn?vd({ModalComponent:ad,content:dD(dD({},t),{},{origin:"cloud",my_cloud_id:t.id})}):o(Yy("sign-in"))},label:he().createElement(he().Fragment,null,he().createElement(Jn,null),(0,At.__)("Insert","templately"))}))},{id:"action",data:he().createElement(NC,{args:{content:dD(dD({},t),{},{my_cloud_id:t.id,origin:"cloud"})},menus:Ig(!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(Zx,{view:e.view,head:he().createElement(t_,null)},he().createElement(r_,{view:e.view,data:n})):he().createElement(tC,{is_verified:e.is_verified}),e.totalPage>1&&he().createElement(X_,{type:"clouds",total:e.totalPage,isSearch:i.has("q"),states:["clouds",i.has("q")?"search":"items",e.platform]}))}),fD=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(Qv(t))},pushToCloud:function(t){return e(Rv(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:Va(n)}),n.length&&e.push({label:(0,At.__)("Shared WorkSpace","templately"),options:Va(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,Ju.useSelect)(function(e){return e("core/editor")},[]),w=(0,Ju.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&&_l({icon:"error",html:he().createElement(Z_,{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&&_l({icon:"error",html:he().createElement(Z_,{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(kl,{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&&_l({icon:"success",timer:1500,html:he().createElement(Z_,{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&&_l({icon:"error",timer:1500,html:he().createElement(Z_,{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:Yy(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(ml,{placeholder:(0,At.__)("Type a name for the template...","templately"),value:i,onChange:function(e){return a(e.target.value)},wrapper:!1}),he().createElement(kg,{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(fl,{disabled:h,onClick:function(){return y(!0)},label:(0,At.__)("Save & Push","templately"),className:"templately-button tb-save-n-push"}))))}),hD=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($v(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(QC,{addNew:!0,name:(0,At.__)("Add New WorkSpace","templately")}),e.items.length>0?e.items.map(function(e){return he().createElement(QC,re({shared:t},e,{key:e.slug}))}):he().createElement(HC,{title:t?(0,At.__)("No shared workspaces yet.","templately"):(0,At.__)("You do not have any workspaces.","templately")})),e.totalPage>1&&he().createElement(X_,{type:e.shared?"sharedWorkspaces":"workspaces",total:e.totalPage}))}),mD=window.wp.element,gD=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"}))},vD=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"}))},yD=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"})))},bD=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 wD=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];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 kD(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}const OD=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,wD),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=kD(kD({},E),{},{placeholder:s})),null!=i&&(E=kD(kD({},E),{},{onBlur:i})),null!=r&&(E=kD(kD({},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(mD.RawHTML,null,null==m?void 0:m.errorMessage)))};var SD=["isLoading","setTab","getSignedIn"];function xD(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 _D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xD(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xD(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;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(ji(t))},getSignedIn:function(t){return e(function(e){return Pi({type:yr},e)}(t))},getSignedInFailed:function(t){return e(Mi(t))},errorCleanUp:function(t){return e(Ri(t))}}})(function(e){var t,n,r,o,i,a,l,s,c,u=e.isLoading,d=(e.setTab,e.getSignedIn),p=Wn(e,SD),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),j=T[0],F=T[1],M=ce((0,pe.useState)(null),2),N=M[0],I=M[1],R=ce((0,pe.useState)({}),2),L=R[0],B=R[1],z=function(e){var t=Za(e,j),n=t.isValid,r=t.title,o=t.content;B(_D(_D({},L),{},Pt({},e,{isValid:n,title:r,content:o}))),n||C(!0)};return(0,pe.useEffect)(function(){p.errorCleanUp(),I({}),null===v&&y(p.profileData)},[]),(0,pe.useEffect)(function(){if(O){var e,t,n=!(null===(e=null==L||null===(t=L.api_key)||void 0===t?void 0:t.isValid)||void 0===e||e)||void 0===(null==j?void 0:j.api_key)||""===(null==j?void 0:j.api_key);C(n)}else{var r=!1;["email","password"].map(function(e){var t,n;r||(r=void 0===(null==j?void 0:j[e])||""==(null==j?void 0:j[e])),r||(r=!(null===(t=null===(n=L[e])||void 0===n?void 0:n.isValid)||void 0===t||t))}),C(r)}N&&I(null)},[j,L]),(0,pe.useEffect)(function(){F(function(e){return _D(_D({},e),{},{viaAPI:O})})},[O]),(0,pe.useEffect)(function(){var e;P&&(E(!0),d(j),C(!0),A(!1),null!=m&&null!==(e=m.state)&&void 0!==e&&e.redirectTo&&f(Yy(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")&&!Na(null==m||null===(t=m.state)||void 0===t?void 0:t.is_logging_out)&&f(Yy(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)&&!Na(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(Yy(u,{platform:p.platform},["redirect-to"]))}Na(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),Na(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(_D({},t))}else"string"==typeof p.loggedInError.message&&I(p.loggedInError.message);else I({})},[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(OD,{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==L||null===(n=L.api_key)||void 0===n?void 0:n.isValid)||void 0===t||t),errorMessage:null===(r=L.api_key)||void 0===r?void 0:r.content},onBlur:function(){return z("api_key")},onChange:function(e){null==e||e.persist(),F(function(t){var n;return _D(_D({},t),{},{api_key:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}})):he().createElement(he().Fragment,null,he().createElement(OD,{type:"email",name:"email",key:"email",disabled:w,onBlur:function(){return z("email")},error:{hasError:!(null===(o=null==L||null===(i=L.email)||void 0===i?void 0:i.isValid)||void 0===o||o),errorMessage:null===(a=L.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(gD,null),onChange:function(e){null==e||e.persist(),F(function(t){var n;return _D(_D({},t),{},{email:null==e||null===(n=e.target)||void 0===n?void 0:n.value})})}}),he().createElement("div",{className:"tf-input-wrapper"},he().createElement(OD,{type:"password",name:"password",key:"password",disabled:w,label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),icon:he().createElement(vD,null),onBlur:function(){return B(_D(_D({},L),{},{password:{isValid:!0,title:"",content:""}}))},error:{hasError:!(null===(l=null==L||null===(s=L.password)||void 0===s?void 0:s.isValid)||void 0===l||l),errorMessage:null===(c=L.password)||void 0===c?void 0:c.content},typeChange:{type:"text",primaryText:he().createElement(bD,null),secondaryText:he().createElement(yD,null)},onChange:function(e){null==e||e.persist(),F(function(t){var n;return _D(_D({},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(mD.RawHTML,null,N)),!p.isGloballySigned&&he().createElement("div",{className:"tf-global_signin"},he().createElement(OD,{type:"checkbox",name:"global_signin",label:(0,At.__)("Global Sign In","templately"),disabled:w,onChange:function(e){null==e||e.persist(),F(function(t){var n;return _D(_D({},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(fl,{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")):"")}),DD=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 PD=["setTab","getSignedUp"];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 TD(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}const jD=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(Ri(t))}}})(function(e){e.setTab;var t,n,r,o,i,a,l,s,c,u,d,p,f=e.getSignedUp,h=Wn(e,PD),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"},j=(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]),F=function(e){var t=Za(e,O),n=t.isValid,r=t.title,o=t.content;A(function(t){return TD(TD({},t),{},Pt({},e,{isValid:n,title:r,content:o}))})};return(0,pe.useEffect)(function(){h.errorCleanUp(),C({})},[]),(0,pe.useEffect)(function(){h.isLoggedIn&&m(Yy([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&&Na(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);Ia(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}}}),Na(e)&&Object.keys(e).length>0&&A(TD({},e))}else C({})},[h.error]),he().createElement("div",{className:"tfu-signup tfu-content"},he().createElement("div",{className:"tfu-row tfu-cols-2"},he().createElement(OD,{name:"first_name",label:(0,At.__)("First Name","templately"),placeholder:(0,At.__)("First Name","templately"),onBlur:function(){return F("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(DD,null),onChange:function(e){return S(function(t){return TD(TD({},t),{},{first_name:e.target.value})})}}),he().createElement(OD,{name:"last_name",label:(0,At.__)("Last Name","templately"),placeholder:(0,At.__)("Last Name","templately"),onBlur:function(){return F("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(DD,null),onChange:function(e){return S(function(t){return TD(TD({},t),{},{last_name:e.target.value})})}}),he().createElement("div",{className:"tfu-error-wrapper"},!(null===(i=null==j?void 0:j.isValid)||void 0===i||i)&&j.content&&he().createElement("div",{className:"tf-error-message"},he().createElement(Bn,null),he().createElement(mD.RawHTML,null,j.content)))),he().createElement(OD,{type:"text",name:"email",label:(0,At.__)("Email Address","templately"),placeholder:(0,At.__)("Enter Your Email Address","templately"),onBlur:function(){return F("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(gD,null),onChange:function(e){return S(function(t){return TD(TD({},t),{},{email:e.target.value})})}}),he().createElement("div",{className:"tfu-row tfu-cols-2"},he().createElement(OD,{type:"password",name:"password",label:(0,At.__)("Password","templately"),placeholder:(0,At.__)("Password","templately"),onBlur:function(){F("password"),F("confirm_password")},error:{hasError:!(null===(c=null===(u=P.password)||void 0===u?void 0:u.isValid)||void 0===c||c)},icon:he().createElement(vD,null),onChange:function(e){return S(function(t){return TD(TD({},t),{},{password:e.target.value})})}}),he().createElement(OD,{type:"password",name:"confirm_password",label:(0,At.__)("Confirm Password","templately"),placeholder:(0,At.__)("Confirm Password","templately"),onBlur:function(){return F("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(vD,null),onChange:function(e){return S(function(t){return TD(TD({},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(mD.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(OD,{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 TD(TD({},t),{},{privacy_consent:e.target.checked})})}})),he().createElement("div",{className:"tfu-consent"},he().createElement(OD,{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 TD(TD({},t),{},{terms_consent:e.target.checked})})}}))),_&&"string"==typeof _&&he().createElement("div",{className:"tf-global-error-message"},he().createElement(Bn,null),he().createElement(mD.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"))))}),FD=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"}))},MD=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)"}))))},ND=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 ID(){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 RD(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]())):(RD(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,RD(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,RD(d,"constructor",c),RD(c,"constructor",s),s.displayName="GeneratorFunction",RD(c,o,"GeneratorFunction"),RD(d),RD(d,o,"Generator"),RD(d,r,function(){return this}),RD(d,"toString",function(){return"[object Generator]"}),(ID=function(){return{w:i,m:p}})()}function RD(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}RD=function(e,t,n,r){function i(t,n){RD(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))},RD(e,t,n,r)}const LD=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(ID().m(function e(){var t,n,r;return ID().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,ya({path:"/templately/v1/google-auth-url?redirect-to=".concat(encodeURIComponent(t),"¤t_url=").concat(encodeURIComponent(window.location.href)),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&&_l({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(MD,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(ND,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(FD,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(CD,{setTab:r}):React.createElement(jD,{setTab:r})))))))},BD=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}),zD=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(S_,{key:t.id,isLoggedIn:e.isLoggedIn,platform:e.platform,content:t})}):he().createElement(tC,null)),e.totalPage>1&&he().createElement(X_,re({type:e.type,total:e.totalPage},e.pagination)))};var WD=a(7918),UD=a.n(WD),VD=/[A-Z]/g,HD=/^ms-/,GD={};function qD(e){return"-"+e.toLowerCase()}const $D=function(e){if(GD.hasOwnProperty(e))return GD[e];var t=e.replace(VD,qD);return GD[e]=HD.test(t)?"-"+t:t};const QD=C_().oneOfType([C_().string,C_().number]),XD={all:C_().bool,grid:C_().bool,aural:C_().bool,braille:C_().bool,handheld:C_().bool,print:C_().bool,projection:C_().bool,screen:C_().bool,tty:C_().bool,tv:C_().bool,embossed:C_().bool},YD={orientation:C_().oneOf(["portrait","landscape"]),scan:C_().oneOf(["progressive","interlace"]),aspectRatio:C_().string,deviceAspectRatio:C_().string,height:QD,deviceHeight:QD,width:QD,deviceWidth:QD,color:C_().bool,colorIndex:C_().bool,monochrome:C_().bool,resolution:QD,type:Object.keys(XD)},{type:KD,...ZD}=YD,JD={minAspectRatio:C_().string,maxAspectRatio:C_().string,minDeviceAspectRatio:C_().string,maxDeviceAspectRatio:C_().string,minHeight:QD,maxHeight:QD,minDeviceHeight:QD,maxDeviceHeight:QD,minWidth:QD,maxWidth:QD,minDeviceWidth:QD,maxDeviceWidth:QD,minColor:C_().number,maxColor:C_().number,minColorIndex:C_().number,maxColorIndex:C_().number,minMonochrome:C_().number,maxMonochrome:C_().number,minResolution:QD,maxResolution:QD,...ZD};var eP={all:{...XD,...JD},types:XD,matchers:YD,features:JD};const tP=(0,pe.createContext)(void 0),nP=e=>{if(e)return Object.keys(e).reduce((t,n)=>(t[$D(n)]=e[n],t),{})},rP=()=>{const e=(0,pe.useRef)(!1);return(0,pe.useEffect)(()=>{e.current=!0},[]),e.current},oP=e=>{const t=()=>(e=>e.query||(e=>{const t=[];return Object.keys(eP.all).forEach(n=>{const r=e[n];null!=r&&t.push(((e,t)=>{const n=$D(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},iP=(e,t,n)=>{const r=(e=>{const t=(0,pe.useContext)(tP),n=()=>nP(e)||nP(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=oP(e);if(!o)throw new Error("Invalid or missing MediaQuery!");const i=((e,t)=>{const n=()=>UD()(e,t||{},!!t),[r,o]=(0,pe.useState)(n),i=rP();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=rP();return(0,pe.useEffect)(()=>{l&&n&&n(a)},[a]),(0,pe.useEffect)(()=>()=>{i&&i.dispose()},[]),a},aP=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"}))))},lP=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 sP=["fill"];const cP=function(e){var t=e.fill,n=void 0===t?"#949DA8":t;return Wn(e,sP),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"}))))},uP=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"})))},dP=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"}))},pP=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"})))},fP=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"})))},hP=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"})))},mP=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"}))))},gP=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 vP(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 yP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vP(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var bP=["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"],wP=["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"],EP=["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"],kP=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}},OP=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)})&&(!!EP.includes(t)||EP.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}},SP=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")}}},xP=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")}}},_P=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")}}},CP=null,DP=null,PP=null,AP=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return DP===t&&PP===n&&CP||(DP=t,PP=n,CP=[{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||(CP=CP.filter(function(e){return"language"!==e.key}))),CP},TP=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=TP);var jP=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(TP())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&&(TP()?(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)});jP.displayName="ConversationTypingEffect";const FP=jP;function MP(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 NP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MP(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var IP=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:Il(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(Il(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=Il(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 NP(NP({},e),{},{steps:e.steps.map(function(e,t){if(e.key===o.key){var n=NP(NP({},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?NP(NP({},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 Il(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 NP(NP({},e),{},{start:!1,complete:!1,errorMessage:null,steps:e.steps.map(function(e){return NP(NP({},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 NP(NP({},e),{},{start:!0,complete:!1,errorMessage:null,steps:e.steps.map(function(e,t){return NP(NP({},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 NP(NP({},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?NP(NP({},e),{},{status:"has-error",completedAt:void 0,activatedAt:void 0}):n===t+1?NP(NP({},e),{},{status:"waiting",completedAt:void 0,activatedAt:void 0}):e});return NP(NP({},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(gP,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://templately.com?support=open",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://templately.com?support=open",target:"_blank"},(0,At.__)("contact support.","templately")))}};IP.resetProgress=function(e){return e&&e()},IP.startProgress=function(e){return e&&e()},IP.completeProgress=function(e,t){return e&&e(t)},IP.setProgressError=function(e,t,n){return e&&e(t,n)};const RP=IP,LP=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"})))},BP=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"})))},zP=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,ka.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(BP,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(LP,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 WP(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function UP(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function VP(...e){return t=>{let n=!1;const r=e.map(e=>{const r=UP(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():UP(e[t],null)}}}}function HP(...e){return pe.useCallback(VP(...e),e)}"undefined"==typeof window||!window.document||window.document.createElement;const GP=window.ReactJSXRuntime;function qP(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,GP.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}\``)}]},$P(r,...t)]}function $P(...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 QP(e){const t=XP(e),n=pe.forwardRef((e,n)=>{const{children:r,...o}=e,i=pe.Children.toArray(r),a=i.find(KP);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,GP.jsx)(t,{...o,ref:n,children:pe.isValidElement(e)?pe.cloneElement(e,void 0,r):null})}return(0,GP.jsx)(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function XP(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?VP(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 YP=Symbol("radix.slottable");function KP(e){return pe.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===YP}var ZP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=QP(`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,GP.jsx)(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function JP(e){const t=pe.useRef(e);return pe.useEffect(()=>{t.current=e}),pe.useMemo(()=>(...e)=>t.current?.(...e),[])}var eA,tA="dismissableLayer.update",nA=pe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rA=pe.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...s}=e,c=pe.useContext(nA),[u,d]=pe.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=pe.useState({}),h=HP(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=JP(e),r=pe.useRef(!1),o=pe.useRef(()=>{});return pe.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){aA("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=JP(e),r=pe.useRef(!1);return pe.useEffect(()=>{const e=e=>{e.target&&!r.current&&aA("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=JP(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&&(eA=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),iA(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=eA)}},[u,p,n,c]),pe.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),iA())},[u,c]),pe.useEffect(()=>{const e=()=>f({});return document.addEventListener(tA,e),()=>document.removeEventListener(tA,e)},[]),(0,GP.jsx)(ZP.div,{...s,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:WP(e.onFocusCapture,k.onFocusCapture),onBlurCapture:WP(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:WP(e.onPointerDownCapture,E.onPointerDownCapture)})});rA.displayName="DismissableLayer";var oA=pe.forwardRef((e,t)=>{const n=pe.useContext(nA),r=pe.useRef(null),o=HP(t,r);return pe.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,GP.jsx)(ZP.div,{...e,ref:o})});function iA(){const e=new CustomEvent(tA);document.dispatchEvent(e)}function aA(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)}oA.displayName="DismissableLayerBranch";var lA=0;function sA(){pe.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cA()),document.body.insertAdjacentElement("beforeend",e[1]??cA()),lA++,()=>{1===lA&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),lA--}},[])}function cA(){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 uA="focusScope.autoFocusOnMount",dA="focusScope.autoFocusOnUnmount",pA={bubbles:!1,cancelable:!0},fA=pe.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=pe.useState(null),c=JP(o),u=JP(i),d=pe.useRef(null),p=HP(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:vA(d.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||vA(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vA(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){yA.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(uA,pA);l.addEventListener(uA,c),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vA(r,{select:t}),document.activeElement!==n)return}(hA(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&vA(l))}return()=>{l.removeEventListener(uA,c),setTimeout(()=>{const t=new CustomEvent(dA,pA);l.addEventListener(dA,u),l.dispatchEvent(t),t.defaultPrevented||vA(e??document.body,{select:!0}),l.removeEventListener(dA,u),yA.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=hA(e);return[mA(t,e),mA(t.reverse(),e)]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&vA(i,{select:!0})):(e.preventDefault(),n&&vA(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,f.paused]);return(0,GP.jsx)(ZP.div,{tabIndex:-1,...a,ref:p,onKeyDown:h})});function hA(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 mA(e,t){for(const n of e)if(!gA(n,{upTo:t}))return n}function gA(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 vA(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()}}fA.displayName="FocusScope";var yA=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=bA(e,t),e.unshift(t)},remove(t){e=bA(e,t),e[0]?.resume()}}}();function bA(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wA=globalThis?.document?pe.useLayoutEffect:()=>{},EA=fe[" useId ".trim().toString()]||(()=>{}),kA=0;function OA(e){const[t,n]=pe.useState(EA());return wA(()=>{e||n(e=>e??String(kA++))},[e]),e||(t?`radix-${t}`:"")}var SA="undefined"!=typeof document?pe.useLayoutEffect:function(){};function xA(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(!xA(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||xA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function _A(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CA(e,t){const n=_A(e);return Math.round(t*n)/n}function DA(e){const t=pe.useRef(e);return SA(()=>{t.current=e}),t}const PA=(e,t)=>{const n=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=yf(n),l=bf(n),s="y"===kf(n),c=If.has(a)?-1:1,u=i&&s?-1:1,d=vf(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}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},AA=(e,t)=>{const n=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}=vf(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=kf(yf(o)),f=wf(p);let h=u[f],m=u[p];if(a){const e="y"===f?"bottom":"right";h=gf(h+d["y"===f?"top":"left"],h,h-d[e])}if(l){const e="y"===p?"bottom":"right";m=gf(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}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},TA=(e,t)=>({fn:_h(e).fn,options:[e,t]}),jA=(e,t)=>{const n=Sh(e);return{name:n.name,fn:n.fn,options:[e,t]}},FA=(e,t)=>{const n=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}=vf(e,t),u=await a.detectOverflow(t,c),d=yf(o),p=bf(o),f="y"===kf(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=uf(m-u[g],y),E=uf(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=df(u.left,0),t=df(u.right,0),n=df(u.top,0),r=df(u.bottom,0);f?S=h-2*(0!==e||0!==t?e+t:df(u.left,u.right)):O=m-2*(0!==n||0!==r?n+r:df(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}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},MA=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=vf(e,t);switch(o){case"referenceHidden":{const e=Mf(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Nf(e)}}}case"escaped":{const e=Mf(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Nf(e)}}}default:return{}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},NA=(e,t)=>{const n=(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?xh({element:n.current,padding:r}).fn(t):{}:n?xh({element:n,padding:r}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var IA=pe.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return(0,GP.jsx)(ZP.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,GP.jsx)("polygon",{points:"0,0 30,0 15,10"})})});IA.displayName="Arrow";var RA=IA,LA="Popper",[BA,zA]=qP(LA),[WA,UA]=BA(LA),VA=e=>{const{__scopePopper:t,children:n}=e,[r,o]=pe.useState(null);return(0,GP.jsx)(WA,{scope:t,anchor:r,onAnchorChange:o,children:n})};VA.displayName=LA;var HA="PopperAnchor",GA=pe.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=UA(HA,n),a=pe.useRef(null),l=HP(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,GP.jsx)(ZP.div,{...o,ref:l})});GA.displayName=HA;var qA="PopperContent",[$A,QA]=BA(qA),XA=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=UA(qA,n),[v,y]=pe.useState(null),b=HP(t,e=>y(e)),[w,E]=pe.useState(null),k=function(e){const[t,n]=pe.useState(void 0);return wA(()=>{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(JA),altBoundary:D},{refs:A,floatingStyles:T,placement:j,isPositioned:F,middlewareData:M}=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);xA(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,_=DA(s),C=DA(o),D=DA(c),P=pe.useCallback(()=>{if(!k.current||!O.current)return;const e={placement:t,strategy:n,middleware:p};C.current&&(e.platform=C.current),Ch(k.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};A.current&&!xA(S.current,t)&&(S.current=t,oe.flushSync(()=>{d(t)}))})},[p,t,n,C,D]);SA(()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);const A=pe.useRef(!1);SA(()=>(A.current=!0,()=>{A.current=!1}),[]),SA(()=>{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]),j=pe.useMemo(()=>({reference:w,floating:E}),[w,E]),F=pe.useMemo(()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=CA(j.floating,u.x),r=CA(j.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",..._A(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,j.floating,u.x,u.y]);return pe.useMemo(()=>({...u,update:P,refs:T,elements:j,floatingStyles:F}),[u,P,T,j,F])}({strategy:"fixed",placement:x,whileElementsMounted:(...e)=>Oh(...e,{animationFrame:"always"===f}),elements:{reference:g.anchor},middleware:[PA({mainAxis:o+S,alignmentAxis:a}),s&&AA({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?TA():void 0,...P}),s&&jA({...P}),FA({...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&&NA({element:w,padding:l}),eT({arrowWidth:O,arrowHeight:S}),p&&MA({strategy:"referenceHidden",...P})]}),[N,I]=tT(j),R=JP(h);wA(()=>{F&&R?.()},[F,R]);const L=M.arrow?.x,B=M.arrow?.y,z=0!==M.arrow?.centerOffset,[W,U]=pe.useState();return wA(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]),(0,GP.jsx)("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:F?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,GP.jsx)($A,{scope:n,placedSide:N,onArrowChange:E,arrowX:L,arrowY:B,shouldHideArrow:z,children:(0,GP.jsx)(ZP.div,{"data-side":N,"data-align":I,...m,ref:b,style:{...m.style,animation:F?void 0:"none"}})})})});XA.displayName=qA;var YA="PopperArrow",KA={top:"bottom",right:"left",bottom:"top",left:"right"},ZA=pe.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=QA(YA,n),i=KA[o.placedSide];return(0,GP.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,GP.jsx)(RA,{...r,ref:t,style:{...r.style,display:"block"}})})});function JA(e){return null!==e}ZA.displayName=YA;var eT=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]=tT(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 tT(e){const[t,n="center"]=e.split("-");return[t,n]}var nT=VA,rT=GA,oT=XA,iT=ZA,aT=pe.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=pe.useState(!1);wA(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?oe.createPortal((0,GP.jsx)(ZP.div,{...r,ref:t}),a):null});aT.displayName="Portal";var lT=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=sT(r.current);i.current="mounted"===l?e:"none"},[l]),wA(()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=sT(t);s(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&r!==a?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,s]),wA(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=sT(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=sT(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=HP(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 sT(e){return e?.animationName||"none"}lT.displayName="Presence";var cT=fe[" useInsertionEffect ".trim().toString()]||wA;function uT({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 cT(()=>{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 dT=new WeakMap,pT=new WeakMap,fT={},hT=0,mT=function(e){return e&&(e.host||mT(e.parentNode))},gT=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=mT(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]);fT[n]||(fT[n]=new WeakMap);var i=fT[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=(dT.get(e)||0)+1,c=(i.get(e)||0)+1;dT.set(e,s),i.set(e,c),a.push(e),1===s&&o&&pT.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(),hT++,function(){a.forEach(function(e){var t=dT.get(e)-1,o=i.get(e)-1;dT.set(e,t),i.set(e,o),t||(pT.has(e)||e.removeAttribute(r),pT.delete(e)),o||e.removeAttribute(n)}),--hT||(dT=new WeakMap,dT=new WeakMap,pT=new WeakMap,fT={})}}(r,o,n,"aria-hidden")):function(){return null}},vT=a(1635),yT="right-scroll-bar-position",bT="width-before-scroll-bar";function wT(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ET="undefined"!=typeof window?pe.useLayoutEffect:pe.useEffect,kT=new WeakMap;function OT(e){return e}var ST=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=OT);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,vT.__assign)({async:!0,ssr:!1},e),t}(),xT=function(){},_T=pe.forwardRef(function(e,t){var n,r,o,i=pe.useRef(null),a=pe.useState({onScrollCapture:xT,onWheelCapture:xT,onTouchMoveCapture:xT}),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,vT.__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 wT(t,e)})}),ET(function(){var e=kT.get(o);if(e){var t=new Set(e),r=new Set(n),i=o.current;t.forEach(function(e){r.has(e)||wT(e,null)}),r.forEach(function(e){t.has(e)||wT(e,i)})}kT.set(o,n)},[n]),o),_=(0,vT.__assign)((0,vT.__assign)({},O),l);return pe.createElement(pe.Fragment,null,f&&pe.createElement(S,{sideCar:ST,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,vT.__assign)((0,vT.__assign)({},_),{ref:x})):pe.createElement(E,(0,vT.__assign)({},_,{className:d,ref:x}),u))});_T.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_T.classNames={fullWidth:bT,zeroRight:yT};var CT=function(e){var t=e.sideCar,n=(0,vT.__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,vT.__assign)({},n))};CT.isSideCarExport=!0;var DT=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)}}},PT=function(){var e,t=(e=DT(),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}},AT={left:0,top:0,right:0,gap:0},TT=function(e){return parseInt(e||"",10)||0},jT=PT(),FT="data-scroll-locked",MT=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(FT,"] {\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(yT," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(bT," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(yT," .").concat(yT," {\n right: 0 ").concat(r,";\n }\n \n .").concat(bT," .").concat(bT," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(FT,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},NT=function(){var e=parseInt(document.body.getAttribute(FT)||"0",10);return isFinite(e)?e:0},IT=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(FT,(NT()+1).toString()),function(){var e=NT()-1;e<=0?document.body.removeAttribute(FT):document.body.setAttribute(FT,e.toString())}},[]);var i=pe.useMemo(function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return AT;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[TT(n),TT(r),TT(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(jT,{styles:MT(i,!t,o,n?"":"!important")})},RT=!1;if("undefined"!=typeof window)try{var LT=Object.defineProperty({},"passive",{get:function(){return RT=!0,!0}});window.addEventListener("test",LT,LT),window.removeEventListener("test",LT,LT)}catch(e){RT=!1}var BT=!!RT&&{passive:!1},zT=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])},WT=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),UT(e,r)){var o=VT(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UT=function(e,t){return"v"===e?function(e){return zT(e,"overflowY")}(t):function(e){return zT(e,"overflowX")}(t)},VT=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)},HT=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GT=function(e){return[e.deltaX,e.deltaY]},qT=function(e){return e&&"current"in e?e.current:e},$T=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},QT=0,XT=[];function YT(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const KT=(ZT=function(e){var t=pe.useRef([]),n=pe.useRef([0,0]),r=pe.useRef(),o=pe.useState(QT++)[0],i=pe.useState(PT)[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,vT.__spreadArray)([e.lockRef.current],(e.shards||[]).map(qT),!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=HT(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=WT(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=WT(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=VT(e,a),f=p[0],h=p[1]-p[2]-o*f;(f||h)&&UT(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(XT.length&&XT[XT.length-1]===i){var r="deltaY"in n?GT(n):HT(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(qT).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:YT(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=HT(e),r.current=void 0},[]),d=pe.useCallback(function(t){c(t.type,GT(t),t.target,l(t,e.lockRef.current))},[]),p=pe.useCallback(function(t){c(t.type,HT(t),t.target,l(t,e.lockRef.current))},[]);pe.useEffect(function(){return XT.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",s,BT),document.addEventListener("touchmove",s,BT),document.addEventListener("touchstart",u,BT),function(){XT=XT.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,BT),document.removeEventListener("touchmove",s,BT),document.removeEventListener("touchstart",u,BT)}},[]);var f=e.removeScrollBar,h=e.inert;return pe.createElement(pe.Fragment,null,h?pe.createElement(i,{styles:$T(o)}):null,f?pe.createElement(IT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ST.useMedium(ZT),CT);var ZT,JT=pe.forwardRef(function(e,t){return pe.createElement(_T,(0,vT.__assign)({},e,{ref:t,sideCar:KT}))});JT.classNames=_T.classNames;const ej=JT;var tj="Popover",[nj,rj]=qP(tj,[zA]),oj=zA(),[ij,aj]=nj(tj),lj=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=oj(t),s=pe.useRef(null),[c,u]=pe.useState(!1),[d,p]=uT({prop:r,defaultProp:o??!1,onChange:i,caller:tj});return(0,GP.jsx)(nT,{...l,children:(0,GP.jsx)(ij,{scope:t,contentId:OA(),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})})};lj.displayName=tj;var sj="PopoverAnchor";pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=aj(sj,n),i=oj(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=o;return pe.useEffect(()=>(a(),()=>l()),[a,l]),(0,GP.jsx)(rT,{...i,...r,ref:t})}).displayName=sj;var cj="PopoverTrigger",uj=pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=aj(cj,n),i=oj(n),a=HP(t,o.triggerRef),l=(0,GP.jsx)(ZP.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":kj(o.open),...r,ref:a,onClick:WP(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,GP.jsx)(rT,{asChild:!0,...i,children:l})});uj.displayName=cj;var dj="PopoverPortal",[pj,fj]=nj(dj,{forceMount:void 0}),hj=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=aj(dj,t);return(0,GP.jsx)(pj,{scope:t,forceMount:n,children:(0,GP.jsx)(lT,{present:n||i.open,children:(0,GP.jsx)(aT,{asChild:!0,container:o,children:r})})})};hj.displayName=dj;var mj="PopoverContent",gj=pe.forwardRef((e,t)=>{const n=fj(mj,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=aj(mj,e.__scopePopover);return(0,GP.jsx)(lT,{present:r||i.open,children:i.modal?(0,GP.jsx)(yj,{...o,ref:t}):(0,GP.jsx)(bj,{...o,ref:t})})});gj.displayName=mj;var vj=QP("PopoverContent.RemoveScroll"),yj=pe.forwardRef((e,t)=>{const n=aj(mj,e.__scopePopover),r=pe.useRef(null),o=HP(t,r),i=pe.useRef(!1);return pe.useEffect(()=>{const e=r.current;if(e)return gT(e)},[]),(0,GP.jsx)(ej,{as:vj,allowPinchZoom:!0,children:(0,GP.jsx)(wj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:WP(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:WP(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:WP(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),bj=pe.forwardRef((e,t)=>{const n=aj(mj,e.__scopePopover),r=pe.useRef(!1),o=pe.useRef(!1);return(0,GP.jsx)(wj,{...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()}})}),wj=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=aj(mj,n),f=oj(n);return sA(),(0,GP.jsx)(fA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,GP.jsx)(rA,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:(0,GP.jsx)(oT,{"data-state":kj(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)"}})})})}),Ej="PopoverClose";function kj(e){return e?"open":"closed"}pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=aj(Ej,n);return(0,GP.jsx)(ZP.button,{type:"button",...r,ref:t,onClick:WP(e.onClick,()=>o.onOpenChange(!1))})}).displayName=Ej,pe.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=oj(n);return(0,GP.jsx)(iT,{...o,...r,ref:t})}).displayName="PopoverArrow";var Oj=lj,Sj=uj,xj=hj,_j=gj;const Cj=function(e){var t=e.open,n=e.onOpenChange,r=e.children,o=e.content;return React.createElement(Oj,{open:t,onOpenChange:n},React.createElement(Sj,{asChild:!0},r),React.createElement(xj,null,React.createElement(_j,{className:"templately-fsi-ai-sidebar-conversation-categories-panel",sideOffset:12,side:"top",align:"end"},o)))},Dj=function(e){var t=e.open,n=e.onOpenChange,r=e.children,o=e.content;return React.createElement(Oj,{open:t,onOpenChange:n},React.createElement(Sj,{asChild:!0},r),React.createElement(xj,null,React.createElement(_j,{className:"templately-fsi-ai-sidebar-conversation-languages-panel",sideOffset:12,side:"top",align:"end"},o)))};function Pj(){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 Aj(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]())):(Aj(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,Aj(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Aj(d,"constructor",c),Aj(c,"constructor",s),s.displayName="GeneratorFunction",Aj(c,o,"GeneratorFunction"),Aj(d),Aj(d,o,"Generator"),Aj(d,r,function(){return this}),Aj(d,"toString",function(){return"[object Generator]"}),(Pj=function(){return{w:i,m:p}})()}function Aj(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Aj=function(e,t,n,r){function i(t,n){Aj(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))},Aj(e,t,n,r)}function Tj(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 jj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fj=function(){return Dd(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_d(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=jj(jj({},this.data),v)),Xa("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}}])}(),Mj=function(){var e=hi(Pj().m(function e(t,n,r){var o,i,a,l,s,c,u,d,p,f;return Pj().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,Ea(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,jj({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)}}(),Nj=function(){var e=hi(Pj().m(function e(t,n){var r,o,i;return Pj().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,ka.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,ma("/templately/v1/ai-content/modify-content/",jj(jj({},t),{},{content_ids:o,preview_pages:t.preview_pages||[]}),{signal:n},!0);case 5:if(i=e.v,Xa(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)}}(),Ij=function(){var e=hi(Pj().m(function e(t){var n,r,o,i,a,l,s=arguments;return Pj().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 Xa("Fetching attachments data from API...",{packId:t,type:n}),o={type:n,pack_id:t},e.n=3,ha("/templately/v1/ai-content/attachments",o,{signal:r});case 3:if(i=e.v,Xa("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 Xa("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)}}(),Rj=function(){var e=hi(Pj().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,j,F,M,N,I=arguments;return Pj().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=I.length>2&&void 0!==I[2]?I[2]:null,r=new Fj(I.length>1&&void 0!==I[1]?I[1]:{}),o=new AbortController,i=setTimeout(function(){o.abort("Workflow timeout")},zj.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||vO(),l=jj(jj({},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([Mj(l,t.pack_id,s[0].signal).then(function(e){return r.setState("session_created",e),{success:!0,data:e}}),Nj(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,Ea(S,x);case 9:e.n=11;break;case 10:e.p=10,F=e.v,Xa("Failed to update session data with process_id:",F);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 Xa("Error showing confirmation dialog:",t),void(e&&(document.removeEventListener("visibilitychange",e),e=null))}},zj.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=Wj(E.session_id,k.process_id,a,[],function(){},function(t){clearTimeout(o),Xa("Workflow polling completed successfully"),e(t)},function(e){clearTimeout(o),Xa("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,M=e.v,new Error(M.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 Xa("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 Xa("AI Content Workflow was cancelled"),(j=new Error((0,At.__)("AI content workflow was cancelled","templately"))).cause="cancelled",r.setState("error",j),j;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)}}(),Lj=1e4,Bj=2e4,zj={OVERALL_TIMEOUT:3e5,POLLING_TIMEOUT:3e5,PARALLEL_OPERATIONS_TIMEOUT:12e4},Wj=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,ka.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?Bj: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 Xa("calculateNextInterval: local site, returning ".concat(Bj,"ms")),Bj;var e=2*(Math.random()-.5)*.05,t=Math.min(u*(1+e),Lj);u=Math.min(1.2*u,Lj);var n=Math.max(Math.round(t),5e3);return Xa("calculateNextInterval: currentInterval=".concat(u,", jitter=").concat(e.toFixed(3),", interval=").concat(t.toFixed(0),", final=").concat(n,"ms")),n},w=function(){var r=hi(Pj().m(function r(){var E,k,O,S,x,_,C,D,P,A,T,j,F,M,N,I,R;return Pj().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 Xa("Starting poll attempt ".concat(d)),r.p=3,O=Date.now(),S=Date.now()-c,Xa("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,ma(_,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=jj({},D.data.templates),Object.assign(f,T),v=g.filter(function(e){return!f[e]}),Xa("missing pages: ".concat(v.length," of ").concat(g.length)),Xa("receivedData",f),Object.keys(f).forEach(function(e){(0,ka.isEmpty)(f[e])&&delete f[e]}),null==o||o(f,v),j=null===(A=D.data)||void 0===A?void 0:A.is_last_part,!s||!j){r.n=6;break}if(y.cleanup(),F=Date.now()-c,Xa("AI polling completed (is_last_part=true) after ".concat(d," attempts in ").concat(m(F))),!(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(),M=Date.now()-c,Xa("AI polling completed after ".concat(d," attempts in ").concat(m(M))),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,Lj)),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"===(R=r.v).name||null!=l&&l.aborted)){r.n=11;break}return Xa("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,Xa("AI polling attempt ".concat(d," failed after ").concat(m(N),":"),R.message),!s&&R.status>=500&&(u=Math.min(2*u,Lj));case 12:h=!1,!y.isActive||null!=l&&l.aborted?Xa("Polling stopped: active=".concat(y.isActive,", aborted=").concat(null==l?void 0:l.aborted)):(I=b(),Xa("Scheduling next poll in ".concat(I,"ms (attempt ").concat(d+1,")")),p=setTimeout(w,I));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},Uj=function(e){return function(e){var t={};return e&&(0,ka.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 Vj(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?Vj(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Gj=window.wp.mediaUtils,qj=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"}))))},$j=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"}))))},Qj=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"}))))},Xj=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"}))))},Yj=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"}))))},Kj=a.p+"images/image-placeholder.png",Zj=a.p+"images/arrow-no-selected-image.png",Jj=a.p+"images/ai-generated-image-placeholder.png";var eF=he().memo(function(e){var t=e.children,n=e.content,r=e.disabled;return void 0!==r&&r?t:he().createElement(Oj,null,he().createElement(Sj,{asChild:!0},t),he().createElement(xj,null,he().createElement(_j,{className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-ratio-popover",sideOffset:3,align:"end"},n)))});const tF=eF;var nF={low:0,max:0,high:0,C:2,P:void 0,R:void 0,L:void 0,list:void 0};function rF(e){var t=e.high;e.L===nF&&e.R===nF?e.max=t:e.L===nF?e.max=Math.max(e.R.max,t):e.R===nF?e.max=Math.max(e.L.max,t):e.max=Math.max(Math.max(e.L.max,e.R.max),t)}function oF(e){for(var t=e;t.P!==nF;)rF(t.P),t=t.P}function iF(e,t){if(t.R!==nF){var n=t.R;t.R=n.L,n.L!==nF&&(n.L.P=t),n.P=t.P,t.P===nF?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.L=t,t.P=n,rF(t),rF(n)}}function aF(e,t){if(t.L!==nF){var n=t.L;t.L=n.R,n.R!==nF&&(n.R.P=t),n.P=t.P,t.P===nF?e.root=n:t===t.P.R?t.P.R=n:t.P.L=n,n.R=t,t.P=n,rF(t),rF(n)}}function lF(e,t,n){t.P===nF?e.root=n:t===t.P.L?t.P.L=n:t.P.R=n,n.P=t.P}nF.P=nF,nF.L=nF,nF.R=nF;const sF=e=>{const t=pe.useRef(e);return pe.useEffect(()=>{t.current=e}),t},cF=(e,t=100,n=!1)=>{const r=sF(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)},uF=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])},dF={},pF="undefined"==typeof window?null:window,fF=pF&&void 0!==pF.visualViewport?pF.visualViewport:null,hF=()=>[document.documentElement.clientWidth,document.documentElement.clientHeight],mF=(e,t)=>{const n=t||gF;let r,o;return function(){return r&&n(arguments,r)?o:o=e.apply(null,r=arguments)}},gF=(e,t)=>e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3],vF=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}}},yF=e=>{try{return new e}catch(e){const t={};return{set(e,n){t[e]=n},get:e=>t[e]}}},bF=(e,t)=>{let n;const{g:r,s:o}=(e=>{const t=e.length,n=yF(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=yF(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=yF(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 wF=new WeakMap;function EF(){var e=pe.useState(kF)[1];return pe.useRef(function(){return e({})}).current}var kF={},OF="0",SF=bF([vF,{},WeakMap,vF],function(e,t,n,r){return pe.createElement(e,{index:t,data:n,width:r})}),xF=mF(function(e){return{position:"relative",width:"100%",maxWidth:"100%",height:Math.ceil(e),maxHeight:Math.ceil(e)}}),_F=function(e,t){return e[0]===t[0]&&e[1]===t[1]},CF=mF(function(e,t){return Object.assign({},e,t)},_F);function DF(e,t){return t}var PF=mF(function(e){return{width:e,zIndex:-1e3,visibility:"hidden",position:"absolute",writingMode:"horizontal-tb"}},function(e,t){return e[0]===t[0]}),AF=mF(function(e,t){return function(n){return function(r){null!==r&&(t&&(t.observe(r),wF.set(r,n)),void 0===e.get(n)&&e.set(n,r.offsetHeight))}}},_F);let TF="undefined",jF=typeof window!==TF?window:{},FF=typeof performance!==TF?performance:Date,MF=()=>FF.now(),NF="AnimationFrame",IF="cancel"+NF,RF="request"+NF,LF=jF[RF]&&jF[RF].bind(jF),BF=jF[IF]&&jF[IF].bind(jF);if(!LF||!BF){let e=0;LF=t=>{let n=MF(),r=Math.max(e+1e3/60,n);return setTimeout(()=>{t(e=r)},r-n)},BF=function(e){return clearTimeout(e)}}const zF="undefined"!=typeof performance?performance:Date;function WF(e,t=30,n=!1){const r=sF(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=zF.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 UF="undefined"==typeof window?null:window,VF=()=>void 0!==UF.scrollY?UF.scrollY:void 0===UF.pageYOffset?0:UF.pageYOffset;function HF(){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],WF(n[1],t,!0)]}("undefined"==typeof window?0:VF,e);return uF(UF,"scroll",()=>t[1](VF())),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=MF(),r={},o=()=>{MF()-n>=t?e.call(null):r.v=LF(o)};return r.v=LF(o),r})(function(){e||c(!1)},40+1e3/t);return u.current=1,function(){e=!0,BF(n.v||-1)}},[t,p]),{scrollTop:Math.max(0,p-e),isScrolling:s}}function GF(e){var t=HF(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?DF: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=EF(),A=AF(n,r),T=o.length,j=n.columnWidth,F=n.estimateHeight,M=[],N="list"===d?"listitem":"grid"===d?"gridcell":void 0,I=sF(D),R=0,L=S*_,B=Math.max(0,k-L/2),z=k+S+L;n.range(B,z,function(e){void 0===t?(R=e,t=e):(R=Math.min(R,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:j,writingMode:"horizontal-tb",position:"absolute"};M.push(pe.createElement(g,{key:V,ref:A(W),role:N,style:"object"===ne(v)&&null!==v?Object.assign({},G,v):G},SF(C,W,U,j)))}else{var q=PF(j);M.push(pe.createElement(g,{key:V,ref:A(W),role:N,style:"object"===ne(v)?Object.assign({},q,v):q},SF(C,W,U,j)))}}pe.useEffect(function(){"function"==typeof I.current&&void 0!==t&&I.current(R,t,o),OF="1"},[R,t,o,I]),pe.useEffect(function(){P()},[n]);var $=xF(F(T,b));return pe.createElement(a,{ref:h,key:OF,id:l,role:d,className:s,tabIndex:f,style:"object"===ne(c)?CF($,c):$,children:M})}({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 qF=he()["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"];var $F=[],QF=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:nF,size:0},t={};return{insert:function(n,r,o){for(var i=e.root,a=nF;i!==nF&&n!==(a=i).low;)i=n<i.low?i.L:i.R;if(n===a.low&&a!==nF){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),rF(a),oF(a),t[o]=a,void e.size++}var l={low:n,high:r,max:r,C:0,P:a,L:nF,R:nF,list:{index:o,high:r,next:null}};a===nF?e.root=l:(l.low<a.low?a.L=l:a.R=l,oF(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&&iF(e,t=t.P),t.P.C=1,t.P.P.C=0,aF(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&&aF(e,t=t.P),t.P.C=1,t.P.P.C=0,iF(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,rF(r),oF(r),void e.size--;var i,a=r,l=a.C;r.L===nF?(i=r.R,lF(e,r,r.R)):r.R===nF?(i=r.L,lF(e,r,r.L)):(a=function(e){for(;e.L!==nF;)e=e.L;return e}(r.R),l=a.C,i=a.R,a.P===r?i.P=a:(lF(e,a,a.R),a.R=r.R,a.R.P=a),lF(e,r,a),a.L=r.L,a.L.P=a,a.C=r.C),rF(i),oF(i),1===l&&function(e,t){for(var n;t!==nF&&1===t.C;)t===t.P.L?(0===(n=t.P.R).C&&(n.C=1,t.P.C=0,iF(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,aF(e,n),n=t.P.R),n.C=t.P.C,t.P.C=1,n.R.C=1,iF(e,t.P),t=e.root)):(0===(n=t.P.L).C&&(n.C=1,t.P.C=0,aF(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,iF(e,n),n=t.P.L),n.C=t.P.C,t.P.C=1,n.L.C=1,aF(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===nF||t>i.max)&&(i.L!==nF&&o.push(i.L),i.R!==nF&&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=XF(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}}},XF=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},YF=[];const KF=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};KF(function(e){});var ZF=bF([WeakMap],function(e,t){var n=[],r=KF(function(){n.length>0&&(e.update(n),t(n)),n.length=0}),o=function(t){var o=t.offsetHeight;if(o>0){var i=wF.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=wF.get(n.target);if(void 0!==r){var a=i.get(r);a||(a=KF(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}),JF={index:void 0,position:void 0,prevTop:void 0};function eM(e){var t,n,r,o=pe.useRef(null),i=e.containerRef||o,a=function(e){void 0===e&&(e=dF);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],cF(r[1],t,n)]})("undefined"==typeof document?[r,o]:hF,t,n),l=()=>a(hF);return uF(pF,"resize",l),uF(fF,"resize",l),uF(pF,"orientationchange",l),i}({initialWidth:e.ssrWidth,initialHeight:e.ssrHeight}),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$F,n=ce(pe.useState({offset:0,width:0}),2),r=n[0],o=n[1];return qF(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]:YF,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 QF(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=EF(),r=ZF(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=sF({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 JF;return r},JF),2),m=h[0],g=h[1],v=WF(g,15),y=f();uF(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(GF,s)}var tM=function(e,t){return void 0!==t[e]},nM={};const rM=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"}))},oM=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"}))))},iM=function(e){var t=e.isOpen,n=e.image,r=e.setIsOpen;return he().createElement(he().Fragment,null,t?he().createElement($_,{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 aM(){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 lM(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]())):(lM(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,lM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,lM(d,"constructor",c),lM(c,"constructor",s),s.displayName="GeneratorFunction",lM(c,o,"GeneratorFunction"),lM(d),lM(d,o,"Generator"),lM(d,r,function(){return this}),lM(d,"toString",function(){return"[object Generator]"}),(aM=function(){return{w:i,m:p}})()}function lM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}lM=function(e,t,n,r){function i(t,n){lM(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))},lM(e,t,n,r)}const sM=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(rM,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(oM,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,ka.debounce)(function(){var e=hi(aM().m(function e(t,r,o){var c;return aM().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]:nM,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=sF(e),u=sF(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]:tM,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(eM,{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(iM,{isOpen:d,image:h,setIsOpen:p}))},cM=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 uM=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(rM,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(cM,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(oM,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(eM,{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(iM,{isOpen:p,image:m,setIsOpen:f}))});const dM=uM;var pM=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,j=[{label:(0,At.__)("All","templately"),value:"all"},{label:(0,At.__)("Landscape","templately"),value:"landscape",icon:he().createElement(Qj,null)},{label:(0,At.__)("Portrait","templately"),value:"portrait",icon:he().createElement(Xj,null)},{label:(0,At.__)("Square","templately"),value:"square",icon:he().createElement(Yj,null)}];(0,pe.useEffect)(function(){return s&&s(),function(){c&&c()}},[s,c]);var F=function(){d.length?o(d):(o([]),h(!1)),i(!1)},M=(0,pe.useCallback)(function(){try{return he().createElement(he().Fragment,null,j.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(dM,{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(qj,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(tF,{content:he().createElement(M,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=j.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:Zj,alt:"image-arrow",className:"templately-fsi-ai-sidebar-image-replace-panel-body-right-portion-no-image-selected-panel-image-arrow"}),he().createElement("img",{src:Kj,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(sM,{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:Jj,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(Gj.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($j,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 F()},onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),document.activeElement===e.target&&F())},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(pP,null)))))};const fM=he().memo(pM);function hM(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 mM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hM(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gM(){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 vM(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]())):(vM(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,vM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,vM(d,"constructor",c),vM(c,"constructor",s),s.displayName="GeneratorFunction",vM(c,o,"GeneratorFunction"),vM(d),vM(d,o,"Generator"),vM(d,r,function(){return this}),vM(d,"toString",function(){return"[object Generator]"}),(gM=function(){return{w:i,m:p}})()}function vM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}vM=function(e,t,n,r){function i(t,n){vM(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))},vM(e,t,n,r)}var yM=function(){var e=hi(gM().m(function e(t,n,r,o){var i,a,l,s,c,u=arguments;return gM().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,ha("/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)}}(),bM=function(e,t,n){return"".concat(t||"all","-").concat(n||1,"-").concat(e||"")},wM=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},EM=function(e,t,n,r){var o=e[bM(t,n,r)];return o&&wM(o,t,n)?o.data:null},kM=function(e,t,n,r,o){var i=bM(t,n,r);return mM(mM({},e),{},Pt({},i,{data:o,searchParams:{query:t,orientation:n},timestamp:Date.now()}))},OM=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];wM(i,t,n)&&(r[o]=i)}return r};function SM(){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 xM(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]())):(xM(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,xM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,xM(d,"constructor",c),xM(c,"constructor",s),s.displayName="GeneratorFunction",xM(c,o,"GeneratorFunction"),xM(d),xM(d,o,"Generator"),xM(d,r,function(){return this}),xM(d,"toString",function(){return"[object Generator]"}),(SM=function(){return{w:i,m:p}})()}function xM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xM=function(e,t,n,r){function i(t,n){xM(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))},xM(e,t,n,r)}const _M=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],j=A[1],F=ce((0,pe.useState)(0),2),M=F[0],N=F[1],I=ce((0,pe.useState)({}),2),R=I[0],L=I[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[0],Q=q[1],X=ce((0,pe.useState)(new Set),2),Y=X[0],K=X[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(SM().m(function e(t,r,o){var i,a,l,s,c,u,d,p,f,h,m=arguments;return SM().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 _([]),j(null),e.a(2);case 1:if(t||(t=n),a="".concat(t||"default","-").concat(o||"all","-").concat(i||1),!Y.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=$.query!==t||$.orientation!==o)&&(P(!0),_([]),K(new Set),O(function(e){return OM(e,t,o)}),Q(l),i=1),!(c=EM(k,t,o,i))){e.n=3;break}return _(1===i||s?c.images:function(e){return[].concat(Il(e),Il(c.images))}),N(c.total_pages||0),j(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),j(null),e.p=4,e.n=5,yM(t,o,i,G,u.signal);case 5:(d=e.v)&&d.images?(_(1===i||s?d.images:function(e){return[].concat(Il(e),Il(d.images))}),N(d.total_pages||0),O(function(e){return kM(e,t,o,i,d)})):(_([]),j((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),j(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,$,Y,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(Il(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,ka.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(SM().m(function e(t){var r;return SM().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:j,totalPages:M,setTotalPages:N,imageUploadingProgress:R,setImageUploadingProgress:L,uploadAbortController:z,setUploadAbortController:W,searchAbortController:V,setSearchAbortController:H,perPage:G,lastSearchParams:$,setLastSearchParams:Q,loadingPages:Y,setLoadingPages:K,imageRatioOptions:Z,handleImageSearchById:J,handleSearchInputChange:ee,handleSearchSubmit:te,replaceSelectedImage:ne,handleImageReplace:re,handleImageUndo:oe,handleLoadMore:ie,getSelectedRatio:ae,onReset:le}},CM=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=_M(n,r,l),d=(0,pe.useCallback)(function(){s(function(){return{type:ei,payload:wy({expanded:!0},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]),p=(0,pe.useCallback)(function(){s(function(){return{type:ti,payload:wy({expanded:!1},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}}())},[s]);return he().createElement(fM,{imagesAlreadyReplaced:n,defaultImages:r,handleSkip:o,handleSaveChange:i,setShowImageReplacePanel:a,selectedCategory:l,imagePanelData:u,aiSidebarContext:c,onExpandAiSidebar:d,onCollapseAiSidebar:p})};function DM(){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 PM(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]())):(PM(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,PM(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,PM(d,"constructor",c),PM(c,"constructor",s),s.displayName="GeneratorFunction",PM(c,o,"GeneratorFunction"),PM(d),PM(d,o,"Generator"),PM(d,r,function(){return this}),PM(d,"toString",function(){return"[object Generator]"}),(DM=function(){return{w:i,m:p}})()}function PM(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}PM=function(e,t,n,r){function i(t,n){PM(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))},PM(e,t,n,r)}function AM(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 TM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const jM=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],j=A[1],F=ce((0,pe.useState)([]),2),M=F[0],N=F[1],I=(0,pe.useCallback)(function(e){try{ct.current&&(clearTimeout(ct.current),ct.current=null),De(!0),ct.current=setTimeout(function(){G(function(t){return TM(TM({},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 TM(TM({},t),{},{key:e})}),De(!1)}},[]),R=(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]),L=(0,pe.useMemo)(function(){try{var e=Array.isArray(M)?M.filter(function(e){return!bP.includes(e)}):[];return[].concat(Il(bP),Il(e))}catch(e){return console.error("Error creating categories:",e),[]}},[M]),B=ce((0,pe.useState)(function(){return AP(null==h?void 0:h.first_name,D.length>0)}),2),z=B[0],W=B[1],U=(0,pe.useMemo)(function(){return AP(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=AP(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 TM(TM({},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[0],Q=q[1],X=ce((0,pe.useState)(""),2),Y=X[0],K=X[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)(Il(wP)),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],je=ce((0,pe.useState)(new Set),2),Fe=je[0],Me=je[1],Ne=ce((0,pe.useState)(!1),2),Ie=Ne[0],Re=Ne[1],Le=ce((0,pe.useState)(!1),2),Be=Le[0],ze=Le[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],$e=Ge[1],Qe=ce((0,pe.useState)({isValid:!0,errorMessage:""}),2),Xe=Qe[0],Ye=Qe[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,ka.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&&(Xa("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==L?void 0:L.length)>0&&oe(L)},[L]),(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=Hj(Hj({},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}),_=Il(x);x.length>0&&(s.headerFooterIDs=x),(k.length>0||_.length>0)&&(s.previewPages=[].concat(Il(k),Il(_))),(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?TM(TM({},e),{},{editable:!1,done:!0}):"finalize"===e.key?TM(TM({},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]?TM(TM({},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]?TM(TM({},kt(t[e.key],{key:e.key},e)),{},{editable:n}):Object.hasOwn(t,e.key)&&!t[e.key]?TM(TM({},e),{},{done:!0,editable:n,answer:(0,At.__)("I want to skip the question","templately")}):TM(TM({},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 yP(yP({},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?yP(yP({},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==$||!$.trim())return void console.warn("Category submission blocked: Invalid category data");var t=xP($,4);if(Ye(t),!t.isValid)return void console.warn("Category submission blocked: Too many words");be(!1),Ot($)}catch(e){return void console.error("Error submitting category:",e)}else if("email"===(null==H?void 0:H.key)){var n=SP(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(OP(J))return Et();var r=_P(J);if($e(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(kP(z,null==H?void 0:H.key)&&OP(J))return Et();be(!1),Ot(J)}},[null==H?void 0:H.key,$,J,pt,Ot]),ht=(0,pe.useMemo)(function(){return(0,ka.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=xP(n,4);if(Ye(o),!r)return Q(""),oe(L),ht.cancel(),void Ye({isValid:!0,errorMessage:""});if(Q(r),t&&Re(!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,L,oe)}catch(e){console.error("Error in handleCategoryInputChange:",e),K(""),Q(""),oe(L),Ye({isValid:!0,errorMessage:""})}},[L,z,ht]),gt=(0,pe.useCallback)(function(e){try{if(ee(null!=e?e:""),"email"===(null==H?void 0:H.key)){var t=SP(e);He(t),$e({isValid:!0,errorMessage:""})}else if("contactNumber"===(null==H?void 0:H.key)){var n=_P(e),r=OP(e);$e(r?{isValid:!0,errorMessage:""}:n),He({isValid:!0,errorMessage:""})}else He({isValid:!0,errorMessage:""}),$e({isValid:!0,errorMessage:""});"language"===(null==H?void 0:H.key)&&et(e||"",wP,le),"category"!==(null==H?void 0:H.key)&&Ye({isValid:!0,errorMessage:""})}catch(e){console.error("Error in handleTextInputChange:",e),ee(""),He({isValid:!0,errorMessage:""}),$e({isValid:!0,errorMessage:""}),Ye({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)?TM(TM({},e),{},{done:!0}):e})});var e=setTimeout(function(){var t,n;I(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)},[I]),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)?TM(TM({},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)?TM(TM({},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&&I(t.key)}},[null==H?void 0:H.key,dt,I]),bt=(0,pe.useCallback)(function(){var e,t,n=AP(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(""),Q(""),oe(L),He({isValid:!0,errorMessage:""}),$e({isValid:!0,errorMessage:""}),Ye({isValid:!0,errorMessage:""}),de({}),ge({}),_(function(e){return TM(TM({},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,L]),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(){Me(function(t){return new Set([].concat(Il(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 TM(TM({},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(TP())return void G(function(e){return TM(TM({},e),{},{isThinking:!1,isTyping:!0})});var e=setTimeout(function(){De(!0),G(function(e){return TM(TM({},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)?TM(TM({},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&&I(e.key)}catch(e){console.error("Error in handleAnswerSkip:",e)}},[null==H?void 0:H.key,dt,I]),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 TM(TM({},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!=L?L:[]).some(function(e){try{return e===t}catch(t){return console.warn("Error checking category:",e,t),!1}});j(!n)}catch(e){console.error("Error detecting category type:",e),j(!0)}if("language"===(null==H?void 0:H.key)&&!wP.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&&I(r.key)}catch(e){console.error("Error in handleAnswerSubmit:",e)}},[null==H?void 0:H.key,dt,L,I]),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!=L?L:[]).find(function(e){try{return e===t.result}catch(t){return console.warn("Error checking category in edit:",e,t),!1}});n?(K(n||""),Q(n||""),oe(L),j(!1),ge(function(n){return TM(TM({},n),{},Pt({},e,t.result))})):(K(t.result),Q(t.result),oe([]),j(!0),ge(function(n){return TM(TM({},n),{},Pt({},e,t.result))}))}else K(""),Q(""),oe(L),j(!1)}catch(e){console.error("Error in category edit setup:",e),K(""),Q(""),oe(L),j(!1)}else null!=t&&t.result&&(de(function(n){return TM(TM({},n),{},Pt({},e,t.result))}),ge(function(n){return TM(TM({},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?TM(TM({},t),{},{editMode:!0}):t}))&&void 0!==n?n:[]})}catch(e){console.error("Error in handleEdit:",e)}},[z,L]),xt=(0,pe.useCallback)(function(e){if("category"===e){var t=$||Y||"",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()},[$,Y,ue,me]),_t=(0,pe.useCallback)(function(e){try{var t,n;if("category"===e)return!(null!=Y&&Y.trim()&&xt(e)&&Xe.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=kP(z,e),i=OP(r);return!(o&&i||("email"===e?Ve.isValid:"contactNumber"!==e||qe.isValid))}catch(e){return console.error("Error in isEditSubmitDisabled:",e),!0}},[Y,xt,Xe,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 TM(TM({},n),{},Pt({},e,null!=t?t:""))}),"email"===e){var n=SP(t);He(n)}else if("contactNumber"===e)if(OP(t))$e({isValid:!0,errorMessage:""});else{var r=_P(t);$e(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 Xa("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=kP(z,e),i=OP(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?TM(TM({},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=TM({},t);return delete n[e],n}),ge(function(t){var n=TM({},t);return delete n[e],n}),He({isValid:!0,errorMessage:""}),$e({isValid:!0,errorMessage:""}),void _(function(e){return TM(TM({},e),{},{ai_preview_content:null})});if("email"===e){var a=SP(r);if(He(a),!a.isValid)return void console.warn("Email edit submission blocked: Invalid email")}else if("contactNumber"===e){var l=_P(r);if($e(l),!l.isValid)return void console.warn("Phone edit submission blocked: Invalid phone number")}if("category"===e){var s=xP($,4);if(Ye(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?$:r,o="category"===e?$:r;return TM(TM({},t),{},{editMode:!1,answer:n,result:o})}return t}))&&void 0!==n?n:[]}),"category"===e?(K(""),Q(""),oe(L),j(!1)):de(function(t){var n=TM({},t);return delete n[e],n}),ge(function(t){var n=TM({},t);return delete n[e],n}),_(function(e){return TM(TM({},e),{},{ai_preview_content:null})})}catch(e){console.error("Error in handleEditSubmit:",e)}},[ue,z,dt,$,L,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?TM(TM({},t),{},{editMode:!1}):t}))&&void 0!==n?n:[]}),"category"===e?(K(""),Q(""),oe(L),j(!1)):de(function(t){var n=TM({},t);return delete n[e],n}),ge(function(t){var n=TM({},t);return delete n[e],n})}catch(e){console.error("Error in handleEditCancel:",e)}},[L]),jt=(0,pe.useCallback)(function(){try{G(function(e){return TM(TM({},e),{},{isTyping:!1})})}catch(e){console.error("Error in handleTypingComplete:",e)}},[]),Ft=(0,pe.useCallback)(hi(DM().m(function e(){var t,n,r,o,i,a,u,f,h,m,g,v;return DM().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)?TM(TM({},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,Rj(r,{onSessionCreated:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("downloading","done"),Xa("Session created:",e.session_id)},onAIContentStarted:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("analyzing","done"),Xa("AI content generation started:",e.process_id)},onBothCompleted:function(e){var t=e.sessionResult,n=e.aiContentResult;Xa("Both AJAX calls completed:",{sessionId:t.session_id,processId:n.process_id})},onPollingComplete:function(e){nt.current.stepStatusSetter&&nt.current.stepStatusSetter("generating","done"),Xa("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){Xa("AI workflow completed successfully:",e),ut.current=null}},t);case 6:i=e.v,a=Date.now(),u=((a-o)/1e3).toFixed(2),Xa("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:Uj(r.imageReplace||[]),originalAttachments:D,name:r.name,description:r.description},tt.current=f,Xa("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 Xa("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]),Mt=(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:Uj(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 TM(TM({},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 TM(TM({},e),{},{show:!1,finishAnimation:!1})}),Xa("AI templates submitted:",e),y(Dy({aiTemplates:e})),lt.current=lt.current.filter(function(e){return e!==t})},500);return lt.current.push(t),t},[i,a,y]),It=(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]),Rt=(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:$===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,$,mt]);return(0,pe.useEffect)(function(){var e=function(){var e=hi(DM().m(function e(){var t,n,r,o;return DM().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,Ij(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),Xa("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(dP,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(Fe.has(null==e?void 0:e.key)?"animate-in":"")},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(gP,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(Fe.has(null==e?void 0:e.key)?"animate-in":"")},R()?he().createElement("img",{src:R(),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!=Y?Y:"":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&&Xe.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:$===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)&&!Xe.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Xe.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(hP,null)))),"imageReplace"===(null==e?void 0:e.key)?he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation image-replace-conversation ".concat(Fe.has(null==e?void 0:e.key)?"animate-in":"")},he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-icon"},he().createElement(gP,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(gP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-text-wrapper"},he().createElement(FP,{currentStep:H,isCatchFetching:Ae,conversation:e,onTypingComplete:jt,intervalRefs:st})))}),"finalize"===(null==H?void 0:H.key)?he().createElement(RP,{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(CM,{imagesAlreadyReplaced:null===(t=z.find(function(e){return"imageReplace"===e.key}))||void 0===t?void 0:t.result,defaultImages:D,setShowImageReplacePanel:ke,selectedCategory:$||(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&&I(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)?TM(TM({},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&&I(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(zP,{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(pP,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(mP,null))),he().createElement("button",{onClick:function(){return Ft()},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(pP,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(mP,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 Ft()},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(pP,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(mP,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?Mt():Ft()},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(pP,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(mP,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:Ft,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(pP,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:Y,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}),!Xe.isValid&&he().createElement("div",{className:"templately-fsi-ai-sidebar-email-error"},Xe.errorMessage),he().createElement("div",{className:"templately-fsi-ai-sidebar-conversation-categories-wrapper"},(null==re?void 0:re.length)>0&&Xe.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:$===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:$===e,onChange:function(){return mt(e,!0)}}),he().createElement("span",null,null!=e?e:(0,At.__)("Unknown Category","templately")))}),he().createElement(Cj,{open:Ie,onOpenChange:Re,content:he().createElement(Rt,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(Dj,{open:k,onOpenChange:O,content:he().createElement(It,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"},kP(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 kP(z,null==H?void 0:H.key)&&OP(J)?Et():Ot("category"===(null==H?void 0:H.key)?$:J)},disabled:pt||("category"===(null==H?void 0:H.key)?!(null!=$&&$.trim()&&Xe.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&&!OP(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(fP,null))))))))):he().createElement(he().Fragment,null))});var FM=he().memo(function(e){var t=e.isOpenWarningPopover,n=e.open,r=e.onOpenChange,o=e.children,i=e.content;return he().createElement(Oj,{open:n,onOpenChange:r},he().createElement(Sj,{asChild:!0},o),he().createElement(xj,null,he().createElement(_j,{style:t?MM:{},className:"templately-fsi-ai-sidebar-credit-limit-panel",sideOffset:12,align:"end"},i)))});FM.displayName="CreditLimitPopover";var MM={backgroundColor:"#fbf3f3",border:"1px solid #ff7a8e"};const NM=FM;function IM(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 RM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?IM(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const LM=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:wy({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 RM(RM({},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 RM(RM({},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 RM(RM({},e),{},{hideAnimation:!0})}),k.current=setTimeout(function(){null==i||i(),c(function(e){return RM(RM({},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(cP,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(aP,null)),he().createElement("div",{className:"templately-fsi-ai-sidebar-header-right"},he().createElement("div",{className:"templately-fsi-ai-sidebar-header-right-bg"},he().createElement(lP,null)),!E&&he().createElement(NM,{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(uP,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(jM,{setSidebarShowState:c,creditDataLoading:E,creditData:w,packId:a,hideAiSidebar:i,creditLimitPopoverOpen:h,setCreditLimitPopoverOpen:m,setCreditLimitWarningPopover:y,onGeneratingProgressVisibilityChange:O,handleSidebarClose:S,showErrorAlert:function(e){_l({icon:"info",showCloseButton:!0,html:he().createElement(Z_,{title:(0,At.__)("Oops!","templately"),content:e})},!1)}})))))}),BM=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"})))},zM=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"})))},WM=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"}))},UM=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(WM,null),o&&React.createElement("span",{className:"templately-badge-title"},a))};var VM=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"}),HM=pe.forwardRef((e,t)=>(0,GP.jsx)(ZP.span,{...e,ref:t,style:{...VM,...e.style}}));HM.displayName="VisuallyHidden";var GM=HM,[qM,$M]=qP("Tooltip",[zA]),QM=zA(),XM="TooltipProvider",YM=700,KM="tooltip.open",[ZM,JM]=qM(XM),eN=e=>{const{__scopeTooltip:t,delayDuration:n=YM,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,GP.jsx)(ZM,{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})};eN.displayName=XM;var tN="Tooltip",[nN,rN]=qM(tN),oN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,s=JM(tN,e.__scopeTooltip),c=QM(t),[u,d]=pe.useState(null),p=OA(),f=pe.useRef(0),h=a??s.disableHoverableContent,m=l??s.delayDuration,g=pe.useRef(!1),[v,y]=uT({prop:r,defaultProp:o??!1,onChange:e=>{e?(s.onOpen(),document.dispatchEvent(new CustomEvent(KM))):s.onClose(),i?.(e)},caller:tN}),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,GP.jsx)(nT,{...c,children:(0,GP.jsx)(nN,{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})})};oN.displayName=tN;var iN="TooltipTrigger",aN=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rN(iN,n),i=JM(iN,n),a=QM(n),l=HP(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,GP.jsx)(rT,{asChild:!0,...a,children:(0,GP.jsx)(ZP.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:WP(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),c.current=!0))}),onPointerLeave:WP(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:WP(e.onPointerDown,()=>{o.open&&o.onClose(),s.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:WP(e.onFocus,()=>{s.current||o.onOpen()}),onBlur:WP(e.onBlur,o.onClose),onClick:WP(e.onClick,o.onClose)})})});aN.displayName=iN;var lN="TooltipPortal",[sN,cN]=qM(lN,{forceMount:void 0}),uN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=rN(lN,t);return(0,GP.jsx)(sN,{scope:t,forceMount:n,children:(0,GP.jsx)(lT,{present:n||i.open,children:(0,GP.jsx)(aT,{asChild:!0,container:o,children:r})})})};uN.displayName=lN;var dN="TooltipContent",pN=pe.forwardRef((e,t)=>{const n=cN(dN,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=rN(dN,e.__scopeTooltip);return(0,GP.jsx)(lT,{present:r||a.open,children:a.disableHoverableContent?(0,GP.jsx)(vN,{side:o,...i,ref:t}):(0,GP.jsx)(fN,{side:o,...i,ref:t})})}),fN=pe.forwardRef((e,t)=>{const n=rN(dN,e.__scopeTooltip),r=JM(dN,e.__scopeTooltip),o=pe.useRef(null),i=HP(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,GP.jsx)(vN,{...e,ref:i})}),[hN,mN]=qM(tN,{isInside:!1}),gN=function(e){const t=({children:e})=>(0,GP.jsx)(GP.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=YP,t}("TooltipContent"),vN=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,s=rN(dN,n),c=QM(n),{onClose:u}=s;return pe.useEffect(()=>(document.addEventListener(KM,u),()=>document.removeEventListener(KM,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,GP.jsx)(rA,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,GP.jsxs)(oT,{"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,GP.jsx)(gN,{children:r}),(0,GP.jsx)(hN,{scope:n,isInside:!0,children:(0,GP.jsx)(GM,{id:s.contentId,role:"tooltip",children:o||r})})]})})});pN.displayName=dN;var yN="TooltipArrow",bN=pe.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=QM(n);return mN(yN,n).isInside?null:(0,GP.jsx)(iT,{...o,...r,ref:t})});bN.displayName=yN;var wN=eN,EN=oN,kN=aN,ON=uN,SN=pN,xN=bN,_N=["children","content","side","align","sideOffset","alignOffset","open","onOpenChange","className","disabled","enableClick"],CN={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 DN=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,_N),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(wN,{delayDuration:0},he().createElement(EN,re({open:_,onOpenChange:function(e){y?E||x(e):p&&p(e)}},b),he().createElement(kN,{asChild:!0,onClick:function(){y&&(k(!E),x(!1))}},t),he().createElement(ON,null,he().createElement(SN,{side:o,align:a,sideOffset:s,alignOffset:u,className:"templately-custom-tooltip ".concat(h),style:CN.content,"data-slot":"tooltip-content"},n,he().createElement(xN,{className:"templately-custom-tooltip-arrow",style:CN.arrow})))))};function PN(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 AN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?PN(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const TN=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=iP({query:"(max-width: 480px)"}),w=iP({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,j=function(){var e=u||{},t=e.isPurchased,n=e.isSubscribed,r=parseInt(l);return!t&&!n&&0!==r},F=function(){if(j())return M((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)},M=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(UM,{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:j()?(0,vi.addQueryArgs)(t,{live_demo:1,buy_url:F(),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:j()?(0,vi.addQueryArgs)(t,{live_demo:1,buy_url:F(),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(zM,null)),React.createElement("button",{type:"button",onClick:function(){d(!0)},className:"templately-item-details-banner-overlay-button"},React.createElement(BM,null)))))),React.createElement(P_(),{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:AN({},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)}})))},jN=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"}))},FN=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"}))},MN=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"}))},NN=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"}))},IN=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"}))},RN=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 LN=["classNamePrefix"];const BN=function(e){var t=e.classNamePrefix;return Wn(e,LN),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"}))))},zN=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"}))};function WN(e){var t=e.id,n=ce((0,pe.useState)(function(){return new FormData}),1)[0],r=sO(),o=r.startImporting,i=r.setSteps,a=r.steps,l=r.isImportRunning,s=r.isImportComplete,c=r.hasError,u=ce((0,pe.useState)(!1),2),d=u[0],p=u[1],f=function(){l||p(!1)};return he().createElement(he().Fragment,null,he().createElement(P_(),{isOpen:d,onRequestClose:f,className:"templately-dependency-modal-content",portalClassName:"templately-dependency-modal-portal",overlayClassName:"templately-dependency-modal-overlay",shouldCloseOnOverlayClick:!l,contentLabel:"Demo Data Import",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"}}},he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement("div",{className:"templately-dependency-modal-header"},he().createElement("h3",{className:"templately-title"},s?(0,At.__)("Import Complete","templately"):(0,At.__)("Importing Demo Data","templately")),he().createElement("p",{className:"templately-details"},(0,At.__)("Please wait while we set up your website contents.","templately"))),he().createElement("div",{className:"templately-dependency-modal-body"},he().createElement("div",{className:"templately-dependency-modal-body-inner"},he().createElement("ul",{style:{textAlign:"left",listStyle:"none",padding:0,margin:0}},a.map(function(e,t){return he().createElement("li",{key:t,style:{marginBottom:"12px",padding:"10px",borderRadius:"8px",background:"error"===e.status?"#fff1f0":"#f9fafb",border:"1px solid ".concat("error"===e.status?"#ffa39e":"#eaecf0")}},he().createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"}},he().createElement("span",{style:{fontWeight:500,fontSize:"14px"}},e.message),he().createElement("span",{style:{fontSize:"12px",color:"#667085"}},e.progress,"%")),he().createElement("div",{style:{width:"100%",height:"6px",background:"#e0e0e0",borderRadius:"3px",overflow:"hidden"}},he().createElement("div",{style:{width:"".concat(e.progress,"%"),height:"100%",background:"error"===e.status?"#f04438":"#5453f4",transition:"width 0.3s ease"}})))}),0===a.length&&!c&&he().createElement("li",{style:{textAlign:"center",padding:"20px",color:"#667085"}},(0,At.__)("Initializing import...","templately"))),c&&he().createElement("div",{style:{marginTop:"15px",padding:"12px",borderRadius:"8px",background:"#fff1f0",border:"1px solid #ffa39e",color:"#f04438",fontSize:"14px"}},he().createElement("strong",null,(0,At.__)("Error:","templately"))," ",(0,At.__)("Something went wrong during the import. Please check your server logs.","templately")))),he().createElement("div",{className:"templately-dependency-modal-footer"},(c||s)&&he().createElement("button",{onClick:f,className:"templately-dependency-modal-footer-final-button",style:{borderRadius:"8px",marginLeft:0,width:"100%",color:"#FFF"}},(0,At.__)("Close","templately"))),!l&&he().createElement("button",{type:"button",className:"templately-dependency-modal-close-button",onClick:f},he().createElement(zN,{size:16}))))),he().createElement("button",{type:"button",onClick:function(){p(!0),i([]),n.set("id",t),n.set("demo_data_only",!0),n.set("import_demo_content",!0),o(n)},className:"templately-item-details-fsi-button"},he().createElement(jN,null),he().createElement("span",null,(0,At.__)("Import Demo Data","templately")),he().createElement("span",{className:"templately-button-badge",style:{display:"inline-flex",height:"24px",padding:"0 8px",background:"#9cc6ff",alignItems:"center",justifyContent:"center",borderRadius:"24px",fontSize:"12px",fontWeight:"400",color:"#5633d1",marginLeft:"6px"}},(0,At.__)("Dev","templately"))))}const UN=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"})))},VN=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"})))},HN=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 GN=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function qN(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 $N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qN(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var QN=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,GN),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=$N($N({},k),{},{placeholder:c})),null!=a&&(k=$N($N({},k),{},{onBlur:a})),null!=o&&(k=$N($N({},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 XN=he().forwardRef(QN),YN=window.wp.components,KN=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"}))},ZN=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"}))},JN=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 eI=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(YN.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o}))))};const tI=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 nI=a(124);function rI(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 oI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var iI=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,ka.isFunction)(t)?t(i):t,a(t),n({type:Qo,payload:{type:e,value:t}})},function(e){return i}]},aI=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],lI=function(e,t){if(e&&"Default"!==e&&!aI.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 sI(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 cI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const uI=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 oI(oI({},{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(YN.TextControl,{min:h,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(YN.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(nI.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:cI(cI({},t.style),{},{height:"12px",display:"flex",width:"100%"})},he().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,nI.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:cI(cI({},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 dI(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Pd(e,t)}var pI=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function fI(e,t){return e===t||!(!pI(e)||!pI(t))}function hI(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!fI(e[n],t[n]))return!1;return!0}const mI=function(e,t){var n;void 0===t&&(t=hI);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 gI="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function vI(e){cancelAnimationFrame(e.id)}function yI(e,t){var n=gI(),r={id:requestAnimationFrame(function o(){gI()-n>=t?e.call(null):r.id=requestAnimationFrame(o)})};return r}var bI=-1;function wI(e){if(void 0===e&&(e=!1),-1===bI||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),bI=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return bI}var EI=null;function kI(e){if(void 0===e&&(e=!1),null===EI||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?EI="positive-descending":(t.scrollLeft=1,EI=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),EI}return EI}var OI=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function SI(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,jd(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:jd(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=mI(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=mI(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=mI(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(kI()){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&&vI(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=yI(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}dI(t,e),t.getDerivedStateFromProps=function(e,t){return xI(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=wI();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(kI()){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&&vI(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?OI: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 xI=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},_I=function(e,t){return e};function CI(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,jd(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:jd(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=mI(function(e,t,n,o){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:o})}),r._callOnScroll=void 0,r._callOnScroll=mI(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=mI(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(kI()){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&&vI(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=yI(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}dI(t,e),t.getDerivedStateFromProps=function(e,t){return DI(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?wI():0:s.scrollHeight>s.clientHeight?wI():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(kI()){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&&vI(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?_I: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 DI=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},PI=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]},AI=function(e,t,n,r,o){for(;r<=n;){var i=r+Math.floor((n-r)/2),a=PI(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},TI=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},jI=CI({getItemOffset:function(e,t,n){return PI(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:TI,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=PI(e,t,o),p=TI(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?AI(e,t,o,0,n):function(e,t,n,r){for(var o=e.itemCount,i=1;n<o&&PI(e,n,t).offset<r;)n+=i,i*=2;return AI(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=PI(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=PI(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}}),FI=SI({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}}),MI=["options","children","maxHeight","getValue","loadedFonts"];function NI(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 II(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var RI=he().createContext({}),LI=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=he().useContext(RI),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)||(lI(u.value,window.templately.locale),l.current=[].concat(Il(l.current),[u.value]))},[]),(0,pe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),he().createElement("div",{ref:c},t)};function BI(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 zI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const WI=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(){lI(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(HN,null))),he().createElement("button",{className:"templately-color-picker-close-button",onClick:function(){return t(!1)}},he().createElement(ZN,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(kg,{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,MI),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=II(II({},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(RI.Provider,{value:{setSize:d,windowWidth:f,loadedFonts:a,options:n,listRef:c}},he().createElement("div",null,he().createElement(jI,{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:II(II({},o),{},{fontFamily:n[t].value})},he().createElement(LI,{index:t,style:o,isScrolling:i},r[t]))})))}(zI(zI({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-typography-picker-select",classNamePrefix:"templately-typography-picker-select"}))),he().createElement(uI,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),he().createElement(uI,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),he().createElement(uI,{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(kg,{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(kg,{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(kg,{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 UI=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&&lI(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(WI,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts})))};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}var GI=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,ka.isEmpty)(t))return React.createElement(React.Fragment,null);var u=(0,pe.useMemo)(function(){var e=aI.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Il(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Il(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(HN,null))),React.createElement("div",{className:"templately-typography-panel-wrapper"},o.map(function(e,o){var a=e.key,d=e.items;return React.createElement(tI,{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(UI,{key:o,setTypographyPickerOpen:i,reset:function(){return function(e){r(HI(HI({},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=Ba(r[e],t,n);return HI(HI({},r),{},Pt({},e,o))})}(o,e,t)},fontList:u,screen:l,setScreen:s,loadedFonts:c})})))}))))},qI="Dialog",[$I,QI]=qP(qI),[XI,YI]=$I(qI),KI=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]=uT({prop:r,defaultProp:o??!1,onChange:i,caller:qI});return(0,GP.jsx)(XI,{scope:t,triggerRef:l,contentRef:s,contentId:OA(),titleId:OA(),descriptionId:OA(),open:c,onOpenChange:u,onOpenToggle:pe.useCallback(()=>u(e=>!e),[u]),modal:a,children:n})};KI.displayName=qI;var ZI="DialogTrigger",JI=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=YI(ZI,n),i=HP(t,o.triggerRef);return(0,GP.jsx)(ZP.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":yR(o.open),...r,ref:i,onClick:WP(e.onClick,o.onOpenToggle)})});JI.displayName=ZI;var eR="DialogPortal",[tR,nR]=$I(eR,{forceMount:void 0}),rR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=YI(eR,t);return(0,GP.jsx)(tR,{scope:t,forceMount:n,children:pe.Children.map(r,e=>(0,GP.jsx)(lT,{present:n||i.open,children:(0,GP.jsx)(aT,{asChild:!0,container:o,children:e})}))})};rR.displayName=eR;var oR="DialogOverlay",iR=pe.forwardRef((e,t)=>{const n=nR(oR,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=YI(oR,e.__scopeDialog);return i.modal?(0,GP.jsx)(lT,{present:r||i.open,children:(0,GP.jsx)(lR,{...o,ref:t})}):null});iR.displayName=oR;var aR=QP("DialogOverlay.RemoveScroll"),lR=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=YI(oR,n);return(0,GP.jsx)(ej,{as:aR,allowPinchZoom:!0,shards:[o.contentRef],children:(0,GP.jsx)(ZP.div,{"data-state":yR(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),sR="DialogContent",cR=pe.forwardRef((e,t)=>{const n=nR(sR,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=YI(sR,e.__scopeDialog);return(0,GP.jsx)(lT,{present:r||i.open,children:i.modal?(0,GP.jsx)(uR,{...o,ref:t}):(0,GP.jsx)(dR,{...o,ref:t})})});cR.displayName=sR;var uR=pe.forwardRef((e,t)=>{const n=YI(sR,e.__scopeDialog),r=pe.useRef(null),o=HP(t,n.contentRef,r);return pe.useEffect(()=>{const e=r.current;if(e)return gT(e)},[]),(0,GP.jsx)(pR,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:WP(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:WP(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:WP(e.onFocusOutside,e=>e.preventDefault())})}),dR=pe.forwardRef((e,t)=>{const n=YI(sR,e.__scopeDialog),r=pe.useRef(!1),o=pe.useRef(!1);return(0,GP.jsx)(pR,{...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()}})}),pR=pe.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=YI(sR,n),s=pe.useRef(null),c=HP(t,s);return sA(),(0,GP.jsxs)(GP.Fragment,{children:[(0,GP.jsx)(fA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,GP.jsx)(rA,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yR(l.open),...a,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),(0,GP.jsxs)(GP.Fragment,{children:[(0,GP.jsx)(kR,{titleId:l.titleId}),(0,GP.jsx)(OR,{contentRef:s,descriptionId:l.descriptionId})]})]})}),fR="DialogTitle",hR=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=YI(fR,n);return(0,GP.jsx)(ZP.h2,{id:o.titleId,...r,ref:t})});hR.displayName=fR;var mR="DialogDescription";pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=YI(mR,n);return(0,GP.jsx)(ZP.p,{id:o.descriptionId,...r,ref:t})}).displayName=mR;var gR="DialogClose",vR=pe.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=YI(gR,n);return(0,GP.jsx)(ZP.button,{type:"button",...r,ref:t,onClick:WP(e.onClick,()=>o.onOpenChange(!1))})});function yR(e){return e?"open":"closed"}vR.displayName=gR;var bR="DialogTitleWarning",[wR,ER]=function(e,t){const n=pe.createContext(t),r=e=>{const{children:t,...r}=e,o=pe.useMemo(()=>r,Object.values(r));return(0,GP.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}\``)}]}(bR,{contentName:sR,titleName:fR,docsSlug:"dialog"}),kR=({titleId:e})=>{const t=ER(bR),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},OR=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ER("DialogDescriptionWarning").contentName}}.`;return pe.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},SR=KI,xR=JI,_R=rR,CR=iR,DR=cR,PR=vR;const AR=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"}))))},TR=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"}))},jR=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"}))))},FR=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 MR=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)},NR=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"}}))},IR=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(qu,{size:16,color:"#CC4436",style:{flexShrink:0,marginTop:"1px"}}),he().createElement("span",{style:{color:"#CC4436",fontSize:"12px",fontWeight:"400"},dangerouslySetInnerHTML:{__html:t}}))};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 LR(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 BR=[{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"}],zR=[{label:(0,At.__)("Typographic Logo","templately"),value:"typographic"},{label:(0,At.__)("Shape Logo","templately"),value:"shaped"},{label:(0,At.__)("Handwritten Logo","templately"),value:"handwritten"}],WR=[{label:(0,At.__)("PNG","templately"),value:"png"},{label:(0,At.__)("JPEG","templately"),value:"jpeg"}],UR=[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4}],VR="auto",HR="auto",GR="typographic",qR="transparent",$R={control:function(e,t){return LR(LR({},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 LR(LR({},e),{},{margin:0})},indicatorSeparator:function(e){return LR(LR({},e),{},{display:"none"})},dropdownIndicator:function(e){return LR(LR({},e),{},{color:"#535865!important"})},menuPortal:function(e){return LR(LR({},e),{},{zIndex:100001,pointerEvents:"auto"})},menu:function(e){return LR(LR({},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 LR(LR({},e),{},{padding:"4px",maxHeight:"200px",overflowY:"scroll"})},option:function(e,t){return LR(LR({},e),{},{backgroundColor:t.isSelected?"#E4E7EB":t.isFocused?"#F2F5F7":"transparent",color:"#40444F",borderRadius:"4px"})}};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 XR(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]())):(XR(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,XR(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,XR(d,"constructor",c),XR(c,"constructor",s),s.displayName="GeneratorFunction",XR(c,o,"GeneratorFunction"),XR(d),XR(d,o,"Generator"),XR(d,r,function(){return this}),XR(d,"toString",function(){return"[object Generator]"}),(QR=function(){return{w:i,m:p}})()}function XR(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XR=function(e,t,n,r){function i(t,n){XR(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))},XR(e,t,n,r)}var YR=[{label:(0,At.__)("1536×1024 (Landscape)","templately"),value:"1536x1024",icon:he().createElement(Qj,{width:24,height:24})},{label:(0,At.__)("1024×1536 (Portrait)","templately"),value:"1024x1536",icon:he().createElement(Xj,{width:24,height:24})},{label:(0,At.__)("1024×1024 (Square)","templately"),value:"1024x1024",icon:he().createElement(Yj,{width:24,height:24})}],KR=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(QR().m(function e(){return QR().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(MR,{label:(0,At.__)("Prompt","templately")},he().createElement(YN.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(MR,{label:(0,At.__)("Number of variations","templately"),halfWidth:!0},he().createElement(kg,{isSearchable:!1,value:UR.find(function(e){return e.value===S}),options:UR,onChange:function(e){return e&&x(Number(e.value))},styles:$R,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"})),he().createElement(MR,{label:(0,At.__)("Image size","templately"),halfWidth:!0},he().createElement("div",{className:"templately-ai-logo-size-options"},null==YR?void 0:YR.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(MR,{label:(0,At.__)("Category","templately")},he().createElement(kg,{isSearchable:!1,value:zR.find(function(e){return e.value===y}),options:zR,onChange:function(e){return e&&b(e.value)},styles:$R,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(MR,{label:(0,At.__)("Image quality","templately"),halfWidth:!0},he().createElement(kg,{isSearchable:!1,value:BR.find(function(e){return e.value===p}),options:BR,onChange:function(e){return e&&f(e.value)},styles:$R,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"})),he().createElement(MR,{label:(0,At.__)("Output format","templately"),halfWidth:!0},he().createElement(kg,{isSearchable:!1,value:WR.find(function(e){return e.value===E}),options:WR,onChange:function(e){return e&&k(e.value)},styles:$R,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 ZR(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 JR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var eL=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 tL(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 nL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tL(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rL(){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 oL(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]())):(oL(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,oL(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,oL(d,"constructor",c),oL(c,"constructor",s),s.displayName="GeneratorFunction",oL(c,o,"GeneratorFunction"),oL(d),oL(d,o,"Generator"),oL(d,r,function(){return this}),oL(d,"toString",function(){return"[object Generator]"}),(rL=function(){return{w:i,m:p}})()}function oL(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}oL=function(e,t,n,r){function i(t,n){oL(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))},oL(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 JR(JR({},e),eL(e.name,e.prefix))});var iL=new Map,aL=new Map,lL=function(e,t){return"".concat(t,":").concat(e)},sL=new Map,cL=function(){var e=hi(rL().m(function e(t,n){var r,o,i,l;return rL().w(function(e){for(;;)switch(e.n){case 0:return r=["fa6","io5","md","tfi"],o=0,i=function(){var e=hi(rL().m(function e(i){var l,s,c,u,d,p,f;return rL().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!aL.has(i)){e.n=1;break}l=aL.get(i),e.n=10;break;case 1:if(sL.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:sL.set(i,s);case 8:return e.n=9,sL.get(i);case 9:l=e.v,aL.set(i,l),sL.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:nL({name:e,prefix:i,category:"all"},eL(e,i))};d.push(n);var r=lL(e,i);iL.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)}}(),uL=312,dL=104,pL=500/uL,fL=180,hL=120,mL="Your Logo",gL="rgba(0,0,0,0)",vL=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(Il(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()})},yL=function(e){var t=e.name,n=e.color,r=e.defaultColor,o=e.onChange,i=n||r||"#000000";return he().createElement(Oj,null,he().createElement(Sj,{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(xj,null,he().createElement(_j,{align:"start",className:"templately-ai-prompt-colorpicker",style:{zIndex:1e5},alignOffset:0,sideOffset:12},he().createElement("span",{className:"templately-title"},t),he().createElement(YN.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 bL(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 wL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bL(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var EL=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(Il(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(Oj,{open:l,onOpenChange:s,modal:!1},he().createElement("div",{className:"templately-ai-icon-picker"},he().createElement(Sj,{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(_j,{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(FI,{columnCount:6,columnWidth:30,height:m,rowCount:h,rowHeight:30,width:181,itemData:g,key:f.length},kL)))))},kL=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=wL(wL({},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 OL(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 SL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OL(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xL=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()},_L=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=SL(SL({},t),{},Pt({},e,r));c(o)}else n(function(t){var n=SL(SL({},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(MR,{label:(0,At.__)("Logo text","templately")},he().createElement(YN.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(MR,{className:"typography-logo-tab-font-family",label:(0,At.__)("Font family","templately")},he().createElement(kg,{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:$R,menuPlacement:"auto",getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value}})),he().createElement(MR,{className:"typography-logo-tab-font-weight",label:(0,At.__)("Font weight","templately")},he().createElement(kg,{isSearchable:!1,value:{label:xL(t.fontWeight),value:t.fontWeight},options:p.map(function(e){return{label:xL(e),value:e}}),onChange:function(e){return e&&u("fontWeight",e.value)},styles:$R,classNamePrefix:"templately-ai-select",menuPlacement:"auto",menuPosition:"fixed"}))),he().createElement("div",{style:{display:"flex",gap:"12px"}},he().createElement(MR,{label:(0,At.__)("Font size","templately")},he().createElement(YN.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(MR,{label:(0,At.__)("Icon gap","templately")},he().createElement(YN.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(MR,{label:(0,At.__)("Shape","templately")},he().createElement(EL,{icons:r,selectedIcon:t.icon,onIconSelect:function(e){return u("icon",e)},isLoading:l})),he().createElement(MR,{label:(0,At.__)("Shape size","templately")},he().createElement(YN.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(MR,{label:(0,At.__)("Text color","templately")},he().createElement(yL,{name:(0,At.__)("Text Color","templately"),color:String(t.textColor),defaultColor:"#1a1a1a",onChange:function(e){return u("textColor",e)}})),he().createElement(MR,{label:(0,At.__)("Background color","templately")},he().createElement(yL,{name:(0,At.__)("Background Color","templately"),color:String(t.backgroundColor),defaultColor:String(gL),onChange:function(e){return u("backgroundColor",e)}}))))},CL=function(){return CL=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},CL.apply(this,arguments)},DL=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"),j=y?{transform:"scaleX(-1)"}:null,F="".concat(w,"s"),M="".concat(-1*m," 0"),N="".concat(m," 0");return(0,pe.createElement)("svg",CL({"aria-labelledby":T,role:"img",style:CL(CL({},k),j)},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(M,")")},(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(M,"; 0 0; ").concat(N),dur:F,repeatCount:"indefinite"}))))},PL=function(e){return e.children?(0,pe.createElement)(DL,CL({},e)):(0,pe.createElement)(AL,CL({},e))},AL=function(e){return(0,pe.createElement)(PL,CL({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 TL=PL;var jL=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(TL,{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"))))})))},FL=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(jL,{images:t,selectedImageId:n,onSelectImage:r,isLoading:i,onInsertSelected:function(e){o(e),s(!1)},loaderQuantity:c})),l&&he().createElement(IR,{message:l}),!!a&&he().createElement("div",{style:{padding:"0",backgroundColor:"transparent",borderRadius:"0",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}},he().createElement(qu,{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"))))},ML=function(e){return"object"===ne(e)&&"linear"===e.type},NL=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}}},IL=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=uL,A=dL,T=u?i:0,j=Math.round((o+T)/8),F=u?void 0===c||""===c?j: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=ML(l),s="";if(a){var c="icon-gradient-".concat(Math.random().toString(36).substr(2,9)),d=(0,mD.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,mD.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),vL(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 M={x:0,y:0,width:P,height:A};if(ML(s)){var N=NL(s.angle,P,A);M.fillLinearGradientStartPoint=N.start,M.fillLinearGradientEndPoint=N.end,M.fillLinearGradientColorStops=[0,s.startColor,1,s.endColor]}else M.fill=s;var I=(P-(u?T+F+S:S))/2,R=Math.max(4,I),L=E?{image:E,x:R,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?R+T+F:R,y:(A-B)/2,width:S>0?S:304,height:B,align:"left",verticalAlign:"middle",wrap:"none"};if(ML(l)){var W=NL(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,M),L&&he().createElement(m,L),y&&he().createElement(f,z)))});function RL(){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 LL(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]())):(LL(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,LL(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,LL(d,"constructor",c),LL(c,"constructor",s),s.displayName="GeneratorFunction",LL(c,o,"GeneratorFunction"),LL(d),LL(d,o,"Generator"),LL(d,r,function(){return this}),LL(d,"toString",function(){return"[object Generator]"}),(RL=function(){return{w:i,m:p}})()}function LL(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}LL=function(e,t,n,r){function i(t,n){LL(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))},LL(e,t,n,r)}var BL=he().lazy(hi(RL().m(function e(){var t,n,r,o,i,l;return RL().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(IL,re({},e,{ref:t,Stage:n,Layer:r,KonvaText:o,Rect:i,KonvaImage:l}))})})}},e)}))),zL=function(){var e=hi(RL().m(function e(){return RL().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)}}(),WL=he().forwardRef(function(e,t){var n;return he().createElement("div",{style:{width:uL,height:dL,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(BL,re({},e,{ref:t}))))});function UL(){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 VL(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]())):(VL(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,VL(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,VL(d,"constructor",c),VL(c,"constructor",s),s.displayName="GeneratorFunction",VL(c,o,"GeneratorFunction"),VL(d),VL(d,o,"Generator"),VL(d,r,function(){return this}),VL(d,"toString",function(){return"[object Generator]"}),(UL=function(){return{w:i,m:p}})()}function VL(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}VL=function(e,t,n,r){function i(t,n){VL(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))},VL(e,t,n,r)}var HL=.25,GL=function(e,t,n){return Math.min(Math.max(e,t),n)},qL=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)},$L=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||mL,b=(0,pe.useCallback)(function(e,t,n){u(function(r){var o=GL(e,HL,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/uL,n=e.height/dL,r=GL(.9*Math.min(t,n),HL,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(UL().m(function e(){var t;return UL().w(function(e){for(;;)switch(e.n){case 0:if(!a.current){e.n=2;break}return t=a.current.toDataURL({pixelRatio:pL}),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(WL,{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(qL,{onClick:E,title:(0,At.__)("Zoom Out","templately"),disabled:c<=HL},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(qL,{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(qL,{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(YN.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 QL(){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 XL(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]())):(XL(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,XL(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,XL(d,"constructor",c),XL(c,"constructor",s),s.displayName="GeneratorFunction",XL(c,o,"GeneratorFunction"),XL(d),XL(d,o,"Generator"),XL(d,r,function(){return this}),XL(d,"toString",function(){return"[object Generator]"}),(QL=function(){return{w:i,m:p}})()}function XL(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}XL=function(e,t,n,r){function i(t,n){XL(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))},XL(e,t,n,r)}var YL=function(){var e=hi(QL().m(function e(t,n,r){var o,i;return QL().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,vL(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)}}(),KL=function(){var e=hi(QL().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 QL().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?uL:c,d=t.canvasHeight,p=void 0===d?dL:d,f=t.padding,h=void 0===f?4:f,e.n=1,YL(n,r,o);case 1:if(0!==(m=e.v)){e.n=2;break}return e.a(2,{maxFontSize:fL,maxIconSize:hL});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),fL,v)),k=i?y?g-m*a-b:(g-a*(m+.125))/1.125:hL,O=Math.max(6,Math.min(Math.floor(k),hL,v)),e.a(2,{maxFontSize:E,maxIconSize:O})}},e)}));return function(t){return e.apply(this,arguments)}}(),ZL=function(){var e=hi(QL().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 QL().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?uL:a,s=t.padding,c=void 0===s?4:s,u=t.maxFontSize,d=void 0===u?fL:u,p=t.maxIconSize,f=void 0===p?hL:p,h=t.iconGap,e.n=1,YL(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 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 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]"}),(JL=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)}function tB(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 nB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var rB=[{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}),oB=function(e){for(var t=Il(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},iB=function(){return Dd(function e(t){_d(this,e),Pt(this,"items",void 0),Pt(this,"currentIndex",0),Pt(this,"lastItem",null),this.items=Il(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=Il(e),this.shuffle()}}])}(),aB=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(Il(s),Il(rB));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 iB(r)),!t.current&&i.length>0&&(t.current=new iB(i)),n.current&&null!==n.current||(n.current=new iB(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 lB=a.p+"images/ai-logo.png";function sB(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 cB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uB(){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 dB(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]())):(dB(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,dB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,dB(d,"constructor",c),dB(c,"constructor",s),s.displayName="GeneratorFunction",dB(c,o,"GeneratorFunction"),dB(d),dB(d,o,"Generator"),dB(d,r,function(){return this}),dB(d,"toString",function(){return"[object Generator]"}),(uB=function(){return{w:i,m:p}})()}function dB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}dB=function(e,t,n,r){function i(t,n){dB(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))},dB(e,t,n,r)}var pB=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],j=(0,pe.useRef)(!1),F=(0,pe.useRef)(!1),M=(0,pe.useCallback)(hi(uB().m(function e(){var t;return uB().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!j.current&&!F.current){e.n=1;break}return e.a(2);case 1:return T(!0),F.current=!0,e.p=2,e.n=3,cL(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(Il(t),Il(r))}),T(!1)});case 3:j.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),F.current=!1,e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])})),[]);(0,pe.useEffect)(function(){"typography"===h&&M()},[h,M]),(0,pe.useEffect)(function(){d&&(zL(),j.current||M())},[d,M]);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 iB(n))},[n]);var a=(0,pe.useCallback)(function(){return aB(r,o,i,e,t,n)},[e,t,n]),l=(0,pe.useState)(function(){var a=aB(r,o,i,e,t,n);return nB(nB({text:mL,fontSize:72,iconSize:80,iconGap:20},a),{},{backgroundColor:gL})}),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 iB(n);o.current=t,e=t.next().icon}if(e){d.current=!0;var r=c.text,i=c.fontFamily,a=c.fontWeight;ZL({text:r,fontFamily:i,fontWeight:a,icon:e,canvasWidth:uL,canvasHeight:dL,padding:4,maxFontSize:fL,maxIconSize:hL}).then(function(t){u(function(n){return n.icon?n:nB(nB({},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?oB(Il(n)):[]}),2),h=f[0],m=f[1];(0,pe.useEffect)(function(){if(n.length>p.current){var e=n.slice(p.current),t=oB(Il(e));m(function(e){return[].concat(Il(e),Il(t))}),p.current=n.length}else 0===n.length&&p.current>0&&(m([]),p.current=0)},[n]);var g=(0,pe.useCallback)(hi(JL().m(function e(){var t,n;return JL().w(function(e){for(;;)switch(e.n){case 0:return t=a(),e.n=1,ZL({text:c.text,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon,canvasWidth:uL,canvasHeight:dL,padding:4,maxFontSize:fL,maxIconSize:hL});case 1:n=e.v,u(function(e){return nB(nB({},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 nB(nB({},n),{},Pt({},e,t))})},[]);return{settings:c,setSettings:u,shuffleSettings:g,updateSetting:v,shuffledIcons:h,iconsLoaded:n.length>0}}(a,l,C),I=N.settings,R=N.setSettings,L=N.shuffleSettings,B=N.shuffledIcons,z=(N.iconsLoaded,ce((0,pe.useState)({maxFontSize:fL,maxIconSize:hL}),2)),W=z[0],U=z[1],V=(0,pe.useMemo)(function(){return(I.text||"").trim()||x},[I.text,x]),H=(0,pe.useMemo)(function(){return cB(cB({},I),{},{text:V})},[I,V]);(0,pe.useEffect)(function(){var e=function(){var e=hi(uB().m(function e(){var t;return uB().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,KL({text:V,fontFamily:I.fontFamily,fontWeight:I.fontWeight,icon:I.icon,fontSize:I.fontSize,iconSize:I.iconSize,iconGap:I.iconGap});case 1:t=e.v,U(t);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();e()},[V,I.fontFamily,I.fontWeight,I.icon,I.fontSize,I.iconSize,I.iconGap]);var G=(0,pe.useCallback)(function(){var e=hi(uB().m(function e(t){var n,r,o;return uB().w(function(e){for(;;)switch(e.n){case 0:return n=(t.text||"").trim()||x,e.n=1,ZL({text:n,fontFamily:t.fontFamily,fontWeight:t.fontWeight,icon:t.icon});case 1:return r=e.v,e.n=2,KL({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),R(function(e){return cB(cB({},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,R]);he().useEffect(function(){r(d)},[d,r]),he().useEffect(function(){x&&"Your Logo"===I.text&&R(function(e){return cB(cB({},e),{},{text:x})})},[x,R]);var q=null==o?void 0:o.error,$=function(){var e=hi(uB().m(function e(t,r,o){return uB().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)}}(),Q=function(){var e=hi(uB().m(function e(r){var i;return uB().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(SR,{open:d,onOpenChange:function(e){v||p(e)}},he().createElement(xR,{asChild:!0},he().createElement("button",{className:"templately-ai-prompt-button",style:{cursor:"pointer",transformOrigin:"center"},title:q||void 0,type:"button"},he().createElement(FR,null),he().createElement("span",{className:"templately-ai-prompt-button-text"},(0,At.__)("Generate Logo with AI","templately")))),he().createElement(_R,null,he().createElement(CR,{style:{backgroundColor:"rgba(24, 26, 31, 0.7)",position:"fixed",inset:0,zIndex:99999}}),he().createElement(DR,{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:lB,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(hR,{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(jR,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(PR,{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(AR,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(TR,null),(0,At.__)("Typography","templately"))),"ai-generation"===h?he().createElement(KR,{fieldName:t,onSubmit:$,aiState:o,isLoading:v,setIsLoading:y,setLoaderQuantity:S,siteTitle:x}):he().createElement(_L,{settings:I,onSettingsChange:R,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(FL,{generatedImages:(null==o?void 0:o.images)||[],selectedImageId:w,onSelectImage:E,onInsertSelected:Q,isLoading:v,creditCost:null==o?void 0:o.creditCost,error:null==o?void 0:o.error,setShowPicker:p,loaderQuantity:O}):he().createElement($L,{settings:H,onSubmit:n,fieldName:t,setShowPicker:p,onShuffle:L}))))))))};const fB=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"}))))},hB=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 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.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(mB().m(function e(){var r;return mB().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(Oj,{open:s,onOpenChange:function(e){h||c(e)}},he().createElement(Sj,{asChild:!0},he().createElement("span",{className:"templately-ai-prompt-trigger",style:{cursor:"pointer",transformOrigin:"center"},title:v||void 0},he().createElement(fB,null),he().createElement("span",{className:"templately-ai-prompt-trigger-text"},(0,At.__)("Generate with AI","templately")))),he().createElement(xj,null,he().createElement(_j,{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(NR,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(hB,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(YN.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(IR,{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"))))))},yB=function(e){var t=e.fieldName,n=e.showAllFields;return"logo"===t&&void 0!==n&&n?he().createElement(pB,e):he().createElement(vB,e)},bB=["data","image_mappings"];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)}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 OB(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}var SB=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,j=b.setLogoSize,F=b.color,M=b.setColor,N=b.currentStep,I=b.setCurrentStep,R=b.settingsLoaded,L=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,$=b.logoGeneration,Q=b.taglineGeneration,X=Yg(W,v),Y=X.normalizedTypography,K=X.groupedData,Z=X.getDeNormalizedTypography,J=ce((0,pe.useState)(function(){return Y}),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,ka.isEmpty)(Y)||(ne.current=W,te(Y))},[W,Y]);var De=(0,ka.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=Me.current.contentWindow)||void 0===i||i.postMessage(a,"*")},500),Pe=(0,pe.useMemo)(function(){return(0,ka.throttle)(function(e){var t,n=OB({type:"templately_ai_data",aiData:e.data,imageMappings:e.image_mappings||null},Wn(e,bB)),r=Me.current;null!=r&&r.contentWindow&&(r.contentWindow.postMessage(n,"*"),null!==(t=window.templatelyDeveloper)&&void 0!==t&&t.log&&Xa("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=OB(OB({},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),je=Te[0],Fe=Te[1],Me=(0,pe.useRef)(),Ne=ce((0,pe.useState)(0),2),Ie=Ne[0],Re=Ne[1],Le=function(){var e=hi(wB().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 wB().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!==(o=window.templatelyDeveloper)&&void 0!==o&&o.log&&Xa("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&&Xa("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?VR:u,p=n.size,f=void 0===p?HR: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||GR,background:qR,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&&Xa("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&&Xa("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){Xa("Failed to convert logo to base64:",t),A(e.url)})}};return(0,pe.useEffect)(function(){Ie&&Ae("postMessage")},[k,Ie,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=$g(n,v),i=o.colors,a=o._systemColors;if(z(a),(0,ka.isEmpty)(F)&&M(i),(0,ka.isEmpty)(W)){var l=Xg(n,v),s=l.systemTypography,c=l.customTypography;U({systemTypography:s,customTypography:c})}if(L(!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&&L(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&&(L(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(){Ie>0&&De(F,T,ee,je)},[F,T,ee,je,Ie,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 Re(function(e){return e+1});"templately_css_variable"===(null===(r=t.data)||void 0===r?void 0:r.type)&&t.data.logoWidth&&(j(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&&(Xa("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(ZN,null)),he().createElement("button",{className:"templately-dmc-header-toggle-button ".concat(oe?"show":"hide"),onClick:function(){return ie(!oe)}},he().createElement(KN,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(XN,{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(XN,{type:"text",name:"page_name",placeholder:Se[1]?"i.e: ".concat(Se[1]):"",label:(0,At.__)("Site Tagline","templately"),additionalButtons:[he().createElement(yB,{fieldName:"tag_line",onSubmit:Le,setAIPromptPickerOpen:ke,initialDescription:null==y?void 0:y.description,aiState:Q,systemColors:B,availableCredit:b.availableCredit})],value:x,onChange:function(e){return _(e.target.value)}}),d&&!0===R&&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(Gj.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(JN,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(YN.RangeControl,{label:"Logo Width (px)",value:T,onChange:function(e){j(e)},min:20,max:800})),he().createElement("div",{className:"templately-ai-divider"},he().createElement("span",null,(0,At.__)("OR","templately"))),he().createElement(yB,{fieldName:"logo",onSubmit:Le,setAIPromptPickerOpen:ke,aiState:$,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===R&&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}),M(e)}},he().createElement(HN,null))),he().createElement("div",{className:"templately-color-picker-panel"},B&&(null==B?void 0:B.map(function(e,t){var n;return he().createElement(eI,{key:e._id,name:e.title,setColorPickerOpen:fe,color:null!==(n=null==F?void 0:F[e._id])&&void 0!==n?n:e.color,setColor:function(t){return M(function(n){return OB(OB({},n),{},Pt({},e._id,t))})},defaultValue:e.color})})))),he().createElement(GI,{normalizedTypography:Y,selectedTypography:ee,setSelectedTypography:Ce,groupedData:K,setTypographyPickerOpen:ve,fontList:V,screen:je,setScreen:Fe})),d&&!1===R&&he().createElement(kl,{isWhiteLabel:E})),he().createElement("div",{className:"templately-dmc-button-wrapper"},he().createElement("button",{disabled:d&&!1===R&&!(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(F)),_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 I(N+1<=0?0:N+1)},className:"templately-dmc-submit-button"},he().createElement("span",null,d&&0===N?"Style Website":"Confirm Setup"),he().createElement(VN,null)),(d||g)&&he().createElement("button",{onClick:function(){0===N&&g?(w&&w(),m&&m(!1)):N>0?I(N-1):s()},disabled:0===N&&(!g||h),className:"templately-dmc-back-button"},he().createElement(UN,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"===je?"720px":"mobile"===je?"320px":"100%",height:"tablet"===je?"1080px":"mobile"===je?"480px":"100%"}},he().createElement("iframe",{ref:Me,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){Xa("iframe loaded",e),se(!1),Re(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(kl,{isWhiteLabel:E})))))};const xB=he().memo(SB);function _B(){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 CB(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]())):(CB(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,CB(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,CB(d,"constructor",c),CB(c,"constructor",s),s.displayName="GeneratorFunction",CB(c,o,"GeneratorFunction"),CB(d),CB(d,o,"Generator"),CB(d,r,function(){return this}),CB(d,"toString",function(){return"[object Generator]"}),(_B=function(){return{w:i,m:p}})()}function CB(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}CB=function(e,t,n,r){function i(t,n){CB(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))},CB(e,t,n,r)}const DB=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],j=A[1],F=ce((0,pe.useState)(function(){return d("slogan","")}),2),M=F[0],N=F[1],I=ce((0,pe.useState)(""),2),R=I[0],L=I[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],$=G[1],Q=ce((0,pe.useState)(0),2),X=Q[0],Y=Q[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],je=Ae[1],Fe=ce((0,pe.useState)(!1),2),Me=Fe[0],Ne=Fe[1],Ie=ce((0,pe.useState)(null),2),Re=Ie[0],Le=Ie[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],$e=Ge[1],Qe=(0,pe.useCallback)(hi(_B().m(function e(){var t,n,r,o;return _B().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,ma("/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)&&$e(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(){Qe()},[Qe]);var Xe=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"},Ye=(0,pe.useCallback)(function(){var e=hi(_B().m(function e(t){var r,o,i,a,l,s,c,u,d,p,f=arguments;return _B().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,ha(l);case 3:s=e.v,c=s.response,(u=s.error)?(console.error("Pack import info error:",Xe(u)),_(Xe(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(_B().m(function e(){var t,n,r,o,i,a,l;return _B().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,ha(r);case 2:o=e.v,i=o.response,(a=o.error)?(console.error("Google fonts error:",Xe(a)),P(Xe(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(_B().m(function e(t,n){var r,o;return _B().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(_B().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 _B().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++,Xa("Logo polling attempt ".concat(r,"/").concat(84)),l.p=2,l.n=3,ma((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=Xe(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(_B().m(function e(t){var n,r;return _B().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(_B().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 _B().w(function(a){for(;;)switch(a.p=a.n){case 0:return n++,a.p=1,a.n=2,ma((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=Xe(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(_B().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 _B().w(function(e){for(;;)switch(e.p=e.n){case 0:return _e(!0),Pe(null),We([]),He(null),je(t.description||""),e.p=1,e.n=2,ma("/templately/v1/logo-generation/generate",{business_name:t.business_name||"",description:t.description,quality:null!==(n=t.quality)&&void 0!==n?n:VR,size:null!==(r=t.size)&&void 0!==r?r:HR,category:null!==(o=t.category)&&void 0!==o?o:GR,background:null!==(i=t.background)&&void 0!==i?i:qR,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=Xe(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(Xa("Logo generation started with process_id: ".concat(p.process_id)),!0!==(null==p?void 0:p.is_local_site)){e.n=6;break}return Xa("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 Xa("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(_B().m(function e(t){var n,r,o,i,a,l,s,c,d;return _B().w(function(e){for(;;)switch(e.p=e.n){case 0:return Ne(!0),Le(null),e.p=1,e.n=2,ma("/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=Xe(i)||(0,At.__)("Failed to generate tagline","templately"),Le(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"),Le(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),Qe(),e.a(2,{text:o.data.content,message:o.message});case 5:throw s=(0,At.__)("Failed to generate tagline","templately"),Le(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"),Le(c),Ne(!1),d;case 7:return e.a(2)}},e,null,[[1,6]])}));return function(t){return e.apply(this,arguments)}}(),[u,Qe]),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=Wj(e,t,n,r,function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&Xa("AI content polling update:",Object.keys(e),t),he(e)},function(e,t){var n;null!==(n=window.templatelyDeveloper)&&void 0!==n&&n.log&&Xa("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&&Xa("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&&Xa("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(_B().m(function e(){var t;return _B().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.all([Ye(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,Ye,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&&Xa("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&&Xa("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:j,slogan:M,setSlogan:N,siteLogo:R,setSiteLogo:L,logoSrc:z,setLogoSrc:W,logoSize:V,setLogoSize:H,color:q,setColor:$,currentStep:X,setCurrentStep:Y,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:Ye,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:Me,error:Re},availableCredit:qe,setAvailableCredit:$e,fetchAvailableCredits:Qe,isLoading:b||k,hasErrors:!!x||!!D,initialFetchAttempted:Ee}},PB=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=DB(i,{id:n,isAi:d,shouldFetchData:!0,showErrorAlert:s,aiTemplates:h}),g=En(),v=(0,pe.useCallback)(function(){g(Py())},[g]),y=(0,pe.useCallback)(function(){g(Cy())},[g]);return React.createElement(xB,{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})},AB=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 )")):"")))},TB=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(){Xa("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};ma("/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};ma("/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=Il(d);t=_(e.plugin_file)?t.filter(function(t){return(null==t?void 0:t.plugin_file)!==e.plugin_file}):[].concat(Il(t),[e]),p(t)}(e)}),C.push(React.createElement(AB,{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(tI,{title:"Plugin Dependencies",current:void 0,setCurrent:function(){},id:null},C),(null==S?void 0:S.name)&&React.createElement(tI,{title:"Theme Dependency",current:void 0,setCurrent:function(){},id:null},React.createElement(AB,{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(AB,{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=[oO("writing_permission_check","Permission Passed",1,"processing"),oO("download","Downloading Template Pack","--","processing"),oO("theme","Installing Required Theme","--","processing"),oO("plugin","Installing Required Theme","--","processing"),oO("attachments","Importing Media Attachments","--","processing"),oO("templates","Importing Templates (i.e: Header, Footer, etc)","--","processing"),oO("content","Importing Page and Post Templates","--","processing"),oO("wp-content","Importing Content (Pages, Posts, Products, Navigation)","--","processing"),oO("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(VN,null))))};var jB,FB,MB=a(4552);function NB(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"}(jB||(jB={})),function(e){e[e.Positive=1]="Positive",e[e.Negative=-1]="Negative"}(FB||(FB={}));const IB=1e3/60;class RB{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=NB(5,20),this.h=NB(5,20),this.radius=NB(5,10),this.vx="number"==typeof i?NB(-i,i):NB(i.min,i.max),this.vy="number"==typeof a?NB(-a,0):NB(a.min,a.max),this.shape=Math.floor(0+3*Math.random()),this.angle=NB(0,360)*Math.PI/180,this.angularSpin=NB(-.2,.2),this.color=o[Math.floor(Math.random()*o.length)],this.rotateY=NB(0,1),this.rotationDirection=NB(0,1)?FB.Positive:FB.Negative}update(e){const{gravity:t,wind:n,friction:r,opacity:o,drawShape:i}=this.getOptions(),a=e/IB;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===FB.Positive?this.rotationDirection=FB.Negative:this.rotateY<=-1&&this.rotationDirection===FB.Negative&&(this.rotationDirection=FB.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 jB.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case jB.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case jB.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h)}this.context.closePath(),this.context.restore()}}class LB{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=NB(this.x,this.w+this.x),t=NB(this.y,this.h+this.y);return new RB(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 BB={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:MB.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class zB{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,...BB,...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 LB(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 WB=pe.createRef();class UB extends pe.Component{constructor(e){super(e),this.canvas=pe.createRef(),this.canvas=e.canvasRef||WB}componentDidMount(){if(this.canvas.current){const e=VB(this.props)[0];this.confetti=new zB(this.canvas.current,e)}}componentDidUpdate(){const e=VB(this.props)[0];this.confetti&&(this.confetti.options=e)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[e,t]=VB(this.props),n={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...t.style};return(0,GP.jsx)("canvas",{width:e.width,height:e.height,ref:this.canvas,...t,style:n})}}function VB(e){const t={},n={},r=[...Object.keys(BB),"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,{}]}UB.defaultProps={...BB},UB.displayName="ReactConfetti";const HB=pe.forwardRef((e,t)=>(0,GP.jsx)(UB,{canvasRef:t,...e}));var GB=a(4364);function qB(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 $B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qB(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const QB=function(e){var t,n,r,o,i,a,l,s,c=e.results,u=(e.steps,e.isAi),d=(e.importCounter,e.formData),p=ce((0,pe.useState)({0:!0}),2),f=p[0],h=p[1],m="undefined"!=typeof window&&(window.navigator.webdriver||(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.playwright)),g=ce((0,pe.useState)(!m),2),v=g[0],y=g[1];(0,pe.useEffect)(function(){if(!m){var e=setTimeout(function(){y(!1)},3500);return function(){return clearTimeout(e)}}},[]);var b=(0,GB.A)(),w=b.width,E=b.height;function k(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 O,S=[],x=templately.url;if(null!=c&&null!==(n=c.results)&&void 0!==n&&n.home_url&&(x=c.results.home_url),u){var _,C,D,P={label:" ",details:[]};if(null==c||null===(_=c.results)||void 0===_||!_.ai_content)return P.label=(0,At.__)("AI Content Processing Information Unavailable","templately"),void S.push(P);if(void 0!==(null==c||null===(C=c.results)||void 0===C||null===(C=C.ai_content)||void 0===C||null===(C=C.processed)||void 0===C?void 0:C.credit_cost)){var A=c.results.ai_content.processed.credit_cost;P.label=(0,At.__)("Credit Cost:","templately")+" ".concat(A)}else P.label=(0,At.__)("Credit Cost: Not Available","templately");if((0,ka.isEmpty)(null==c||null===(D=c.results)||void 0===D||null===(D=D.ai_content)||void 0===D||null===(D=D.processed)||void 0===D?void 0:D.pages))P.details.push(React.createElement(React.Fragment,null,(0,At.__)("No AI pages were processed","templately")));else{var T=c.results.ai_content.processed.pages,j=Object.values(T).filter(function(e){return"1"!==e}).length;P.details.push(React.createElement(React.Fragment,null,(0,At.__)("AI Generated Pages & Templates:","templately")," ",j));var F=c.results.ai_content.requested,M=c.results.ai_content.processed.pages,N=Object.values(F).flat().filter(function(e){return!M.hasOwnProperty(e)});N.length>0&&P.details.push(React.createElement(React.Fragment,null,(0,At.__)("Failed:","templately")," ",N.length," ",(0,At.__)("pages or templates","templately")))}S.push(P)}if(null!=c&&null!==(r=c.results)&&void 0!==r&&null!==(r=r.dependency_data)&&void 0!==r&&null!==(r=r.plugins)&&void 0!==r&&r.total){var I,R=c.results.dependency_data.plugins,L={label:" ".concat((0,At.__)("Installed Required Plugins","templately")," (").concat(R.succeed,"/").concat(R.total,")"),details:[]},B={"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=R.failed)||void 0===I?void 0:I.length)>0)for(var z=0;z<R.failed.length;z++){var W=R.failed[z];L.details.push(React.createElement(React.Fragment,null,W.name," ",(0,At.__)("not found.","templately"),B[W.slug]&&React.createElement(React.Fragment,null," ".concat((0,At.__)("Please get it","templately")," "),React.createElement("a",{href:B[W.slug],target:"_blank",rel:"noopener noreferrer"},(0,At.__)("here","templately")),".")))}S.push(L)}if(null!=c&&null!==(o=c.results)&&void 0!==o&&null!==(o=o.dependency_data)&&void 0!==o&&o.theme&&d.get("theme")&&(O=c.results.dependency_data.theme.success?{label:(0,At.__)("Installed Recommended Theme","templately")}:{label:(0,At.__)("Theme Installation Failed","templately")},S.push(O)),(null==c||null===(i=c.results)||void 0===i?void 0:i.attachments)>0){var U=c.results.attachments;S.push({label:"".concat((0,At.__)("Imported Attachments:","templately")," ").concat(U)})}if((null==c||null===(a=c.results)||void 0===a||null===(a=a.post_types)||void 0===a?void 0:a.length)>0){var V=k(c.results.post_types);S.push({label:"".concat((0,At.__)("Imported Contents:","templately")," ").concat(V)})}if((null==c||null===(l=c.results)||void 0===l||null===(l=l.template_types)||void 0===l?void 0:l.length)>0){var H=c.results.template_types;H=H.map(function(e){return e.includes("single")?(0,At.__)("Single Post type","templately"):e});var G=k(H=Il(new Set(H)));S.push({label:"".concat((0,At.__)("Imported Templates:","templately")," ").concat(G)})}if((null==c||null===(s=c.results)||void 0===s||null===(s=s.skipped_items)||void 0===s?void 0:s.length)>0){for(var q=c.results.skipped_items,$={label:"⚠️ ".concat((0,At.__)("Skipped Items:","templately")," ").concat(q.length),details:[]},Q=0;Q<q.length;Q++){var X=q[Q],Y=X.class?X.class.split("::").pop():"Unknown";$.details.push(React.createElement(React.Fragment,null,Y," - ",(0,At.__)("Item","templately")," #",X.key,": ",X.reason||(0,At.__)("Unknown error","templately")))}S.push($)}return S.push({label:(0,At.__)("Imported Site Settings: Layout, Fonts, Colors, Typography, Images, Custom CSS, etc.","templately")}),React.createElement(React.Fragment,null,!m&&React.createElement(HB,{className:"templately-confetti-canvas",width:w,height:E,recycle:v}),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==S?void 0:S.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!=f&&f[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 h(function(e){return $B($B({},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:x,target:"_blank",className:"templately-dependency-modal-footer-final-button",style:{marginLeft:0,width:"100%",color:"#FFF"}},(0,At.__)("Visit your website","templately"))))},XB=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(iI("process_id",""),2),f=(p[0],p[1],ce(iI("aiRequestData",[]),1)[0]),h=ce(iI("isRequestStarted",!1),2),m=h[0],g=h[1],v=ce(iI("isAIRequestDone",!1),2),y=(v[0],v[1],(0,ka.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(Ln,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(mD.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 YB=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],KB=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},ZB={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(t){return KB(e,t,r)})||n.some(function(t){return KB(e,t,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}},JB=(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?ZB.formatCreateLabel:i,l=e.isValidNewOption,s=void 0===l?ZB.isValidNewOption:l,c=e.getNewOptionData,u=void 0===c?ZB.getNewOptionData:c,d=e.onCreateOption,p=e.options,f=void 0===p?[]:p,h=e.onChange,m=Wn(e,YB),g=m.getOptionValue,v=void 0===g?rg:g,y=m.getOptionLabel,b=void 0===y?ng:y,w=m.inputValue,E=m.isLoading,k=m.isMulti,O=m.value,S=m.name,x=(0,pe.useMemo)(function(){return s(w,Fh(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(Il(f)):[].concat(Il(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($h(k,[].concat(Il(Fh(O)),[r]),r),o)}},[u,w,k,S,x,d,h,O]);return Od(Od({},m),{},{options:_,onChange:C})}(xd(e));return pe.createElement(wg,re({ref:t},n))}),ez=JB;const tz=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"}))))},nz=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 rz=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 oz=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(rz()),"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 iz(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 az(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const lz=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(iI("prompt",""),2),g=m[0],v=m[1],y=ce(iI("businessNiches",[]),2),b=y[0],w=y[1],E=ce(iI("address",""),2),k=E[0],O=E[1],S=ce(iI("email",""),2),x=S[0],_=S[1],C=ce(iI("phone",""),2),D=C[0],P=C[1],A=En(),T=ce((0,pe.useState)([]),2),j=T[0],F=T[1],M=ce(iI("AIPageIDs",{"content/page":[],templates:[]}),2),N=M[0],I=M[1],R=ce(iI("aiRequestData",[]),2),L=(R[0],R[1]),B=ce(iI("previewPages",[]),2),z=B[0],W=B[1],U=ce(iI("process_id",""),2),V=(U[0],U[1]),H=ce(iI("cachedPreviewInput",{}),2),G=H[0],q=H[1],$=(0,pe.useMemo)(function(){return Object.values(N).flat().length},[N]),Q=["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(Il((0,ka.isArray)(j)?j:[])),X=xn(function(e){return e.general.platform},Jt),Y=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=Y.available_credit-Y.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(""),L({address:k,email:x,phone:D,platform:X,pack_id:n,prompt:g,AIPageIDs:N,preview_pages:z,businessNiches:null!==(o=null==b?void 0:b.value)&&void 0!==o?o:"",isBusinessNichesNew:!Q.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});ma(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&&F(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(_y(az(az({},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)&&I({"content/page":D,templates:T})}d(!1)}).catch(function(e){d(!1),window.templately.log&&console.error(e)})},[]),(0,pe.useEffect)(function(){(0,ka.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(kl,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(tz,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(tI,{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(ez,{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:Q.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(YN.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(YN.Notice,{status:"error",isDismissible:!1},f))),React.createElement(tI,{title:(0,At.__)("Contact Information","templately"),current:l,setCurrent:s,initialCollapsed:!0,id:"contact-information"},React.createElement("div",{className:"templately-ai-content"},React.createElement(YN.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(YN.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(YN.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(oz,{creditData:Y}),0===$&&React.createElement(YN.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://templately.com?support=open",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(""),L(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(nz,null),React.createElement("span",null,(0,At.__)("Buy Credit","templately")),React.createElement(VN,null)),K>0&&React.createElement("button",{disabled:0===$,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(nz,null),React.createElement("span",null,(0,At.__)("Preview","templately"))),K>0&&React.createElement("button",{disabled:0===$,onClick:function(e){return Z(e)},className:"templately-dmc-submit-button"},React.createElement(nz,null),React.createElement("span",null,(0,At.__)("Set Branding","templately")),React.createElement(VN,null))))},sz=function(e){var t,n,r,o=En(),i=ce(iI("isAi",e.isAi),2),a=i[0],l=i[1],s=sO(),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:$o,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(rO({},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(ky(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),xl.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(lz,{back:function(){return o(ky(0))},next:function(){return o(ky(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(ZN,null)))),1===y&&he().createElement("div",{className:"templately-dependency-modal-container full-screen"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(PB,{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(ky(0))},next:function(){return o(ky(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(TB,{back:function(){return o(ky(1))},next:function(){return o(ky(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(ZN,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(XB,{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(ZN,null)))),4===y&&he().createElement("div",{className:"templately-dependency-modal-container"},he().createElement("div",{className:"templately-dependency-modal"},he().createElement(QB,{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(ZN,null)))))};function cz(){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 uz(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]())):(uz(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,uz(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,uz(d,"constructor",c),uz(c,"constructor",s),s.displayName="GeneratorFunction",uz(c,o,"GeneratorFunction"),uz(d),uz(d,o,"Generator"),uz(d,r,function(){return this}),uz(d,"toString",function(){return"[object Generator]"}),(cz=function(){return{w:i,m:p}})()}function uz(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}uz=function(e,t,n,r){function i(t,n){uz(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))},uz(e,t,n,r)}const dz=function(e){var t,n=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),r=ce(iI("isAi",!1),2),o=r[0],i=r[1],a=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),l=xn(function(e){return null!=e.profile.data},Jt),s=xn(function(e){return e.profile},Jt),c=En(),u=rt(),d=tt(),p=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),xl.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(Hg().m(function e(){var t;return Hg().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),_l({icon:"info",showCloseButton:!0,allowOutsideClick:!0,showConfirmButton:!1,html:React.createElement("div",{className:"templately-import-modal templately-modal"},React.createElement(Zu,{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://templately.com?support=open")}))},!0),n(Li()),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])}(),f=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"modal";null!==(e=d.state)&&void 0!==e&&e[t]||u(Yy(d.pathname.replace(/^\/+/,"")),{state:Pt({},t,!0)})},h=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]&&u(-1)},m=function(){var t=hi(cz().m(function t(n){var r,o,a;return cz().w(function(t){for(;;)switch(t.p=t.n){case 0:if(l){t.n=1;break}return u(Yy("sign-in"),{state:{redirectTo:d.pathname.replace(/^\/(.*)/,"$1")}}),t.a(2);case 1:return o=null==s||null===(r=s.data)||void 0===r?void 0:r.is_verified,t.p=2,t.n=3,p();case 3:!0===(null==(a=t.v)?void 0:a.is_verified)&&(o=!0),t.n=5;break;case 4:t.p=4,t.v;case 5:if(!Vg(l,o)){t.n=6;break}return t.a(2);case 6:if(h(),h("isRunning"),f(),c(xy()),c(Ny()),c(ky(1)),c(Oy(0)),c(Sy(!1)),window.templately.can_fsi){t.n=7;break}return _l({icon:"warning",showCloseButton:!0,html:React.createElement(Z_,{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:c(n?Cy({id:e.id}):Dy()),i(n);case 8:return t.a(2)}},t,null,[[2,4]])}));return function(_x){return t.apply(this,arguments)}}(),g=function(){c(xy()),h(),h("isRunning"),c(Sy(!0)),c(Py())};return(0,pe.useEffect)(function(){n||g()},[n]),(0,pe.useEffect)(function(){a&&a.id===e.id&&m(a.isWithAI)},[a]),React.createElement(React.Fragment,null,React.createElement(P_(),{isOpen:n,onRequestClose:function(){return g()},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(sz,re({},e,{pushState:f,removeState:h,setShowFSIModal:function(){return c(Py())},showErrorAlert:function(e){c(xy()),c(Sy(!0)),_l({icon:"info",showCloseButton:!0,html:React.createElement(Z_,{title:(0,At.__)("Oops!","templately"),content:e})},!1)},isAi:o}))),React.createElement("button",{type:"button",onClick:function(){return m(!1)},className:"templately-item-details-fsi-button"},React.createElement(jN,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 m(!0)},className:"templately-item-details-fsi-ai-button with-ai"},React.createElement(BN,{classNamePrefix:Ya()}),React.createElement("span",null,(0,At.__)("Build with Templately AI","templately")),React.createElement("span",{className:"templately-button-badge"},"Beta")),(null===(t=window.templatelyDeveloper)||void 0===t?void 0:t.dev_mode)&&React.createElement(WN,{id:null==e?void 0:e.id}))};var pz=["children","details"],fz=(0,pe.createContext)({items:[],templateType:"",type:"",setType:function(e){return e}}),hz=function(e){var t,n,r,o,i,a=e.children,l=e.details,s=(Wn(e,pz),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(fz.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)},mz=fz.Consumer,gz={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 vz=function(e){var t;return React.createElement(Oj,null,React.createElement(Sj,{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(xj,null,React.createElement(_j,{className:"hello",sideOffset:5,align:"end",style:gz.content},null==e?void 0:e.children)))},yz=a.p+"images/blurry-bg.png",bz=a.p+"images/templately-bg-gradient.png";function wz(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 Ez(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kz(e){if(e){var t=(e=e.toString()).match(/^-?\d+(?:\.\d{0,2})?/);return t?t[0]:e}return e}const Oz=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(Na(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 Ez(Ez({},e),{},{calculatedPrice:t})}).reduce(function(e,t){return t.calculatedPrice<e.calculatedPrice?t:e});return{price:kz(t.calculatedPrice),plan:t}}(n),t?t.price:"4.99")))),he().createElement(P_(),{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:bz,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(kz(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(kz(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 Sz=["template_type","categories","pack","id","platform","dependencies","isPurchased","isSubscribed","details","favourite_count","downloads","rating","price"];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}const Cz=function(e){var t,n,r,o,i,a,l=e.template_type,s=e.categories,c=e.pack,u=e.id,d=e.platform,p=e.dependencies,f=e.isPurchased,h=e.isSubscribed,m=e.details,g=e.favourite_count,v=e.downloads,y=e.rating,b=e.price,w=Wn(e,Sz),E=En(),k=rt(),O=ce(Ct(),1)[0],S=xn(function(e){return null!=e.profile.data}),x=xn(function(e){return e.profile},Jt),_=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(Yy("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),Kg(v,g,b))},[b]),{starred:w,isClicked:l,favouriteLoading:y,setIsClicked:s,favouriteCount:f}}(u,w.type,w.is_favourite,g),C=_.starred,D=_.setIsClicked,P=_.favouriteLoading,A=_.favouriteCount,T=ce((0,pe.useState)(null),2),j=T[0],F=T[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}),N=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}),I=(0,pe.useMemo)(function(){return null===j||M?w.is_reviewed:j},[w.is_reviewed,j,M]),R=(0,pe.useMemo)(function(){if("pack"==w.type){var e,t={};return null===(e=w.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 p},[]);(0,pe.useEffect)(function(){M&&"string"==typeof M&&Kg(S,x,M)},[M]);var L=ce((0,pe.useState)(!1),2),B=L[0],z=L[1],W=function(e){var t;e!==d&&k(Yy("".concat(e,"/").concat("pack"===w.type?"packs":"page"===w.type?"pages":"blocks","/").concat(null==w||null===(t=w.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.slug)))},U=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==w||w.name,(null==w?void 0:w.id)||u,null==w?void 0:w.slug,null==w?void 0:w.coupon,(null==w?void 0:w.type)||"pack",null==w?void 0:w.sites)};return(0,pe.useEffect)(function(){B&&_l({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)&&z(!1)})},[B]),he().createElement(he().Fragment,null,he().createElement("div",{className:"templately-item-details-item-meta"},he().createElement("img",{src:yz,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==w||null===(t=w.variations)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.platform)&&"elementor"!==d?he().createElement(DN,{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(){W("elementor")},className:"templately-item-details-item-meta-variations-button ".concat("elementor"===d?"active":"")},(0,At.__)("Elementor","templately")),"gutenberg"!==(null==w||null===(n=w.variations)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.platform)&&"gutenberg"!==d?he().createElement(DN,{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(){W("gutenberg")},className:"templately-item-details-item-meta-variations-button ".concat("gutenberg"===d?"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==m?void 0:m.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==m?void 0:m.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(qx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(d,"/").concat(w.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(qx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(d,"/").concat(w.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(vz,{details:m},he().createElement(he().Fragment,null,null==s?void 0:s.map(function(e,t){return he().createElement(he().Fragment,{key:Math.random()},he().createElement(qx,{query:{category:e.id},ignoreKeys:["tag_id"],to:"".concat(d,"/").concat(w.type,"s"),className:"templately-item-details-item-meta-category"},e.name)," ",t+1<(null==s?void 0:s.length)?", ":"")})))):"--")),v?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!=v?v:"--")):he().createElement(he().Fragment,null)),he().createElement("div",{className:"templately-item-details-item-meta-content-badges"},null==m||null===(a=m.badges)||void 0===a?void 0:a.map(function(e){var t=Ka.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;S?N||(F(e),E((t={type_id:u,itemType:w.type,rating:e},Pi({type:oo},t)))):k(Yy("sign-in",{"redirect-to":O.get("path")}))}(e)},className:"templately-item-details-item-meta-content-ratting-button"},e<=I?he().createElement(MN,{fill:"#FEB273"}):he().createElement(RN,{fill:"#FEB273"}))})),y&&he().createElement("div",{className:"templately-item-details-item-meta-content-average-ratting"},null==y?void 0:y.toFixed(1)))),he().createElement("button",{type:"button",onClick:function(){return D(!0)},className:"templately-item-details-item-meta-content-favorite-button"},he().createElement("span",{className:"templately-item-details-item-meta-content-favorite-button-tooltip"},C?"Added to Favorite":"Add to Favorite"),P?he().createElement(FN,{fill:"#F96796",className:"animate-spin"}):C?he().createElement(NN,{fill:"#F96796"}):he().createElement(IN,{fill:"#F96796"}),null!=A?A:he().createElement(he().Fragment,null))))),he().createElement("div",{className:"templately-item-details-button-wrapper"},"pack"===(null==w?void 0:w.type)?he().createElement(he().Fragment,null,parseInt(b)>0&&!f&&!h&&he().createElement("a",{target:"_blank",href:U(),className:"templately-item-details-fsi-button"},he().createElement(jN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"Pack"))),(null==w?void 0:w.fullsite_import)&&(0===parseInt(b)||f||h)&&he().createElement(hz,{details:m},he().createElement(mz,null,function(e){return he().createElement(dz,re({sidebar:!0,platform:d},e))})),!h&&he().createElement(Oz,null)):he().createElement(he().Fragment,null,parseInt(b)>0&&!f&&!h&&he().createElement("a",{target:"_blank",href:U(),className:"templately-item-details-fsi-button"},he().createElement(jN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Purchase This %s","templately"),"page"===w.type?"Page":"Block"))),(0===parseInt(b)||f||h)&&he().createElement("button",{onClick:function(){w.isLoggedIn?Vg(w.isLoggedIn,x)||vd({ModalComponent:ad,content:_z({id:u,dependencies:R,pack:c},w)}):k(Yy("sign-in",{"redirect-to":O.get("path")}))},className:"templately-item-details-fsi-button"},he().createElement(jN,null),he().createElement("span",null,(0,At.sprintf)((0,At.__)("Insert This %s","templately"),"page"===w.type?"Page":"Block"))),!h&&he().createElement(Oz,null))))),null!=R&&R.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"},R.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 Dz=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:Yy("".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 Pz=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(Dz,{data:o,platform:n,type:"blocks"}):React.createElement(Dz,{data:l,platform:n,type:"pages"}))};var Az=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:Yy("".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 Tz=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:Yy("".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(Az,{data:i,platform:r,type:"blocks"}):React.createElement(Az,{data:s,platform:r,type:"pages"}))};var jz=a(4145);const Fz=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 Mz=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(jz.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:Yy("".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=Ka.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(UM,{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:Yy("".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=Ka.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(UM,{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 Nz=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(Fz,null))),React.createElement(Mz,{hasCarousel:c,data:l,platform:u}))},Iz=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 gv({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(kl,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(Nz,{title:"Featured Products",browseLink:Yy("".concat(null==e?void 0:e.platform)),redBg:!0,data:e.items,platform:e.platform,hasCarousel:!0}))});function Rz(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 Lz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rz(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)($a("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(Na(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 Lz(Lz({},e),{},{starter:t,pro:n})})}},[e.counts]),(0,pe.useEffect)(function(){m($a(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(qx,{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 Bz=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"}))},zz=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"}))},Wz=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(zz,null):React.createElement(Bz,null)))):React.createElement(React.Fragment,null))},Uz=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 gv({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(kl,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(Nz,{title:"Related Products",browseLink:Yy("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!1}))}),Vz=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:Yy("".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:Yy("".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:Yy("".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))},Hz=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 gv({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(kl,{style:"placeholder",template:"featuredItems"})):0===e.items.length?null:he().createElement(he().Fragment,null,he().createElement(Nz,{title:"Trending Products",browseLink:Yy("".concat(null==e?void 0:e.platform)),redBg:!1,data:e.items,platform:e.platform,hasCarousel:!0}))});function Gz(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 qz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const $z=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 gv({type:Ra(ko,e.key)},e)}(t))},setPlatform:function(t){return e(ev(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=iP({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(Yy("sign-in",{"redirect-to":n}),{})}d(function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:di,payload:wy({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=Yy(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=w_(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(K_,{type:a.type,stateSubKey:"itemsDetails",element:React.createElement(Qz,{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(Q_,{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(Vz,re({},l,{platform:s})),React.createElement("div",{className:"templately-item-details-container"},React.createElement("div",{className:"templately-item-details"},React.createElement(TN,{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:qz(qz({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(Cz,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(Pz,{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(Wz,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(Tz,{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(Cz,re({details:l,isPurchased:m,isSubscribed:g,params:a},l,{platform:e.params.platform,isLoggedIn:e.isLoggedIn})))),React.createElement(Uz,{slug:a.slug,itemId:l.id,itemType:l.type||a.type,platform:s}),React.createElement(Iz,{slug:a.slug,platform:s}),React.createElement(Hz,{slug:a.slug,platform:s}))}})}),React.createElement(LM,{packId:null==l?void 0:l.id}))}),Qz=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)},Xz=a.p+"images/footer-bar-bg.png",Yz=a.p+"images/footer-bar-icon.png",Kz=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 Zz(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 Jz=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?Zz(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zz(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:Xz,alt:"footer-bar-bg",className:"footer-bar-bg"}),he().createElement("div",{className:"footer-bar-content"},he().createElement("img",{src:Yz,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(Kz,null))))};const eW=gn(function(e){return{headerHeight:e.general.headerHeight,current_screen:e.general.current_screen}})(he().memo(Jz));function tW(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?tW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const rW=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(PC,{title:t.title,platform:e.platform})},[{id:"last_modified",data:t.date},{id:"action",data:he().createElement("div",{className:"tt-actions"},he().createElement(NC,{current_screen:e.current_screen,args:{content:nW(nW({},t),{},{my_cloud_id:t.id,origin:"local",currentPage:e.currentPage})},menus:Bg(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(Zx,{view:"list",head:he().createElement(t_,null)},he().createElement(r_,{view:"list",data:n})):he().createElement(tC,null),e.totalPage>1&&he().createElement(X_,{type:"savedTemplates",total:e.totalPage})))});var oW=["plan","active","label","total"],iW=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,oW),s=Vn()("components-button","templately-plan-".concat(n),{"templately-plan-active":o});return he().createElement("button",re({className:s},l),i," (",a,")")};const aW=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(iW,{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(iW,{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(iW,{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"}))}),lW=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))},sW=function(){var e=rt(),t=it();return he().createElement("div",{className:"templately-logo"},he().createElement(jn,{width:"37.66px"}),null==(null==t?void 0:t.slug)&&he().createElement(Fn,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 cW(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?cW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dW=function(e){return e.join("/")};const pW=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:dW([n,"packs"]),label:(0,At.__)("Packs","templately"),element:!1,query:{}}),"gutenberg"===n&&r.push({to:dW([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),r.push({to:dW([n,"pages"]),label:(0,At.__)("Pages","templately"),element:!1,capability:"templately_read",query:{}}),"elementor"===n&&r.push({to:dW([n,"blocks"]),label:(0,At.__)("Blocks","templately"),element:!1,query:{}}),"elementor"===n&&r.push({to:dW([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 uW(uW({},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(Yy(i[0].to))},[e.platform]),he().createElement(Kx,{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 fW(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 hW=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(ev(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(kg,{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(Yy(s,{platform:o.value},i))}else r(Yy(n.pathname.substring(1),{platform:o.value}))},value:u,isSearchable:!1})}),mW=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(ji({linking:!0}))}}})(function(e){var t=rt();return e.canLinkAccount?he().createElement(qx,{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(fl,{className:"tb-logout",onClick:function(){t(Yy("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}),gW=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(In,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(In,{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(qx,{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(qx,{className:"d-flex align-center",to:"downloads"},he().createElement(Jn,null),(0,At.__)("My Downloads","templately"))),he().createElement("li",null,he().createElement(qx,{className:"d-flex align-center",to:"purchased-items"},he().createElement(nC,null),(0,At.__)("Purchased Items","templately"))),he().createElement("li",null,he().createElement(mW,null)))))},vW=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(hW,null),he().createElement("a",{className:"templately-button templately-chat-button",href:"https://templately.com?support=open",target:"_blank",rel:"noopener"},he().createElement(fW,null),he().createElement("span",null,"Talk to Support")),r&&o.get("path")&&Ug(o.get("path"))&&he().createElement(fl,{className:"templately-cloud-sync ".concat(e.syncing?"tc-syncing":""),onClick:function(){return e.syncProfile()}},he().createElement(Ln,null)),!r&&he().createElement(qx,{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(gW,e.profile),"templately"!==o.get("page")&&"templately_settings"!==o.get("page")&&he().createElement(fl,{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 yW(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 bW=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 yW(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)?yW(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(sW,null),he().createElement(pW,null),he().createElement(vW,null))}),wW=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")))};function EW(){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 kW(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]())):(kW(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,kW(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,kW(d,"constructor",c),kW(c,"constructor",s),s.displayName="GeneratorFunction",kW(c,o,"GeneratorFunction"),kW(d),kW(d,o,"Generator"),kW(d,r,function(){return this}),kW(d,"toString",function(){return"[object Generator]"}),(EW=function(){return{w:i,m:p}})()}function kW(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}kW=function(e,t,n,r){function i(t,n){kW(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))},kW(e,t,n,r)}const OW=function(){var e=En(),t=xn(function(e){return null!==e.profile.data}),n=xn(function(e){var t;return null===(t=e.profile)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.is_disconnected}),r=ce((0,pe.useState)(!1),2),o=r[0],i=r[1],a=(0,pe.useCallback)(hi(EW().m(function t(){var n,r,o;return EW().w(function(t){for(;;)switch(t.p=t.n){case 0:return i(!0),t.p=1,t.n=2,ma("templately/v1/sites/migrate",{},{method:"POST"});case 2:if((n=t.v).response,!(r=n.error)){t.n=3;break}throw new Error((null==r?void 0:r.message)||(0,At.__)("Migration failed","templately"));case 3:e(zi({is_disconnected:!1})),_l({icon:"success",timer:1500,title:(0,At.__)("Site Migrated","templately"),html:he().createElement(Z_,{title:(0,At.__)("Site Migrated!","templately"),content:(0,At.__)("Your site has been successfully connected. You can now import templates.","templately")}),showConfirmButton:!1},!1),t.n=5;break;case 4:t.p=4,o=t.v,_l({icon:"error",timer:3e3,title:(0,At.__)("Migration Failed","templately"),html:he().createElement(Z_,{content:o.message||(0,At.__)("Failed to migrate site connection. Please try again.","templately")})},!1);case 5:return t.p=5,i(!1),t.f(5);case 6:return t.a(2)}},t,null,[[1,4,5,6]])})),[e]);return t&&n?he().createElement("div",{className:"templately-site-migration"},he().createElement("p",null,(0,At.__)("Your site connection needs to be updated. This typically happens when migrating from staging to production.","templately")," ",(0,At.__)("Click the button below to migrate your connection to this site.","templately")),he().createElement("button",{onClick:a,className:"templately-button components-button tb-migrate",disabled:o},o?(0,At.__)("Migrating . . .","templately"):(0,At.__)("Migrate Site Connection","templately"))):null},SW=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(bW,null),he().createElement(eW,null),he().createElement(wW,{isVerifiedProfile:e.isVerifiedProfile}),he().createElement(OW,null))},xW=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(Cv(t))},getWorkSpaces:function(t){return e($v(t))},getWorkSpaceDetails:function(t){return e(oy(t))},getFavourites:function(t){return e(Wi(t))},getDownloads:function(t){return e(ta(t))},getPurchasedItems:function(t){return e(Gi(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=Yy("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(CC,null),he().createElement(K_,{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(Qz,{header:function(e){var t=e.stickyClass;if("profile"!==a&&"purchasedItems"!==a&&"downloads"!==a&&"saveTemplate"!==a&&!p)return he().createElement(lW,{hideTitle:"favourites"===a||"purchasedItems"===a,element:he().createElement(cD,{type:a}),label:c,className:t})},render:function(){return he().createElement(vt,null)}})}}))}),_W=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(hy(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(K_,{type:"savedTemplates",element:he().createElement(Qz,{header:function(e){var t=e.stickyClass;return he().createElement(lW,{label:"Saved Templates",className:t})},render:he().createElement(rW,null)})}))});var CW=["prevQuery","doQuery","results"];function DW(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 PW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const AW=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,CW)),f=1,h=0,m=[a,l,s];return d||null!=i||(f=La(e,[].concat(Il(m),["currentPage"]),1),h=La(e,[].concat(Il(m),["totalPage"]),0),m.push(f)),d&&d===u&&(m.push("filteredResults"),f=La(e,[].concat(Il(m),["currentPage"]),1),h=La(e,[].concat(Il(m),["totalPage"]),0),m=m.concat([f])),null!==i&&(m.push("search"),f=La(e,[].concat(Il(m),["currentPage"]),1),h=La(e,[].concat(Il(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 gv({type:Ra(yo,e.key)},e)}(t))},setPlatform:function(t){return e(ev(t))},setPrevQuery:function(t){return e(tv({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(PW(PW({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(CC,null),he().createElement(K_,{type:t.type,element:he().createElement(Qz,{className:"templately-search-results",header:function(e){var t=e.stickyClass;return he().createElement(lW,{label:o,element:he().createElement(he().Fragment,null,he().createElement(dl,null),he().createElement(aW,null)),className:t})},render:he().createElement(zD,{platform:e.platform,items:e.items,currentPage:e.currentPage,totalPage:e.totalPage,type:null==t?void 0:t.type,isLoggedIn:e.isLoggedIn})})}))});var TW=["selected","setSelected","settings"];function jW(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 FW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const MW=gn(function(e){return{platform:e.general.platform}},function(e){return{setPlatform:function(t){return e(Iy(t))}}})(function(e){var t=e.selected,n=(e.setSelected,e.settings),r=Wn(e,TW),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")),_l({icon:"error",timer:2e3,html:he().createElement(Z_,{title:o})},!1),!1}p(e),r.setPlatform(t);var i=Ga("/settings/:platform/:tab",l.get("path")).tab;a(Yy(["settings",t,i]))};return he().createElement(kg,{components:{Option:function(e){return he().createElement(wm.Option,re({},e,{className:"tt-top",innerProps:FW(FW({},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 NW(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 IW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?NW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const RW=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 IW(IW({},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,dy.setSettings)(t))},setPlatform:function(t){return e(Iy(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=je("/settings/:platform/:tab","/"+u).params.tab,p=Qg(r,o)._systemColors,f=Xg(r,o),h=Yg(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,ka.isEmpty)(p))return!1;if("typography"===e.key&&(0,ka.isEmpty)(g))return!1}return n.has_eb}return!1})},[o,l.platform,n,b]);(0,pe.useEffect)(function(){i(l.platform),je("/settings/:platform/:tab","/"+u);var e=E.some(function(e){return e.key===d});if(!e&&E.length>0){var t=E[0];c(Yy(["settings",l.platform,t.key]))}},[d,E,c,l.platform,i]);var k=(0,pe.useMemo)(function(){return E.map(function(e){var t=Ie(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(qx,{to:r,isActive:o},n))})),React.createElement(MW,{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=IW(IW({},a),{},{platform:o}),n=v(a.typography);if("gutenberg"===o&&!(0,ka.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){_l({icon:"success",timer:2e3,html:React.createElement(Z_,{title:(0,At.__)("Successfully Updated Settings","templately")})},!1)}).catch(function(e){var t;_l({icon:"error",timer:2e3,html:React.createElement(Z_,{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 LW=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(YN.ColorPicker,{color:n,onChangeComplete:function(e){return r(e.hex)},enableAlpha:!0,defaultValue:null!=n?n:o})))))};function BW(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 zW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BW(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const WW=gn(function(e,t){var n,r,o,i,a,l=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return zW(zW({},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=Qg(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,ka.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(HN,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(LW,{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(zW(zW({},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(LW,{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(zW(zW({},r),{},Pt({},e._id,t)))},defaultValue:e.color})}))))),c&&he().createElement("div",{className:"templately-setting-overlay"}))}),UW=1024;let VW=0;class HW{constructor(e,t){this.from=e,this.to=t}}class GW{constructor(e={}){this.id=VW++,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=QW.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}GW.closedBy=new GW({deserialize:e=>e.split(" ")}),GW.openedBy=new GW({deserialize:e=>e.split(" ")}),GW.group=new GW({deserialize:e=>e.split(" ")}),GW.isolate=new GW({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),GW.contextHash=new GW({perNode:!0}),GW.lookAhead=new GW({perNode:!0}),GW.mounted=new GW({perNode:!0});class qW{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[GW.mounted.id]}}const $W=Object.create(null);class QW{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):$W,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new QW(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(GW.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(GW.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?e.name:n[r]];if(o)return o}}}}QW.none=new QW("",Object.create(null),0,8);class XW{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 QW(n.name,r,n.id,n.flags):n)}return new XW(t)}}const YW=new WeakMap,KW=new WeakMap;var ZW;!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"}(ZW||(ZW={}));class JW{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=qW.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 pU(this.topNode,e)}cursorAt(e,t=0,n=0){let r=YW.get(this)||this.topNode,o=new pU(r);return o.moveTo(e,t),YW.set(this,o._tree),o}get topNode(){return new iU(this,0,0,null)}resolve(e,t=0){let n=rU(YW.get(this)||this.topNode,e,t,!1);return YW.set(this,n),n}resolveInner(e,t=0){let n=rU(KW.get(this)||this.topNode,e,t,!0);return KW.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 iU?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=qW.get(e.tree);if(i&&i.overlay&&i.overlay[0].from<=t&&i.overlay[i.overlay.length-1].to>=t){let a=new iU(i.tree,i.overlay[0].from+e.from,-1,e);(o||(o=[r])).push(rU(a,t,n,!1))}}return o?uU(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&ZW.IncludeAnonymous)>0;for(let e=this.cursor(i|ZW.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:gU(QW.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new JW(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new JW(QW.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:o=UW,reused:i=[],minRepeatType:a=r.types.length}=e,l=Array.isArray(n)?new eU(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 tU(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 JW){if(!s&&i.type==e&&i.length==o)return i;(a=i.prop(GW.lookAhead))&&(l=r[s]+i.length+a)}return h(e,n,r,o,l,t)}}(C,S);x=gU(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 tU(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=[GW.contextHash,i];a=a?[e].concat(a):[e]}if(o>25){let e=[GW.lookAhead,o];a=a?[e].concat(a):[e]}return new JW(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 JW(s[e.topID],g.reverse(),v.reverse(),y)}(e)}}JW.empty=new JW(QW.none,[],[],0);class eU{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 eU(this.buffer,this.index)}}class tU{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return QW.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&&!(nU(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 tU(o,i,this.set)}}function nU(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 rU(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 iU&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:ZW.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof iU&&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 oU{cursor(e=0){return new pU(this,e)}getChild(e,t=null,n=null){let r=aU(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return aU(this,e,t,n)}resolve(e,t=0){return rU(this,e,t,!1)}resolveInner(e,t=0){return rU(this,e,t,!0)}matchContext(e){return lU(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 iU extends oU{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&ZW.EnterBracketed&&c instanceof JW&&(s=qW.get(c))&&!s.overlay&&s.bracketed&&n>=u&&n<=u+c.length||nU(r,n,u,u+c.length))if(c instanceof tU){if(o&ZW.ExcludeBuffers)continue;let a=c.findChild(0,c.buffer.length,t,n-u,r);if(a>-1)return new cU(new sU(i,c,e,u),null,a)}else if(o&ZW.IncludeAnonymous||!c.type.isAnonymous||fU(c)){let a;if(!(o&ZW.IgnoreMounts)&&(a=qW.get(c))&&!a.overlay)return new iU(a.tree,u,e,i);let l=new iU(c,u,e,i);return o&ZW.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?c.children.length-1:0,t,n,r,o)}}if(o&ZW.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&ZW.IgnoreOverlays)&&(r=qW.get(this._tree))&&r.overlay){let o=e-this.from,i=n&ZW.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 iU(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 aU(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 lU(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 sU{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class cU extends oU{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 cU(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&ZW.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 cU(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 cU(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 cU(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 JW(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uU(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 iU&&n.index<0?null:n.parent,o=e.slice();return r?o[t]=r:o.splice(t,1),new dU(o,n)}class dU{constructor(e,t){this.heads=e,this.node=t}get next(){return uU(this.heads)}}class pU{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&~ZW.EnterBracketed,e instanceof iU)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 iU?(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&ZW.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ZW.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ZW.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&ZW.IncludeAnonymous||e instanceof tU||!e.type.isAnonymous||fU(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 cU(this.buffer,t,this.stack[e]);return this.bufferNode=new cU(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 lU(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 lU(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 fU(e){return e.children.some(e=>e instanceof tU||!e.type.isAnonymous||fU(e))}const hU=new WeakMap;function mU(e,t){if(!e.isAnonymous||t instanceof tU||t.type!=e)return 1;let n=hU.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof JW)){n=1;break}n+=mU(e,r)}hU.set(t,n)}return n}function gU(e,t,n,r,o,i,a,l,s){let c=0;for(let n=r;n<o;n++)c+=mU(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=mU(e,n[c]);for(c++;c<a;c++){let t=mU(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(gU(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 vU{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 cU?this.setBuffer(e.context.buffer,e.index,t):e instanceof iU&&this.map.set(e.tree,t)}get(e){return e instanceof cU?this.getBuffer(e.context.buffer,e.index):e instanceof iU?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 yU{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 yU(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 yU(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 bU{startParse(e,t,n){return"string"==typeof e&&(e=new wU(e)),n=n?n.length?n.map(e=>new HW(e.from,e.to)):[new HW(0,0)]:[new HW(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 wU{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 GW({perNode:!0});class EU{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 EU(e,[],t,n,n,0,[],0,r?new kU(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 EU(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 OU(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 kU(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 kU{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class OU{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 SU{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 SU(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 SU(this.stack,this.pos,this.index)}}function xU(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 _U{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const CU=new _U;class DU{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=CU,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=CU,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 PU{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;jU(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}PU.prototype.contextual=PU.prototype.fallback=PU.prototype.extend=!1;class AU{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?xU(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,o=e.resolveOffset(1,1);if(jU(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))}}AU.prototype.contextual=PU.prototype.fallback=PU.prototype.extend=!1;class TU{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function jU(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||MU(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 FU(e,t,n){for(let r,o=t;65535!=(r=e[o]);o++)if(r==n)return o-t;return-1}function MU(e,t,n,r){let o=FU(n,r,t);return o<0||FU(n,r,e)<o}const NU="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let IU=null;function RU(e,t,n){let r=e.cursor(ZW.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 LU{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?RU(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?RU(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 JW){if(i==e){if(i<this.safeFrom)return null;let e=i+o.length;if(e<=this.safeTo){let t=o.prop(GW.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 BU{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new _U)}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 _U,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 _U,{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(HU(a,l+2),t,n,r));break}l=HU(a,l+2)}a[l]==t&&(r=this.putAction(HU(a,l+1),t,n,r))}return r}}class zU{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 DU(t,r),this.tokens=new BU(e,this.stream),this.topTerm=e.top[1];let{from:o}=r[0];this.stacks=[EU.start(this,e.top[0],o)],this.fragments=n.length&&this.stream.end-o>4*e.bufferLength?new LU(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 NU&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw NU&&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 NU&&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=NU?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(GW.contextHash)||0)==n))return e.useNode(a,r),NU&&console.log(i+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof JW)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof JW&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),NU&&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),NU&&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 WU(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=NU?this.stackID(a)+" -> ":"";if(a.deadEnd){if(o)continue;if(o=!0,a.restart(),NU&&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()&&(NU&&console.log(d+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));e++)NU&&(d=this.stackID(u)+" -> ");for(let e of a.recoverByInsert(l))NU&&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),NU&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),WU(a,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),JW.build({buffer:SU.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=(IU||(IU=new WeakMap)).get(e);return t||IU.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function WU(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 UU{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}class VU extends bU{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=GW[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 XW(t.map((t,o)=>QW.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=UW;let i=xU(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(GU),this.states=xU(e.states,Uint32Array),this.data=xU(e.stateData),this.goto=xU(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new PU(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 zU(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 HU(n,i+2);break}o=n[i=HU(n,i+2)]}if(o==t||0==o)return HU(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=HU(this.data,n+2)}r=t(HU(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=HU(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(VU.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]=GU(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 UU(e,n,r)}static deserialize(e){return new VU(e)}}function HU(e,t){return e[t]|e[t+1]<<16}function GU(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}let qU=0;class $U{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=qU++}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 $U&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let r=new $U(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 XU(e);return e=>e.modified.indexOf(t)>-1?e:XU.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let QU=0;class XU{constructor(e){this.name=e,this.instances=[],this.id=QU++}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 $U(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(XU.get(t,e));return o}}function YU(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 ZU(r,o,a>0?n.slice(0,a):null);t[l]=s.sort(t[l])}}return KU.add(t)}const KU=new GW({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 ZU(o.tags,o.mode,o.context);n?n.next=i:r=i,n=i}return r}});class ZU{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 JU(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 eV(e,t,n,r=0,o=e.length){let i=new tV(r,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),r,o,"",i.highlighters),i.flush(o)}ZU.empty=new ZU([],2,null);class tV{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(KU);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||ZU.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(GW.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 nV=$U.define,rV=nV(),oV=nV(),iV=nV(oV),aV=nV(oV),lV=nV(),sV=nV(lV),cV=nV(lV),uV=nV(),dV=nV(uV),pV=nV(),fV=nV(),hV=nV(),mV=nV(hV),gV=nV(),vV={comment:rV,lineComment:nV(rV),blockComment:nV(rV),docComment:nV(rV),name:oV,variableName:nV(oV),typeName:iV,tagName:nV(iV),propertyName:aV,attributeName:nV(aV),className:nV(oV),labelName:nV(oV),namespace:nV(oV),macroName:nV(oV),literal:lV,string:sV,docString:nV(sV),character:nV(sV),attributeValue:nV(sV),number:cV,integer:nV(cV),float:nV(cV),bool:nV(lV),regexp:nV(lV),escape:nV(lV),color:nV(lV),url:nV(lV),keyword:pV,self:nV(pV),null:nV(pV),atom:nV(pV),unit:nV(pV),modifier:nV(pV),operatorKeyword:nV(pV),controlKeyword:nV(pV),definitionKeyword:nV(pV),moduleKeyword:nV(pV),operator:fV,derefOperator:nV(fV),arithmeticOperator:nV(fV),logicOperator:nV(fV),bitwiseOperator:nV(fV),compareOperator:nV(fV),updateOperator:nV(fV),definitionOperator:nV(fV),typeOperator:nV(fV),controlOperator:nV(fV),punctuation:hV,separator:nV(hV),bracket:mV,angleBracket:nV(mV),squareBracket:nV(mV),paren:nV(mV),brace:nV(mV),content:uV,heading:dV,heading1:nV(dV),heading2:nV(dV),heading3:nV(dV),heading4:nV(dV),heading5:nV(dV),heading6:nV(dV),contentSeparator:nV(uV),list:nV(uV),quote:nV(uV),emphasis:nV(uV),strong:nV(uV),link:nV(uV),monospace:nV(uV),strikethrough:nV(uV),inserted:nV(),deleted:nV(),changed:nV(),invalid:nV(),meta:gV,documentMeta:nV(gV),annotation:nV(gV),processingInstruction:nV(gV),definition:$U.defineModifier("definition"),constant:$U.defineModifier("constant"),function:$U.defineModifier("function"),standard:$U.defineModifier("standard"),local:$U.defineModifier("local"),special:$U.defineModifier("special")};for(let e in vV){let t=vV[e];t instanceof $U&&(t.name=e)}JU([{tag:vV.link,class:"tok-link"},{tag:vV.heading,class:"tok-heading"},{tag:vV.emphasis,class:"tok-emphasis"},{tag:vV.strong,class:"tok-strong"},{tag:vV.keyword,class:"tok-keyword"},{tag:vV.atom,class:"tok-atom"},{tag:vV.bool,class:"tok-bool"},{tag:vV.url,class:"tok-url"},{tag:vV.labelName,class:"tok-labelName"},{tag:vV.inserted,class:"tok-inserted"},{tag:vV.deleted,class:"tok-deleted"},{tag:vV.literal,class:"tok-literal"},{tag:vV.string,class:"tok-string"},{tag:vV.number,class:"tok-number"},{tag:[vV.regexp,vV.escape,vV.special(vV.string)],class:"tok-string2"},{tag:vV.variableName,class:"tok-variableName"},{tag:vV.local(vV.variableName),class:"tok-variableName tok-local"},{tag:vV.definition(vV.variableName),class:"tok-variableName tok-definition"},{tag:vV.special(vV.variableName),class:"tok-variableName2"},{tag:vV.definition(vV.propertyName),class:"tok-propertyName tok-definition"},{tag:vV.typeName,class:"tok-typeName"},{tag:vV.namespace,class:"tok-namespace"},{tag:vV.className,class:"tok-className"},{tag:vV.macroName,class:"tok-macroName"},{tag:vV.propertyName,class:"tok-propertyName"},{tag:vV.operator,class:"tok-operator"},{tag:vV.comment,class:"tok-comment"},{tag:vV.meta,class:"tok-meta"},{tag:vV.invalid,class:"tok-invalid"},{tag:vV.punctuation,class:"tok-punctuation"}]);const yV=[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 bV(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function wV(e){return e>=48&&e<=57}function EV(e){return wV(e)||e>=97&&e<=102||e>=65&&e<=70}const kV=(e,t,n)=>(r,o)=>{for(let i=!1,a=0,l=0;;l++){let{next:s}=r;if(bV(s)||45==s||95==s||i&&wV(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(),EV(r.next)){do{r.advance()}while(EV(r.next));32==r.next&&r.advance()}else r.next>-1&&r.advance();i=!0}}},OV=new TU(kV(136,2,137),{contextual:!0}),SV=new TU(kV(138,3,4),{contextual:!0}),xV=new TU(e=>{if(yV.includes(e.peek(-1))){let{next:t}=e;(bV(t)||95==t||35==t||46==t||42==t||91==t||58==t&&bV(e.peek(1))||45==t||38==t)&&e.acceptToken(135)}}),_V=new TU(e=>{if(!yV.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),bV(t)){do{e.advance()}while(bV(e.next)||wV(e.next));e.acceptToken(1)}}}),CV=YU({"AtKeyword import charset namespace keyframes media supports font-feature-values":vV.definitionKeyword,"from to selector scope MatchFlag":vV.keyword,NamespaceName:vV.namespace,KeyframeName:vV.labelName,KeyframeRangeName:vV.operatorKeyword,TagName:vV.tagName,ClassName:vV.className,PseudoClassName:vV.constant(vV.className),IdName:vV.labelName,"FeatureName PropertyName":vV.propertyName,AttributeName:vV.attributeName,NumberLiteral:vV.number,KeywordQuery:vV.keyword,UnaryQueryOp:vV.operatorKeyword,"CallTag ValueName FontName":vV.atom,VariableName:vV.variableName,Callee:vV.operatorKeyword,Unit:vV.unit,"UniversalSelector NestingSelector":vV.definitionOperator,"MatchOp CompareOp":vV.compareOperator,"ChildOp SiblingOp, LogicOp":vV.logicOperator,BinOp:vV.arithmeticOperator,Important:vV.modifier,Comment:vV.blockComment,ColorLiteral:vV.color,"ParenthesizedContent StringLiteral":vV.string,":":vV.punctuation,"PseudoOp #":vV.derefOperator,"; , |":vV.separator,"( )":vV.paren,"[ ]":vV.squareBracket,"{ }":vV.brace}),DV={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},PV={__proto__:null,or:104,and:104,not:112,only:112,layer:186},AV={__proto__:null,selector:118,layer:182},TV={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},jV={__proto__:null,to:223},FV=VU.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName 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 , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag 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 FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[CV],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[xV,_V,OV,SV,1,2,3,4,new AU("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>DV[e]||-1},{term:138,get:e=>PV[e]||-1},{term:4,get:e=>AV[e]||-1},{term:28,get:e=>TV[e]||-1},{term:136,get:e=>jV[e]||-1}],tokenPrec:2256});let MV=[],NV=[];function IV(e){if(e<768)return!1;for(let t=0,n=MV.length;;){let r=t+n>>1;if(e<MV[r])n=r;else{if(!(e>=NV[r]))return!0;t=r+1}if(t==n)return!1}}function RV(e){return e>=127462&&e<=127487}function LV(e,t,n=!0,r=!0){return(n?BV:zV)(e,t,r)}function BV(e,t,n){if(t==e.length)return t;t&&UV(e.charCodeAt(t))&&VV(e.charCodeAt(t-1))&&t--;let r=WV(e,t);for(t+=HV(r);t<e.length;){let o=WV(e,t);if(8205==r||8205==o||n&&IV(o))t+=HV(o),r=o;else{if(!RV(o))break;{let n=0,r=t-2;for(;r>=0&&RV(WV(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function zV(e,t,n){for(;t>0;){let r=BV(e,t-2,n);if(r<t)return r;t--}return 0}function WV(e,t){let n=e.charCodeAt(t);if(!VV(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return UV(r)?r-56320+(n-55296<<10)+65536:n}function UV(e){return e>=56320&&e<57344}function VV(e){return e>=55296&&e<56320}function HV(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?NV:MV).push(n+=e[t])})();class GV{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]=eH(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),$V.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]=eH(this,e,t);let n=[];return this.decompose(e,t,n,0),$V.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 YV(this),o=new YV(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 YV(this,e)}iterRange(e,t=this.length){return new KV(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 ZV(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 qV(e):$V.from(qV.split(e,[])):GV.empty}}class qV extends GV{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 JV(r,a,n,i);r=a+1,n++}}decompose(e,t,n,r){let o=e<=0&&t>=this.length?this:new qV(XV(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=QV(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new qV(t,e.length+o.length));else{let e=t.length>>1;n.push(new qV(t.slice(0,e)),new qV(t.slice(e)))}}else n.push(o)}replace(e,t,n){if(!(n instanceof qV))return super.replace(e,t,n);[e,t]=eH(this,e,t);let r=QV(this.text,QV(n.text,XV(this.text,0,e)),t),o=this.length+n.length-(t-e);return r.length<=32?new qV(r,o):$V.from(qV.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=eH(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 qV(n,r)),n=[],r=-1);return r>-1&&t.push(new qV(n,r)),t}}class $V extends GV{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]=eH(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 $V(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]=eH(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 $V))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 qV(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 $V)for(let t of e.children)u(t);else e.lines>i&&(l>i||!l)?(d(),a.push(e)):e instanceof qV&&l&&(t=c[c.length-1])instanceof qV&&e.lines+t.lines<=32?(l+=e.lines,s+=e.length+1,c[c.length-1]=new qV(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]:$V.from(c,s)),s=-1,l=c.length=0)}for(let t of e)u(t);return d(),1==a.length?a[0]:new $V(a,t)}}function QV(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 XV(e,t,n){return QV(e,[""],t,n)}GV.empty=new qV([""],0);class YV{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 qV?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 qV?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 qV){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 qV?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 KV{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new YV(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 ZV{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&&(GV.prototype[Symbol.iterator]=function(){return this.iter()},YV.prototype[Symbol.iterator]=KV.prototype[Symbol.iterator]=ZV.prototype[Symbol.iterator]=function(){return this});class JV{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 eH(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function tH(e,t,n=!0,r=!0){return LV(e,t,n,r)}function nH(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 rH(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function oH(e){return e<65536?1:2}const iH=/\r\n?|\n/;var aH=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(aH||(aH={}));class lH{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){dH(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 lH(e)}composeDesc(e){return this.empty?e:e.empty?this:fH(this,e)}mapDesc(e,t=!1){return e.empty?this:pH(this,e,t)}mapPos(e,t=-1,n=aH.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!=aH.Simple&&s>=e&&(n==aH.TrackDel&&r<e&&s>e||n==aH.TrackBefore&&r<e||n==aH.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 lH(e)}static create(e){return new lH(e)}}class sH extends lH{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 dH(this,(t,n,r,o,i)=>e=e.replace(r,r+(n-t),i),!1),e}mapDesc(e,t=!1){return pH(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(GV.empty);n.push(i?e.slice(o,o+i):GV.empty)}o+=i}return new sH(t,n)}compose(e){return this.empty?e:e.empty?this:fH(this,e,!0)}map(e,t=!1){return e.empty?this:pH(this,e,t,!0)}iterChanges(e,t=!1){dH(this,e,t)}get desc(){return lH.create(this.sections)}filter(e){let t=[],n=[],r=[],o=new hH(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);cH(r,e,-1);let i=-1==o.ins?-1:0==o.off?o.ins:0;cH(t,e,i),i>0&&uH(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);cH(t,e,-1),cH(r,e,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(e),a+=e}}return{changes:new sH(t,n),filtered:lH.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&&cH(r,t-i,-1);let n=new sH(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 sH){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?GV.of(c.split(n||iH)):c:GV.empty,d=u.length;if(e==a&&0==d)return;e<i&&l(),e>i&&cH(r,e-i,-1),cH(r,a-e,d),uH(o,r,u),i=a}}(e),l(!a),a}static empty(e){return new sH(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(GV.empty);n[r]=GV.of(o.slice(1)),t.push(o[0],n[r].length)}}}return new sH(t,n)}static createSet(e,t){return new sH(e,t)}}function cH(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 uH(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(GV.empty);e.push(n)}}function dH(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=GV.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 pH(e,t,n,r=!1){let o=[],i=r?[]:null,a=new hH(e),l=new hH(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);cH(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(cH(o,l.ins,-1);t;){let n=Math.min(a.len,t);a.ins>=0&&e<a.i&&a.len<=n&&(cH(o,0,a.ins),i&&uH(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?sH.createSet(o,i):lH.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()}cH(o,t,e<a.i?a.ins:0),i&&e<a.i&&uH(i,o,a.text),e=a.i,a.forward(a.len-n)}}}}function fH(e,t,n=!1){let r=[],o=n?[]:null,i=new hH(e),a=new hH(t);for(let e=!1;;){if(i.done&&a.done)return o?sH.createSet(r,o):lH.create(r);if(0==i.ins)cH(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;cH(r,t,n,e),o&&n&&uH(o,r,a.text)}else-1==a.ins?(cH(r,i.off?0:i.len,t,e),o&&uH(o,r,i.textBit(t))):(cH(r,i.off?0:i.len,a.off?0:a.ins,e),o&&!a.off&&uH(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 cH(r,0,a.ins,e),o&&uH(o,r,a.text),a.next()}}class hH{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?GV.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?GV.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 mH{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 mH(n,r,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return gH.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return gH.range(this.anchor,r,void 0,void 0,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 gH.range(e.anchor,e.head)}static create(e,t,n){return new mH(e,t,n)}}class gH{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:gH.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 gH([this.main],0)}addRange(e,t=!0){return gH.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,gH.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 gH(e.ranges.map(e=>mH.fromJSON(e)),e.main)}static single(e,t=e){return new gH([gH.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 gH.normalized(e.slice(),t);n=o.to}return new gH(e,t)}static cursor(e,t=0,n,r){return mH.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,o){let i=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return o||e==t||(o=t<e?1:-1),t<e?mH.create(t,e,48|i):mH.create(e,t,(o?o<0?8:16:0)|i)}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?gH.range(a,i):gH.range(i,a))}}return new gH(e,t)}}function vH(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let yH=0;class bH{constructor(e,t,n,r,o){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=yH++,this.default=e([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(e={}){return new bH(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:wH),!!e.static,e.enables)}of(e){return new EH([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new EH(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new EH(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function wH(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class EH{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=yH++}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)||OH(e,c)){let t=n(e);if(a?!kH(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=MH(t,s);if(this.dependencies.every(n=>n instanceof bH?t.facet(n)===e.facet(n):!(n instanceof _H)||t.field(n,!1)==e.field(n,!1))||(a?kH(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 kH(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 OH(e,t){let n=!1;for(let r of t)1&FH(e,r)&&(n=!0);return n}function SH(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=MH(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)FH(e,t);return e.values[a]=l(e),1},update(e,n){if(!OH(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=OH(e,r),s=o.config.facets[t.id],c=o.facet(t);if(s&&!i&&wH(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 xH=bH.define({static:!0});class _H{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 _H(yH++,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(xH).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(xH),i=n.facet(xH);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,xH.of({field:this,create:e})]}get extension(){return this}}function CH(e){return t=>new PH(t,e)}const DH={highest:CH(0),high:CH(1),default:CH(2),low:CH(3),lowest:CH(4)};class PH{constructor(e,t){this.inner=e,this.prec=t}}class AH{of(e){return new TH(this,e)}reconfigure(e){return AH.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class TH{constructor(e,t){this.compartment=e,this.inner=t}}class jH{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 TH&&n.delete(i.compartment)}if(o.set(i,a),Array.isArray(i))for(let t of i)e(t,a);else if(i instanceof TH){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 PH)e(i.inner,i.prec);else if(i instanceof _H)r[a].push(i),i.provides&&e(i.provides,a);else if(i instanceof EH)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 _H?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,wH(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=>SH(e,r,t))}}let u=s.map(e=>e(a));return new jH(e,i,u,a,l,o)}}function FH(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 MH(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const NH=bH.define(),IH=bH.define({combine:e=>e.some(e=>e),static:!0}),RH=bH.define({combine:e=>e.length?e[0]:void 0,static:!0}),LH=bH.define(),BH=bH.define(),zH=bH.define(),WH=bH.define({combine:e=>!!e.length&&e[0]});class UH{constructor(e,t){this.type=e,this.value=t}static define(){return new VH}}class VH{of(e){return new UH(this,e)}}class HH{constructor(e){this.map=e}of(e){return new GH(this,e)}}class GH{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 GH(this.type,t)}is(e){return this.type==e}static define(e={}){return new HH(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}}GH.reconfigure=GH.define(),GH.appendConfig=GH.define();class qH{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&&vH(n,t.newLength),o.some(e=>e.type==qH.time)||(this.annotations=o.concat(qH.time.of(Date.now())))}static create(e,t,n,r,o,i){return new qH(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(qH.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function $H(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 QH(e,t,n){var r;let o,i,a;return n?(o=t.changes,i=sH.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:GH.mapEffects(e.effects,o).concat(GH.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function XH(e,t,n){let r=t.selection,o=ZH(t.annotations);return t.userEvent&&(o=o.concat(qH.userEvent.of(t.userEvent))),{changes:t.changes instanceof sH?t.changes:sH.of(t.changes||[],n,e.facet(RH)),selection:r&&(r instanceof gH?r:gH.single(r.anchor,r.head)),effects:ZH(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function YH(e,t,n){let r=XH(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=QH(r,XH(e,t[o],i?r.changes.newLength:e.doc.length),i)}let o=qH.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(zH),r=e;for(let o=n.length-1;o>=0;o--){let i=n[o](e);i&&Object.keys(i).length&&(r=QH(r,XH(t,i,e.changes.newLength),!0))}return r==e?e:qH.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(LH)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:$H(n,t))}if(!0!==n){let r,o;if(!1===n)o=e.changes.invertedDesc,r=sH.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=qH.create(t,r,e.selection&&e.selection.map(o),GH.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(BH);for(let n=r.length-1;n>=0;n--){let o=r[n](e);e=o instanceof qH?o:Array.isArray(o)&&1==o.length&&o[0]instanceof qH?o[0]:YH(t,ZH(o),!1)}return e}(o):o)}qH.time=UH.define(),qH.userEvent=UH.define(),qH.addToHistory=UH.define(),qH.remote=UH.define();const KH=[];function ZH(e){return null==e?KH:Array.isArray(e)?e:[e]}var JH=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(JH||(JH={}));const eG=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let tG;try{tG=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class nG{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++)FH(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return FH(this,n),MH(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return YH(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:o}=n;for(let t of e.effects)t.is(AH.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(GH.reconfigure)?(n=null,r=t.value):t.is(GH.appendConfig)&&(n=null,r=ZH(r).concat(t.value));n?t=e.startState.values.slice():(n=jH.resolve(r,o,this),t=new nG(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let i=e.startState.facet(IH)?e.newSelection:e.newSelection.asSingle();new nG(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:gH.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=ZH(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=GH.mapEffects(i,s).concat(GH.mapEffects(ZH(a.effects),c))}return{changes:r,selection:gH.create(o,t.mainIndex),effects:i}}changes(e=[]){return e instanceof sH?e:sH.of(e,this.doc.length,this.facet(nG.lineSeparator))}toText(e){return GV.of(e.split(this.facet(nG.lineSeparator)||iH))}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:(FH(this,t),MH(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 _H&&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 nG.create({doc:e.doc,selection:gH.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=jH.resolve(e.extensions||[],new Map),n=e.doc instanceof GV?e.doc:GV.of((e.doc||"").split(t.staticFacet(nG.lineSeparator)||iH)),r=e.selection?e.selection instanceof gH?e.selection:gH.single(e.selection.anchor,e.selection.head):gH.single(0);return vH(r,n.length),t.staticFacet(IH)||(r=r.asSingle()),new nG(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(nG.tabSize)}get lineBreak(){return this.facet(nG.lineSeparator)||"\n"}get readOnly(){return this.facet(WH)}phrase(e,...t){for(let t of this.facet(nG.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(NH))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 JH.Space;if(function(e){if(tG)return tG.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||eG.test(n)))return!0}return!1}(e))return JH.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return JH.Word;return JH.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=tH(t,i,!1);if(o(t.slice(e,i))!=JH.Word)break;i=e}for(;a<r;){let e=tH(t,a);if(o(t.slice(a,e))!=JH.Word)break;a=e}return i==a?null:gH.range(i+n,a+n)}}function rG(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}nG.allowMultipleSelections=IH,nG.tabSize=bH.define({combine:e=>e.length?e[0]:4}),nG.lineSeparator=RH,nG.readOnly=WH,nG.phrases=bH.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])}}),nG.languageData=NH,nG.changeFilter=LH,nG.transactionFilter=BH,nG.transactionExtender=zH,AH.reconfigure=GH.define();class oG{eq(e){return this==e}range(e,t=e){return aG.create(e,t,this)}}function iG(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}oG.prototype.startSide=oG.prototype.endSide=0,oG.prototype.point=!1,oG.prototype.mapMode=aH.TrackDel;class aG{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new aG(e,t,n)}}function lG(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class sG{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 sG(r,o,n,a):null,pos:i}}}class cG{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 cG(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(lG)),this.isEmpty)return t.length?cG.of(t):this;let a=new pG(this,null,-1).goto(0),l=0,s=[],c=new uG;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(aG.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!s.length?cG.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 cG(n,t,o||cG.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 fG.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return fG.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=dG(i,a,n),s=new mG(i,l,o),c=new mG(a,l,o);n.iterGaps((e,t,n)=>gG(s,e,c,t,n,r)),n.empty&&0==n.length&&gG(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=dG(o,i),l=new mG(o,a,0).goto(n),s=new mG(i,a,0).goto(n);for(;;){if(l.to!=s.to||!vG(l.active,s.active)||l.point&&(!s.point||!iG(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 mG(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 uG;for(let r of e instanceof aG?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(lG(t,r)>0)return e.slice().sort(lG);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return cG.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=cG.empty;r=r.nextLayer)t=new cG(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}cG.empty=new cG([],[],null,-1),cG.empty.nextLayer=cG.empty;class uG{finishChunk(e){this.chunks.push(new sG(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 uG)).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(cG.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=cG.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function dG(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 pG{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 fG{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 pG(i,t,n,o));return 1==r.length?r[0]:new fG(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--)hG(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--)hG(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(),hG(this.heap,0)}}}function hG(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 mG{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=fG.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){yG(this.active,e),yG(this.activeTo,e),yG(this.activeRank,e),this.minActive=wG(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++;bG(this.active,t,n),bG(this.activeTo,t,r),bG(this.activeRank,t,o),e&&bG(e,t,this.cursor.from),this.minActive=wG(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&&yG(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 gG(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&&iG(e.point,n.point)&&vG(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(l,d,e.point,n.point),t=!1):(t&&i.boundChange(l),d>l&&!vG(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 vG(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!iG(e[n],t[n]))return!1;return!0}function yG(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function bG(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function wG(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 EG(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=tH(e,o));return r}function kG(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=tH(e,r)}return!0===r?-1:e.length}const OG="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),SG="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),xG="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class _G{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=xG[OG]||1;return xG[OG]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[SG],o=n&&n.nonce;r?o&&r.setNonce(o):r=new DG(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let CG=new Map;class DG{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=CG.get(n);if(t)return e[SG]=t;this.sheet=new r.CSSStyleSheet,CG.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[SG]=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 PG={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:"'"},AG={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},TG="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),jG="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),FG=0;FG<10;FG++)PG[48+FG]=PG[96+FG]=String(FG);for(FG=1;FG<=24;FG++)PG[FG+111]="F"+FG;for(FG=65;FG<=90;FG++)PG[FG]=String.fromCharCode(FG+32),AG[FG]=String.fromCharCode(FG);for(var MG in PG)AG.hasOwnProperty(MG)||(AG[MG]=PG[MG]);function NG(){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++)IG(e,arguments[t]);return e}function IG(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++)IG(e,t[n])}}let RG="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},LG="undefined"!=typeof document?document:{documentElement:{style:{}}};const BG=/Edge\/(\d+)/.exec(RG.userAgent),zG=/MSIE \d/.test(RG.userAgent),WG=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(RG.userAgent),UG=!!(zG||WG||BG),VG=!UG&&/gecko\/(\d+)/i.test(RG.userAgent),HG=!UG&&/Chrome\/(\d+)/.exec(RG.userAgent),GG="webkitFontSmoothing"in LG.documentElement.style,qG=!UG&&/Apple Computer/.test(RG.vendor),$G=qG&&(/Mobile\/\w+/.test(RG.userAgent)||RG.maxTouchPoints>2);var QG={mac:$G||/Mac/.test(RG.platform),windows:/Win/.test(RG.platform),linux:/Linux|X11/.test(RG.platform),ie:UG,ie_version:zG?LG.documentMode||6:WG?+WG[1]:BG?+BG[1]:0,gecko:VG,gecko_version:VG?+(/Firefox\/(\d+)/.exec(RG.userAgent)||[0,0])[1]:0,chrome:!!HG,chrome_version:HG?+HG[1]:0,ios:$G,android:/Android\b/.test(RG.userAgent),webkit:GG,webkit_version:GG?+(/\bAppleWebKit\/(\d+)/.exec(RG.userAgent)||[0,0])[1]:0,safari:qG,safari_version:qG?+(/\bVersion\/(\d+(\.\d+)?)/.exec(RG.userAgent)||[0,0])[1]:0,tabSize:null!=LG.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function XG(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 YG=Object.create(null);function KG(e,t,n){if(e==t)return!0;e||(e=YG),t||(t=YG);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 ZG(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 JG(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 eq{eq(e){return!1}updateDOM(e,t,n){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 tq=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(tq||(tq={}));class nq extends oG{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 rq(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 iq(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}=aq(e,r);t=(o?r?-3e8:-1:5e8)-1,n=1+(i?r?2e8:1:-6e8)}return new iq(e,t,n,r,e.widget||null,!0)}static line(e){return new oq(e)}static set(e,t=!1){return cG.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}nq.none=cG.empty;class rq extends nq{constructor(e){let{start:t,end:n}=aq(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?XG(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||YG}eq(e){return this==e||e instanceof rq&&this.tagName==e.tagName&&KG(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)}}rq.prototype.point=!1;class oq extends nq{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof oq&&this.spec.class==e.spec.class&&KG(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)}}oq.prototype.mapMode=aH.TrackBefore,oq.prototype.point=!0;class iq extends nq{constructor(e,t,n,r,o,i){super(t,n,o,e),this.block=r,this.isReplace=i,this.mapMode=r?t<=0?aH.TrackBefore:aH.TrackAfter:aH.TrackDel}get type(){return this.startSide!=this.endSide?tq.WidgetRange:this.startSide<=0?tq.WidgetBefore:tq.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof iq&&(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 aq(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 lq(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)}iq.prototype.point=!0;class sq extends oG{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof sq&&this.tagName==e.tagName&&KG(this.attributes,e.attributes)}static create(e){return new sq(e.tagName,e.attributes||YG)}static set(e,t=!1){return cG.of(e,t)}}function cq(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function uq(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function dq(e,t){if(!t.anchorNode)return!1;try{return uq(e,t.anchorNode)}catch(e){return!1}}function pq(e){return 3==e.nodeType?_q(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function fq(e,t,n,r){return!!n&&(gq(e,t,n,r,-1)||gq(e,t,n,r,1))}function hq(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function mq(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function gq(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:vq(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=hq(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?vq(e):0}}}function vq(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function yq(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function bq(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 wq(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}}function Eq(e,t=!0){let n=e.ownerDocument,r=null,o=null;for(let i=e.parentNode;i&&i!=n.body&&(t&&!r||!o);)if(1==i.nodeType)!o&&i.scrollHeight>i.clientHeight&&(o=i),t&&!r&&i.scrollWidth>i.clientWidth&&(r=i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}return{x:r,y:o}}sq.prototype.startSide=sq.prototype.endSide=-1;class kq{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?vq(t):0),n,Math.min(e.focusOffset,n?vq(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Oq,Sq=null;function xq(e){if(e.setActive)return e.setActive();if(Sq)return e.focus(Sq);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==Sq?{get preventScroll(){return Sq={preventScroll:!0},!0}}:void 0),!Sq){Sq=!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 _q(e,t,n=t){let r=Oq||(Oq=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Cq(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 Dq(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Pq(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=vq(n)}else{if(!n.parentNode||mq(n))return null;r=hq(n),n=n.parentNode}}}function Aq(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||mq(n))return null;r=hq(n)+1,n=n.parentNode}}}QG.safari&&QG.safari_version>=26&&(Sq=!1);class Tq{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Tq(e.parentNode,hq(e),t)}static after(e,t){return new Tq(e.parentNode,hq(e)+1,t)}}var jq=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(jq||(jq={}));const Fq=jq.LTR,Mq=jq.RTL;function Nq(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const Iq=Nq("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Rq=Nq("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Lq=Object.create(null),Bq=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);Lq[t]=n,Lq[n]=-t}function zq(e){return e<=247?Iq[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 Wq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Uq{get dir(){return this.level%2?Mq:Fq}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 Vq(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||!Vq(r.inner,o.inner))return!1}return!0}const Hq=[];function Gq(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=Hq[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(Hq[e]==l)break e;break}e=i[t++].to}c++,d?d.push(h):(h.from>s&&a.push(new Uq(s,h.from,p)),qq(e,h.direction==Fq!=!(p%2)?r+1:r,o,h.inner,h.from,h.to,a),s=h.to),f=h.to}else{if(f==n||(t?Hq[f]!=l:Hq[f]==l))break;f++}d?Gq(e,s,f,r+1,o,d,a):s<f&&a.push(new Uq(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=Hq[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(Hq[e-1]==l)break e;break}e=i[--n].from}d?d.push(h):(h.to<s&&a.push(new Uq(h.to,s,p)),qq(e,h.direction==Fq!=!(p%2)?r+1:r,o,h.inner,h.from,h.to,a),s=h.from),f=h.from}else{if(f==t||(n?Hq[f-1]!=l:Hq[f-1]==l))break;f--}d?Gq(e,f,s,r+1,o,d,a):f<s&&a.push(new Uq(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=zq(e.charCodeAt(t));512==o?o=n:8==o&&4==r&&(o=16),Hq[t]=4==o?2:o,7&o&&(r=o),n=o}for(let e=a,t=s,r=s;e<l;e++){let o=Hq[e];if(128==o)e<l-1&&t==Hq[e+1]&&24&t?o=Hq[e]=t:Hq[e]=256;else if(64==o){let o=e+1;for(;o<l&&64==Hq[o];)o++;let i=e&&8==t||o<n&&8==Hq[o]?1==r?1:8:256;for(let t=e;t<o;t++)Hq[t]=i;e=o-1}else 8==o&&1==r&&(Hq[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=Lq[t=e.charCodeAt(a)])if(n<0){for(let e=l-3;e>=0;e-=3)if(Bq[e+1]==-n){let t=Bq[e+2],n=2&t?o:4&t?1&t?i:o:0;n&&(Hq[a]=Hq[Bq[e]]=n),l=e;break}}else{if(189==Bq.length)break;Bq[l++]=a,Bq[l++]=t,Bq[l++]=s}else if(2==(r=Hq[a])||1==r){let e=r==o;s=e?0:1;for(let t=l-3;t>=0;t-=3){let n=Bq[t+2];if(2&n)break;if(e)Bq[t+2]|=2;else{if(4&n)break;Bq[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=Hq[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!=Hq[a])break;a++}let c=1==i,u=c==(1==(a<t?Hq[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),Hq[--t]=u;s=a}else i=a,s++}}}(o,i,r,l),Gq(e,o,i,t,n,r,a)}function $q(e){return[new Uq(0,e,0)]}let Qq="";function Xq(e,t,n,r,o){var i;let a=r.head-e.from,l=Uq.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=tH(e.text,a,s.forward(o,n));(u<s.from||u>s.to)&&(u=c),Qq=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?gH.cursor(d.side(!o,n)+e.from,d.forward(o,n)?1:-1,d.level):gH.cursor(u+e.from,s.forward(o,n)?-1:1,s.level)}function Yq(e,t,n){for(let r=t;r<n;r++){let t=zq(e.charCodeAt(r));if(1==t)return Fq;if(2==t||4==t)return Mq}return Fq}const Kq=bH.define(),Zq=bH.define(),Jq=bH.define(),e$=bH.define(),t$=bH.define(),n$=bH.define(),r$=bH.define(),o$=bH.define(),i$=bH.define(),a$=bH.define({combine:e=>e.some(e=>e)}),l$=bH.define({combine:e=>e.some(e=>e)}),s$=bH.define();class c${constructor(e,t,n,r,o,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 c$(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 c$(gH.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const u$=GH.define({map:(e,t)=>e.map(t)}),d$=GH.define();function p$(e,t,n){let r=e.facet(e$);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 f$=bH.define({combine:e=>!e.length||e[0]});let h$=0;const m$=bH.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 g${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(m$.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(m$.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:o,decorations:i}=t||{};return new g$(h$++,e,n,r,e=>{let t=[];return i&&t.push(w$.of(t=>{let n=t.plugin(e);return n?i(n):nq.none})),o&&t.push(o(e)),t})}static fromClass(e,t){return g$.define((t,n)=>new e(t,n),t)}}class v${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(p$(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){p$(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){p$(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const y$=bH.define(),b$=bH.define(),w$=bH.define(),E$=bH.define(),k$=bH.define(),O$=bH.define(),S$=bH.define();function x$(e,t){let n=e.state.facet(S$);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),o=[];return cG.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=Yq(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 _$=bH.define();function C$(e){let t=0,n=0,r=0,o=0;for(let i of e.state.facet(_$)){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 D$=bH.define();class P${constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new P$(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 P$(c,d,s,u))}return n}}class A${constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=sH.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 P$(e,t,n,o))),this.changedRanges=r}static create(e,t,n){return new A$(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 T$=[];class j${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 T$}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=hq(this.dom),r=this.length?e>0:t>0;return new Tq(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 N$)return e;return null}static get(e){return e.cmTile}}class F$ extends j${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=M$(t);else n.insertBefore(a.dom,t);r=a.dom}for(t=r?r.nextSibling:n.firstChild,o&&t&&(o.written=!0);t;)t=M$(t);this.length=i}}function M$(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class N$ extends F${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=j$.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 I$)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 I$ extends F${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 I$(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class R$ extends F${constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new R$(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&&L$(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=pq(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 Tq(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 Tq(e.dom,0);e==n.tile&&(i=!0)}}return new Tq(this.dom,0)}}function L$(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class B$ extends F${constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new B$(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class z$ extends j${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?QG.chrome||QG.gecko||(e?(r--,i=1):o<n&&(o++,i=-1)):t<0?r--:o<n&&o++;let a=_q(this.dom,r,o).getClientRects();if(!a.length)return null;let l=a[(i?i<0:t>=0)?0:a.length-1];return QG.safari&&!i&&0==l.width&&(l=Array.prototype.find.call(a,e=>e.width)||l),i?yq(l,i<0):l||null}static of(e,t){let n=new z$(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class W$ extends j${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 yq(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 yq(n,!r)}}get overrideDOMText(){if(!this.length)return GV.empty;let{root:e}=this;if(!e)return GV.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 W$(o,n,e,r)}}class U$ extends j${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 GV.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class V${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 H${constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class G${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 z$(a.dom,a.text+e)).parent=i):i.append(r||z$.of(e,null===(o=this.cache.find(z$))||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)?Z$(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 B$&&o.mark.eq(n.mark))o.dom!=n.dom&&o.setDOM(Z$(n.dom)),r=o;else{if(this.cache.reused.get(n)){let e=j$.get(n.dom);e&&e.setDOM(Z$(n.dom))}let e=B$.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let o=j$.get(e.text);o&&this.cache.reused.set(o,2);let i=new z$(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=K$);let r=R$.start(e,t||(null===(n=this.cache.find(R$))||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 B$&&i.mark.eq(a))r=i,t--;else{let e=B$.of(a,null===(n=this.cache.find(B$,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&&Y$(this.curLine,!1)&&("BR"==e.dom.nodeName||!e.isWidget()||QG.ios&&Y$(this.curLine,!0))||this.curLine.append(this.cache.findWidget(eQ,0,32)||new W$(eQ.toDOM(),0,eQ,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 H$(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 I$&&r.wrapper.eq(n.wrapper))t=r;else{let r=I$.of(n.wrapper,null===(e=this.cache.find(I$,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(U$,void 0,1);return n&&(n.flags=t),n||new U$(t)}flushBuffer(){!this.afterWidget||32&this.afterWidget.flags||(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class q${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 $$=[W$,R$,z$,B$,U$,I$,N$];for(let e=0;e<$$.length;e++)$$[e].bucket=e;class Q${constructor(e){this.view=e,this.buckets=$$.map(()=>[]),this.index=$$.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,a.widget)))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 W$(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 X${constructor(e,t,n,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new Q$(e),this.text=new q$(e.state.doc),this.builder=new G$(this.cache,new N$(e,e.contentDOM),cG.iter(n)),this.cache.reused.set(t,2),this.old=new V$(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 B$&&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?W$.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.reused.has(e)?(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 U$)this.cache.add(e);else{if(!(e instanceof B$))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 B$&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=o=0):e instanceof B$&&(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=cG.spans(this.decorations,e,t,{point:(e,t,i,a,l,s)=>{if(i instanceof iq){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?J$.block:J$.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)||W$.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&&XG(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=j$.get(r);if(r==this.view.contentDOM)break;e instanceof B$?t.push(e):(null==e?void 0:e.isLine())?n=e:e instanceof I$||("DIV"!=r.nodeName||n||r==this.view.contentDOM?n||t.push(B$.of(new rq({tagName:r.nodeName.toLowerCase(),attributes:JG(r)}),r)):n=new R$(r,K$))}return{line:n,marks:t}}}function Y$(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 K$={class:"cm-line"};function Z$(e){let t=j$.get(e);return t&&t.setDOM(e.cloneNode()),e}class J$ extends eq{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}}J$.inline=new J$("span"),J$.block=new J$("div");const eQ=new class extends eq{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class tQ{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=nq.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 N$(e,e.contentDOM),this.updateInner([new P$(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=rQ(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 P$(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 P$(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,(QG.ie||QG.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 oQ;return cG.compare(e,t,n,r),r.changes}(i,this.decorations,e.changes);l.length&&(n=P$.extendWithRanges(n,l));let s=function(e,t,n){let r=new iQ;return cG.compare(e,t,n,r),r.changes}(a,this.blockWrappers,e.changes);return s.length&&(n=P$.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 X$(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&j$.get(t.text)&&r.cache.reused.set(j$.get(t.text),2),this.tile=r.run(e,t),nQ(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=QG.chrome||QG.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 aQ&&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(d$)&&(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(f$)||n.tabIndex>-1)&&dq(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)),QG.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 Tq(e,0),a=!0}var u;let d=this.view.observer.selectionRange;!a&&d.focusNode&&(fq(l.node,l.offset,d.anchorNode,d.anchorOffset)&&fq(s.node,s.offset,d.focusNode,d.focusOffset)||this.suppressWidgetCursorChange(d,c))||(this.view.observer.ignore(()=>{QG.android&&QG.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=cq(this.view.root);if(e)if(c.empty){if(QG.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?Pq:Aq)(l.node,l.offset);t&&(l=new Tq(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 Tq(d.anchorNode,d.anchorOffset),this.impreciseHead=s.precise?null:new Tq(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&fq(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=cq(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==vq(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&&!j$.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 aQ?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=tH(t.text,n);if(e==n)return null;let r=_q(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==jq.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 I$)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?pq(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?jq.RTL:jq.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=pq(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=pq(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(nq.replace({widget:new aQ(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!o)break;n=o.to+1}return nq.set(e)}updateDeco(){let e=1,t=this.view.state.facet(w$).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(k$).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(cG.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(E$).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){var t;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(s$))try{if(t(this.view,e.range,e))return!0}catch(e){p$(this.view.state,e,"scroll handler")}let n,{range:r}=e,o=this.coordsAt(r.head,null!==(t=r.assoc)&&void 0!==t?t:r.empty?0:r.head>r.anchor?-1:1);if(!o)return;!r.empty&&(n=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(o={left:Math.min(o.left,n.left),top:Math.min(o.top,n.top),right:Math.max(o.right,n.right),bottom:Math.max(o.bottom,n.bottom)});let i=C$(this.view),a={left:o.left-i.left,top:o.top-i.top,right:o.right+i.right,bottom:o.bottom+i.bottom},{offsetWidth:l,offsetHeight:s}=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=bq(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}=wq(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+a?(g=t.top-(e.top+a),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+a)):t.bottom>e.bottom-a&&(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+i?(m=t.left-(e.left+i),n>0&&t.right>e.right+m&&(m=t.right-e.right+i)):t.right>e.right-i&&(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,a,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==jq.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(r.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(){nQ(this.tile)}}function nQ(e,t){let n=null==t?void 0:t.get(e);if(1!=n){null==n&&e.destroy();for(let n of e.children)nQ(n,t)}}function rQ(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Pq(n.focusNode,n.focusOffset),o=Aq(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let t=j$.get(o.node);if(!t||t.isText()&&t.text!=o.node.nodeValue)i=o;else if(e.docView.lastCompositionAfterCursor){let e=j$.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 oQ=class{constructor(){this.changes=[]}compareRange(e,t){lq(e,t,this.changes)}comparePoint(e,t){lq(e,t,this.changes)}boundChange(e){lq(e,e,this.changes)}};class iQ{constructor(){this.changes=[]}compareRange(e,t){lq(e,t,this.changes)}comparePoint(){}boundChange(e){lq(e,e,this.changes)}}class aQ extends eq{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 lQ(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!=tq.Text||e.type==o.type&&!(n<0?o.from<t:o.to>t))||(e=o)}}return e||r}return r}function sQ(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=Qq;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 cQ(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 uQ(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=cQ(e,o.from,0);t!=o.from&&(i=gH.cursor(t,-1))}else{let t=cQ(e,o.from,-1),n=cQ(e,o.to,1);t==o.from&&n==o.to||(i=gH.range(o.from==o.anchor?t:n,o.from==o.head?t:n))}i&&(n||(n=t.ranges.slice()),n[r]=i)}return n?gH.create(n,t.mainIndex):t}function dQ(e,t,n){let r=cQ(e.state.facet(O$).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:gH.cursor(r,r<n.from?1:-1)}class pQ{constructor(e,t){this.pos=e,this.assoc=t}}function fQ(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 pQ(0,1);if(c>e.viewState.docHeight)return new pQ(e.state.doc.length,-1);if(o=e.elementAtHeight(c),null==r)break;if(o.type==tq.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==tq.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+kG(a,i,e.state.tabSize)}(e,i,o,l,s);return new pQ(t,t==o.from?1:-1)}}if(o.type!=tq.Text)return c<(o.top+o.bottom)/2?new pQ(o.from,1):new pQ(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 hQ(e,l,s,e.textDirectionAt(o.from)).scanTile(u,o.from)}class hQ{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[Uq.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[Uq.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(!(0==l.width&&f.length>1)){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==jq.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)}if(u){if(n&&n.bottom>o.top)return this.y=n.bottom-1,this.scan(e,t);if(r&&r.top<o.bottom)return this.y=r.top+1,this.scan(e,t)}let d=(s?this.dirAt(e[c],1):this.baseDir)==jq.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=tH(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 _q(e.dom,o,i).getClientRects()});return r.after?new pQ(n[r.i+1],-1):new pQ(n[r.i],1)}scanTile(e,t){if(!e.length)return new pQ(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:_q(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 pQ(n[r.i+1],-1):new pQ(i,1)}}const mQ="";class gQ{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(nG.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=mQ}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=j$.get(r),i=r.nextSibling;if(i==t){(null==o?void 0:o.breakAfter)&&!i&&n!=this.view.contentDOM&&this.lineBreak();break}let a=j$.get(i);(o&&a?o.breakAfter:(o?o.breakAfter:mq(r))||mq(i)&&("BR"!=r.nodeName||(null==o?void 0:o.isWidget()))&&this.text.length>e)&&!yQ(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=j$.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+(vQ(e,n.node,n.offset)?t:0))}}function vQ(e,t,n){for(;;){if(!t||n<vq(t))return!1;if(t==e)return!0;n=hq(t)+1,t=t.parentNode}}function yQ(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=j$.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 bQ{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class wQ{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:i}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=EQ(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 bQ(n,r)),o==n&&i==r||t.push(new bQ(o,i))),t}(e),n=new gQ(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?gH.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||!uq(e.contentDOM,t.focusNode)?a.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!uq(e.contentDOM,t.anchorNode)?a.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),l=e.viewport;if((QG.ios||QG.chrome)&&a.main.empty&&n!=r&&(l.from>0||l.to<e.state.doc.length)){let t=Math.min(n,r),o=Math.max(n,r),i=l.from-t,a=l.to-o;0!=i&&1!=i&&0!=t||0!=a&&-1!=a&&o!=e.state.doc.length||(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(gH.range(r,n));else if(e.lineWrapping&&r==n&&(!a.main.empty||a.main.head!=n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=gH.create([gH.cursor(n,r)])}else this.newSel=gH.single(r,n)}}}function EQ(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 EQ(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 kQ(e,t){let n,{newSel:r}=t,{state:o}=e,i=o.selection.main,a=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,l=i.from,s=null;(8===a||QG.android&&t.text.length<r-e)&&(l=i.to,s="end");let c,u,d=o.doc.sliceString(e,r,mQ);!i.empty&&i.from>=e&&i.to<=r&&(t.typeOver||d!=t.text)&&d.slice(0,i.from-e)==t.text.slice(0,i.from-e)&&d.slice(i.to-e)==t.text.slice(c=t.text.length-(d.length-(i.to-e)))?n={from:i.from,to:i.to,insert:GV.of(t.text.slice(i.from-e,c).split(mQ))}:(u=SQ(d,t.text,l-e,s))&&(QG.chrome&&13==a&&u.toB==u.from+2&&t.text.slice(u.from,u.toB)==mQ+mQ&&u.toB--,n={from:e+u.from,to:e+u.toA,insert:GV.of(t.text.slice(u.from,u.toB).split(mQ))})}else r&&(!e.hasFocus&&o.facet(f$)||xQ(r,i))&&(r=null);if(!n&&!r)return!1;if((QG.mac||QG.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=gH.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:GV.of([n.insert.toString().replace("."," ")])}):o.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:o.toText(e.inputState.insertingText)}:QG.chrome&&n&&n.from==n.to&&n.from==i.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=gH.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:GV.of([" "])}),n)return OQ(e,n,r,a);if(r&&!xQ(r,i)){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=uQ(o.facet(O$).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function OQ(e,t,n,r=-1){if(QG.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(QG.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&&Cq(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)&&Cq(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&Cq(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=cQ(o.facet(O$).map(t=>t(e)),r,n);t.from==l&&(a=l)}if(a>-1)r={changes:t,selection:gH.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&&rQ(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?gH.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(n$).some(n=>n(e,t.from,t.to,a,l))||e.dispatch(l()),!0}function SQ(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 xQ(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class _Q{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=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,QG.safari&&e.contentDOM.addEventListener("input",()=>null),QG.gecko&&function(e){YQ.has(e)||(YQ.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=j$.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=DQ(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&&TQ.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),QG.android&&QG.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!QG.ios||e.synthetic||e.altKey||e.metaKey||e.shiftKey||!((t=PQ.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||AQ.indexOf(e.key)>-1&&e.ctrlKey)?(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,Cq(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||!!(QG.safari&&!QG.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 CQ(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){p$(n.state,e)}}}function DQ(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(CQ(t.value,o))}if(o)for(let e in o){let r=o[e];r&&n(e).observers.push(CQ(t.value,r))}}for(let e in MQ)n(e).handlers.push(MQ[e]);for(let e in NQ)n(e).observers.push(NQ[e]);return t}const PQ=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],AQ="dthko",TQ=[16,17,18,20,91,92,224,225];function jQ(e){return.7*Math.max(0,e)+8}class FQ{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=Eq(e.contentDOM),this.atoms=e.state.facet(O$).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(nG.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Kq);return n.length?n[0](t):QG.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=cq(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!=HQ(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=C$(this.view);e.clientX-c.left<=i+6?r=-jQ(i-e.clientX):e.clientX+c.right>=l-6&&(r=jQ(e.clientX-l)),e.clientY-c.top<=a+6?o=-jQ(a-e.clientY):e.clientY+c.bottom>=s-6&&(o=jQ(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=uQ(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 MQ=Object.create(null),NQ=Object.create(null),IQ=QG.ie&&QG.ie_version<15||QG.ios&&QG.webkit_version<604;function RQ(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function LQ(e,t){t=RQ(e.state,o$,t);let n,{state:r}=e,o=1,i=r.toText(t),a=i.lines==r.selection.ranges.length;if(null!=qQ&&r.selection.ranges.every(e=>e.empty)&&qQ==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:gH.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:gH.cursor(e.from+t.length)}}):r.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function BQ(e,t,n,r){if(1==r)return gH.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 gH.cursor(t);0==i?n=1:i==o.length&&(n=-1);let a=i,l=i;n<0?a=tH(o.text,i,!1):l=tH(o.text,i);let s=r(o.text.slice(a,l));for(;a>0;){let e=tH(o.text,a,!1);if(r(o.text.slice(e,a))!=s)break;a=e}for(;l<o.length;){let e=tH(o.text,l);if(r(o.text.slice(l,e))!=s)break;l=e}return gH.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++,gH.range(i,a)}}NQ.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},NQ.wheel=NQ.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},MQ.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),NQ.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")},NQ.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},MQ.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(Jq))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=HQ(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=BQ(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!i){let t=BQ(e,n.pos,n.assoc,r),o=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=o<c.from?gH.range(o,i,c.assoc):gH.range(i,o,c.assoc)}return i?o.replaceRange(o.main.extend(c.from,c.to,c.assoc)):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 gH.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):gH.create([c])}}}(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new FQ(e,t,n,r)),r&&e.observer.ignore(()=>{xq(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 zQ=QG.ie&&QG.ie_version<=11;let WQ=null,UQ=0,VQ=0;function HQ(e){if(!zQ)return e.detail;let t=WQ,n=VQ;return WQ=e,VQ=Date.now(),UQ=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(UQ+1)%3:1}function GQ(e,t,n,r){if(!(n=RQ(e.state,o$,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(Zq);return n.length?n[0](t):QG.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}MQ.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=gH.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",RQ(e.state,i$,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},MQ.dragend=e=>(e.inputState.draggedContent=null,!1),MQ.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&&GQ(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 GQ(e,t,n,!0),!0}return!1},MQ.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=IQ?null:t.clipboardData;return n?(LQ(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(),LQ(e,n.value)},50)}(e),!1)};let qQ=null;MQ.copy=MQ.cut=(e,t)=>{if(!dq(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:RQ(e,i$,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!n&&!o)return!1;qQ=o?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=IQ?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 $Q=UH.define();function QQ(e,t){let n=[];for(let r of e.facet(r$)){let o=r(e,t);o&&n.push(o)}return n.length?e.update({effects:n,annotations:$Q.of(!0)}):null}function XQ(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=QQ(e.state,t);n?e.dispatch(n):e.update([])}},10)}NQ.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),XQ(e)},NQ.blur=e=>{e.observer.clearSelectionRange(),XQ(e)},NQ.compositionstart=NQ.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},NQ.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,QG.chrome&&QG.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},NQ.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},MQ.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 OQ(e,{from:n,to:i,insert:e.state.toText(r)},null),!0}}let o;if(QG.chrome&&QG.android&&(o=PQ.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 QG.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),QG.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>NQ.compositionend(e,t),20),!1};const YQ=new Set,KQ=["pre-wrap","normal","pre-line","break-spaces"];let ZQ=!1;function JQ(){ZQ=!1}class eX{constructor(e){this.lineWrapping=e,this.doc=GV.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 KQ.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=KQ.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 tX{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class nX{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?tq.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 iq?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 nX(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var rX=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(rX||(rX={}));const oX=.001;class iX{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)>oX&&(ZQ=!0),this.height=e)}replace(e,t,n){return iX.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,rX.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:o.lineAt(s,rX.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,rX.ByPosNoHeight,n,0,0));c+=d.from-l,l=d.from;let f=fX.build(n.setDoc(i),e,c,u);o=aX(o,o.replace(l,s,f))}return o.updateHeight(n,0)}static empty(){return new cX(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 dX(iX.of(e.slice(0,t)),i,iX.of(e.slice(n)))}}function aX(e,t){return e==t?e:(e.constructor!=t.constructor&&(ZQ=!0),t)}iX.prototype.size=1;const lX=nq.replace({});class sX extends iX{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new nX(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 nX(r,0,n,this.spaceAbove,lX):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,rX.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 cX extends sX{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 nX(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 cX||r instanceof uX&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof uX?r=new cX(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):iX.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 uX extends iX{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 nX(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 nX(l,s,n+a*r,a,0)}}lineAt(e,t,n,r,o){if(t==rX.ByHeight)return this.blockAt(e,n,r,o);if(t==rX.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new nX(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 nX(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 nX(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 uX?n[n.length-1]=new uX(e.length+r):n.push(null,new uX(r-1))}if(e>0){let t=n[0];t instanceof uX?n[0]=new uX(e+t.length):n.unshift(new uX(e-1),null)}return iX.of(n)}decomposeLeft(e,t){t.push(new uX(e-1),null)}decomposeRight(e,t){t.push(null,new uX(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 uX(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)>=oX&&(a=-2);let s=new cX(t,o,l);s.outdated=!1,n.push(s),i+=t+1}i<=o&&n.push(null,new uX(o-i).updateHeight(e,i));let l=iX.of(n);return(a<0||Math.abs(l.height-this.height)>=oX||Math.abs(a-this.heightMetrics(e,t).perLine)>=oX)&&(ZQ=!0),aX(this,l)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class dX extends iX{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==rX.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==rX.ByPosNoHeight?rX.ByPosNoHeight:rX.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,rX.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&&pX(o,i-1),t<this.length){let e=o.length;this.decomposeRight(t,o),pX(o,e)}return iX.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?iX.of(this.break?[e,null,t]:[e,t]):(this.left=aX(this.left,e),this.right=aX(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 pX(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof uX&&(r=e[t+1])instanceof uX&&e.splice(t-1,3,new uX(n.length+1+r.length))}class fX{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 cX?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new cX(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 sX(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 cX(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new uX(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 cX)return e;let t=new cX(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 cX||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new cX(0,-1,0));let n=e;for(let e of this.nodes)e instanceof cX&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let o=new fX(n,e);return cG.spans(t,n,r,o,0),o.finish(n)}}class hX{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&lq(e,t,this.changes,5)}}function mX(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 gX(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class vX{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 nq.replace({widget:new yX(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class yX extends eq{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 bX{constructor(e,t){this.view=e,this.state=t,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.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=OX,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=jq.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(b$).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new eX(n),this.stateDeco=SX(t),this.heightMap=iX.empty().applyChanges(this.stateDeco,GV.empty,this.heightOracle.setDoc(t.doc),[new P$(0,0,0,t.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=nq.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,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 wX(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?OX:new xX(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(_X(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=SX(this.state);let r=e.changedRanges,o=P$.extendWithRanges(r,function(e,t,n){let r=new hX;return cG.compare(e,t,n,r,0),r.changes}(n,this.stateDeco,e?e.changes:sH.empty(this.state.doc.length))),i=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);JQ(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=i||ZQ)&&(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(l$)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?jq.RTL:jq.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}=wq(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=Eq(this.view.contentDOM,!1).y;p!=this.scrollParent&&(this.scrollParent=p,this.scrollAnchorHeight=-1,this.scrollOffset=0);let f=this.getScrollOffset();this.scrollOffset!=f&&(this.scrollAnchorHeight=-1,this.scrollOffset=f),this.scrolledToBottom=Dq(this.scrollParent||e.win);let h=(this.printing?gX:mX)(t,this.paddingTop),m=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(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 y=a.width;if(this.contentDOMWidth==y&&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(y-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,y/a),t),i&&(e.docView.minWidth=0,s|=16)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),JQ();for(let n of this.viewports){let o=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?iX.empty().applyChanges(this.stateDeco,GV.empty,this.heightOracle,[new P$(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,i,new tX(n.from,o))}ZQ&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return b&&(2&s&&(s|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),s|=this.updateForViewport()),(2&s||b)&&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 wX(r.lineAt(i-1e3*n,rX.ByHeight,o,0,0).from,r.lineAt(a+1e3*(1-n),rX.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,rX.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 wX(r.lineAt(n-500,rX.ByHeight,o,0,0).from,r.lineAt(n+i+500,rX.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 wX(this.heightMap.lineAt(n,rX.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,rX.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,rX.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,rX.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 vX(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!=jq.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(gH.cursor(i),!1,!0).head;e>r&&(i=e)}let e=this.gapSize(s,r,i,c);p=new vX(r,i,e,n||e<2e6?e:2e6)}a.push(p)},s=t=>{if(t.length<i||t.type!=tq.Text)return;let o=function(e,t,n){let r=[],o=e,i=0;return cG.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=kX(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=EX(o,e),s=EX(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=kX(o,c),t=((f-p)/2+i)/n;u=e-t,d=e+t}else u=(p-i)/n,d=(f+i)/n;a=EX(o,u),s=EX(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=kX(r,n)-kX(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){vX.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=nq.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=[];cG.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)||_X(this.heightMap.lineAt(e,rX.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)||_X(this.heightMap.lineAt(this.scaler.fromDOM(e),rX.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}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 _X(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 wX{constructor(e,t){this.from=e,this.to=t}}function EX({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 kX(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 OX={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function SX(e){let t=e.facet(w$).filter(e=>"function"!=typeof e),n=e.facet(k$).filter(e=>"function"!=typeof e);return n.length&&t.push(cG.join(n)),t}class xX{constructor(e,t,n){let r=0,o=0,i=0;this.viewports=n.map(({from:n,to:o})=>{let i=t.lineAt(n,rX.ByPos,e,0,0).top,a=t.lineAt(o,rX.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 xX&&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 _X(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new nX(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>_X(e,t)):e._content)}const CX=bH.define({combine:e=>e.join(" ")}),DX=bH.define({combine:e=>e.indexOf(!0)>-1}),PX=_G.newName(),AX=_G.newName(),TX=_G.newName(),jX={"&light":"."+AX,"&dark":"."+TX};function FX(e,t,n){return new _G(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 MX=FX("."+PX,{"&":{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-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".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"}},jX),NX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},IX=QG.ie&&QG.ie_version<=11;class RX{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new kq,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);(QG.ie&&QG.ie_version<=11||QG.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||!QG.android||!1===e.constructor.EDIT_CONTEXT||QG.chrome&&QG.chrome_version<126||(this.editContext=new zX(e),e.state.facet(f$)&&(e.contentDOM.editContext=this.editContext.editContext)),IX&&(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(f$)?n.root.activeElement!=this.dom:!dq(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):(QG.ie&&QG.ie_version<=11||QG.android&&QG.chrome)&&!n.state.selection.main.empty&&r.focusNode&&fq(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=cq(e.root);if(!t)return!1;let n=QG.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 BX(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?BX(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=dq(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,vq(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:(n=e,r=vq(n))}else{if(n==e)return!0;r=hq(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,NX),IX&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),IX&&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&&Cq(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&&dq(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 wQ(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=kQ(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!xQ(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=LX(t,e.previousSibling||e.target.previousSibling,-1),r=LX(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(f$)!=e.state.facet(f$)&&(e.view.contentDOM.editContext=e.state.facet(f$)?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 LX(e,t,n){for(;t;){let r=j$.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 BX(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 fq(a.node,a.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}class zX{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=SQ(e.state.sliceDoc(a,l),n.text,(s?r.from:r.to)-a,s?"end":null);if(!c){let t=gH.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));return void(xQ(t,r)||e.dispatch({selection:t,userEvent:"select"}))}let u={from:c.from+a,to:c.toA+a,insert:GV.of(n.text.slice(c.from,c.toB).split("\n"))};if((QG.mac||QG.android)&&u.from==i-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(u={from:a,to:l,insert:GV.of([n.text.replace("."," ")])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);OQ(e,u,gH.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(nq.mark({attributes:{style:e}}).range(o,i))}}}e.dispatch({effects:d$.of(nq.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=cq(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 WX{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 bX(this,e.state||nG.create(e)),e.scrollTo&&e.scrollTo.is(u$)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(m$).map(e=>new v$(e));for(let e of this.plugins)e.update(this);this.observer=new RX(this),this.inputState=new _Q(this),this.inputState.ensureHandlers(this.plugins),this.docView=new tQ(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 qH?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($Q))?(this.inputState.notifiedFocused=i,a=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,l=QQ(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(nG.phrases)!=this.state.facet(nG.phrases))return this.setState(o);t=A$.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,{x:n,y:r}=this.state.facet(WX.cursorScrollMargin);u=new c$(e.empty?e:gH.cursor(e.head,e.head>e.anchor?-1:1),"nearest","nearest",r,n)}for(let e of t.effects)e.is(u$)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=HX.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(D$)!=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(CX)!=t.state.facet(CX)&&(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(t$))try{e(t)}catch(e){p$(this.state,e,"update listener")}(l||c)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),c&&!kQ(this,c)&&s.force&&Cq(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 bX(this,e),this.plugins=e.facet(m$).map(e=>new v$(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new tQ(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(m$),n=e.state.facet(m$);if(t!=n){let r=[];for(let o of n){let n=t.indexOf(o);if(n<0)r.push(new v$(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){p$(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.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:i}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(Dq(n||this.win))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();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 p$(this.state,e),VX}}),c=A$.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]!=VX)try{let t=l[e];t.write&&t.write(s[e],this)}catch(e){p$(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)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(t$))e(t)}get themeClasses(){return PX+" "+(this.state.facet(DX)?TX:AX)+" "+this.state.facet(CX)}updateAttrs(){let e=GX(this,y$,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(f$)?"true":"false",class:"cm-content",style:`${QG.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),GX(this,b$,t);let n=this.observer.ignore(()=>{let n=ZG(this.contentDOM,this.contentAttrs,t),r=ZG(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(WX.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(D$);let e=this.state.facet(WX.cspNonce);_G.mount(this.root,this.styleModules.concat(MX).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 dQ(this,e,sQ(this,e,t,n))}moveByGroup(e,t){return dQ(this,e,sQ(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==JH.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 gH.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=lQ(e,t.head,t.assoc||-1),i=r&&o.type==tq.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==jq.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=a)return gH.cursor(a,n?-1:1)}return gH.cursor(n?o.to:o.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return dQ(this,e,function(e,t,n,r){let o=t.head,i=n?1:-1;if(o==(n?e.state.doc.length:0))return gH.cursor(o,t.assoc);let a,l=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(o,t.assoc||((t.empty?n:t.head==t.from)?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=s.left+l,p=e.viewState.heightOracle.textHeight>>1,f=null!=r?r:p;for(let t=0;;t+=p){let r=a+(f+t)*i,o=fQ(e,{x:d,y:r},!1,i);if(n?r>s.bottom:r<s.top)return gH.cursor(o.pos,o.assoc);let c=e.coordsAtPos(o.pos,o.assoc),u=c?(c.top+c.bottom)/2:0;if(!c||(n?u>a:u<a))return gH.cursor(o.pos,o.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=fQ(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),fQ(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 yq(n,o[Uq.find(o,e-r.from,-1,t)].dir==jq.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(a$)||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>UX)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||Vq(r.isolates,t=x$(this,e))))return r.order;t||(t=x$(this,e));let r=function(e,t,n){if(!e)return[new Uq(0,0,t==Mq?1:0)];if(t==Fq&&!n.length&&!Wq.test(e))return $q(e.length);if(n.length)for(;e.length>Hq.length;)Hq[Hq.length]=256;let r=[],o=t==Fq?0:1;return qq(e,o,o,n,0,e.length,r),r}(e.text,n,t);return this.bidiCache.push(new HX(e.from,e.to,n,t,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||QG.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{xq(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={}){var n,r,o,i;return u$.of(new c$("number"==typeof e?gH.cursor(e):e,null!==(n=t.y)&&void 0!==n?n:"nearest",null!==(r=t.x)&&void 0!==r?r:"nearest",null!==(o=t.yMargin)&&void 0!==o?o:5,null!==(i=t.xMargin)&&void 0!==i?i:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return u$.of(new c$(gH.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 g$.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return g$.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=_G.newName(),r=[CX.of(n),D$.of(FX(`.${n}`,e))];return t&&t.dark&&r.push(DX.of(!0)),r}static baseTheme(e){return DH.lowest(D$.of(FX("."+PX,e,jX)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&j$.get(n)||j$.get(e);return(null===(t=null==r?void 0:r.root)||void 0===t?void 0:t.view)||null}}WX.styleModule=D$,WX.inputHandler=n$,WX.clipboardInputFilter=o$,WX.clipboardOutputFilter=i$,WX.scrollHandler=s$,WX.focusChangeEffect=r$,WX.perLineTextDirection=a$,WX.exceptionSink=e$,WX.updateListener=t$,WX.editable=f$,WX.mouseSelectionStyle=Jq,WX.dragMovesSelection=Zq,WX.clickAddsSelectionRange=Kq,WX.decorations=w$,WX.blockWrappers=E$,WX.outerDecorations=k$,WX.atomicRanges=O$,WX.bidiIsolatedRanges=S$,WX.cursorScrollMargin=bH.define({combine:e=>{let t=5,n=5;for(let r of e)"number"==typeof r?t=n=r:({x:t,y:n}=r);return{x:t,y:n}}}),WX.scrollMargins=_$,WX.darkTheme=DX,WX.cspNonce=bH.define({combine:e=>e.length?e[0]:""}),WX.contentAttributes=b$,WX.editorAttributes=y$,WX.lineWrapping=WX.contentAttributes.of({class:"cm-lineWrapping"}),WX.announce=GH.define();const UX=4096,VX={};class HX{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:jq.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 HX(t.mapPos(i.from,1),t.mapPos(i.to,-1),i.dir,i.isolates,!1,i.order))}return n}}function GX(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&&XG(i,n)}return n}const qX=QG.mac?"mac":QG.windows?"win":QG.linux?"linux":"key";function $X(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 QX=DH.default(WX.domEventHandlers({keydown:(e,t)=>tY(KX(t.state),e,t,"editor")})),XX=bH.define({enables:QX}),YX=new WeakMap;function KX(e){let t=e.facet(XX),n=YX.get(t);return n||YX.set(t,n=function(e,t=qX){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=ZX={view:t,prefix:n,scope:e};return setTimeout(()=>{ZX==r&&(ZX=null)},JX),!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,eY))}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 ZX=null;const JX=4e3;let eY=null;function tY(e,t,n,r){eY=t;let o=function(e){var t=!(TG&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||jG&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?AG:PG)[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=oH(nH(o,0))==o.length&&" "!=o,a="",l=!1,s=!1,c=!1;ZX&&ZX.view==n&&ZX.scope==r&&(a=ZX.prefix+" ",TQ.indexOf(t.keyCode)<0&&(s=!0,ZX=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+$X(o,t,!i)])?l=!0:!i||!(t.altKey||t.metaKey||t.ctrlKey)||QG.windows&&t.ctrlKey&&t.altKey||QG.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(u=PG[t.keyCode])||u==o?i&&t.shiftKey&&f(h[a+$X(o,t,!0)])&&(l=!0):(f(h[a+$X(u,t,!0)])||t.shiftKey&&(d=AG[t.keyCode])!=o&&d!=u&&f(h[a+$X(d,t,!1)]))&&(l=!0),!l&&f(h._any)&&(l=!0)),s&&(l=!0),l&&c&&t.stopPropagation(),eY=null,l}class nY{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=rY(e);return[new nY(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==jq.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),s=rY(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=lQ(e,r,1),h=lQ(e,o,-1),m=f.type==tq.Text?f:null,g=h.type==tq.Text?h:null;if(m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=oY(e,r,1,m)),g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=oY(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==tq.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 nY(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==jq.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 rY(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==jq.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function oY(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 iY{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(aY)!=e.state.facet(aY)&&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(aY);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,QG.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const aY=bH.define();function lY(e){return[g$.define(t=>new iY(t,e)),aY.of(e)]}const sY=bH.define({combine:e=>rG(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function cY(e){return e.startState.facet(sY)!=e.state.facet(sY)}const uY=lY({above:!0,markers(e){let{state:t}=e,n=t.facet(sY),r=[];for(let o of t.selection.ranges){let i=o==t.selection.main;if(o.empty||n.drawRangeCursor&&!(i&&QG.ios&&n.iosSelectionHandles)){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=o.empty?o:gH.cursor(o.head,o.assoc);for(let o of nY.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=cY(e);return n&&dY(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){dY(t.state,e)},class:"cm-cursorLayer"});function dY(e,t){t.style.animationDuration=e.facet(sY).cursorBlinkRate+"ms"}const pY=lY({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of nY.forRange(e,"cm-selectionBackground",n))t.push(r);if(QG.ios&&!n.empty&&e.state.facet(sY).iosSelectionHandles){for(let r of nY.forRange(e,"cm-selectionHandle cm-selectionHandle-start",gH.cursor(n.from,1)))t.push(r);for(let r of nY.forRange(e,"cm-selectionHandle cm-selectionHandle-end",gH.cursor(n.to,1)))t.push(r)}return t},update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||cY(e),class:"cm-selectionLayer"}),fY=DH.highest(WX.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"}}}})),hY=GH.define({map:(e,t)=>null==e?null:t.mapPos(e)}),mY=_H.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(hY)?t.value:e,e))}),gY=g$.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(mY);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(mY)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(mY),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(mY)!=e&&this.view.dispatch({effects:hY.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 vY(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 yY{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 uG,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))vY(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 vY(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 bY=null!=/x/.unicode?"gu":"g",wY=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",bY),EY={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 kY=null;const OY=bH.define({combine(e){let t=rG(e,{render:null,specialChars:wY,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==kY&&"undefined"!=typeof document&&document.body){let t=document.body.style;kY=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return kY||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,bY)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,bY)),t}});let SY=null;class xY extends eq{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")+" "+(EY[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 _Y extends eq{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 CY=nq.line({class:"cm-activeLine"}),DY=g$.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(CY.range(o.from)),t=o.from)}return nq.set(n)}},{decorations:e=>e.decorations});class PY extends eq{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?pq(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=yq(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 AY=2e3;function TY(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>AY?-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):EG(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}const jY={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},FY={style:"cursor: crosshair"},MY="-10000px";class NY{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 IY(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const RY=bH.define({combine:e=>{var t,n,r;return{position:QG.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)||IY}}}),LY=new WeakMap,BY=g$.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(RY);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 NY(e,VY,(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(RY);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=MY,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(QG.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=C$(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(RY).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=MY;continue}let f=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,h=f?7:0,m=p.right-p.left,g=null!==(t=LY.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||UY,y=this.view.textDirection==jq.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=MY;continue}LY.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",zY(u,(b-e.parent.left)/o)):(u.style.top=k/i+"px",zY(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=MY}},{eventObservers:{scroll(){this.maybeMeasure()}}});function zY(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const WY=WX.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"}}}),UY={x:0,y:0},VY=bH.define({enables:[BY,WY]}),HY=bH.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class GY{static create(e){return new GY(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new NY(e,HY,(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 qY=VY.compute([HY],e=>{let t=e.facet(HY);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:GY.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class $Y{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==jq.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=>p$(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(BY),t=e?e.manager.tooltips.findIndex(e=>e.create==GY.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-QY&&t.clientX<=o+QY&&t.clientY>=i-QY&&t.clientY<=a+QY}(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 QY=4;function XY(e,t={}){let n=GH.define(),r=_H.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,aH.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(KY)&&(e=[]);return e},provide:e=>HY.from(e)});return{active:r,extension:[r,g$.define(o=>new $Y(o,e,r,n,t.hoverTime||300)),qY]}}function YY(e,t){let n=e.plugin(BY);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const KY=GH.define(),ZY=bH.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 JY(e,t){let n=e.plugin(eK),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const eK=g$.fromClass(class{constructor(e){this.input=e.state.facet(rK),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(ZY);this.top=new tK(e,!0,t.topContainer),this.bottom=new tK(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(ZY);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new tK(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new tK(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(rK);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=>WX.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class tK{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=nK(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=nK(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 nK(e){let t=e.nextSibling;return e.remove(),t}const rK=bH.define({enables:eK});const oK=_H.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(iK)?e=[n.value].concat(e):n.is(aK)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>rK.computeN([e],t=>t.field(e))}),iK=GH.define(),aK=GH.define();class lK extends oG{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}lK.prototype.elementClass="",lK.prototype.toDOM=void 0,lK.prototype.mapMode=aH.TrackBefore,lK.prototype.startSide=lK.prototype.endSide=-1,lK.prototype.point=!0;const sK=bH.define(),cK=bH.define(),uK={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>cG.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},dK=bH.define();function pK(e){return[hK(),dK.of({...uK,...e})]}const fK=bH.define({combine:e=>e.some(e=>e)});function hK(e){let t=[mK];return e&&!1===e.fixed&&t.push(fK.of(!0)),t}const mK=g$.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(dK).map(t=>new bK(e,t)),this.fixed=!e.state.facet(fK);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(fK)!=!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=cG.iter(this.view.state.facet(sK),this.view.viewport.from),r=[],o=this.gutters.map(e=>new yK(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==tq.Text&&t){vK(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==tq.Text){vK(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(dK),n=e.state.facet(dK),r=e.docChanged||e.heightChanged||e.viewportChanged||!cG.eq(e.startState.facet(sK),e.state.facet(sK),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 bK(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=>WX.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==jq.LTR?{left:r,right:o}:{right:r,left:o}})});function gK(e){return Array.isArray(e)?e:[e]}function vK(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class yK{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=cG.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 wK(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=[];vK(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(cK)){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 bK{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=gK(t.markers(e)),t.initialSpacer&&(this.spacer=new wK(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=gK(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!cG.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 wK{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 EK=bH.define(),kK=bH.define(),OK=bH.define({combine:e=>rG(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 SK extends lK{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function xK(e,t){return e.state.facet(OK).formatNumber(t,e.state)}const _K=dK.compute([OK],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(EK),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new SK(xK(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(kK)){let o=r(e,t,n);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(OK)!=e.state.facet(OK),initialSpacer:e=>new SK(xK(e,CK(e.state.doc.lines))),updateSpacer(e,t){let n=xK(t.view,CK(t.view.state.doc.lines));return n==e.number?e:new SK(n)},domEventHandlers:e.facet(OK).domEventHandlers,side:"before"}));function CK(e){let t=9;for(;t<e;)t=10*t+9;return t}const DK=new class extends lK{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},PK=sK.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(DK.range(o)))}return cG.of(t)});var AK;const TK=new GW;const jK=new GW;class FK{constructor(e,t,n=[],r=""){this.data=e,this.name=r,nG.prototype.hasOwnProperty("tree")||Object.defineProperty(nG.prototype,"tree",{get(){return IK(this)}}),this.parser=t,this.extension=[GK.of(this),nG.languageData.of((e,t,n)=>{let r=MK(e,t,n),o=r.type.prop(TK);if(!o)return[];let i=e.facet(o),a=r.type.prop(jK);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 MK(e,t,n).type.prop(TK)==this.data}findRegions(e){let t=e.facet(GK);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(TK)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(GW.mounted);if(o){if(o.tree.prop(TK)==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 JW&&r(o,e.positions[n]+t)}};return r(IK(e),0),n}get allowsNesting(){return!0}}function MK(e,t,n){let r=e.facet(GK),o=IK(e).topNode;if(!r||r.allowsNesting)for(let e=o;e;e=e.enter(t,n,ZW.ExcludeBuffers|ZW.EnterBracketed))e.type.isTop&&(o=e);return o}FK.setState=GH.define();class NK extends FK{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=(n=e.languageData,bH.define({combine:n?e=>e.concat(n):void 0}));var n;return new NK(t,e.parser.configure({props:[TK.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new NK(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function IK(e){let t=e.field(FK.state,!1);return t?t.tree:JW.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 LK=null;class BK{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 BK(e,t,[],JW.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!=JW.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(yU.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(yU.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=LK;LK=this;try{return e()}finally{LK=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=zK(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=yU.applyChanges(n,t),r=JW.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 BK(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=zK(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 bU{createParse(t,n,r){let o=r[0].from,i=r[r.length-1].to;return{parsedPos:o,advance(){let t=LK;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 JW(QW.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 LK}}function zK(e,t,n){return yU.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class WK{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 WK(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=BK.create(e.facet(GK).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new WK(n)}}FK.state=_H.define({create:WK.init,update(e,t){for(let e of t.effects)if(e.is(FK.setState))return e.value;return t.startState.facet(GK)!=t.state.facet(GK)?WK.init(t.state):e.apply(t)}});let UK=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(UK=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const VK="undefined"!=typeof navigator&&(null===(AK=navigator.scheduling)||void 0===AK?void 0:AK.isInputPending)?()=>navigator.scheduling.isInputPending():null,HK=g$.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(FK.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(FK.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=UK(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(FK.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,e&&!VK?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<r&&n.doc.length>r+1e3,l=o.context.work(()=>VK&&VK()||Date.now()>i,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:FK.setState.of(new WK(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=>p$(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()}}}),GK=bH.define({combine:e=>e.length?e[0]:null,enables:e=>[FK.state,HK,WX.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=bH.define(),QK=bH.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(QK);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function YK(e,t){let n="",r=e.tabSize,o=e.facet(QK)[0];if("\t"==o){for(;t>=r;)n+="\t",t-=r;o=" "}for(let e=0;e<t;e++)n+=o;return n}function KK(e,t){e instanceof nG&&(e=new ZK(e));for(let n of e.state.facet($K)){let r=n(e,t);if(void 0!==r)return r}let n=IK(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 eZ(r,e,n)}(e,n,t):null}class ZK{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 EG(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 JK=new GW;function eZ(e,t,n){for(let r=e;r;r=r.next){let e=tZ(r.node);if(e)return e(rZ.create(t,n,r))}return 0}function tZ(e){let t=e.type.prop(JK);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(GW.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?nZ:null}function nZ(){return 0}class rZ extends ZK{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 rZ(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(oZ(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return eZ(this.context.next,this.base,this.pos)}}function oZ(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function iZ({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const aZ=bH.define(),lZ=new GW;function sZ(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function cZ(e,t,n){for(let r of e.facet(aZ)){let o=r(e,t,n);if(o)return o}return function(e,t,n){let r=IK(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(lZ);if(l&&(a.to<r.length-50||r.length==e.doc.length||!sZ(a))){let r=l(a,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function uZ(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 dZ=GH.define({map:uZ}),pZ=GH.define({map:uZ});function fZ(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 hZ=_H.define({create:()=>nq.none,update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=mZ(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(dZ)&&!vZ(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(kZ),o=r?nq.replace({widget:new _Z(r(t.state,n.value))}):xZ;e=e.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(pZ)&&(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=mZ(e,t.selection.main.head)),e},provide:e=>WX.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(xZ.range(r,o))}return nq.set(t,!0)}});function mZ(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 gZ(e,t,n){var r;let o=null;return null===(r=e.field(hZ,!1))||void 0===r||r.between(t,n,(e,t)=>{(!o||o.from>e)&&(o={from:e,to:t})}),o}function vZ(e,t,n){let r=!1;return e.between(t,t,(e,o)=>{e==t&&o==n&&(r=!0)}),r}function yZ(e,t){return e.field(hZ,!1)?t:t.concat(GH.appendConfig.of(OZ()))}function bZ(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return WX.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${o}.`)}const wZ=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of fZ(e)){let n=cZ(e.state,t.from,t.to);if(n)return e.dispatch({effects:yZ(e.state,[dZ.of(n),bZ(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(hZ,!1))return!1;let t=[];for(let n of fZ(e)){let r=gZ(e.state,n.from,n.to);r&&t.push(pZ.of(r),bZ(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=cZ(t,o.from,o.to);i&&n.push(dZ.of(i)),r=(i?e.lineBlockAt(i.to):o).to+1}return n.length&&e.dispatch({effects:yZ(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(hZ,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(pZ.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],EZ={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},kZ=bH.define({combine:e=>rG(e,EZ)});function OZ(e){let t=[hZ,PZ];return e&&t.push(kZ.of(e)),t}function SZ(e,t){let{state:n}=e,r=n.facet(kZ),o=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=gZ(e.state,n.from,n.to);r&&e.dispatch({effects:pZ.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 xZ=nq.replace({widget:new class extends eq{toDOM(e){return SZ(e,null)}}});class _Z extends eq{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return SZ(e,this.value)}}const CZ={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class DZ extends lK{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 PZ=WX.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 AZ{constructor(e,t){let n;function r(e){let t=_G.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 FK?e=>e.prop(TK)==i.data:i?e=>e==i:void 0,this.style=JU(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:o}).style,this.module=n?new _G(n):null,this.themeType=t.themeType}static define(e,t){return new AZ(e,t||{})}}const TZ=bH.define(),jZ=bH.define({combine:e=>e.length?[e[0]]:null});function FZ(e){let t=e.facet(TZ);return t.length?t:e.facet(jZ)}function MZ(e,t){let n,r=[IZ];return e instanceof AZ&&(e.module&&r.push(WX.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(jZ.of(e)):n?r.push(TZ.computeN([WX.darkTheme],t=>t.facet(WX.darkTheme)==("dark"==n)?[e]:[])):r.push(TZ.of(e)),r}class NZ{constructor(e){this.markCache=Object.create(null),this.tree=IK(e.state),this.decorations=this.buildDeco(e,FZ(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=IK(e.state),n=FZ(e.state),r=n!=FZ(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 nq.none;let n=new uG;for(let{from:r,to:o}of e.visibleRanges)eV(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=nq.mark({class:r})))},r,o);return n.finish()}}const IZ=DH.high(g$.fromClass(NZ,{decorations:e=>e.decorations})),RZ=AZ.define([{tag:vV.meta,color:"#404740"},{tag:vV.link,textDecoration:"underline"},{tag:vV.heading,textDecoration:"underline",fontWeight:"bold"},{tag:vV.emphasis,fontStyle:"italic"},{tag:vV.strong,fontWeight:"bold"},{tag:vV.strikethrough,textDecoration:"line-through"},{tag:vV.keyword,color:"#708"},{tag:[vV.atom,vV.bool,vV.url,vV.contentSeparator,vV.labelName],color:"#219"},{tag:[vV.literal,vV.inserted],color:"#164"},{tag:[vV.string,vV.deleted],color:"#a11"},{tag:[vV.regexp,vV.escape,vV.special(vV.string)],color:"#e40"},{tag:vV.definition(vV.variableName),color:"#00f"},{tag:vV.local(vV.variableName),color:"#30a"},{tag:[vV.typeName,vV.namespace],color:"#085"},{tag:vV.className,color:"#167"},{tag:[vV.special(vV.variableName),vV.macroName],color:"#256"},{tag:vV.definition(vV.propertyName),color:"#00c"},{tag:vV.comment,color:"#940"},{tag:vV.invalid,color:"#f00"}]),LZ=WX.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),BZ="()[]{}",zZ=bH.define({combine:e=>rG(e,{afterCursor:!0,brackets:BZ,maxScanDistance:1e4,renderMatch:VZ})}),WZ=nq.mark({class:"cm-matchingBracket"}),UZ=nq.mark({class:"cm-nonmatchingBracket"});function VZ(e){let t=[],n=e.matched?WZ:UZ;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function HZ(e){let t=[],n=e.facet(zZ);for(let r of e.selection.ranges){if(!r.empty)continue;let o=XZ(e,r.head,-1,n)||r.head>0&&XZ(e,r.head-1,1,n)||n.afterCursor&&(XZ(e,r.head,1,n)||r.head<e.doc.length&&XZ(e,r.head+1,-1,n));o&&(t=t.concat(n.renderMatch(o,e)))}return nq.set(t,!0)}const GZ=[g$.fromClass(class{constructor(e){this.paused=!1,this.decorations=HZ(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=HZ(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),LZ],qZ=new GW;function $Z(e,t,n){let r=e.prop(t<0?GW.openedBy:GW.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 QZ(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||BZ,a=IK(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=QZ(e);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return YZ(0,0,n,e,o,r,i)}}return function(e,t,n,r,o,i,a){if(n<0?!t:t==e.doc.length)return null;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 YZ(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=QZ(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=QZ(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 KZ=Object.create(null),ZZ=[QW.none],JZ=[],eJ=Object.create(null),tJ=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"]])tJ[e]=rJ(KZ,t);function nJ(e,t){JZ.indexOf(e)>-1||(JZ.push(e),console.warn(t))}function rJ(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||vV[n];r?"function"==typeof r?t.length?t=t.map(r):nJ(n,`Modifier ${n} used at start of tag`):t.length?nJ(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:nJ(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=eJ[o];if(i)return i.id;let a=eJ[o]=QW.define({id:ZZ.length,name:r,props:[YU({[r]:n})]});return ZZ.push(a),a.id}jq.RTL,jq.LTR;let oJ=null;function iJ(){if(!oJ&&"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)));oJ=t.sort().map(e=>({type:"property",label:e,apply:e+": "}))}return oJ||[]}const aJ=["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})),lJ=["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}))),sJ=["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})),cJ=["@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})),uJ=/^(\w[\w-]*|-\w[\w-]*|)$/,dJ=/^-(-[\w-]*)?$/,pJ=new vU,fJ=["Declaration"];function hJ(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function mJ(e,t,n){if(t.to-t.from>4096){let r=pJ.get(t);if(r)return r;let o=[],i=new Set,a=t.cursor(ZW.IncludeAnonymous);if(a.firstChild())do{for(let t of mJ(e,a.node,n))i.has(t.label)||(i.add(t.label),o.push(t))}while(a.nextSibling());return pJ.set(t,o),o}{let r=[],o=new Set;return t.cursor().iterate(t=>{var i;if(n(t)&&t.matchContext(fJ)&&":"==(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 gJ=e=>t=>{let{state:n,pos:r}=t,o=IK(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:iJ(),validFor:uJ};if("ValueName"==o.name)return{from:o.from,options:lJ,validFor:uJ};if("PseudoClassName"==o.name)return{from:o.from,options:aJ,validFor:uJ};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:mJ(n.doc,hJ(o),e),validFor:dJ};if("TagName"==o.name){for(let{parent:e}=o;e;e=e.parent)if("Block"==e.name)return{from:o.from,options:iJ(),validFor:uJ};return{from:o.from,options:sJ,validFor:uJ}}if("AtKeyword"==o.name)return{from:o.from,options:cJ,validFor:uJ};if(!t.explicit)return null;let a=o.resolve(r),l=a.childBefore(r);return l&&":"==l.name&&"PseudoClassSelector"==a.name?{from:r,options:aJ,validFor:uJ}:l&&":"==l.name&&"Declaration"==a.name||"ArgList"==a.name?{from:r,options:lJ,validFor:uJ}:"Block"==a.name||"Styles"==a.name?{from:r,options:iJ(),validFor:uJ}:null},vJ=gJ(e=>"VariableName"==e.name),yJ=NK.define({name:"css",parser:FV.configure({props:[JK.add({Declaration:iZ()}),lZ.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 bJ{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class wJ{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(MJ).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new uG,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,nq.widget({widget:new BJ(p),diagnostics:a.slice()}));else{let e=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(t,n,nq.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 wJ(d,t,EJ(d))}}function EJ(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 bJ(r.from,n,r.diagnostic)}else r=new bJ(e,n,t||o.diagnostics[0])}),r}function kJ(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(MJ).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(SJ))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}function OJ(e,t){return e.field(CJ,!1)?t:t.concat(GH.appendConfig.of(e0))}const SJ=GH.define(),xJ=GH.define(),_J=GH.define(),CJ=_H.define({create:()=>new wJ(nq.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=EJ(n,e.selected.diagnostic,o)||EJ(n,null,o)}!n.size&&o&&t.state.facet(MJ).autoPanel&&(o=null),e=new wJ(n,o,r)}for(let n of t.effects)if(n.is(SJ)){let r=t.state.facet(MJ).autoPanel?n.value.length?WJ.open:null:e.panel;e=wJ.init(n.value,r,t.state)}else n.is(xJ)?e=new wJ(e.diagnostics,n.value?WJ.open:null,e.selected):n.is(_J)&&(e=new wJ(e.diagnostics,e.panel,n.value));return e},provide:e=>[rK.from(e,e=>e.panel),WX.decorations.from(e,e=>e.diagnostics)]}),DJ=nq.mark({class:"cm-lintRange cm-lintRange-active"});function PJ(e,t,n){let r,{diagnostics:o}=e.state.field(CJ),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(MJ).tooltipFilter;return r&&l&&(r=l(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:AJ(e,r)})}:null}function AJ(e,t){return NG("ul",{class:"cm-tooltip-lint"},t.map(t=>LJ(e,t,!1)))}const TJ=e=>{let t=e.state.field(CJ,!1);return!(!t||!t.panel||(e.dispatch({effects:xJ.of(!1)}),0))},jJ=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(CJ,!1);t&&t.panel||e.dispatch({effects:OJ(e.state,[xJ.of(!0)])});let n=JY(e,WJ.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(CJ,!1);if(!t)return!1;let n=e.state.selection.main,r=EJ(t.diagnostics,null,n.to+1);return!(!r&&(r=EJ(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))}}],FJ=g$.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(MJ);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(MJ);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:OJ(e,[SJ.of(t)])}}(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{p$(this.view.state,e)})}}update(e){let t=e.state.facet(MJ);(e.docChanged||t!=e.startState.facet(MJ)||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)}}),MJ=bH.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...rG(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:NJ,tooltipFilter:NJ,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 NJ(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function IJ(e,t={}){return[MJ.of({source:e,config:t}),FJ,e0]}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 LJ(e,t,n){var r;let o=n?RJ(t.actions):[];return NG("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},NG("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=EJ(e.state.field(CJ).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),NG("u",l.slice(s,s+1)),l.slice(s+1)];return NG("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&&NG("div",{class:"cm-diagnosticSource"},t.source))}class BJ extends eq{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return NG("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class zJ{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=LJ(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class WJ{constructor(e){this.view=e,this.items=[],this.list=NG("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)TJ(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=EJ(this.view.state.field(CJ).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=NG("div",{class:"cm-panel-lint"},this.list,NG("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>TJ(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(CJ).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(CJ),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 zJ(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 zJ(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=EJ(this.view.state.field(CJ).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:_J.of(t)})}static open(e){return new WJ(e)}}function UJ(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 VJ(e){return UJ(`<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 HJ=WX.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:VJ("#d11")},".cm-lintRange-warning":{backgroundImage:VJ("orange")},".cm-lintRange-info":{backgroundImage:VJ("#999")},".cm-lintRange-hint":{backgroundImage:VJ("#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}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function GJ(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=GJ(r.severity);e>n&&(n=e,t=r.severity)}return t}class $J extends lK{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(t0).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:KJ.of({pos:r.from,above:!1,clip:!1,create:()=>({dom:AJ(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(ZJ)&&e.dispatch({effects:KJ.of(null)})}};window.addEventListener("mousemove",n)}(e,t)}let{hoverTime:o}=e.state.facet(t0),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 QJ(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 cG.of(r,!0)}const XJ=pK({class:"cm-gutter-lint",markers:e=>e.state.field(YJ),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(YJ).between(n.from,n.to,(e,t,o)=>{e>n.from&&e<n.to&&r.push(...o.diagnostics)}),r.length?new $J(r):null}}),YJ=_H.define({create:()=>cG.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(t0).markerFilter;for(let r of t.effects)if(r.is(SJ)){let o=r.value;n&&(o=n(o||[],t.state)),e=QJ(t.state.doc,o.slice(0))}return e}}),KJ=GH.define(),ZJ=_H.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=kJ(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(KJ)?t.value:e,e)),provide:e=>VY.from(e)}),JJ=WX.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:UJ('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:UJ('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:UJ('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),e0=[CJ,WX.decorations.compute([CJ],e=>{let{selected:t,panel:n}=e.field(CJ);return t&&n&&t.from!=t.to?nq.set([DJ.range(t.from,t.to)]):nq.none}),XY(PJ,{hideOn:kJ}),HJ],t0=bH.define({combine:e=>rG(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function n0(e={}){return[t0.of(e),YJ,XJ,JJ,ZJ]}function r0(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 o0=r0(u0,0),i0=r0(c0,0),a0=r0((e,t)=>c0(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 l0(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const s0=50;function c0(e,t,n=t.selection.ranges){let r=n.map(e=>l0(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-s0,r),s=e.sliceDoc(o,o+s0),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*s0?i=a=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+s0),a=e.sliceDoc(o-s0,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 u0(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=l0(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 d0=UH.define(),p0=UH.define(),f0=bH.define(),h0=bH.define({combine:e=>rG(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)})}),m0=_H.define({create:()=>T0.empty,update(e,t){let n=t.state.facet(h0),r=t.annotation(d0);if(r){let o=E0.fromTransaction(t,r.selection),i=r.side,a=0==i?e.undone:e.done;return a=o?k0(a,a.length,n.minDepth,o):_0(a,t.startState.selection),new T0(0==i?r.rest:a,0==i?a:r.rest)}let o=t.annotation(p0);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(qH.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=E0.fromTransaction(t),a=t.annotation(qH.time),l=t.annotation(qH.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 T0(e.done.map(E0.fromJSON),e.undone.map(E0.fromJSON))});function g0(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(m0,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}const v0=g0(0,!1),y0=g0(1,!1),b0=g0(0,!0),w0=g0(1,!0);class E0{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 E0(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 E0(e.changes&&sH.fromJSON(e.changes),[],e.mapped&&lH.fromJSON(e.mapped),e.startSelection&&gH.fromJSON(e.startSelection),e.selectionsAfter.map(gH.fromJSON))}static fromTransaction(e,t){let n=S0;for(let t of e.startState.facet(f0)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new E0(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,S0)}static selection(e){return new E0(void 0,S0,void 0,void 0,e)}}function k0(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 O0(e,t){return e.length?t.length?e.concat(t):e:t}const S0=[],x0=200;function _0(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-x0));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),k0(e,e.length-1,1e9,n.setSelAfter(r)))}return[E0.selection([t])]}function C0(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 D0(e,t){if(!e.length)return e;let n=e.length,r=S0;for(;n;){let o=P0(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?[E0.selection(r)]:S0}function P0(e,t,n){let r=O0(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):S0,n);if(!e.changes)return E0.selection(r);let o=e.changes.map(t),i=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(i):i;return new E0(o,GH.mapEffects(e.effects,t),a,e.startSelection.map(i),r)}const A0=/^(input\.type|delete)($|\.)/;class T0{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 T0(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||A0.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)?k0(i,i.length-1,r.minDepth,new E0(e.changes.compose(a.changes),O0(GH.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,S0)):k0(i,i.length,r.minDepth,e),new T0(i,S0,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:S0;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 T0(_0(this.done,e),this.undone,t,n);var i,a}addMapping(e){return new T0(D0(this.done,e),D0(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:d0.of({side:e,rest:C0(r),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let n=1==r.length?S0:r.slice(0,r.length-1);return o.mapped&&(n=D0(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:d0.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}T0.empty=new T0(S0,S0);const j0=[{key:"Mod-z",run:v0,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:y0,preventDefault:!0},{linux:"Ctrl-Shift-z",run:y0,preventDefault:!0},{key:"Mod-u",run:b0,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:w0,preventDefault:!0}];function F0(e,t){return gH.create(e.ranges.map(t),e.mainIndex)}function M0(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function N0({state:e,dispatch:t},n){let r=F0(e.selection,n);return!r.eq(e.selection,!0)&&(t(M0(e,r)),!0)}function I0(e,t){return gH.cursor(t?e.to:e.from)}function R0(e,t){return N0(e,n=>n.empty?e.moveByChar(n,t):I0(n,t))}function L0(e){return e.textDirectionAt(e.state.selection.main.head)==jq.LTR}const B0=e=>R0(e,!L0(e)),z0=e=>R0(e,L0(e));function W0(e,t){return N0(e,n=>n.empty?e.moveByGroup(n,t):I0(n,t))}function U0(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 V0(e,t,n){let r,o,i=IK(e).resolveInner(t.head),a=n?GW.closedBy:GW.openedBy;for(let r=t.head;;){let t=n?i.childAfter(r):i.childBefore(r);if(!t)break;U0(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,gH.cursor(o,n?-1:1)}function H0(e,t){return N0(e,n=>{if(!n.empty)return I0(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;const G0=e=>H0(e,!1),q0=e=>H0(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(WX.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 Q0(e,t){let n,r=$0(e),{state:o}=e,i=F0(o.selection,n=>n.empty?e.moveVertically(n,t,r.height):I0(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=WX.scrollIntoView(i.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(M0(o,i),{effects:n}),!0}const X0=e=>Q0(e,!1),Y0=e=>Q0(e,!0);function K0(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=gH.cursor(r.from+n))}return o}function Z0(e,t){let n=F0(e.state.selection,e=>{let n=t(e);return gH.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return!n.eq(e.state.selection)&&(e.dispatch(M0(e.state,n)),!0)}function J0(e,t){return Z0(e,n=>e.moveByChar(n,t))}const e1=e=>J0(e,!L0(e)),t1=e=>J0(e,L0(e));function n1(e,t){return Z0(e,n=>e.moveByGroup(n,t))}function r1(e,t){return Z0(e,n=>e.moveVertically(n,t))}const o1=e=>r1(e,!1),i1=e=>r1(e,!0);function a1(e,t){return Z0(e,n=>e.moveVertically(n,t,$0(e).height))}const l1=e=>a1(e,!1),s1=e=>a1(e,!0),c1=({state:e,dispatch:t})=>(t(M0(e,{anchor:0})),!0),u1=({state:e,dispatch:t})=>(t(M0(e,{anchor:e.doc.length})),!0),d1=({state:e,dispatch:t})=>(t(M0(e,{anchor:e.selection.main.anchor,head:0})),!0),p1=({state:e,dispatch:t})=>(t(M0(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function f1(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(M0(n,gH.create(o,o.length-1))),!0)}function h1(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=m1(e,a,!1)):a>o&&(n="delete.forward",a=m1(e,a,!0)),o=Math.min(o,a),i=Math.max(i,a)}else o=m1(e,o,!1),i=m1(e,i,!0);return o==i?{range:r}:{changes:{from:o,to:i},range:gH.cursor(o,o<r.head?-1:1)}});return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?WX.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function m1(e,t,n){if(e instanceof WX)for(let r of e.state.facet(WX.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}const g1=(e,t,n)=>h1(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=EG(o,l.tabSize)%XK(l)||XK(l);for(let t=0;t<e&&" "==o[o.length-1-t];t++)a--;i=a}else i=tH(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=tH(s.text,i-s.from,!1,!1)+s.from);return i}),v1=e=>g1(e,!1,!0),y1=e=>g1(e,!0,!1),b1=(e,t)=>h1(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=tH(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}),w1=e=>b1(e,!1);function E1(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 k1(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let t of E1(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(gH.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(gH.range(e.anchor-a,e.head-a))}}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:gH.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function O1(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of E1(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 S1=x1(!1);function x1(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=IK(e).resolveInner(t),o=r.childBefore(t),i=r.childAfter(t);return o&&i&&o.to<=t&&i.from>=t&&(n=o.type.prop(GW.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 ZK(t,{simulateBreak:r,simulateDoubleBreak:!!a}),s=KK(l,r);for(null==s&&(s=EG(/^\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=["",YK(t,s)];return a&&c.push(YK(t,l.lineIndent(i.from,-1))),{changes:{from:r,to:o,insert:GV.of(c)},range:gH.cursor(r+1+c[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function _1(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:gH.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const C1=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(_1(e,(t,n)=>{n.push({from:t.from,insert:e.facet(QK)})}),{userEvent:"input.indent"})),!0),D1=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(_1(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=EG(r,e.tabSize),i=0,a=YK(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),P1=[{key:"Ctrl-b",run:B0,shift:e1,preventDefault:!0},{key:"Ctrl-f",run:z0,shift:t1},{key:"Ctrl-p",run:G0,shift:o1},{key:"Ctrl-n",run:q0,shift:i1},{key:"Ctrl-a",run:e=>N0(e,t=>gH.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Z0(e,t=>gH.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>N0(e,t=>gH.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Z0(e,t=>gH.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:y1},{key:"Ctrl-h",run:v1},{key:"Ctrl-k",run:e=>h1(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:w1},{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:GV.of(["",""])},range:gH.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:tH(r.text,n-r.from,!1)+r.from,i=n==r.to?n+1:tH(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:gH.cursor(i)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Y0}],A1=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>N0(e,t=>V0(e.state,t,!L0(e))),shift:e=>Z0(e,t=>V0(e.state,t,!L0(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>N0(e,t=>V0(e.state,t,L0(e))),shift:e=>Z0(e,t=>V0(e.state,t,L0(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>k1(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>O1(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>k1(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>O1(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>f1(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>f1(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=gH.create([n.main]):n.main.empty||(r=gH.create([gH.cursor(n.main.head)])),!!r&&(t(M0(e,r)),!0)}},{key:"Mod-Enter",run:x1(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=E1(e).map(({from:t,to:n})=>gH.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:gH.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=F0(e.selection,t=>{let n=IK(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 gH.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(M0(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:D1},{key:"Mod-]",run:C1},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new ZK(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=_1(e,(t,o,i)=>{let a=KK(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],s=YK(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(E1(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=F0(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=F0(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?gH.range(t.anchor,i):gH.cursor(i)});return!!r&&(t(M0(e,o)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=l0(e.state,n.from);return r.line?o0(e):!!r.block&&a0(e)}},{key:"Alt-A",run:i0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:B0,shift:e1,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>W0(e,!L0(e)),shift:e=>n1(e,!L0(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>N0(e,t=>K0(e,t,!L0(e))),shift:e=>Z0(e,t=>K0(e,t,!L0(e))),preventDefault:!0},{key:"ArrowRight",run:z0,shift:t1,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>W0(e,L0(e)),shift:e=>n1(e,L0(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>N0(e,t=>K0(e,t,L0(e))),shift:e=>Z0(e,t=>K0(e,t,L0(e))),preventDefault:!0},{key:"ArrowUp",run:G0,shift:o1,preventDefault:!0},{mac:"Cmd-ArrowUp",run:c1,shift:d1},{mac:"Ctrl-ArrowUp",run:X0,shift:l1},{key:"ArrowDown",run:q0,shift:i1,preventDefault:!0},{mac:"Cmd-ArrowDown",run:u1,shift:p1},{mac:"Ctrl-ArrowDown",run:Y0,shift:s1},{key:"PageUp",run:X0,shift:l1},{key:"PageDown",run:Y0,shift:s1},{key:"Home",run:e=>N0(e,t=>K0(e,t,!1)),shift:e=>Z0(e,t=>K0(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:c1,shift:d1},{key:"End",run:e=>N0(e,t=>K0(e,t,!0)),shift:e=>Z0(e,t=>K0(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:u1,shift:p1},{key:"Enter",run:S1,shift:S1},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:v1,shift:v1,preventDefault:!0},{key:"Delete",run:y1,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:w1,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>b1(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>h1(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=>h1(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(P1.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),T1={key:"Tab",run:C1,shift:D1},j1="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class F1{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(j1(e)):j1,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 nH(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=rH(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=oH(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&&(F1.prototype[Symbol.iterator]=function(){return this});const M1={from:-1,to:-1,match:/.*/.exec("")},N1="gm"+(null==/x/.unicode?"":"u");class I1{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=M1,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new B1(e,t,n,r,o);this.re=new RegExp(t,N1+((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=z1(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=z1(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 L1{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 L1(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 L1(i,o)),new L1(t,o.slice(t-i,n-i))}}class B1{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=M1,this.matchPos=z1(e,r),this.re=new RegExp(t,N1+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=L1.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=z1(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=L1.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function z1(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&&(I1.prototype[Symbol.iterator]=B1.prototype[Symbol.iterator]=function(){return this});const W1={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},U1=bH.define({combine:e=>rG(e,W1,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),V1=nq.mark({class:"cm-selectionMatch"}),H1=nq.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function G1(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==JH.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==JH.Word)}const q1=g$.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(U1),{state:n}=e,r=n.selection;if(r.ranges.length>1)return nq.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return nq.none;let e=n.wordAt(i.head);if(!e)return nq.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 nq.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!G1(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==JH.Word&&e(t.sliceDoc(r-1,r))==JH.Word}(a,n,i.from,i.to))return nq.none}else if(o=n.sliceDoc(i.from,i.to),!o)return nq.none}let l=[];for(let r of e.visibleRanges){let e=new F1(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||G1(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?l.push(H1.range(r,o)):(r>=i.to||o<=i.from)&&l.push(V1.range(r,o)),l.length>t.maxMatches))return nq.none}}return nq.set(l)}},{decorations:e=>e.decorations}),$1=WX.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Q1=bH.define({combine:e=>rG(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new O2(e),scrollToMatch:e=>WX.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,N1),!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 n2(this):new Z1(this)}getCursor(e,t=0,n){let r=e.doc?e:nG.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?J1(this,r,t,n):K1(this,r,t,n)}}class Y1{constructor(e){this.spec=e}}function K1(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(e2(o,n-i))==JH.Word&&t(t2(o,n-i))==JH.Word||t(t2(o,r-i))==JH.Word&&t(e2(o,r-i))==JH.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 F1(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),o)}class Z1 extends Y1{constructor(e){super(e)}nextMatch(e,t,n){let r=K1(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=K1(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=K1(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=K1(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=K1(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 J1(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(e2(n.input,n.index))!=JH.Word||i(t2(n.input,n.index))!=JH.Word)&&(i(t2(n.input,n.index+n[0].length))!=JH.Word||i(e2(n.input,n.index+n[0].length))!=JH.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 I1(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function e2(e,t){return e.slice(tH(e,t,!1),t)}function t2(e,t){return e.slice(t,tH(e,t))}class n2 extends Y1{nextMatch(e,t,n){let r=J1(this.spec,e,n,e.doc.length).next();return r.done&&(r=J1(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=J1(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=J1(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=J1(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 r2=GH.define(),o2=GH.define(),i2=_H.define({create:e=>new a2(v2(e).create(),null),update(e,t){for(let n of t.effects)n.is(r2)?e=new a2(n.value.create(),e.panel):n.is(o2)&&(e=new a2(e.query,n.value?g2:null));return e},provide:e=>rK.from(e,e=>e.panel)});class a2{constructor(e,t){this.query=e,this.panel=t}}const l2=nq.mark({class:"cm-searchMatch"}),s2=nq.mark({class:"cm-searchMatch cm-searchMatch-selected"}),c2=g$.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(i2))}update(e){let t=e.state.field(i2);(t!=e.startState.field(i2)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return nq.none;let{view:n}=this,r=new uG;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?s2:l2)})}return r.finish()}},{decorations:e=>e.decorations});function u2(e){return t=>{let n=t.state.field(i2,!1);return n&&n.query.spec.valid?e(t,n):w2(t)}}const d2=u2((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=gH.single(r.from,r.to),i=e.state.facet(Q1);return e.dispatch({selection:o,effects:[C2(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),b2(e),!0}),p2=u2((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=gH.single(o.from,o.to),a=e.state.facet(Q1);return e.dispatch({selection:i,effects:[C2(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),b2(e),!0}),f2=u2((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:gH.create(n.map(e=>gH.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),h2=u2((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(WX.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let d=e.state.changes(c);return s&&(a=gH.single(s.from,s.to).map(d),u.push(C2(e,s)),u.push(n.facet(Q1).scrollToMatch(a.main,e))),e.dispatch({changes:d,selection:a,effects:u,userEvent:"input.replace"}),!0}),m2=u2((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:WX.announce.of(r),userEvent:"input.replace.all"}),!0});function g2(e){return e.state.facet(Q1).createPanel(e)}function v2(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(Q1);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 y2(e){let t=JY(e,g2);return t&&t.dom.querySelector("[main-field]")}function b2(e){let t=y2(e);t&&t==e.root.activeElement&&t.select()}const w2=e=>{let t=e.state.field(i2,!1);if(t&&t.panel){let n=y2(e);if(n&&n!=e.root.activeElement){let r=v2(e.state,t.query.spec);r.valid&&e.dispatch({effects:r2.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[o2.of(!0),t?r2.of(v2(e.state,t.query.spec)):GH.appendConfig.of(P2)]});return!0},E2=e=>{let t=e.state.field(i2,!1);if(!t||!t.panel)return!1;let n=JY(e,g2);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:o2.of(!1)}),!0},k2=[{key:"Mod-f",run:w2,scope:"editor search-panel"},{key:"F3",run:d2,shift:p2,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:d2,shift:p2,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:E2,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 F1(e.doc,e.sliceDoc(r,o));!t.next().done;){if(i.length>1e3)return!1;t.value.from==r&&(a=i.length),i.push(gH.range(t.value.from,t.value.to))}return t(e.update({selection:gH.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=NG("form"),t.input){let e=NG("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),r.appendChild(NG("label",(t.label||"")+": ",e))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(NG("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=NG("div",r,NG("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(oK,!1)?e.dispatch({effects:iK.of(o)}):e.dispatch({effects:GH.appendConfig.of(oK.init(()=>[o]))});let i=aK.of(o);return{close:i,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(oK).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=gH.cursor(p.from+Math.max(0,Math.min(u,p.length)));e.dispatch({effects:[r,WX.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=gH.create(n.ranges.map(t=>e.wordAt(t.head)||gH.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 F1(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 F1(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(gH.range(o.from,o.to),!1),effects:WX.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class O2{constructor(e){this.view=e;let t=this.query=e.state.field(i2).query.spec;function n(e,t,n){return NG("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=NG("input",{value:t.search,placeholder:S2(e,"Find"),"aria-label":S2(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=NG("input",{value:t.replace,placeholder:S2(e,"Replace"),"aria-label":S2(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=NG("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=NG("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=NG("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=NG("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>d2(e),[S2(e,"next")]),n("prev",()=>p2(e),[S2(e,"previous")]),n("select",()=>f2(e),[S2(e,"all")]),NG("label",null,[this.caseField,S2(e,"match case")]),NG("label",null,[this.reField,S2(e,"regexp")]),NG("label",null,[this.wordField,S2(e,"by word")]),...e.state.readOnly?[]:[NG("br"),this.replaceField,n("replace",()=>h2(e),[S2(e,"replace")]),n("replaceAll",()=>m2(e),[S2(e,"replace all")])],NG("button",{name:"close",onclick:()=>E2(e),"aria-label":S2(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:r2.of(e)}))}keydown(e){var t,n;t=this.view,n=e,tY(KX(t.state),n,t,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?p2:d2)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),h2(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(r2)&&!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(Q1).top}}function S2(e,t){return e.state.phrase(t)}const x2=30,_2=/[\s\.,:;?!]/;function C2(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-x2),a=Math.min(o,n+x2),l=e.state.sliceDoc(i,a);if(i!=r.from)for(let e=0;e<x2;e++)if(!_2.test(l[e+1])&&_2.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-x2;e--)if(!_2.test(l[e-1])&&_2.test(l[e])){l=l.slice(0,e);break}return WX.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}const D2=WX.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"}}),P2=[i2,DH.low(c2),D2];class A2{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=IK(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(M2(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 T2(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 j2{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function F2(e){return e.selection.main.from}function M2(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 N2=UH.define();function I2(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:gH.cursor(l.from+i+s.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const R2=new WeakMap;function L2(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=T2(t)+T2(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 B2=GH.define(),z2=GH.define();class W2{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=nH(e,t),r=oH(n);this.chars.push(n);let o=e.slice(t,t+r),i=o.toUpperCase();this.folded.push(nH(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=nH(e,0),o=oH(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=nH(e,o);i!=t[s]&&i!=n[s]||(r[s++]=o),o+=oH(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=nH(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=rH(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+=oH(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?oH(nH(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 U2{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 V2=bH.define({combine:e=>rG(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:G2,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=>H2(e(n),t(n)),optionClass:(e,t)=>n=>H2(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function H2(e,t){return e?t?e+" "+t:e:t}function G2(e,t,n,r,o,i){let a,l,s=e.textDirection==jq.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")}}const q2=GH.define();function $2(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 Q2{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(V2);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=$2(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();if(n.target==this.list){let t=this.list.classList.contains("cm-completionListIncompleteTop")&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=t&&(e.dispatch({effects:q2.of(t)}),n.preventDefault())}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(V2).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:z2.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=$2(o.length,i,e.state.facet(V2).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=$2(t.options.length,t.selected,this.view.state.facet(V2).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=>p$(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(V2).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 X2(e,t){return n=>new Q2(n,e,t)}function Y2(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(V2);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 j2(t,r.source,e?e(t):[],1e9-n.length));else{let n,l=t.sliceDoc(r.from,r.to),s=a.filterStrict?new U2(l):new W2(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 j2(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):Y2(e.completion)>Y2(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(V2).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:c3,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(V2),r=(n.override||t.languageDataAt("autocomplete",F2(t)).map(L2)).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(q2)&&(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(N2);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(B2))r=new o3(r.source,1,t.value);else if(t.is(z2))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(F2(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=F2(e.state);if(a>i||!r||2&t&&(F2(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):M2(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 A2(e.state,a,!1)))?new i3(this.source,this.explicit,l,r,r.from,null!==(n=r.to)&&void 0!==n?n:F2(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=GH.define({map:(e,t)=>e.map(e=>e.map(t))}),l3=_H.define({create:()=>Z2.start(),update:(e,t)=>e.update(t),provide:e=>[VY.from(e,e=>e.tooltip),WX.contentAttributes.from(e,e=>e.attrs)]});function s3(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(l3).active.find(e=>e.source==t.source);return r instanceof i3&&("string"==typeof n?e.dispatch({...I2(e.state,n,r.from,r.to),annotations:N2.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}const c3=X2(l3,s3);function u3(e,t="option"){return n=>{let r=n.state.field(l3,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(V2).interactionDelay)return!1;let o,i=1;"page"==t&&(o=YY(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:q2.of(l)}),!0}}const d3=e=>!!e.state.field(l3,!1)&&(e.dispatch({effects:B2.of(!0)}),!0);class p3{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const f3=g$.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(l3).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(l3),n=e.state.facet(V2);if(!e.selectionSet&&!e.docChanged&&e.startState.field(l3)==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){p$(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(B2)))&&(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(l3);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(V2).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=F2(t),r=new A2(t,n,e.explicit,this.view),o=new p3(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:z2.of(null)}),p$(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(V2).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(V2),r=this.view.state.field(l3);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=F2(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(l3,!1);if(t&&t.tooltip&&this.view.state.facet(V2).closeOnBlur){let n=t.open&&YY(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:z2.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:B2.of(!1)}),20),this.composing=0}}}),h3="object"==typeof navigator&&/Win/.test(navigator.platform),m3=DH.highest(WX.domEventHandlers({keydown(e,t){let n=t.state.field(l3,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!h3||!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&&s3(t,r),!1}})),g3=WX.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"}}}),v3={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},y3=GH.define({map(e,t){let n=t.mapPos(e,-1,aH.TrackAfter);return null==n?void 0:n}}),b3=new class extends oG{};b3.startSide=1,b3.endSide=-1;const w3=_H.define({create:()=>cG.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(y3)&&(e=e.update({add:[b3.range(n.value,n.value+1)]}));return e}}),E3="()[]{}<>«»»«[]{}";function k3(e){for(let t=0;t<16;t+=2)if(E3.charCodeAt(t)==e)return E3.charAt(t+1);return rH(e<128?e:e+1)}function O3(e,t){return e.languageDataAt("closeBrackets",t)[0]||v3}const S3="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),x3=WX.inputHandler.of((e,t,n,r)=>{if((S3?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==oH(nH(r,0))||t!=o.from||n!=o.to)return!1;let i=function(e,t){let n=O3(e,e.selection.main.head),r=n.brackets||v3.brackets;for(let o of r){let i=k3(nH(o,0));if(t==o)return i==o?T3(e,o,r.indexOf(o+o+o)>-1,n):P3(e,o,i,n.before||v3.before);if(t==i&&C3(e,e.selection.main.from))return A3(e,0,i)}return null}(e.state,r);return!!i&&(e.dispatch(i),!0)}),_3=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=O3(e,e.selection.main.head).brackets||v3.brackets,r=null,o=e.changeByRange(t=>{if(t.empty){let r=function(e,t){let n=e.sliceString(t-2,t);return oH(nH(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==r&&D3(e.doc,t.head)==k3(nH(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:gH.cursor(t.head-o.length)}}return{range:r=t}});return r||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function C3(e,t){let n=!1;return e.field(w3).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function D3(e,t){let n=e.sliceString(t,t+2);return n.slice(0,oH(nH(n,0)))}function P3(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:y3.of(i.to+t.length),range:gH.range(i.anchor+t.length,i.head+t.length)};let a=D3(e.doc,i.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:i.head},effects:y3.of(i.head+t.length),range:gH.cursor(i.head+t.length)}:{range:o=i}});return o?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function A3(e,t,n){let r=null,o=e.changeByRange(t=>t.empty&&D3(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:gH.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function T3(e,t,n,r){let o=r.stringPrefixes||v3.stringPrefixes,i=null,a=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:y3.of(r.to+t.length),range:gH.range(r.anchor+t.length,r.head+t.length)};let a,l=r.head,s=D3(e.doc,l);if(s==t){if(j3(e,l))return{changes:{insert:t+t,from:l},effects:y3.of(l+t.length),range:gH.cursor(l+t.length)};if(C3(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:gH.cursor(l+r.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(a=F3(e,l-2*t.length,o))>-1&&j3(e,a))return{changes:{insert:t+t+t+t,from:l},effects:y3.of(l+t.length),range:gH.cursor(l+t.length)};if(e.charCategorizer(l)(s)!=JH.Word&&F3(e,l,o)>-1&&!function(e,t,n,r){let o=IK(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:y3.of(l+t.length),range:gH.cursor(l+t.length)}}return{range:i=r}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function j3(e,t){let n=IK(e).resolveInner(t+1);return n.parent&&n.from==t}function F3(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=JH.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))!=JH.Word)return n}return-1}const M3=[{key:"Ctrl-Space",run:d3},{mac:"Alt-`",run:d3},{mac:"Alt-i",run:d3},{key:"Escape",run:e=>{let t=e.state.field(l3,!1);return!(!t||!t.active.some(e=>0!=e.state)||(e.dispatch({effects:z2.of(null)}),0))}},{key:"ArrowDown",run:u3(!0)},{key:"ArrowUp",run:u3(!1)},{key:"PageDown",run:u3(!0,"page")},{key:"PageUp",run:u3(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(l3,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(V2).interactionDelay)&&s3(e,t.open.options[t.open.selected])}}],N3=DH.highest(XX.computeN([V2],e=>e.facet(V2).defaultKeymap?[M3]:[]));var I3=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(_3)),!1!==e.defaultKeymap&&(n=n.concat(A1)),!1!==e.searchKeymap&&(n=n.concat(k2)),!1!==e.historyKeymap&&(n=n.concat(j0)),!1!==e.foldKeymap&&(n=n.concat(wZ)),!1!==e.completionKeymap&&(n=n.concat(M3)),!1!==e.lintKeymap&&(n=n.concat(jJ));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[OK.of(e),hK(),_K]}()),!1!==e.highlightActiveLineGutter&&r.push(PK),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[OY.of(e),SY||(SY=g$.fromClass(class{constructor(e){this.view=e,this.decorations=nq.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(OY)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new yY({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:o}=n.state,i=nH(t[0],0);if(9==i){let e=o.lineAt(r),t=n.state.tabSize,i=EG(e.text,t,r-e.from);return nq.replace({widget:new _Y((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=nq.replace({widget:new xY(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(OY);e.startState.facet(OY)!=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[m0,h0.of(e),WX.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?v0:"historyRedo"==e.inputType?y0:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t={...CZ,...e},n=new DZ(t,!0),r=new DZ(t,!1),o=g$.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(GK)!=e.state.facet(GK)||e.startState.field(hZ,!1)!=e.state.field(hZ,!1)||IK(e.startState)!=IK(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new uG;for(let o of e.viewportLineBlocks){let i=gZ(e.state,o.from,o.to)?r:cZ(e.state,o.from,o.to)?n:null;i&&t.add(o.from,o.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[o,pK({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||cG.empty},initialSpacer:()=>new DZ(t,!1),domEventHandlers:{...i,click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let r=gZ(e.state,t.from,t.to);if(r)return e.dispatch({effects:pZ.of(r)}),!0;let o=cZ(e.state,t.from,t.to);return!!o&&(e.dispatch({effects:dZ.of(o)}),!0)}}}),OZ()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[sY.of(e),uY,pY,fY,l$.of(!0)]}()),!1!==e.dropCursor&&r.push([mY,gY]),!1!==e.allowMultipleSelections&&r.push(nG.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(nG.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=KK(a,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],o=YK(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(MZ(RZ,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[zZ.of(e),GZ]}()),!1!==e.closeBrackets&&r.push([x3,w3]),!1!==e.autocompletion&&r.push(function(e={}){return[m3,l3,V2.of(e),f3,N3,g3]}()),!1!==e.rectangularSelection&&r.push(function(){let e=e=>e.altKey&&0==e.button;return WX.mouseSelectionStyle.of((t,n)=>e(n)?function(e,t){let n=TY(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=TY(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>AY||n.off>AY||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(gH.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=kG(n.text,a,e.tabSize,!0);if(r<0)i.push(gH.cursor(n.to));else{let t=kG(n.text,l,e.tabSize);i.push(gH.range(n.from+r,n.from+t))}}}return i}(e.state,n,a);return l.length?i?gH.create(l.concat(r.ranges)):gH.create(l):r}}:null}(t,n):null)}()),!1!==t&&r.push(function(e={}){let[t,n]=jY[e.key||"Alt"],r=g$.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,WX.contentAttributes.of(e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?FY:null})]}()),!1!==e.highlightActiveLine&&r.push(DY),!1!==e.highlightSelectionMatches&&r.push(function(){let e=[$1,q1];return e}()),e.tabSize&&"number"==typeof e.tabSize&&r.push(QK.of(" ".repeat(e.tabSize))),r.concat([XX.of(n.flat())]).filter(Boolean)};const R3="#e06c75",L3="#abb2bf",B3="#7d8799",z3="#d19a66",W3="#2c313a",U3="#282c34",V3="#353a42",H3="#528bff",G3=[WX.theme({"&":{color:L3,backgroundColor:U3},".cm-content":{caretColor:H3},".cm-cursor, .cm-dropCursor":{borderLeftColor:H3},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:L3},".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:U3,color:B3,border:"none"},".cm-activeLineGutter":{backgroundColor:W3},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:V3},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:V3,borderBottomColor:V3},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:W3,color:L3}}},{dark:!0}),MZ(AZ.define([{tag:vV.keyword,color:"#c678dd"},{tag:[vV.name,vV.deleted,vV.character,vV.propertyName,vV.macroName],color:R3},{tag:[vV.function(vV.variableName),vV.labelName],color:"#61afef"},{tag:[vV.color,vV.constant(vV.name),vV.standard(vV.name)],color:z3},{tag:[vV.definition(vV.name),vV.separator],color:L3},{tag:[vV.typeName,vV.className,vV.number,vV.changed,vV.annotation,vV.modifier,vV.self,vV.namespace],color:"#e5c07b"},{tag:[vV.operator,vV.operatorKeyword,vV.url,vV.escape,vV.regexp,vV.link,vV.special(vV.string)],color:"#56b6c2"},{tag:[vV.meta,vV.comment],color:B3},{tag:vV.strong,fontWeight:"bold"},{tag:vV.emphasis,fontStyle:"italic"},{tag:vV.strikethrough,textDecoration:"line-through"},{tag:vV.link,color:B3,textDecoration:"underline"},{tag:vV.heading,fontWeight:"bold",color:R3},{tag:[vV.atom,vV.bool,vV.special(vV.variableName)],color:z3},{tag:[vV.processingInstruction,vV.string,vV.inserted],color:"#98c379"},{tag:vV.invalid,color:"#ffffff"}]))];var q3=WX.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(XX.of([T1])),a&&("boolean"==typeof a?l.unshift(I3()):l.unshift(I3(a))),i&&l.unshift(function(e){let t=g$.fromClass(class{constructor(t){this.view=t,this.placeholder=e?nq.set([nq.widget({widget:new PY(e),side:1}).range(0)]):nq.none}get decorations(){return this.view.state.doc.length?nq.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,WX.contentAttributes.of({"aria-placeholder":e})]:t}(i)),o){case"light":l.push(q3);break;case"dark":l.push(G3);break;case"none":break;default:l.push(o)}return!1===n&&l.push(WX.editable.of(!1)),r&&l.push(nG.readOnly.of(!0)),[...l]};class Q3{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 Y3=null,K3=UH.define(),Z3=[];var J3=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],e5=(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=Lt(e,J3),_=(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=Z3,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=WX.theme({"&":{height:u,minHeight:d,maxHeight:p,width:f,minWidth:h,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),j=WX.updateListener.of(e=>{if(e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(K3))){P.current?P.current.reset():(P.current=new Q3(()=>{if(A.current){var e=A.current;A.current=null,e()}P.current=null},200),("undefined"==typeof window?new X3:(Y3||(Y3=new X3),Y3)).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))}),F=[j,T,...$3({theme:c,editable:v,readOnly:y,placeholder:g,indentWithTab:b,basicSetup:w})];return a&&"function"==typeof a&&F.push(WX.updateListener.of(a)),F=F.concat(l),(0,pe.useLayoutEffect)(()=>{if(O&&!C){var e={doc:t,selection:n,extensions:F},r=k?nG.fromJSON(k.json,e,k.fields):nG.create(e);if(D(r),!x){var o=new WX({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:GH.reconfigure.of(F)})},[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:[K3.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 j="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,GP.jsx)("div",re({ref:T,className:j+(n?" "+n:"")},x))});e5.displayName="CodeMirror";const t5=e5,n5=0,r5=1,o5=2,i5=3,a5=4,l5=5,s5=7,c5=9,u5=10,d5=11,p5=12,f5=13,h5=14,m5=15,g5=16,v5=17,y5=18,b5=19,w5=20,E5=21,k5=22,O5=23,S5=24,x5=25,_5=0;function C5(e){return e>=48&&e<=57}function D5(e){return C5(e)||e>=65&&e<=70||e>=97&&e<=102}function P5(e){return e>=65&&e<=90}function A5(e){return function(e){return P5(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function T5(e){return A5(e)||C5(e)||45===e}function j5(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function F5(e){return 10===e||13===e||12===e}function M5(e){return F5(e)||32===e||9===e}function N5(e,t){return 92===e&&!F5(t)&&t!==_5}function I5(e,t,n){return 45===e?A5(t)||45===t||N5(t,n):!!A5(e)||92===e&&N5(e,t)}function R5(e,t,n){return 43===e||45===e?C5(t)?2:46===t&&C5(n)?3:0:46===e?C5(t)?2:0:C5(e)?1:0}function L5(e){return 65279===e||65534===e?1:0}const B5=new Array(128),z5=130;for(let e=0;e<B5.length;e++)B5[e]=(M5(e)?z5:C5(e)&&131)||A5(e)&&132||j5(e)&&133||e||128;function W5(e){return e<128?B5[e]:132}function U5(e,t){return t<e.length?e.charCodeAt(t):0}function V5(e,t,n){return 13===n&&10===U5(e,t+1)?2:1}function H5(e,t,n){let r=e.charCodeAt(t);return P5(r)&&(r|=32),r===n}function G5(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(P5(i)&&(i|=32),i!==n)return!1}return!0}function q5(e,t){for(;t<e.length&&M5(e.charCodeAt(t));t++);return t}function $5(e,t){for(;t<e.length&&C5(e.charCodeAt(t));t++);return t}function Q5(e,t){if(D5(U5(e,(t+=2)-1))){for(const n=Math.min(e.length,t+5);t<n&&D5(U5(e,t));t++);const n=U5(e,t);M5(n)&&(t+=V5(e,t,n))}return t}function X5(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!T5(n)){if(!N5(n,U5(e,t+1)))break;t=Q5(e,t)-1}}return t}function Y5(e,t){let n=e.charCodeAt(t);if(43!==n&&45!==n||(n=e.charCodeAt(t+=1)),C5(n)&&(t=$5(e,t+1),n=e.charCodeAt(t)),46===n&&C5(e.charCodeAt(t+1))&&(t=$5(e,t+=2)),H5(e,t,101)){let r=0;n=e.charCodeAt(t+1),45!==n&&43!==n||(r=1,n=e.charCodeAt(t+2)),C5(n)&&(t=$5(e,t+1+r+1))}return t}function K5(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(41===n){t++;break}N5(n,U5(e,t+1))&&(t=Q5(e,t))}return t}function Z5(e){if(1===e.length&&!D5(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)}function J5(e,t){function n(t){return t<a?e.charCodeAt(t):0}function r(){return c=Y5(e,c),I5(n(c),n(c+1),n(c+2))?(l=p5,void(c=X5(e,c))):37===n(c)?(l=d5,void c++):void(l=u5)}function o(){const t=c;return c=X5(e,c),G5(e,t,c,"url")&&40===n(c)?(c=q5(e,c+1),34===n(c)||39===n(c)?(l=o5,void(c=t+4)):void function(){for(l=s5,c=q5(e,c);c<e.length;c++){const t=e.charCodeAt(c);switch(W5(t)){case 41:return void c++;case z5:return c=q5(e,c),41===n(c)||c>=e.length?void(c<e.length&&c++):(c=K5(e,c),void(l=8));case 34:case 39:case 40:case 133:return c=K5(e,c),void(l=8);case 92:if(N5(t,n(c+1))){c=Q5(e,c)-1;break}return c=K5(e,c),void(l=8)}}}()):40===n(c)?(l=o5,void c++):void(l=r5)}function i(t){for(t||(t=n(c++)),l=l5;c<e.length;c++){const r=e.charCodeAt(c);switch(W5(r)){case t:return void c++;case z5:if(F5(r))return c+=V5(e,c,r),void(l=6);break;case 92:if(c===e.length-1)break;const o=n(c+1);F5(o)?c+=V5(e,c+1,o):N5(r,o)&&(c=Q5(e,c)-1)}}}const a=(e=String(e||"")).length;let l,s=L5(n(0)),c=s;for(;c<a;){const a=e.charCodeAt(c);switch(W5(a)){case z5:l=f5,c=q5(e,c+1);break;case 34:i();break;case 35:T5(n(c+1))||N5(n(c+1),n(c+2))?(l=a5,c=X5(e,c+1)):(l=c5,c++);break;case 39:i();break;case 40:l=E5,c++;break;case 41:l=k5,c++;break;case 43:R5(a,n(c+1),n(c+2))?r():(l=c5,c++);break;case 44:l=y5,c++;break;case 45:R5(a,n(c+1),n(c+2))?r():45===n(c+1)&&62===n(c+2)?(l=m5,c+=3):I5(a,n(c+1),n(c+2))?o():(l=c5,c++);break;case 46:R5(a,n(c+1),n(c+2))?r():(l=c5,c++);break;case 47:42===n(c+1)?(l=x5,c=e.indexOf("*/",c+2),c=-1===c?e.length:c+2):(l=c5,c++);break;case 58:l=g5,c++;break;case 59:l=v5,c++;break;case 60:33===n(c+1)&&45===n(c+2)&&45===n(c+3)?(l=h5,c+=4):(l=c5,c++);break;case 64:I5(n(c+1),n(c+2),n(c+3))?(l=i5,c=X5(e,c+1)):(l=c5,c++);break;case 91:l=b5,c++;break;case 92:N5(a,n(c+1))?o():(l=c5,c++);break;case 93:l=w5,c++;break;case 123:l=O5,c++;break;case 125:l=S5,c++;break;case 131:r();break;case 132:o();break;default:l=c5,c++}t(l,s,s=c)}}let e4=null;class t4{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return t4.createItem(e)}allocateCursor(e,t){let n;return null!==e4?(n=e4,e4=e4.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=e4,e4=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=t4.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 t4;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 t4;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 t4;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(t4.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(t4.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(t4.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(t4.createItem(e))}pop(){return null!==this.tail?this.remove(this.tail):null}unshift(e){this.prepend(t4.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 n4(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 r4({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 o4(e,t,n,r,o,i=1,a=1){return Object.assign(n4("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment:e=>r4({source:t,line:r,column:o,baseLine:i,baseColumn:a},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+r4({source:t,line:r,column:o,baseLine:i,baseColumn:a},2)}})}function i4(e=null,t){return null===e||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function a4(e){const t=e.source,n=t.length,r=t.length>0?L5(t.charCodeAt(0)):0,o=i4(e.lines,n),i=i4(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 l4{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||a4(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||a4(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 s4=["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"],c4=16777215,u4=24,d4=new Uint8Array(32);d4[o5]=k5,d4[E5]=k5,d4[b5]=w5,d4[O5]=S5;const p4=new Uint8Array(32);function f4(e,t,n){return e<t?t:e>n?n:e}p4[o5]=1,p4[E5]=1,p4[b5]=1,p4[O5]=1,p4[k5]=2,p4[w5]=2,p4[S5]=2;class h4{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=i4(this.offsetAndType,e.length+1),o=i4(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<<u4|n,-1===a&&(a=t),o[c]=s,e===l){const e=o[s];o[s]=c,s=e,l=d4[r[e]>>u4]}else this.isBlockOpenerTokenType(e)&&(s=c,l=d4[e])}),r[i]=n5<<u4|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]>>u4:n5}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>u4;if(n!==f5&&n!==x5&&0===e--)return n}return n5}lookupOffset(e){return(e+=this.tokenIndex)<this.tokenCount?this.offsetAndType[e-1]&c4:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){const n=this.offsetAndType[t]>>u4;if(n!==f5&&n!==x5&&0===e--)return t-this.tokenIndex}return n5}lookupValue(e,t){return(e+=this.tokenIndex)<this.tokenCount&&G5(this.source,this.offsetAndType[e-1]&c4,this.offsetAndType[e]&c4,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&c4:this.offsetAndType[this.tokenCount]&c4:this.firstCharOffset}getTokenEnd(e){return e===this.tokenIndex?this.tokenEnd:this.offsetAndType[f4(e,0,this.tokenCount)]&c4}getTokenType(e){return e===this.tokenIndex?this.tokenType:this.offsetAndType[f4(e,0,this.tokenCount)]>>u4}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBlockOpenerTokenType(e){return 1===p4[e]}isBlockCloserTokenType(e){return 2===p4[e]}getBlockTokenPairIndex(e){const t=this.getTokenType(e);if(1===p4[t]){const n=this.balance[e],r=this.getTokenType(n);return d4[t]===r?n:-1}if(2===p4[t]){const n=this.balance[e],r=this.getTokenType(n);return d4[r]===t?n:-1}return-1}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===c5&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===c5&&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]&c4,t=this.offsetAndType[t],this.tokenType=t>>u4,this.tokenEnd=t&c4):(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>>u4,this.tokenEnd=e&c4):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=n5,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===f5||this.tokenType===x5;)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]&c4:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>u4)&&(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&c4;n=i,e(o>>u4,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:s4[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}}function m4(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case x5:this.next();continue;case f5: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=()=>{},v4={createList:()=>[],createSingleNodeList:e=>[e],getFirstListNode:e=>e&&e[0]||null,getLastListNode:e=>e&&e.length>0?e[e.length-1]:null},y4={createList:()=>new t4,createSingleNodeList:e=>(new t4).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last};function b4(e){return function(){return this[e]()}}function w4(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 E4=a(1527);const k4=new Set(["Atrule","Selector","Declaration"]),O4=(e,t)=>(e===c5&&(e=t),"string"==typeof e&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),S4=[[r5,r5],[r5,o5],[r5,s5],[r5,8],[r5,"-"],[r5,u5],[r5,d5],[r5,p5],[r5,m5],[r5,E5],[i5,r5],[i5,o5],[i5,s5],[i5,8],[i5,"-"],[i5,u5],[i5,d5],[i5,p5],[i5,m5],[a5,r5],[a5,o5],[a5,s5],[a5,8],[a5,"-"],[a5,u5],[a5,d5],[a5,p5],[a5,m5],[p5,r5],[p5,o5],[p5,s5],[p5,8],[p5,"-"],[p5,u5],[p5,d5],[p5,p5],[p5,m5],["#",r5],["#",o5],["#",s5],["#",8],["#","-"],["#",u5],["#",d5],["#",p5],["#",m5],["-",r5],["-",o5],["-",s5],["-",8],["-","-"],["-",u5],["-",d5],["-",p5],["-",m5],[u5,r5],[u5,o5],[u5,s5],[u5,8],[u5,u5],[u5,d5],[u5,p5],[u5,"%"],[u5,m5],["@",r5],["@",o5],["@",s5],["@",8],["@","-"],["@",m5],[".",u5],[".",d5],[".",p5],["+",u5],["+",d5],["+",p5],["/","*"]],x4=S4.concat([[r5,a5],[p5,a5],[a5,a5],[i5,E5],[i5,l5],[i5,g5],[d5,d5],[d5,p5],[d5,o5],[d5,"-"],[k5,r5],[k5,o5],[k5,d5],[k5,p5],[k5,a5],[k5,"-"]]);function _4(e){const t=new Set(e.map(([e,t])=>O4(e)<<16|O4(t)));return function(e,n,r){const o=O4(n,r),i=r.charCodeAt(0);return o|(45===i&&n!==r5&&n!==o5&&n!==m5||43===i?t.has((65534&e)<<16|i<<7):t.has((65534&e)<<16|o))}}const C4=_4(S4),D4=_4(x4);function P4(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)}const{hasOwnProperty:A4}=Object.prototype,T4=function(){};function j4(e){return"function"==typeof e?e:T4}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===A4.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 N4(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 I4({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 R4(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 B4(e,t){let n=R4,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 z4={offset:0,line:1,column:1};function W4(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?U4(n):n:null}function U4({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 V4=function(e,t){const n=n4("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},H4=function(e,t,n,r){const o=n4("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=W4(i||t,"end")||U4(z4,d),l=U4(a)):(a=W4(i,"start")||U4(W4(t,"start")||z4,d.slice(0,s)),l=W4(i,"end")||U4(a,d.substr(s,c))),{css:d,mismatchOffset:s,mismatchLength:c,start:a,end:l}}(r,n);return o.rawMessage=e,o.syntax=t?B4(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},G4=new Map,q4=new Map,$4=45,Q4=function(e){if(G4.has(e))return G4.get(e);const t=e.toLowerCase();let n=G4.get(t);if(void 0===n){const e=Y4(t,0),r=e?"":K4(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return G4.set(e,n),n},X4=function(e){if(q4.has(e))return q4.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(),q4.has(t))){const n=q4.get(t);return q4.set(e,n),n}const o=r?"":K4(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 q4.set(e,a),a};function Y4(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===$4&&e.charCodeAt(t+1)===$4}function K4(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===$4&&e.charCodeAt(t+1)!==$4){const n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}const Z4=["initial","inherit","unset","revert","revert-layer"],J4=45,e6=!0;function t6(e,t){return null!==e&&e.type===c5&&e.value.charCodeAt(0)===t}function n6(e,t,n){for(;null!==e&&(e.type===f5||e.type===x5);)e=n(++t);return t}function r6(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(43===o||o===J4){if(n)return 0;t++}for(;t<e.value.length;t++)if(!C5(e.value.charCodeAt(t)))return 0;return r+1}function o6(e,t,n){let r=!1,o=n6(e,t,n);if(null===(e=n(o)))return t;if(e.type!==u5){if(!t6(e,43)&&!t6(e,J4))return t;if(r=!0,o=n6(n(++o),o,n),null===(e=n(o))||e.type!==u5)return 0}if(!r){const t=e.value.charCodeAt(0);if(43!==t&&t!==J4)return 0}return r6(e,r?0:1,r,o)}function i6(e,t){return null!==e&&e.type===c5&&e.value.charCodeAt(0)===t}function a6(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 a6(e,t+r+1,!1),6;if(!D5(i))return 0;if(++r>6)return 0}return r}function l6(e,t,n){if(!e)return 0;for(;i6(n(t),63);){if(++e>6)return 0;t++}return t}const s6=["calc(","-moz-calc(","-webkit-calc("],c6=["min(","max(","clamp("],u6=["round(","mod(","rem("],d6=["hypot("],p6=["abs("],f6=[...s6,...c6,...u6,"sin(","cos(","tan(","pow(","sqrt(","log(","exp(","sign(",...d6,...p6],h6=[...s6,...c6,...u6,...d6,...p6],m6=[...s6,...c6,...u6,"asin(","acos(","atan(","atan2(",...d6,...p6],g6=new Map([[o5,k5],[E5,k5],[b5,w5],[O5,S5]]);function v6(e,t){return t<e.length?e.charCodeAt(t):0}function y6(e,t){return G5(e,0,e.length,t)}function b6(e,t){for(let n=0;n<t.length;n++)if(y6(e,t[n]))return!0;return!1}function w6(e,t){return t===e.length-2&&92===v6(e,t)&&C5(v6(e,t+1))}function E6(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 k6(e,t){return function(n,r,o){return null===n?0:n.type===o5&&b6(n.value,t)?function(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case S5:case k5:case w5:if(e.type!==n)break e;if(n=r.pop(),0===r.length){o++;break e}break;case o5:case E5:case b5:case O5:r.push(n),n=g6.get(e.type)}o++}while(e=t(o));return o}(n,r):e(n,r,o)}}function O6(e){return function(t){return null===t||t.type!==e?0:1}}function S6(e){return null===e||e.type!==r5||45!==v6(e.value,0)||45!==v6(e.value,1)?0:1}function x6(e){return e&&(e=new Set(e)),function(t,n,r){if(null===t||t.type!==p5)return 0;const o=Y5(t.value,0);if(null!==e){const n=t.value.indexOf("\\",o),r=-1!==n&&w6(t.value,n)?t.value.substring(o,n):t.value.substr(o);if(!1===e.has(r.toLowerCase()))return 0}return E6(r,t.value,o)?0:1}}function _6(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===u5&&0===Number(t.value)?1:e(t,n,r)}}const C6={"ident-token":O6(r5),"function-token":O6(o5),"at-keyword-token":O6(i5),"hash-token":O6(a5),"string-token":O6(l5),"bad-string-token":O6(6),"url-token":O6(s5),"bad-url-token":O6(8),"delim-token":O6(c5),"number-token":O6(u5),"percentage-token":O6(d5),"dimension-token":O6(p5),"whitespace-token":O6(f5),"CDO-token":O6(h5),"CDC-token":O6(m5),"colon-token":O6(g5),"semicolon-token":O6(v5),"comma-token":O6(y5),"[-token":O6(b5),"]-token":O6(w5),"(-token":O6(E5),")-token":O6(k5),"{-token":O6(O5),"}-token":O6(S5)},D6={string:O6(l5),ident:O6(r5),percentage:k6(function(e,t,n){return null===e||e.type!==d5||E6(n,e.value,e.value.length-1)?0:1},h6),zero:_6(),number:k6(function(e,t,n){if(null===e)return 0;const r=Y5(e.value,0);return r===e.value.length||w6(e.value,r)?E6(n,e.value,r)?0:1:0},f6),integer:k6(function(e,t,n){if(null===e||e.type!==u5)return 0;let r=43===v6(e.value,0)||45===v6(e.value,0)?1:0;for(;r<e.value.length;r++)if(!C5(v6(e.value,r)))return 0;return E6(n,e.value,r)?0:1},f6),"custom-ident":function(e){if(null===e||e.type!==r5)return 0;const t=e.value.toLowerCase();return b6(t,Z4)||y6(t,"default")?0:1},"dashed-ident":S6,"custom-property-name":function(e){return S6(e)?"--"===e.value?0:1:0},"hex-color":function(e){if(null===e||e.type!==a5)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(!D5(v6(e.value,n)))return 0;return 1},"id-selector":function(e){return null===e||e.type!==a5?0:I5(v6(e.value,1),v6(e.value,2),v6(e.value,3))?1:0},"an-plus-b":function(e,t){let n=0;if(!e)return 0;if(e.type===u5)return r6(e,0,!1,n);if(e.type===r5&&e.value.charCodeAt(0)===J4){if(!H5(e.value,1,110))return 0;switch(e.value.length){case 2:return o6(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==J4?0:(n=n6(t(++n),n,t),r6(e=t(n),0,e6,n));default:return e.value.charCodeAt(2)!==J4?0:r6(e,3,e6,n)}}else if(e.type===r5||t6(e,43)&&t(n+1).type===r5){if(e.type!==r5&&(e=t(++n)),null===e||!H5(e.value,0,110))return 0;switch(e.value.length){case 1:return o6(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==J4?0:(n=n6(t(++n),n,t),r6(e=t(n),0,e6,n));default:return e.value.charCodeAt(1)!==J4?0:r6(e,2,e6,n)}}else if(e.type===p5){let r=e.value.charCodeAt(0),o=43===r||r===J4?1:0,i=o;for(;i<e.value.length&&C5(e.value.charCodeAt(i));i++);return i===o?0:H5(e.value,i,110)?i+1===e.value.length?o6(t(++n),n,t):e.value.charCodeAt(i+1)!==J4?0:i+2===e.value.length?(n=n6(t(++n),n,t),r6(e=t(n),0,e6,n)):r6(e,i+2,e6,n):0}return 0},urange:function(e,t){let n=0;if(null===e||e.type!==r5||!H5(e.value,0,117))return 0;if(null===(e=t(++n)))return 0;if(i6(e,43))return null===(e=t(++n))?0:e.type===r5?l6(a6(e,0,!0),++n,t):i6(e,63)?l6(1,++n,t):0;if(e.type===u5){const r=a6(e,1,!0);return 0===r?0:null===(e=t(++n))?n:e.type===p5||e.type===u5?function(e){return 45===e.value.charCodeAt(0)}(e)&&a6(e,1,!1)?n+1:0:l6(r,n,t)}return e.type===p5?l6(a6(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 S5:case k5:case w5:if(e.type!==n)break e;n=r.pop();break;case v5:if(0===n)break e;break;case c5:if(0===n&&"!"===e.value)break e;break;case o5:case E5:case b5:case O5:r.push(n),n=g6.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 S5:case k5:case w5:if(e.type!==n)break e;n=r.pop();break;case o5:case E5:case b5:case O5:r.push(n),n=g6.get(e.type)}o++}while(e=t(o));return o}},P6=["length","angle","time","frequency","resolution","flex","decibel","semitones"];function A6(e){const{angle:t,decibel:n,frequency:r,flex:o,length:i,resolution:a,semitones:l,time:s}=e||{};return{dimension:k6(x6(null),m6),angle:k6(x6(t),m6),decibel:k6(x6(n),m6),frequency:k6(x6(r),m6),flex:k6(x6(o),m6),length:k6(_6(x6(i)),m6),resolution:k6(x6(a),m6),semitones:k6(x6(l),m6),time:k6(x6(s),m6)}}function T6(e){const t=new Set;for(const n of P6)if(Array.isArray(e[n]))for(const r of e[n])t.add(r.toLowerCase());return function(e){return null===e?0:e.type===c5&&"%"===e.value||e.type===r5&&t.has(e.value.toLowerCase())?1:0}}const j6=["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"],F6=["deg","grad","rad","turn"],M6=["s","ms"],N6=["hz","khz"],I6=["dpi","dpcm","dppx","x"],R6=["fr"],L6=["db"],B6=["st"];function z6(e,t,n){return Object.assign(n4("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+"\n "+t+"\n--"+new Array((n||t.length)+1).join("-")+"^"})}const W6=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0);class U6{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===W6[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 z6(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===W6[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 V6=93,H6=123,G6={" ":1,"&&":2,"||":3,"|":4};function q6(e){let t=null,n=null;return e.eat(H6),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 $6(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()===H6?t=q6(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case H6:t=q6(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)||63===e.charCode()&&125===e.charCodeAt(e.pos-1)?$6(e,n):n):t}function Q6(e){const t=e.peek();return""===t?null:$6(e,{type:"Token",value:t})}function X6(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)=>G6[e]-G6[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 Y6(e,t=-1){const n=Object.create(null),r=[];let o=null,i=e.pos,a=!1;for(;e.charCode()!==t;){let t=a?Y6(e,41):K6(e);if(!t)break;if("Spaces"!==t.type){if(a){if(0===t.terms.length){a=!1;continue}if(" "===t.combinator){for(;t.terms.length>1;)n[" "]=!0,r.push({type:"Combinator",value:" "},t.terms.shift());t=t.terms[0]}}"Combinator"===t.type?(null!==o&&"Combinator"!==o.type||(e.pos=i,e.error("Unexpected combinator")),n[t.value]=!0):null!==o&&"Combinator"!==o.type&&(n[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(t),o=t,i=e.pos,a="Function"===t.type}}return null!==o&&"Combinator"===o.type&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:X6(r,n)||" ",disallowEmpty:!1,explicit:!1}}function K6(e){let t=e.charCode();switch(t){case V6:break;case 91:return $6(e,function(e){let t;return e.eat(91),t=Y6(e,V6),e.eat(V6),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));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),$6(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=Y6(e,V6);return e.eat(V6),e.eat(62),$6(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(V6),{type:"Range",min:t,max:n}}(e)),e.eat(62),$6(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 $6(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 t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):Q6(e);case 42:case 43:case 63:case 35:case 33:break;case H6:if(t=e.nextCharCode(),t<48||t>57)return Q6(e);break;default:return e.isNameCharCode(t)?function(e){const t=e.scanWord();return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):$6(e,{type:"Keyword",name:t})}(e):Q6(e)}}function Z6(e){const t=new U6(e),n=Y6(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type?n.terms[0]:n}const J6=function(){};const e8={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 t8={type:"Match"},n8={type:"Mismatch"},r8={type:"DisallowEmpty"};function o8(e,t,n){return t===t8&&n===n8||e===t8&&t===t8&&n===t8?e:("If"===e.type&&e.else===n8&&t===t8&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function i8(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function a8(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&i8(e.name)}function l8(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function s8(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=s8(e.match,t,n),e.then=s8(e.then,t,n),e.else=s8(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function c8(e,t,n){switch(e){case" ":{let e=t8;for(let n=t.length-1;n>=0;n--)e=o8(t[n],e,n8);return e}case"|":{let e=n8,n=null;for(let r=t.length-1;r>=0;r--){let o=t[r];if(a8(o)&&(null===n&&r>0&&a8(t[r-1])&&(n=Object.create(null),e=o8({type:"Enum",map:n},t8,e)),null!==n)){const e=(i8(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(e in n==0){n[e]=o;continue}}n=null,e=o8(o,t8,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=n8;for(let r=t.length-1;r>=0;r--){const o=t[r];let i;i=t.length>1?c8(e,t.filter(function(e){return e!==o}),!1):t8,n=o8(o,i,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?t8:n8;for(let n=t.length-1;n>=0;n--){const o=t[n];let i;i=t.length>1?c8(e,t.filter(function(e){return e!==o}),!0):t8,r=o8(o,i,r)}return r}}}function u8(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=c8(e.combinator,e.terms.map(u8),!1);return e.disallowEmpty&&(t=o8(t,r8,n8)),t}case"Multiplier":return function(e){let t=t8,n=u8(e.term);if(0===e.max)n=o8(n,r8,n8),t=o8(n,null,n8),t.then=o8(t8,t8,t),e.comma&&(t.then.else=o8({type:"Comma",syntax:e},t,n8));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==t8&&(t=o8({type:"Comma",syntax:e},t,n8)),t=o8(n,o8(t8,t8,t),n8);if(0===e.min)t=o8(t8,t8,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==t8&&(t=o8({type:"Comma",syntax:e},t,n8)),t=o8(n,t,n8);return t}(e);case"Boolean":{const t=u8(e.term),n=u8(l8([l8([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),l8([{type:"Type",name:"!boolean-group"},l8([{type:"Multiplier",comma:!1,min:0,max:0,term:l8([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:l8([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),r=u8(l8([{type:"Type",name:"!term"},l8([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return s8(r,{"!term":t,"!self":n}),s8(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 d8(e,t){return"string"==typeof e&&(e=Z6(e)),{type:"MatchGraph",match:u8(e),syntax:t||null,source:e}}const{hasOwnProperty:p8}=Object.prototype,f8="Match";let h8=0;function m8(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 g8(e){return null===e||e.type===y5||e.type===o5||e.type===E5||e.type===b5||e.type===O5||function(e){return e.type===c5&&"?"!==e.value}(e)}function v8(e){return null===e||e.type===k5||e.type===w5||e.type===S5||e.type===c5&&"/"===e.value}function y8(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===f5||v.type===x5))}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=n8;break}g=f8;break}if((t=p.nextState)===r8){if(p.matchStack===w){t=n8;break}t=t8}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!==n8&&l(t.else),t.then!==t8&&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=n8;break}t=t8;break}if(t.mask===(1<<e.length)-1){t=t8;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].*$/,"")),p8.call(t.map,e)){t=t.map[e];break}}t=n8;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=t8}else t=n8;break}case"Type":case"Property":{const e="Type"===t.type?"types":"properties",r=p8.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===r5||"length"===t.name&&"0"===v.value)){null===h&&(h=i(t,f)),t=n8;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].*$/,"")),m8(n,e)){s(),t=t8;break}}t=n8;break}case"AtKeyword":case"Function":if(null!==v&&m8(v.value,t.name)){s(),t=t8;break}t=n8;break;case"Token":if(null!==v&&v.value===t.value){s(),t=t8;break}t=n8;break;case"Comma":null!==v&&v.type===y5?g8(w.token)?t=n8:(s(),t=v8(v)?n8:t8):t=g8(w.token)||v8(v)?t8:n8;break;case"String":let r="",m=y;for(;m<e.length&&r.length<t.value.length;m++)r+=e[m].value;if(m8(r,t.value)){for(;y<m;)s();t=t8}else t=n8;break;default:throw new Error("Unknown node type: "+t.type)}switch(h8+=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 f8: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 b8(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 w8(e,t){return O8(this,e,e=>"Type"===e.type&&e.name===t)}function E8(e,t){return O8(this,e,e=>"Property"===e.type&&e.name===t)}function k8(e){return O8(this,e,e=>"Keyword"===e.type)}function O8(e,t,n){const r=b8.call(e,t);return null!==r&&r.some(n)}function S8(e){return"node"in e?e.node:S8(e.match[0])}function x8(e){return"node"in e?e.node:x8(e.match[e.match.length-1])}function _8(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=S8(a),r=x8(a);e.syntax.walk(t,function(e,t,o){if(e===n){const e=new t4;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:C8}=Object.prototype;function D8(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function P8(e){return Boolean(e)&&D8(e.offset)&&D8(e.line)&&D8(e.column)}function A8(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!==C8.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(P8(n.loc.start)){if(P8(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 t4)}}}else r(n,"Unknown field `"+o+"` for "+e+" node type");i||r(n,"Bad value for `"+e+"."+o+"`")}}for(const o in t)C8.call(t,o)&&!1===C8.call(n,o)&&r(n,"Field `"+e+"."+o+"` is missed")}}function T8(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<"+(T8(o,t)||"any")+">")}}return n.join(" | ")}function j8(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const t in n){if(!1===C8.call(n,t))continue;const i=r[t]=Array.isArray(n[t])?n[t].slice():[n[t]];o[t]=T8(i,e+"."+t)}return{docs:o,check:A8(e,r)}}function F8(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:B4(e[o].syntax,{compact:t}));return r}function M8(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:B4(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&F8(i.descriptors,t,n)};return r}function N8(e,t,r){return{matched:e,iterations:r,error:t,...n}}function I8(e,t,n,r){const o=function(e,t){return"string"==typeof e?function(e){const t=[];return J5(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}(e):t.generate(e,e8)}(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)?N8(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=y8(o,e.cssWideKeywordsSyntax,e)),r&&i.match||(i=y8(o,t.match,e),i.match)?N8(i.match,null,i.iterations):N8(null,new H4(i.reason,t.syntax,n,i),i.iterations))}class R8{constructor(e,n,r){if(this.cssWideKeywords=Z4,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(C8.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]=j8(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,{...C6,...D6,...A6(o),"attr-unit":T6(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=d8(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=d8(e,o):("string"==typeof e?Object.defineProperty(i,"syntax",{get:()=>(Object.defineProperty(i,"syntax",{value:Z6(e)}),i.syntax)}):i.syntax=e,Object.defineProperty(i,"match",{get:()=>(Object.defineProperty(i,"match",{value:d8(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)?d8({...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 V4("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||I8(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 V4("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new V4("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return N8(null,n);const r=this.getAtrule(e);return r.prelude?I8(this,r.prelude,t||"",!1):N8(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return N8(null,r);const o=this.getAtrule(e),i=Q4(t);return I8(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?N8(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(X4(e).custom)return N8(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?N8(null,n):I8(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?I8(this,n,t,!1):N8(null,new V4("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),I8(this,e,t,!1)):N8(null,new V4("Bad syntax"))}findValueFragments(e,t,n,r){return _8(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return _8(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=X4(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=J6,o=J6;if(r=t,r===J6&&o===J6)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:F8(this.types,!t,e),properties:F8(this.properties,!t,e),atrules:M8(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}}function L8(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function B8(e,t){const n=Object.create(null);for(const r of Object.keys(e))t.includes(r)&&(n[r]=e[r]);return n}function z8(e,t,n){const r={...e};for(const[e,o]of Object.entries(t))r[e]={...r[e],...n?B8(o,n):o};return r}function W8(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?L8(i.prelude,t.prelude):i.prelude||null;for(const[e,n]of Object.entries(t.descriptors||{}))i.descriptors[e]=n?L8(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]=L8(n[r][e],t);break;case"parseContext":n[r]={...e[r],...o};break;case"scope":case"features":n[r]=z8(e[r],o);break;case"atrule":case"pseudo":n[r]=z8(e[r],o,["parse"]);break;case"node":n[r]=z8(e[r],o,["name","structure","parse","generate","walkContext"])}return n}function U8(t){const n=function(e){let t="",n="<unknown>",r=!1,o=g4,i=!1;const a=new l4,l=Object.assign(new h4,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:w4(e.atrule),pseudo:w4(e.pseudo),node:w4(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]=b4(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:g4,createSingleNodeList:g4,getFirstListNode:g4,getLastListNode:g4,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!==f5&&t!==x5)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)=>H5(t,e,n),cmpStr:(e,n,r)=>G5(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(o5),e},consumeNumber(e){const n=t.substring(this.tokenStart,Y5(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=s4[e].slice(0,-6).replace(/-/g," ").replace(/^./,e=>e.toUpperCase());let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case r5:this.tokenType===o5||this.tokenType===s5?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case a5:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case d5:this.tokenType===u5&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){this.tokenType===r5&&!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&&M5(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):a.getLocation(this.tokenStart);throw new o4(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,J5),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",list:u=!0,onComment:d,onToken:p}=s;if(c in l.context==0)throw new Error("Unknown context `"+c+"`");Object.assign(l,u?y4:v4),Array.isArray(p)?l.forEachToken((e,t,n)=>{p.push({type:e,start:t,end:n})}):"function"==typeof p&&l.forEachToken(p.bind({filename:n,source:t,tokenCount:l.tokenCount,getTokenType:e=>l.getTokenType(e),getTokenTypeName:e=>s4[l.getTokenType(e)],getTokenStart:e=>l.getTokenStart(e),getTokenEnd:e=>l.getTokenEnd(e),getTokenValue:e=>l.source.substring(l.getTokenStart(e),l.getTokenEnd(e)),substring:(e,t)=>l.source.substring(e,t),balance:l.balance.subarray(0,l.tokenCount+1),isBlockOpenerTokenType:l.isBlockOpenerTokenType,isBlockCloserTokenType:l.isBlockCloserTokenType,getBlockTokenPairIndex:e=>l.getBlockTokenPairIndex(e),getLocation:e=>a.getLocation(e,n),getRangeLocation:(e,t)=>a.getLocationRange(e,t,n)})),"function"==typeof d&&l.forEachToken((e,n,r)=>{if(e===x5){const e=l.getLocation(n,r),o=G5(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);d(o,e)}});const f=l.context[c].call(l,s);return l.eof||l.error(),f},{SyntaxError:o4,config:l.config})}(t),r=function(e){const t=function(e){const t={};for(const n in e.node)if(A4.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)A4.call(t,e)&&null!==t[e]&&(n[e]=N4(t[e],!1),r[e]=N4(t[e],!0));const a=I4(n),l=I4(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=T4,d=T4,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=j4(s.enter),d=j4(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===T4&&d===T4)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:D4,token(e,t,n){i=this.tokenBefore(i,e,t),!n&&1&i&&this.emit(" ",f5,!0),this.emit(t,e,!1),e===c5&&92===t.charCodeAt(0)&&this.emit("\n",f5,!0)},emit(e){o+=e},result:()=>o};r&&("function"==typeof r.decorator&&(a=r.decorator(a)),r.sourceMap&&(a=function(e){const t=new E4.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&&k4.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&&k4.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:P4,token:(e,t)=>a.token(e,t),tokenize:e=>J5(e,(t,n,r)=>{a.token(t,e.slice(n,r),0!==n)})};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 t4==0&&(e.children=(new t4).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof t4&&(e.children=e.children.toArray())}}),t)}}(r),l={lexer:null,createLexer:e=>new R8(e,l,l.lexer.structure),tokenize:J5,parse:n,generate:o,walk:r,find:r.find,findLast:r.findLast,findAll:r.findAll,fromPlainObject:i,toPlainObject:a,fork(e){const n=W8({},t);return U8("function"==typeof e?e(n):W8(n,e))}};return l.lexer=new R8({generic:t.generic,cssWideKeywords:t.cssWideKeywords,units:t.units,types:t.types,atrules:t.atrules,properties:t.properties,node:t.node},l),l}const V8=43,H8=45,G8=110,q8=!0,$8=!1;function Q8(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for(r!==V8&&r!==H8||(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)C5(this.charCodeAt(n))||this.error("Integer is expected",n)}function X8(e){return Q8.call(this,0,e)}function Y8(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case G8:n="N is expected";break;case H8:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function K8(){let e=0,t=0,n=this.tokenType;for(;n===f5||n===x5;)n=this.lookupType(++e);if(n!==u5){if(!this.isDelim(V8,e)&&!this.isDelim(H8,e))return null;t=this.isDelim(V8,e)?V8:H8;do{n=this.lookupType(++e)}while(n===f5||n===x5);n!==u5&&(this.skip(e),X8.call(this,q8))}return e>0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==V8&&n!==H8&&this.error("Number sign is expected")),X8.call(this,0!==t),t===H8?"-"+this.consume(u5):this.consume(u5)}const Z8="AnPlusB",J8={a:[String,null],b:[String,null]};function e7(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===u5)X8.call(this,$8),n=this.consume(u5);else if(this.tokenType===r5&&this.cmpChar(this.tokenStart,H8))switch(t="-1",Y8.call(this,1,G8),this.tokenEnd-this.tokenStart){case 2:this.next(),n=K8.call(this);break;case 3:Y8.call(this,2,H8),this.next(),this.skipSC(),X8.call(this,q8),n="-"+this.consume(u5);break;default:Y8.call(this,2,H8),Q8.call(this,3,q8),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===r5||this.isDelim(V8)&&this.lookupType(1)===r5){let r=0;switch(t="1",this.isDelim(V8)&&(r=1,this.next()),Y8.call(this,0,G8),this.tokenEnd-this.tokenStart){case 1:this.next(),n=K8.call(this);break;case 2:Y8.call(this,1,H8),this.next(),this.skipSC(),X8.call(this,q8),n="-"+this.consume(u5);break;default:Y8.call(this,1,H8),Q8.call(this,2,q8),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===p5){const r=this.charCodeAt(this.tokenStart),o=r===V8||r===H8;let i=this.tokenStart+o;for(;i<this.tokenEnd&&C5(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Y8.call(this,i-this.tokenStart,G8),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=K8.call(this)):(Y8.call(this,i-this.tokenStart+1,H8),i+2===this.tokenEnd?(this.next(),this.skipSC(),X8.call(this,q8),n="-"+this.consume(u5)):(Q8.call(this,i-this.tokenStart+2,q8),this.next(),n=this.substrToCursor(i+1)))}else this.error();return null!==t&&t.charCodeAt(0)===V8&&(t=t.substr(1)),null!==n&&n.charCodeAt(0)===V8&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function t7(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 n7(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function r7(){for(let e,t=1;e=this.lookupType(t);t++){if(e===S5)return!0;if(e===O5||e===i5)return!1}return!1}const o7="Atrule",i7="atrule",a7={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function l7(e=!1){const t=this.tokenStart;let n,r,o=null,i=null;switch(this.eat(i5),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),!1===this.eof&&this.tokenType!==O5&&this.tokenType!==v5&&(o=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),n7):n7.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case v5:this.next();break;case O5:i=hasOwnProperty.call(this.atrule,r)&&"function"==typeof this.atrule[r].block?this.atrule[r].block.call(this,e):this.Block(r7.call(this))}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:o,block:i}}function s7(e){this.token(i5,"@"+e.name),null!==e.prelude&&this.node(e.prelude),e.block?this.node(e.block):this.token(v5,";")}const c7="AtrulePrelude",u7="atrulePrelude",d7={children:[[]]};function p7(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!==O5&&this.tokenType!==v5&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function f7(e){this.children(e)}const h7=36,m7=42,g7=61,v7=94,y7=124,b7=126;function w7(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(m7)?(t=!0,this.next()):this.isDelim(y7)||this.eat(r5),this.isDelim(y7)?this.charCodeAt(this.tokenStart+1)!==g7?(this.next(),this.eat(r5)):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 E7(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==g7&&t!==b7&&t!==v7&&t!==h7&&t!==m7&&t!==y7&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==g7&&(this.isDelim(g7)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}const k7="AttributeSelector",O7={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function S7(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(b5),this.skipSC(),t=w7.call(this),this.skipSC(),this.tokenType!==w5&&(this.tokenType!==r5&&(n=E7.call(this),this.skipSC(),r=this.tokenType===l5?this.String():this.Identifier(),this.skipSC()),this.tokenType===r5&&(o=this.consume(r5),this.skipSC())),this.eat(w5),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function x7(e){this.token(c5,"["),this.node(e.name),null!==e.matcher&&(this.tokenize(e.matcher),this.node(e.value)),null!==e.flags&&this.token(r5,e.flags),this.token(c5,"]")}const _7=38;function C7(){return this.Raw(null,!0)}function D7(){return this.parseWithFallback(this.Rule,C7)}function P7(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function A7(){if(this.tokenType===v5)return P7.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,P7);return this.tokenType===v5&&this.next(),e}const T7="Block",j7="block",F7={children:[["Atrule","Rule","Declaration"]]};function M7(e){const t=e?A7:D7,n=this.tokenStart;let r=this.createList();this.eat(O5);e:for(;!this.eof;)switch(this.tokenType){case S5:break e;case f5:case x5:this.next();break;case i5:r.push(this.parseWithFallback(this.Atrule.bind(this,e),C7));break;default:e&&this.isDelim(_7)?r.push(D7.call(this)):r.push(t.call(this))}return this.eof||this.eat(S5),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function N7(e){this.token(O5,"{"),this.children(e,e=>{"Declaration"===e.type&&this.token(v5,";")}),this.token(S5,"}")}const I7="Brackets",R7={children:[[]]};function L7(e,t){const n=this.tokenStart;let r=null;return this.eat(b5),r=e.call(this,t),this.eof||this.eat(w5),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function B7(e){this.token(c5,"["),this.children(e),this.token(c5,"]")}const z7="CDC",W7=[];function U7(){const e=this.tokenStart;return this.eat(m5),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function V7(){this.token(m5,"--\x3e")}const H7="CDO",G7=[];function q7(){const e=this.tokenStart;return this.eat(h5),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function $7(){this.token(h5,"\x3c!--")}const Q7=46,X7="ClassSelector",Y7={name:String};function K7(){return this.eatDelim(Q7),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(r5)}}function Z7(e){this.token(c5,"."),this.token(r5,e.name)}const J7=43,e9=47,t9=62,n9=126,r9="Combinator",o9={name:String};function i9(){const e=this.tokenStart;let t;switch(this.tokenType){case f5:t=" ";break;case c5:switch(this.charCodeAt(this.tokenStart)){case t9:case J7:case n9:this.next();break;case e9:this.next(),this.eatIdent("deep"),this.eatDelim(e9);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function a9(e){this.tokenize(e.name)}const l9=42,s9=47,c9="Comment",u9={value:String};function d9(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(x5),t-e+2>=2&&this.charCodeAt(t-2)===l9&&this.charCodeAt(t-1)===s9&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function p9(e){this.token(x5,"/*"+e.value+"*/")}const f9=new Set([g5,k5,n5]),h9="Condition",m9={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function g9(e){return this.lookupTypeNonSC(1)===r5&&f9.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const v9={media:g9,container:g9,supports(){return this.SupportsDeclaration()}};function y9(e="media"){const t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case x5:case f5:this.next();continue;case r5:t.push(this.Identifier());break;case E5:{let n=this.parseWithFallback(()=>v9[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(E5);const t=this.Condition(e);return this.eat(k5),t},()=>this.GeneralEnclosed(e))),t.push(n);break}case o5:{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 b9(e){e.children.forEach(e=>{"Condition"===e.type?(this.token(E5,"("),this.node(e),this.token(k5,")")):this.node(e)})}const w9=33,E9=35,k9=36,O9=38,S9=42,x9=43,_9=47;function C9(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function D9(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function P9(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==v5&&!1===this.isDelim(w9)&&!1===this.isBalanceEdge(e)&&this.error(),t}const A9="Declaration",T9="declaration",j9={important:[Boolean,String],property:String,value:["Value","Raw"]};function F9(){const e=this.tokenStart,t=this.tokenIndex,n=N9.call(this),r=Y4(n),o=r?this.parseCustomProperty:this.parseValue,i=r?D9:C9;let a,l=!1;this.skipSC(),this.eat(g5);const s=this.tokenIndex;if(r||this.skipSC(),a=o?this.parseWithFallback(P9,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)===f5){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(w9)&&(l=I9.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==v5&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:l,property:n,value:a}}function M9(e){this.token(r5,e.property),this.token(g5,":"),this.node(e.value),e.important&&(this.token(c5,"!"),this.token(r5,!0===e.important?"important":e.important))}function N9(){const e=this.tokenStart;if(this.tokenType===c5)switch(this.charCodeAt(this.tokenStart)){case S9:case k9:case x9:case E9:case O9:this.next();break;case _9:this.next(),this.isDelim(_9)&&this.next()}return this.tokenType===a5?this.eat(a5):this.eat(r5),this.substrToCursor(e)}function I9(){this.eat(c5),this.skipSC();const e=this.consume(r5);return"important"===e||e}const R9=38;function L9(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const B9="DeclarationList",z9={children:[["Declaration","Atrule","Rule"]]};function W9(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case f5:case x5:case v5:this.next();break;case i5:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),L9));break;default:this.isDelim(R9)?e.push(this.parseWithFallback(this.Rule,L9)):e.push(this.parseWithFallback(this.Declaration,L9))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function U9(e){this.children(e,e=>{"Declaration"===e.type&&this.token(v5,";")})}const V9="Dimension",H9={value:String,unit:String};function G9(){const e=this.tokenStart,t=this.consumeNumber(p5);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function q9(e){this.token(p5,e.value+e.unit)}const $9=47,Q9="Feature",X9={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Y9(e){const t=this.tokenStart;let n,r=null;if(this.eat(E5),this.skipSC(),n=this.consume(r5),this.skipSC(),this.tokenType!==k5){switch(this.eat(g5),this.skipSC(),this.tokenType){case u5:r=this.lookupNonWSType(1)===c5?this.Ratio():this.Number();break;case p5:r=this.Dimension();break;case r5:r=this.Identifier();break;case o5:r=this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim($9)&&this.error(),e},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(k5),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function K9(e){this.token(E5,"("),this.token(r5,e.name),null!==e.value&&(this.token(g5,":"),this.node(e.value)),this.token(k5,")")}const Z9="FeatureFunction",J9={kind:String,feature:String,value:["Declaration","Selector"]};function eee(e,t){const n=(this.features[e]||{})[t];return"function"!=typeof n&&this.error(`Unknown feature ${t}()`),n}function tee(e="unknown"){const t=this.tokenStart,n=this.consumeFunctionName(),r=eee.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(k5),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:o}}function nee(e){this.token(o5,e.feature+"("),this.node(e.value),this.token(k5,")")}const ree=47,oee=60,iee=61,aee=62,lee="FeatureRange",see={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 cee(){switch(this.skipSC(),this.tokenType){case u5:return this.isDelim(ree,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case p5:return this.Dimension();case r5:return this.Identifier();case o5:return this.parseWithFallback(()=>{const e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(ree)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function uee(e){if(this.skipSC(),this.isDelim(oee)||this.isDelim(aee)){const e=this.source[this.tokenStart];return this.next(),this.isDelim(iee)?(this.next(),e+"="):e}if(this.isDelim(iee))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function dee(e="unknown"){const t=this.tokenStart;this.skipSC(),this.eat(E5);const n=cee.call(this),r=uee.call(this,"Identifier"===n.type),o=cee.call(this);let i=null,a=null;return this.lookupNonWSType(0)!==k5&&(i=uee.call(this),a=cee.call(this)),this.skipSC(),this.eat(k5),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:o,rightComparison:i,right:a}}function pee(e){this.token(E5,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(k5,")")}const fee="Function",hee="function",mee={name:String,children:[[]]};function gee(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(k5),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function vee(e){this.token(o5,e.name+"("),this.children(e),this.token(k5,")")}const yee="GeneralEnclosed",bee={kind:String,function:[String,null],children:[[]]};function wee(e){const t=this.tokenStart;let n=null;this.tokenType===o5?n=this.consumeFunctionName():this.eat(E5);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(k5),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function Eee(e){e.function?this.token(o5,e.function+"("):this.token(E5,"("),this.children(e),this.token(k5,")")}const kee="XXX",Oee="Hash",See={value:String};function xee(){const e=this.tokenStart;return this.eat(a5),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function _ee(e){this.token(a5,"#"+e.value)}const Cee="Identifier",Dee={name:String};function Pee(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(r5)}}function Aee(e){this.token(r5,e.name)}const Tee="IdSelector",jee={name:String};function Fee(){const e=this.tokenStart;return this.eat(a5),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Mee(e){this.token(c5,"#"+e.name)}const Nee=46,Iee="Layer",Ree={name:String};function Lee(){let e=this.tokenStart,t=this.consume(r5);for(;this.isDelim(Nee);)this.eat(c5),t+="."+this.consume(r5);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Bee(e){this.tokenize(e.name)}const zee="LayerList",Wee={children:[["Layer"]]};function Uee(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===y5);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Vee(e){this.children(e,()=>this.token(y5,","))}const Hee="MediaQuery",Gee={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function qee(){const e=this.tokenStart;let t=null,n=null,r=null;if(this.skipSC(),this.tokenType===r5&&this.lookupTypeNonSC(1)!==E5){const e=this.consume(r5),o=e.toLowerCase();switch("not"===o||"only"===o?(this.skipSC(),t=o,n=this.consume(r5)):n=e,this.lookupTypeNonSC(0)){case r5:this.skipSC(),this.eatIdent("and"),r=this.Condition("media");break;case O5:case v5:case y5:case n5:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case r5:case E5:case o5:r=this.Condition("media");break;case O5:case v5:case n5: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 $ee(e){e.mediaType?(e.modifier&&this.token(r5,e.modifier),this.token(r5,e.mediaType),e.condition&&(this.token(r5,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}const Qee="MediaQueryList",Xee={children:[["MediaQuery"]]};function Yee(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===y5);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Kee(e){this.children(e,()=>this.token(y5,","))}const Zee=38,Jee="NestingSelector",ete={};function tte(){const e=this.tokenStart;return this.eatDelim(Zee),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function nte(){this.token(c5,"&")}const rte="Nth",ote={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function ite(){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 ate(e){this.node(e.nth),null!==e.selector&&(this.token(r5,"of"),this.node(e.selector))}const lte="Number",ste={value:String};function cte(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(u5)}}function ute(e){this.token(u5,e.value)}const dte="Operator",pte={value:String};function fte(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function hte(e){this.tokenize(e.value)}const mte="Parentheses",gte={children:[[]]};function vte(e,t){const n=this.tokenStart;let r=null;return this.eat(E5),r=e.call(this,t),this.eof||this.eat(k5),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function yte(e){this.token(E5,"("),this.children(e),this.token(k5,")")}const bte="Percentage",wte={value:String};function Ete(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(d5)}}function kte(e){this.token(d5,e.value+"%")}const Ote="PseudoClassSelector",Ste="function",xte={name:String,children:[["Raw"],null]};function _te(){const e=this.tokenStart;let t,n,r=null;return this.eat(g5),this.tokenType===o5?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==k5?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(k5)):t=this.consume(r5),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function Cte(e){this.token(g5,":"),null===e.children?this.token(r5,e.name):(this.token(o5,e.name+"("),this.children(e),this.token(k5,")"))}const Dte="PseudoElementSelector",Pte="function",Ate={name:String,children:[["Raw"],null]};function Tte(){const e=this.tokenStart;let t,n,r=null;return this.eat(g5),this.eat(g5),this.tokenType===o5?(t=this.consumeFunctionName(),n=t.toLowerCase(),this.lookupNonWSType(0)==k5?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(k5)):t=this.consume(r5),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}function jte(e){this.token(g5,":"),this.token(g5,":"),null===e.children?this.token(r5,e.name):(this.token(o5,e.name+"("),this.children(e),this.token(k5,")"))}const Fte=47;function Mte(){switch(this.skipSC(),this.tokenType){case u5:return this.Number();case o5:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}const Nte="Ratio",Ite={left:["Number","Function"],right:["Number","Function",null]};function Rte(){const e=this.tokenStart,t=Mte.call(this);let n=null;return this.skipSC(),this.isDelim(Fte)&&(this.eatDelim(Fte),n=Mte.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Lte(e){this.node(e.left),this.token(c5,"/"),e.right?this.node(e.right):this.node(u5,1)}function Bte(){return this.tokenIndex>0&&this.lookupType(-1)===f5?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const zte="Raw",Wte={value:String};function Ute(e,t){const n=this.getTokenStart(this.tokenIndex);let r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?Bte.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function Vte(e){this.tokenize(e.value)}function Hte(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Gte(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==O5&&this.error(),e}const qte="Rule",$te="rule",Qte={prelude:["SelectorList","Raw"],block:["Block"]};function Xte(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(Gte,Hte):Hte.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function Yte(e){this.node(e.prelude),this.node(e.block)}const Kte="Scope",Zte={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Jte(){let e=null,t=null;this.skipSC();const n=this.tokenStart;return this.tokenType===E5&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(k5)),this.lookupNonWSType(0)===r5&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(E5),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(k5)),{type:"Scope",loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ene(e){e.root&&(this.token(E5,"("),this.node(e.root),this.token(k5,")")),e.limit&&(this.token(r5,"to"),this.token(E5,"("),this.node(e.limit),this.token(k5,")"))}const tne="Selector",nne={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function rne(){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 one(e){this.children(e)}const ine="SelectorList",ane="selector",lne={children:[["Selector","Raw"]]};function sne(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===y5);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function cne(e){this.children(e,()=>this.token(y5,","))}const une=92,dne=34,pne=39;function fne(e){const t=e.length,n=e.charCodeAt(0),r=n===dne||n===pne?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===une){if(n===o){n!==t-1&&(i=e.substr(n+1));break}if(r=e.charCodeAt(++n),N5(une,r)){const t=n-1,r=Q5(e,t);n=r-1,i+=Z5(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else i+=e[n]}return i}const hne="String",mne={value:String};function gne(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:fne(this.consume(l5))}}function vne(e){this.token(l5,function(e){const t=dne;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===une?(n+="\\"+e.charAt(o),r=!1):(r&&(D5(i)||M5(i))&&(n+=" "),n+=e.charAt(o),r=!1):n+="�"}return'"'+n+'"'}(e.value))}const yne=33;function bne(){return this.Raw(null,!1)}const wne="StyleSheet",Ene="stylesheet",kne={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function One(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case f5:this.next();continue;case x5:if(this.charCodeAt(this.tokenStart+2)!==yne){this.next();continue}n=this.Comment();break;case h5:n=this.CDO();break;case m5:n=this.CDC();break;case i5:n=this.parseWithFallback(this.Atrule,bne);break;default:n=this.parseWithFallback(this.Rule,bne)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function Sne(e){this.children(e)}const xne="SupportsDeclaration",_ne={declaration:"Declaration"};function Cne(){const e=this.tokenStart;this.eat(E5),this.skipSC();const t=this.Declaration();return this.eof||this.eat(k5),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function Dne(e){this.token(E5,"("),this.node(e.declaration),this.token(k5,")")}const Pne=42,Ane=124;function Tne(){this.tokenType!==r5&&!1===this.isDelim(Pne)&&this.error("Identifier or asterisk is expected"),this.next()}const jne="TypeSelector",Fne={name:String};function Mne(){const e=this.tokenStart;return this.isDelim(Ane)?(this.next(),Tne.call(this)):(Tne.call(this),this.isDelim(Ane)&&(this.next(),Tne.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Nne(e){this.tokenize(e.name)}const Ine=43,Rne=45,Lne=63;function Bne(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===Rne&&t&&0!==n)return Bne.call(this,e+n+1,!1),-1;D5(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 zne(e){let t=0;for(;this.isDelim(Lne);)++t>e&&this.error("Too many question marks"),this.next()}function Wne(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Ine?"Plus sign":"Hyphen minus")+" is expected")}function Une(){let e=0;switch(this.tokenType){case u5:if(e=Bne.call(this,1,!0),this.isDelim(Lne)){zne.call(this,6-e);break}if(this.tokenType===p5||this.tokenType===u5){Wne.call(this,Rne),Bne.call(this,1,!1);break}break;case p5:e=Bne.call(this,1,!0),e>0&&zne.call(this,6-e);break;default:if(this.eatDelim(Ine),this.tokenType===r5){e=Bne.call(this,0,!0),e>0&&zne.call(this,6-e);break}if(this.isDelim(Lne)){this.next(),zne.call(this,5);break}this.error("Hex digit or question mark is expected")}}const Vne="UnicodeRange",Hne={value:String};function Gne(){const e=this.tokenStart;return this.eatIdent("u"),Une.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function qne(e){this.tokenize(e.value)}const $ne=32,Qne=92,Xne=34,Yne=39,Kne=40,Zne=41,Jne="Url",ere={value:String};function tre(){const e=this.tokenStart;let t;switch(this.tokenType){case s5:t=function(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===Zne?t-2:t-1,o="";for(;n<r&&M5(e.charCodeAt(n));)n++;for(;n<r&&M5(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let n=e.charCodeAt(i);if(n===Qne){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(n=e.charCodeAt(++i),N5(Qne,n)){const t=i-1,n=Q5(e,t);i=n-1,o+=Z5(e.substring(t+1,n))}else 13===n&&10===e.charCodeAt(i+1)&&i++}else o+=e[i]}return o}(this.consume(s5));break;case o5:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(o5),this.skipSC(),t=fne(this.consume(l5)),this.skipSC(),this.eof||this.eat(k5);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function nre(e){this.token(s5,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===$ne||o===Qne||o===Xne||o===Yne||o===Kne||o===Zne?(t+="\\"+e.charAt(r),n=!1):(n&&D5(o)&&(t+=" "),t+=e.charAt(r),n=!1):t+="�"}return"url("+t+")"}(e.value))}const rre="Value",ore={children:[[]]};function ire(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function are(e){this.children(e)}const lre=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),sre="WhiteSpace",cre={value:String};function ure(){return this.eat(f5),lre}function dre(e){this.token(f5,e.value)}const pre={generic:!0,cssWideKeywords:Z4,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>","an+b":"odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","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>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","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()>","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-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 [0,∞]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [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()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","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>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","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>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","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()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"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","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|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( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","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( <radial-size>? [at <position>]? )","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>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,∞]> )","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-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","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>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hsla()":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|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>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","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-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|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> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"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>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","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]","offset-path":"<ray()>|<url>|<basic-shape>","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]]? )","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","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":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,∞]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",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>]]","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}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","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]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|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( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rgba()":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","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>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","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":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","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-composition":"replace|add|accumulate","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}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","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]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","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> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","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>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-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>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","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-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-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]","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,∞]>","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-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}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-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-content-zooming":"none|zoom","-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-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-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-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-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>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-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","-webkit-user-select":"auto|none|text|all","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>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",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":"[auto|<time [0s,∞]>]#","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-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-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":"<visual-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>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-block-start'>","border-block-color":"<'border-top-color'>{1,2}","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-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,∞]>{1,2}","border-bottom-right-radius":"<length-percentage [0,∞]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,∞]>|<number [0,∞]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,∞]>|<percentage [0,∞]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,∞]>|<number [0,∞]>|auto]{1,4}","border-inline":"<'border-block-start'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","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-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","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 [0,∞]>{1,4} [/ <length-percentage [0,∞]>{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>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,∞]>{1,2}","border-top-right-radius":"<length-percentage [0,∞]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","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",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","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-height":"auto|<length [0,∞]>","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":"auto|<length [0,∞]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","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>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","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]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",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","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-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","flood-color":"<color>","flood-opacity":"<'opacity'>",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>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math","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-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,∞]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","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 [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|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|smooth|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'>",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",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","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]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","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:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","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":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-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 [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",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:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-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|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",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:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,∞]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,∞]>","padding-right":"<length-percentage [0,∞]>","padding-top":"<length-percentage [0,∞]>",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|none|<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>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",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-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"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-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","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-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","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-inset":"<length>{1,2}|auto","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","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","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":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-range'> ['/' <'timeline-trigger-exit-range'>]?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-exit-range":"[<'timeline-trigger-exit-range-start'> <'timeline-trigger-exit-range-end'>?]#","timeline-trigger-exit-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-exit-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range":"[<'timeline-trigger-range-start'> <'timeline-trigger-range-end'>?]#","timeline-trigger-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","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>?]?","trigger-scope":"none|all|<dashed-ident>#","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|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-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|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 [0,∞]>||<percentage [0,∞]>","-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":"[<visual-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",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","position-try-options":"<'position-try-fallbacks'>",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",speak:"auto|never|always","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 [0,∞]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,∞]>&&<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>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"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-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","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},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,∞]>","font-family":"<family-name>#","override-colors":"[<integer [0,∞]> <color>]#"}},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 [0,∞]>{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:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}},node:J};function fre(e){switch(this.tokenType){case a5:return this.Hash();case y5:return this.Operator();case E5:return this.Parentheses(this.readSequence,e.recognizer);case b5:return this.Brackets(this.readSequence,e.recognizer);case l5:return this.String();case p5:return this.Dimension();case d5:return this.Percentage();case u5:return this.Number();case o5:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case s5:return this.Url();case r5:return this.cmpChar(this.tokenStart,117)&&this.cmpChar(this.tokenStart+1,43)?this.UnicodeRange():this.Identifier();case c5:{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 hre={getNode:fre},mre={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 b5:return this.AttributeSelector();case a5:return this.IdSelector();case g5:return this.lookupType(1)===g5?this.PseudoElementSelector():this.PseudoClassSelector();case r5:return this.TypeSelector();case u5:case d5:return this.Percentage();case p5:46===this.charCodeAt(this.tokenStart)&&this.error("Identifier is expected",this.tokenStart+1);break;case c5: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 gre(e){return null!==e&&"Operator"===e.type&&("-"===e.value[e.value.length-1]||"+"===e.value[e.value.length-1])}const vre={getNode:fre,onWhiteSpace(e,t){gre(e)&&(e.value=" "+e.value),gre(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===y5){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)===f5){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}e.push(n)}return e}},yre=new Set(["none","and","not","or"]),bre={parse:{prelude(){const e=this.createList();if(this.tokenType===r5){const t=this.substring(this.tokenStart,this.tokenEnd);yre.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}},wre={parse:{prelude:null,block(){return this.Block(!0)}}};function Ere(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==k5&&this.error()}},t||(()=>this.Raw(null,!0)))}const kre={layer(){this.skipSC();const e=this.createList(),t=Ere.call(this,this.Layer);return"Raw"===t.type&&""===t.value||e.push(t),e},supports(){this.skipSC();const e=this.createList(),t=Ere.call(this,this.Declaration,()=>Ere.call(this,()=>this.Condition("supports")));return"Raw"===t.type&&""===t.value||e.push(t),e}},Ore={container:bre,"font-face":wre,import:{parse:{prelude(){const e=this.createList();switch(this.tokenType){case l5:e.push(this.String());break;case s5:case o5:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===r5&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===o5&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,kre)),this.skipSC(),this.tokenType===o5&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,kre)),this.lookupNonWSType(0)!==r5&&this.lookupNonWSType(0)!==E5||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)}}}},Sre={parse(){return this.createSingleNodeList(this.SelectorList())}},xre={parse(){return this.createSingleNodeList(this.Selector())}},_re={parse(){return this.createSingleNodeList(this.Identifier())}},Cre={parse:function(){const e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case r5:e.push(this.Identifier());break;case l5:e.push(this.String());break;case y5:e.push(this.Operator());break;case k5:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}},Dre={parse(){return this.createSingleNodeList(this.Nth())}},Pre={dir:_re,has:Sre,lang:Cre,matches:Sre,is:Sre,"-moz-any":Sre,"-webkit-any":Sre,where:Sre,not:Sre,"nth-child":Dre,"nth-last-child":Dre,"nth-last-of-type":Dre,"nth-of-type":Dre,slotted:xre,host:xre,"host-context":xre},Are={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:Ore,pseudo:Pre,node:te},Tre=(e=>U8(W8({},e)))({...pre,...Are,node:J}),{tokenize:jre,parse:Fre,generate:Mre,lexer:Nre,createLexer:Ire,walk:Rre,find:Lre,findLast:Bre,findAll:zre,toPlainObject:Wre,fromPlainObject:Ure,fork:Vre}=Tre;function Hre(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 Gre(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hre(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,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 Gre(Gre({},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(t5,{value:t,height:"300px",theme:"light",onChange:r,extensions:[new qK(yJ,yJ.data.of({autocomplete:vJ})),n0(),IJ(function(e){var t=[],n=e.state.doc.toString();try{Fre(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 $re=["id","onChange","onBlur","name","placeholder","type","withP","label","icon","typeChange","error"];function Qre(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?Qre(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qre(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Yre=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,$re),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=Xre(Xre({},k),{},{placeholder:c})),null!=a&&(k=Xre(Xre({},k),{},{onBlur:a})),null!=o&&(k=Xre(Xre({},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 Kre=he().forwardRef(Yre);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 Jre(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 eoe=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),Jre(Jre({},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(Kre,{type:"text",label:(0,At.__)("Site Title","templately"),value:t,onChange:function(e){return n(e.target.value)}}),React.createElement(Kre,{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(Gj.MediaUpload,{onSelect:function(e){var t,n;a(Jre(Jre({},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(JN,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)")))}})))}),toe=function(){var e=ce((0,pe.useState)(!1),2),t=e[0],n=e[1],r=function(){xl.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(zN,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(kl,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(fl,{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});ha(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?xl.close({success:!1,error:r}):(xl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),he().createElement(fl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))};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 roe(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 ooe=gn(function(e,t){var n,r,o=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return roe(roe({},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(),_l({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)}}Cl(n,e)},html:he().createElement(toe,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"))))}),ioe=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 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 loe(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}var soe=["Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"],coe=function(e,t){if(e&&"Default"!==e&&!soe.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)}}},uoe=["options","children","maxHeight","getValue","loadedFonts"];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}var foe=he().createContext({}),hoe=function(e){var t=e.children,n=e.index,r=(e.style,e.isScrolling),o=he().useContext(foe),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)||(coe(u.value,window.templately.locale),l.current=[].concat(Il(l.current),[u.value]))},[]),(0,pe.useEffect)(function(){i(n,c.current.getBoundingClientRect().height)},[a]),he().createElement("div",{ref:c},t)};function moe(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 goe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?moe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):moe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const voe=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 loe(loe({},{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(YN.TextControl,{min:h,max:m,step:g,value:d,onChange:y,type:"number",label:"Text Control",hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),he().createElement(YN.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(nI.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:goe(goe({},t.style),{},{height:"12px",display:"flex",width:"100%"})},he().createElement("div",{ref:t.ref,style:{height:"2px",width:"100%",borderRadius:"2px",background:(0,nI.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:goe(goe({},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 yoe(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 boe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const woe=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(){coe(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(HN,null))),he().createElement("button",{className:"templately-setting-typography-picker-close-button",onClick:function(){return t(!1)}},he().createElement(ZN,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(kg,{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,uoe),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=poe(poe({},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(foe.Provider,{value:{setSize:d,windowWidth:f,loadedFonts:a,options:n,listRef:c}},he().createElement("div",null,he().createElement(jI,{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:poe(poe({},o),{},{fontFamily:n[t].value})},he().createElement(hoe,{index:t,style:o,isScrolling:i},r[t]))})))}(boe(boe({},t),{},{loadedFonts:e.loadedFonts}))}},className:"templately-setting-typography-picker-select",classNamePrefix:"templately-setting-typography-picker-select"}))),he().createElement(voe,{label:"Size",screen:a,setScreen:l,typography:n,setTypography:r,field:"selectedSize"}),he().createElement(voe,{label:"Line",title:"Line Height",screen:a,setScreen:l,field:"selectedLineHeight",typography:n,setTypography:r}),he().createElement(voe,{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(kg,{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(kg,{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(kg,{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 Eoe=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(){coe(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(woe,{normalizedTypography:n,setShowPicker:d,typography:r,setTypography:o,fontList:i,reset:a,screen:l,setScreen:s,loadedFonts:e.loadedFonts,closeRef:p})))};function koe(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 Ooe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?koe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):koe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Soe=gn(function(e,t){var n,r,o,i,a,l,s,c=null!==(n=e.settingsPage.platform)&&void 0!==n?n:"elementor";return Ooe(Ooe({},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=soe.map(function(e){return{value:e,label:e}});return[{value:"",label:(0,At.__)("Default","templately")},{label:(0,At.__)("System","templately"),isDisabled:!0}].concat(Il(e),[{label:(0,At.__)("Google","templately"),isDisabled:!0}],Il(h))},[h]);return(0,pe.useEffect)(function(){s(0),(0,ka.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);ha(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(HN,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(ioe,{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(Eoe,{key:t,setTypographyPickerOpen:d,reset:function(){return function(e){i(Ooe(Ooe({},o),{},Pt({},e,v[e])))}(t)},normalizedTypography:v,typography:o[t],setTypography:function(e,n){return function(e,t,n){var r=Ba(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 xoe(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 _oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Coe=gn(function(e,t){var n,r,o,i,a;return _oe(_oe({},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(ev(t))},resetFilter:function(){return e(nv())},isVerifiedProfile:function(t){return e(Li(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(ji({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(Yy(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(Yy(e.route,r))}else t.get("path")&&"/"!==(null==t?void 0:t.get("path"))||("gutenberg"===(null==e?void 0:e.platform)&&n(Yy("gutenberg/packs",{platform:"gutenberg",isGutenbergEditor:!0})),"elementor"!==(null==e?void 0:e.platform)&&void 0!==(null==e?void 0:e.platform)||n(Yy("elementor/packs")));return function(){if(void 0!==e.route){var t,r=Xy(),o=null===(t=r.path)||void 0===t?void 0:t.startsWith("clouds/save-template");n(Yy(o?"":r.path,{closing:!0}))}}}n(Yy("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=Yy("elementor/packs");else if("templately_settings"===a){var s,c=Ga("/settings/:platform/:tab",t.get("path"));l=Yy(["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(SW,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/sign-in",index:!0,exact:!0,element:he().createElement(LD,null)}]},{path:"/settings",exact:!0,element:he().createElement(RW,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(eoe,null)},{path:":platform/miscellaneous",element:he().createElement(ooe,null)},{path:":platform/custom_css",element:he().createElement(qre,null)},{path:":platform/typography",element:he().createElement(Soe,null)},{path:":platform/colors",element:he().createElement(WW,null)}])},{element:he().createElement(SW,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"/:platform/:type",exact:!0,element:he().createElement(AW,re({},Ga("/:platform/:type",t.get("path")),{query:t.get("q")}))},{path:"/:platform/:type/:slug",exact:!0,element:he().createElement($z,{params:Ga("/:platform/:type/:slug",t.get("path"))})},{path:"/:platform/templates",exact:!0,element:he().createElement(_W,null)}]},{element:he().createElement(SW,{isLoggedIn:e.isLoggedIn,user:e.user,isVerifiedProfile:e.isVerifiedProfile}),children:[{path:"clouds",exact:!0,element:he().createElement(xW,null),children:[{path:"workspace",element:he().createElement(hD,null)},{path:"workspace/:slug",element:he().createElement(KC,Ga("/clouds/workspace/:slug",t.get("path")))},{path:"shared-workspace",element:he().createElement(hD,{shared:!0})},{path:"shared-workspace/:slug",element:he().createElement(KC,re({shared:!0},Ga("/clouds/shared-workspace/:slug",t.get("path"))))},{path:"save-template",element:he().createElement(fD,e)},{index:!0,element:he().createElement(pD,{title:"My Clouds",q:t.get("q")})}]},{element:he().createElement(xW,null),children:[{exact:!0,path:"downloads",element:he().createElement(eD,null)},{exact:!0,path:"favourites",element:he().createElement(rD,null)},{exact:!0,path:"purchased-items",element:he().createElement(sD,null)}]}]},{path:"*",element:he().createElement(gt,{to:Yy("elementor/packs")})}])});function Doe(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 Poe=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 Doe(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)?Doe(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(kg,re({isSearchable:!1,classNamePrefix:"templately-condition"},e,{className:"".concat(e.className," templately-condition"),value:r}))};var Aoe=["update"];const Toe=function(e){var t=e.update,n=Wn(e,Aoe),r=[{value:"include",label:(0,At.__)("Include","templately")},{value:"exclude",label:(0,At.__)("Exclude","templately")}];return he().createElement(Poe,{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 joe=["update"];const Foe=function(e){var t=e.update,n=Wn(e,joe);return he().createElement(Poe,{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 Moe=["update"];const Noe=function(e){var t=e.update,n=Wn(e,Moe);return"general"!==n.name&&n.subOptions.length?he().createElement(Poe,{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 Ioe=["update"];const Roe=function(e){var t=e.update,n=Wn(e,Ioe);if(!n.sub_name||null==n||!n.subIdAutocomplete||!Object.keys(null==n?void 0:n.subIdAutocomplete).length)return"";var r=ce(dO(n.subIdAutocomplete,n.sub_id),2),o=r[0],i=r[1];return he().createElement(Poe,{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})},Loe=function(){var e,t=SO(),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(Toe,re({},e,{update:r})),he().createElement(Foe,re({},e,{update:r})),he().createElement(Noe,re({},e,{update:r})),he().createElement(Roe,re({},e,{update:r}))),he().createElement("button",{onClick:function(){return i(e.id)},className:"delete-button"},he().createElement(zN,null)))}));return he().createElement("div",{className:"templately-display-conditions"},a,he().createElement(fl,{onClick:o,label:(0,At.__)("Add New Condition","templately")}))},Boe=function(){var e=SO(),t=e.saveConditions,n=e.isSaving;return he().createElement("div",{className:"templately-display-condition-modal-footer"},he().createElement(fl,{disabled:n,onClick:t,label:n?(0,At.__)("Saving...","templately"):(0,At.__)("Save & Close","templately")}))},zoe=function(){return he().createElement("div",{className:"templately-display-condition-modal-header"},he().createElement("div",{className:"templately-logo"},he().createElement(jn,{width:"37.66px",className:"vector-logo"}),he().createElement(Fn,{className:"text-logo"})),he().createElement("button",{className:"close-button",onClick:function(){window.TemplatelyAppManager.close("templately-edit-conditions-app")}},he().createElement(zN,null)))};function Woe(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 Uoe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Woe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Woe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Voe=gn(function(e,t){var n,r,o,i;return Uoe(Uoe({},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(kl,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(OO,{template:n},he().createElement("div",{className:"templately-display-condition-modal-wrapper"},he().createElement(zoe,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(Loe,null)),he().createElement(Boe,null))))});function Hoe(){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 Goe(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]())):(Goe(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,Goe(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,Goe(d,"constructor",c),Goe(c,"constructor",s),s.displayName="GeneratorFunction",Goe(c,o,"GeneratorFunction"),Goe(d),Goe(d,o,"Generator"),Goe(d,r,function(){return this}),Goe(d,"toString",function(){return"[object Generator]"}),(Hoe=function(){return{w:i,m:p}})()}function Goe(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Goe=function(e,t,n,r){function i(t,n){Goe(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))},Goe(e,t,n,r)}function qoe(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 $oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qoe(Object(n),!0).forEach(function(t){Pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qoe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Qoe=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(Hoe().m(function e(){var t,n,r,i;return Hoe().w(function(e){for(;;)switch(e.n){case 0:return o(!0),e.n=1,ma("/templately/v1/create-template",$oe({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(YN.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($oe($oe({},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(kg,{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($oe($oe({},a),{},{type:null==e?void 0:e.value}))}})),he().createElement(YN.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($oe($oe({},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")))},Xoe=function(){return he().createElement("span",{onClick:function(){_l({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(Qoe,null)))},!0).then(function(e){})}},(0,At.__)("Add New Template","templately"))},Yoe=function(e){return he().createElement(Xoe,null)},Koe=function(){var e=ce((0,pe.useState)(!1),2),t=e[0],n=e[1],r=function(){xl.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(zN,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(kl,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(fl,{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});ha(o,{}).then(function(e){var t=e.response,r=e.error;n(!1),r?xl.close({success:!1,error:r}):(xl.close(t),null!=t&&t.success)})},label:t?(0,At.__)("Processing...","templately"):(0,At.__)("Yes, Revert","templately")}),he().createElement(fl,{disabled:t,onClick:r,label:(0,At.__)("Cancel","templately")})))},Zoe=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(),_l({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)}}Cl(t,e)},html:he().createElement(Koe,null),didDestroy:function(){}},!0).then(function(e){e.success})}},(0,At.__)("Revert Now","templately"))},Joe=function(e){var t=ce((0,pe.useState)({action:Qy.action,location:Qy.location}),2),n=t[0],r=t[1];return(0,pe.useLayoutEffect)(function(){return Qy.listen(function(e,t){r({action:t,location:e})})},[Qy]),he().createElement(he().StrictMode,null,he().createElement(By,{value:{store:Vx,history:Qy}},he().createElement(Rt,{displayName:"ReduxProvider",store:Vx,context:Tt},(null==e?void 0:e.conditions)&&he().createElement(Voe,e),(null==e?void 0:e.revert)&&he().createElement(Zoe,e),!(null!=e&&e.settings)&&!(null!=e&&e.conditions)&&!(null!=e&&e.revert)&&!e.addNewTemplate&&he().createElement(yt,{location:n.location,basename:"/",navigator:Qy,navigationType:n.action},he().createElement(Coe,e)))))};window.wp.domReady,(0,ae.addFilter)("templately_before_content_header","templately",function(e){return React.createElement(BD,e)});var eie=function(e){return React.createElement("div",{className:"templately-gutenberg"},React.createElement(Joe,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(Joe,{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(Joe,{isSettings:!0}),document.getElementById("templatelyAdminSetting"))),null!=document.getElementById("templately-theme-builder-admin-header")){var tie=document.querySelector(".post-type-templately_library a.page-title-action");tie&&(ie().render(React.createElement(Yoe,{platform:"elementor"}),tie),tie.classList.add("rendered"),tie.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(Joe,re({platform:"elementor"},e))),null===r&&"gutenberg"===n&&(t=document.getElementById(t),r=React.createElement(eie,e)),null===r&&"conditions"===n&&(t=document.getElementById(t),r=React.createElement(Joe,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 nie=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",nie),window.addEventListener("resize",nie),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:xB,ImageReplacePanelIsolated:fM},hooks:{useCustomizerData:DB,useImageReplacePanel:_M,useFullSiteImport:sO},utils:{initializeImageMappings:Uj,executeAIContentWorkflow:Rj,templatelyApiFormData:Ea,isFieldSkippable:kP,isAutomaticSkipText:OP}},window.TemplatelyCustomizerIsolated=xB,window.TemplatelyImageReplacePanelIsolated=fM),null!=document.getElementById("templately-fsi-revert-wrapper")){var rie=document.getElementById("templately-fsi-revert-wrapper"),oie=rie.getElementsByTagName("button");if(oie&&oie[0]){ie().render(React.createElement(Zoe,null),oie[0]);var iie=rie.parentNode.querySelector(".subsubsub"),aie=rie.parentNode.parentNode.querySelector("#posts-filter");rie.style.display="block",iie.style.display="none",aie.style.display="none"}}})()})();