diff --git a/package-lock.json b/package-lock.json index 67795db..5b58e02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,9 +29,9 @@ } }, "node_modules/@thelia/blocks-editor": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@thelia/blocks-editor/-/blocks-editor-1.0.9.tgz", - "integrity": "sha512-EjCWGYeXw8Lv0GHqrgUP0w1geYU6JcBgthNxx+Ov/S9JpIrvA8lOmdtRcLxZ3SzB30pSNKtW9vCwyFkdhSQ2eA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@thelia/blocks-editor/-/blocks-editor-1.2.3.tgz", + "integrity": "sha512-/N5NzlauxE18HqKz/LnmWCpzRknxaGUpd8Hzp5Wdyphr31npdiOyIBAbSfpQe7kKuIDzO2p1IDzzlbQUH/4ZmQ==", "dependencies": { "@thelia/fetcher": "*", "axios": "^0.25", @@ -67,9 +67,9 @@ } }, "node_modules/@thelia/media-library": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.0.7.tgz", - "integrity": "sha512-/h4Kb9neELgAySS9Vy8N+iBz5BTg/VmpAYEHZsDGfQ5DCkYrFFC4JkAXixDI71Rz2en6ob9fepqbmEo7dRVBTg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.0.8.tgz", + "integrity": "sha512-0w+uPI382TFc83qHpSD3Xd3ere9wogBQOsdEaonQ78LBwp55O/tkgn6pTD8WbhPSCbxpCXzRLXdhfz0Z4cqKEQ==", "dependencies": { "@thelia/blocks-editor": "*", "@thelia/fetcher": "*", @@ -4490,9 +4490,9 @@ } }, "@thelia/blocks-editor": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@thelia/blocks-editor/-/blocks-editor-1.0.9.tgz", - "integrity": "sha512-EjCWGYeXw8Lv0GHqrgUP0w1geYU6JcBgthNxx+Ov/S9JpIrvA8lOmdtRcLxZ3SzB30pSNKtW9vCwyFkdhSQ2eA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@thelia/blocks-editor/-/blocks-editor-1.2.3.tgz", + "integrity": "sha512-/N5NzlauxE18HqKz/LnmWCpzRknxaGUpd8Hzp5Wdyphr31npdiOyIBAbSfpQe7kKuIDzO2p1IDzzlbQUH/4ZmQ==", "requires": { "@thelia/fetcher": "*", "axios": "^0.25", @@ -4524,9 +4524,9 @@ } }, "@thelia/media-library": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.0.7.tgz", - "integrity": "sha512-/h4Kb9neELgAySS9Vy8N+iBz5BTg/VmpAYEHZsDGfQ5DCkYrFFC4JkAXixDI71Rz2en6ob9fepqbmEo7dRVBTg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@thelia/media-library/-/media-library-1.0.8.tgz", + "integrity": "sha512-0w+uPI382TFc83qHpSD3Xd3ere9wogBQOsdEaonQ78LBwp55O/tkgn6pTD8WbhPSCbxpCXzRLXdhfz0Z4cqKEQ==", "requires": { "@thelia/blocks-editor": "*", "@thelia/fetcher": "*", diff --git a/templates/backOffice/default/tb-plugin/vendor/index.d.ts b/templates/backOffice/default/tb-plugin/vendor/index.d.ts index 69384da..d21a19b 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.d.ts +++ b/templates/backOffice/default/tb-plugin/vendor/index.d.ts @@ -12,7 +12,6 @@ declare type ImageTag = { }; declare type LibraryImage = { id: number | null; - url: string | null; fileName: string; title: string; tags: ImageTag[]; diff --git a/templates/backOffice/default/tb-plugin/vendor/index.global.js b/templates/backOffice/default/tb-plugin/vendor/index.global.js index e0c09e5..0ffb122 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.global.js +++ b/templates/backOffice/default/tb-plugin/vendor/index.global.js @@ -1,5 +1,5 @@ -"use strict";var TheliaMediaLibraryBlock=(()=>{var wd=Object.create;var zr=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Ad=Object.getOwnPropertyNames;var Id=Object.getPrototypeOf,Rd=Object.prototype.hasOwnProperty;var Pd=(e,t,r)=>t in e?zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ld=(e,t)=>()=>(e&&(t=e(e=0)),t);var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ss=(e,t)=>{for(var r in t)zr(e,r,{get:t[r],enumerable:!0})},As=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ad(t))!Rd.call(e,o)&&o!==r&&zr(e,o,{get:()=>t[o],enumerable:!(n=Sd(t,o))||n.enumerable});return e};var $=(e,t,r)=>(r=e!=null?wd(Id(e)):{},As(t||!e||!e.__esModule?zr(r,"default",{value:e,enumerable:!0}):r,e)),Is=e=>As(zr({},"__esModule",{value:!0}),e);var Rs=(e,t,r)=>(Pd(e,typeof t!="symbol"?t+"":t,r),r);var J=A((hb,Ps)=>{Ps.exports=React});var Js=A((vb,Gn)=>{var Ls,Ns,Ds,Ms,Fs,Bs,Hs,ks,Us,jn,mi,js,qs,Gs,br,Ws,Vs,$s,Qs,zs,Ys,Xs,Ks,Zs,qn;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Gn=="object"&&typeof Gn.exports=="object"?e(r(t,r(Gn.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};Ls=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},Ns=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;l--)(c=n[l])&&(u=(s<3?c(u):s>3?c(o,i,u):c(o,i))||u);return s>3&&u&&Object.defineProperty(o,i,u),u},Fs=function(n,o){return function(i,a){o(i,a,n)}},Bs=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},Hs=function(n,o,i,a){function s(u){return u instanceof i?u:new i(function(c){c(u)})}return new(i||(i=Promise))(function(u,c){function l(m){try{f(a.next(m))}catch(g){c(g)}}function p(m){try{f(a.throw(m))}catch(g){c(g)}}function f(m){m.done?u(m.value):s(m.value).then(l,p)}f((a=a.apply(n,o||[])).next())})},ks=function(n,o){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,s,u,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(m){return p([f,m])}}function p(f){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(u=f[0]&2?s.return:f[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,f[1])).done)return u;switch(s=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return i.label++,{value:f[1],done:!1};case 5:i.label++,s=f[1],f=[0];continue;case 7:f=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){i=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,u=[],c;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)u.push(s.value)}catch(l){c={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return u},js=function(){for(var n=[],o=0;o1||l(v,b)})})}function l(v,b){try{p(a[v](b))}catch(E){g(u[0][3],E)}}function p(v){v.value instanceof br?Promise.resolve(v.value.v).then(f,m):g(u[0][2],v)}function f(v){l("next",v)}function m(v){l("throw",v)}function g(v,b){v(b),u.shift(),u.length&&l(u[0][0],u[0][1])}},Vs=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,u){o[s]=n[s]?function(c){return(i=!i)?{value:br(n[s](c)),done:s==="return"}:u?u(c):c}:u}},$s=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof jn=="function"?jn(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(u){i[u]=n[u]&&function(c){return new Promise(function(l,p){c=n[u](c),s(l,p,c.done,c.value)})}}function s(u,c,l,p){Promise.resolve(p).then(function(f){u({value:f,done:l})},c)}},Qs=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};zs=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&qn(o,n,i);return r(o,n),o},Ys=function(n){return n&&n.__esModule?n:{default:n}},Xs=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},Ks=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},Zs=function(n,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?o===n:n.has(o)},e("__extends",Ls),e("__assign",Ns),e("__rest",Ds),e("__decorate",Ms),e("__param",Fs),e("__metadata",Bs),e("__awaiter",Hs),e("__generator",ks),e("__exportStar",Us),e("__createBinding",qn),e("__values",jn),e("__read",mi),e("__spread",js),e("__spreadArrays",qs),e("__spreadArray",Gs),e("__await",br),e("__asyncGenerator",Ws),e("__asyncDelegator",Vs),e("__asyncValues",$s),e("__makeTemplateObject",Qs),e("__importStar",zs),e("__importDefault",Ys),e("__classPrivateFieldGet",Xs),e("__classPrivateFieldSet",Ks),e("__classPrivateFieldIn",Zs)})});var ru=A(ee=>{"use strict";var Ee=typeof Symbol=="function"&&Symbol.for,vi=Ee?Symbol.for("react.element"):60103,gi=Ee?Symbol.for("react.portal"):60106,Wn=Ee?Symbol.for("react.fragment"):60107,Vn=Ee?Symbol.for("react.strict_mode"):60108,$n=Ee?Symbol.for("react.profiler"):60114,Qn=Ee?Symbol.for("react.provider"):60109,zn=Ee?Symbol.for("react.context"):60110,yi=Ee?Symbol.for("react.async_mode"):60111,Yn=Ee?Symbol.for("react.concurrent_mode"):60111,Xn=Ee?Symbol.for("react.forward_ref"):60112,Kn=Ee?Symbol.for("react.suspense"):60113,Nd=Ee?Symbol.for("react.suspense_list"):60120,Zn=Ee?Symbol.for("react.memo"):60115,Jn=Ee?Symbol.for("react.lazy"):60116,Dd=Ee?Symbol.for("react.block"):60121,Md=Ee?Symbol.for("react.fundamental"):60117,Fd=Ee?Symbol.for("react.responder"):60118,Bd=Ee?Symbol.for("react.scope"):60119;function qe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case vi:switch(e=e.type,e){case yi:case Yn:case Wn:case $n:case Vn:case Kn:return e;default:switch(e=e&&e.$$typeof,e){case zn:case Xn:case Jn:case Zn:case Qn:return e;default:return t}}case gi:return t}}}function tu(e){return qe(e)===Yn}ee.AsyncMode=yi;ee.ConcurrentMode=Yn;ee.ContextConsumer=zn;ee.ContextProvider=Qn;ee.Element=vi;ee.ForwardRef=Xn;ee.Fragment=Wn;ee.Lazy=Jn;ee.Memo=Zn;ee.Portal=gi;ee.Profiler=$n;ee.StrictMode=Vn;ee.Suspense=Kn;ee.isAsyncMode=function(e){return tu(e)||qe(e)===yi};ee.isConcurrentMode=tu;ee.isContextConsumer=function(e){return qe(e)===zn};ee.isContextProvider=function(e){return qe(e)===Qn};ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===vi};ee.isForwardRef=function(e){return qe(e)===Xn};ee.isFragment=function(e){return qe(e)===Wn};ee.isLazy=function(e){return qe(e)===Jn};ee.isMemo=function(e){return qe(e)===Zn};ee.isPortal=function(e){return qe(e)===gi};ee.isProfiler=function(e){return qe(e)===$n};ee.isStrictMode=function(e){return qe(e)===Vn};ee.isSuspense=function(e){return qe(e)===Kn};ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Wn||e===Yn||e===$n||e===Vn||e===Kn||e===Nd||typeof e=="object"&&e!==null&&(e.$$typeof===Jn||e.$$typeof===Zn||e.$$typeof===Qn||e.$$typeof===zn||e.$$typeof===Xn||e.$$typeof===Md||e.$$typeof===Fd||e.$$typeof===Bd||e.$$typeof===Dd)};ee.typeOf=qe});var ou=A((Bb,nu)=>{"use strict";nu.exports=ru()});var fu=A((Hb,cu)=>{"use strict";var bi=ou(),Hd={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},kd={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ud={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},uu={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ei={};Ei[bi.ForwardRef]=Ud;Ei[bi.Memo]=uu;function iu(e){return bi.isMemo(e)?uu:Ei[e.$$typeof]||Hd}var jd=Object.defineProperty,qd=Object.getOwnPropertyNames,au=Object.getOwnPropertySymbols,Gd=Object.getOwnPropertyDescriptor,Wd=Object.getPrototypeOf,su=Object.prototype;function lu(e,t,r){if(typeof t!="string"){if(su){var n=Wd(t);n&&n!==su&&lu(e,n,r)}var o=qd(t);au&&(o=o.concat(au(t)));for(var i=iu(e),a=iu(t),s=0;s{"use strict";var Fm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";dl.exports=Fm});var yl=A((B_,gl)=>{"use strict";var Bm=ml();function hl(){}function vl(){}vl.resetWarningCache=hl;gl.exports=function(){function e(n,o,i,a,s,u){if(u!==Bm){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={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:vl,resetWarningCache:hl};return r.PropTypes=r,r}});var yo=A((U_,bl)=>{bl.exports=yl()();var H_,k_});var Cl=A(Yi=>{"use strict";Yi.__esModule=!0;Yi.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?n.toLowerCase().endsWith(s):s.endsWith("/*")?i===s.replace(/\/.*$/,""):o===s})}return!0}});var Co=A((OO,cc)=>{cc.exports=ReactDOM});var ga=A((iC,bc)=>{"use strict";bc.exports=function(t,r){return function(){for(var o=new Array(arguments.length),i=0;i{"use strict";var Lh=ga(),Bt=Object.prototype.toString;function Ea(e){return Array.isArray(e)}function ya(e){return typeof e>"u"}function Nh(e){return e!==null&&!ya(e)&&e.constructor!==null&&!ya(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Ec(e){return Bt.call(e)==="[object ArrayBuffer]"}function Dh(e){return Bt.call(e)==="[object FormData]"}function Mh(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ec(e.buffer),t}function Fh(e){return typeof e=="string"}function Bh(e){return typeof e=="number"}function _c(e){return e!==null&&typeof e=="object"}function So(e){if(Bt.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Hh(e){return Bt.call(e)==="[object Date]"}function kh(e){return Bt.call(e)==="[object File]"}function Uh(e){return Bt.call(e)==="[object Blob]"}function xc(e){return Bt.call(e)==="[object Function]"}function jh(e){return _c(e)&&xc(e.pipe)}function qh(e){return Bt.call(e)==="[object URLSearchParams]"}function Gh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Wh(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function _a(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),Ea(e))for(var r=0,n=e.length;r{"use strict";var Dr=De();function Cc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Tc.exports=function(t,r,n){if(!r)return t;var o;if(n)o=n(r);else if(Dr.isURLSearchParams(r))o=r.toString();else{var i=[];Dr.forEach(r,function(u,c){u===null||typeof u>"u"||(Dr.isArray(u)?c=c+"[]":u=[u],Dr.forEach(u,function(p){Dr.isDate(p)?p=p.toISOString():Dr.isObject(p)&&(p=JSON.stringify(p)),i.push(Cc(c)+"="+Cc(p))}))}),o=i.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Sc=A((uC,wc)=>{"use strict";var Qh=De();function Ao(){this.handlers=[]}Ao.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Ao.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Ao.prototype.forEach=function(t){Qh.forEach(this.handlers,function(n){n!==null&&t(n)})};wc.exports=Ao});var Ic=A((lC,Ac)=>{"use strict";var zh=De();Ac.exports=function(t,r){zh.forEach(t,function(o,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(t[r]=o,delete t[i])})}});var Oa=A((cC,Rc)=>{"use strict";Rc.exports=function(t,r,n,o,i){return t.config=r,n&&(t.code=n),t.request=o,t.response=i,t.isAxiosError=!0,t.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}},t}});var Ca=A((fC,Pc)=>{"use strict";var Yh=Oa();Pc.exports=function(t,r,n,o,i){var a=new Error(t);return Yh(a,r,n,o,i)}});var Nc=A((pC,Lc)=>{"use strict";var Xh=Ca();Lc.exports=function(t,r,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):r(Xh("Request failed with status code "+n.status,n.config,null,n.request,n))}});var Mc=A((dC,Dc)=>{"use strict";var Io=De();Dc.exports=Io.isStandardBrowserEnv()?function(){return{write:function(r,n,o,i,a,s){var u=[];u.push(r+"="+encodeURIComponent(n)),Io.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),Io.isString(i)&&u.push("path="+i),Io.isString(a)&&u.push("domain="+a),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var Bc=A((mC,Fc)=>{"use strict";Fc.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var kc=A((hC,Hc)=>{"use strict";Hc.exports=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t}});var jc=A((vC,Uc)=>{"use strict";var Kh=Bc(),Zh=kc();Uc.exports=function(t,r){return t&&!Kh(r)?Zh(t,r):r}});var Gc=A((gC,qc)=>{"use strict";var Ta=De(),Jh=["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"];qc.exports=function(t){var r={},n,o,i;return t&&Ta.forEach(t.split(` -`),function(s){if(i=s.indexOf(":"),n=Ta.trim(s.substr(0,i)).toLowerCase(),o=Ta.trim(s.substr(i+1)),n){if(r[n]&&Jh.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([o]):r[n]=r[n]?r[n]+", "+o:o}}),r}});var $c=A((yC,Vc)=>{"use strict";var Wc=De();Vc.exports=Wc.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function o(i){var a=i;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(a){var s=Wc.isString(a)?o(a):a;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}()});var mn=A((bC,Qc)=>{"use strict";function wa(e){this.message=e}wa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};wa.prototype.__CANCEL__=!0;Qc.exports=wa});var Aa=A((EC,zc)=>{"use strict";var Ro=De(),ev=Nc(),tv=Mc(),rv=xa(),nv=jc(),ov=Gc(),iv=$c(),Sa=Ca(),av=hn(),sv=mn();zc.exports=function(t){return new Promise(function(n,o){var i=t.data,a=t.headers,s=t.responseType,u;function c(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}Ro.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var p=t.auth.username||"",f=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(p+":"+f)}var m=nv(t.baseURL,t.url);l.open(t.method.toUpperCase(),rv(m,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function g(){if(!!l){var b="getAllResponseHeaders"in l?ov(l.getAllResponseHeaders()):null,E=!s||s==="text"||s==="json"?l.responseText:l.response,x={data:E,status:l.status,statusText:l.statusText,headers:b,config:t,request:l};ev(function(d){n(d),c()},function(d){o(d),c()},x),l=null}}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){!l||(o(Sa("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){o(Sa("Network Error",t,null,l)),l=null},l.ontimeout=function(){var E=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",x=t.transitional||av.transitional;t.timeoutErrorMessage&&(E=t.timeoutErrorMessage),o(Sa(E,t,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},Ro.isStandardBrowserEnv()){var v=(t.withCredentials||iv(m))&&t.xsrfCookieName?tv.read(t.xsrfCookieName):void 0;v&&(a[t.xsrfHeaderName]=v)}"setRequestHeader"in l&&Ro.forEach(a,function(E,x){typeof i>"u"&&x.toLowerCase()==="content-type"?delete a[x]:l.setRequestHeader(x,E)}),Ro.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),s&&s!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(u=function(b){!l||(o(!b||b&&b.type?new sv("canceled"):b),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u))),i||(i=null),l.send(i)})}});var hn=A((_C,Kc)=>{"use strict";var we=De(),Yc=Ic(),uv=Oa(),lv={"Content-Type":"application/x-www-form-urlencoded"};function Xc(e,t){!we.isUndefined(e)&&we.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function cv(){var e;return typeof XMLHttpRequest<"u"?e=Aa():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(e=Aa()),e}function fv(e,t,r){if(we.isString(e))try{return(t||JSON.parse)(e),we.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Po={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:cv(),transformRequest:[function(t,r){return Yc(r,"Accept"),Yc(r,"Content-Type"),we.isFormData(t)||we.isArrayBuffer(t)||we.isBuffer(t)||we.isStream(t)||we.isFile(t)||we.isBlob(t)?t:we.isArrayBufferView(t)?t.buffer:we.isURLSearchParams(t)?(Xc(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):we.isObject(t)||r&&r["Content-Type"]==="application/json"?(Xc(r,"application/json"),fv(t)):t}],transformResponse:[function(t){var r=this.transitional||Po.transitional,n=r&&r.silentJSONParsing,o=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||o&&we.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?uv(a,this,"E_JSON_PARSE"):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],function(t){Po.headers[t]={}});we.forEach(["post","put","patch"],function(t){Po.headers[t]=we.merge(lv)});Kc.exports=Po});var Jc=A((xC,Zc)=>{"use strict";var pv=De(),dv=hn();Zc.exports=function(t,r,n){var o=this||dv;return pv.forEach(n,function(a){t=a.call(o,t,r)}),t}});var Ia=A((OC,ef)=>{"use strict";ef.exports=function(t){return!!(t&&t.__CANCEL__)}});var nf=A((CC,rf)=>{"use strict";var tf=De(),Ra=Jc(),mv=Ia(),hv=hn(),vv=mn();function Pa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vv("canceled")}rf.exports=function(t){Pa(t),t.headers=t.headers||{},t.data=Ra.call(t,t.data,t.headers,t.transformRequest),t.headers=tf.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),tf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var r=t.adapter||hv.adapter;return r(t).then(function(o){return Pa(t),o.data=Ra.call(t,o.data,o.headers,t.transformResponse),o},function(o){return mv(o)||(Pa(t),o&&o.response&&(o.response.data=Ra.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var La=A((TC,of)=>{"use strict";var $e=De();of.exports=function(t,r){r=r||{};var n={};function o(l,p){return $e.isPlainObject(l)&&$e.isPlainObject(p)?$e.merge(l,p):$e.isPlainObject(p)?$e.merge({},p):$e.isArray(p)?p.slice():p}function i(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(t[l],r[l])}function a(l){if(!$e.isUndefined(r[l]))return o(void 0,r[l])}function s(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(void 0,r[l])}function u(l){if(l in r)return o(t[l],r[l]);if(l in t)return o(void 0,t[l])}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return $e.forEach(Object.keys(t).concat(Object.keys(r)),function(p){var f=c[p]||i,m=f(p);$e.isUndefined(m)&&f!==u||(n[p]=m)}),n}});var Na=A((wC,af)=>{af.exports={version:"0.25.0"}});var lf=A((SC,uf)=>{"use strict";var gv=Na().version,Da={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Da[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var sf={};Da.transitional=function(t,r,n){function o(i,a){return"[Axios v"+gv+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return function(i,a,s){if(t===!1)throw new Error(o(a," has been removed"+(r?" in "+r:"")));return r&&!sf[a]&&(sf[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,s):!0}};function yv(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=s===void 0||a(s,i,e);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(r!==!0)throw Error("Unknown option "+i)}}uf.exports={assertOptions:yv,validators:Da}});var hf=A((AC,mf)=>{"use strict";var pf=De(),bv=xa(),cf=Sc(),ff=nf(),Lo=La(),df=lf(),Mr=df.validators;function vn(e){this.defaults=e,this.interceptors={request:new cf,response:new cf}}vn.prototype.request=function(t,r){if(typeof t=="string"?(r=r||{},r.url=t):r=t||{},!r.url)throw new Error("Provided config url is not valid");r=Lo(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&df.assertOptions(n,{silentJSONParsing:Mr.transitional(Mr.boolean),forcedJSONParsing:Mr.transitional(Mr.boolean),clarifyTimeoutError:Mr.transitional(Mr.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(i=i&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});var a=[];this.interceptors.response.forEach(function(m){a.push(m.fulfilled,m.rejected)});var s;if(!i){var u=[ff,void 0];for(Array.prototype.unshift.apply(u,o),u=u.concat(a),s=Promise.resolve(r);u.length;)s=s.then(u.shift(),u.shift());return s}for(var c=r;o.length;){var l=o.shift(),p=o.shift();try{c=l(c)}catch(f){p(f);break}}try{s=ff(c)}catch(f){return Promise.reject(f)}for(;a.length;)s=s.then(a.shift(),a.shift());return s};vn.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=Lo(this.defaults,t),bv(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};pf.forEach(["delete","get","head","options"],function(t){vn.prototype[t]=function(r,n){return this.request(Lo(n||{},{method:t,url:r,data:(n||{}).data}))}});pf.forEach(["post","put","patch"],function(t){vn.prototype[t]=function(r,n,o){return this.request(Lo(o||{},{method:t,url:r,data:n}))}});mf.exports=vn});var gf=A((IC,vf)=>{"use strict";var Ev=mn();function Fr(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var r=this;this.promise.then(function(n){if(!!r._listeners){var o,i=r._listeners.length;for(o=0;o{"use strict";yf.exports=function(t){return function(n){return t.apply(null,n)}}});var _f=A((PC,Ef)=>{"use strict";var _v=De();Ef.exports=function(t){return _v.isObject(t)&&t.isAxiosError===!0}});var Cf=A((LC,Ma)=>{"use strict";var xf=De(),xv=ga(),No=hf(),Ov=La(),Cv=hn();function Of(e){var t=new No(e),r=xv(No.prototype.request,t);return xf.extend(r,No.prototype,t),xf.extend(r,t),r.create=function(o){return Of(Ov(e,o))},r}var vt=Of(Cv);vt.Axios=No;vt.Cancel=mn();vt.CancelToken=gf();vt.isCancel=Ia();vt.VERSION=Na().version;vt.all=function(t){return Promise.all(t)};vt.spread=bf();vt.isAxiosError=_f();Ma.exports=vt;Ma.exports.default=vt});var wf=A((NC,Tf)=>{Tf.exports=Cf()});var ja=A((Do,Ff)=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.default=Mf;var wv=/input|select|textarea|button|object|iframe/;function Sv(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var r=window.getComputedStyle(e);return t?r.getPropertyValue("overflow")!=="visible"||e.scrollWidth<=0&&e.scrollHeight<=0:r.getPropertyValue("display")=="none"}catch{return console.warn("Failed to inspect element style"),!1}}function Av(e){for(var t=e,r=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(r&&t===r&&(t=r.host.parentNode),Sv(t))return!1;t=t.parentNode}return!0}function Iv(e,t){var r=e.nodeName.toLowerCase(),n=wv.test(r)&&!e.disabled||r==="a"&&e.href||t;return n&&Av(e)}function Rv(e){var t=e.getAttribute("tabindex");t===null&&(t=void 0);var r=isNaN(t);return(r||t>=0)&&Iv(e,!r)}function Mf(e){var t=[].slice.call(e.querySelectorAll("*"),0).reduce(function(r,n){return r.concat(n.shadowRoot?Mf(n.shadowRoot):[n])},[]);return t.filter(Rv)}Ff.exports=Do.default});var Bf=A(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.resetState=Dv;it.log=Mv;it.handleBlur=yn;it.handleFocus=bn;it.markForFocusLater=Fv;it.returnFocus=Bv;it.popWithoutFocus=Hv;it.setupScopedFocus=kv;it.teardownScopedFocus=Uv;var Pv=ja(),Lv=Nv(Pv);function Nv(e){return e&&e.__esModule?e:{default:e}}var Hr=[],Br=null,qa=!1;function Dv(){Hr=[]}function Mv(){}function yn(){qa=!0}function bn(){if(qa){if(qa=!1,!Br)return;setTimeout(function(){if(!Br.contains(document.activeElement)){var e=(0,Lv.default)(Br)[0]||Br;e.focus()}},0)}}function Fv(){Hr.push(document.activeElement)}function Bv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{Hr.length!==0&&(t=Hr.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function Hv(){Hr.length>0&&Hr.pop()}function kv(e){Br=e,window.addEventListener?(window.addEventListener("blur",yn,!1),document.addEventListener("focus",bn,!0)):(window.attachEvent("onBlur",yn),document.attachEvent("onFocus",bn))}function Uv(){Br=null,window.addEventListener?(window.removeEventListener("blur",yn),document.removeEventListener("focus",bn)):(window.detachEvent("onBlur",yn),document.detachEvent("onFocus",bn))}});var Uf=A((Mo,kf)=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.default=Wv;var jv=ja(),qv=Gv(jv);function Gv(e){return e&&e.__esModule?e:{default:e}}function Hf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return e.activeElement.shadowRoot?Hf(e.activeElement.shadowRoot):e.activeElement}function Wv(e,t){var r=(0,qv.default)(e);if(!r.length){t.preventDefault();return}var n=void 0,o=t.shiftKey,i=r[0],a=r[r.length-1],s=Hf();if(e===s){if(!o)return;n=a}if(a===s&&!o&&(n=i),i===s&&o&&(n=a),n){t.preventDefault(),n.focus();return}var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),c=u!=null&&u[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!c){var l=r.indexOf(s);if(l>-1&&(l+=o?-1:1),n=r[l],typeof n>"u"){t.preventDefault(),n=o?a:i,n.focus();return}t.preventDefault(),n.focus()}}kf.exports=Mo.default});var Wf=A((GC,Gf)=>{"use strict";var Vv=!1,qf=function(){};Vv&&(jf=function(t,r){var n=arguments.length;r=new Array(n>1?n-1:0);for(var o=1;o2?n-2:0);for(var o=2;o{(function(){"use strict";var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};typeof define=="function"&&typeof define.amd=="object"&&define.amd?define(function(){return t}):typeof Fo<"u"&&Fo.exports?Fo.exports=t:window.ExecutionEnvironment=t})()});var Ho=A(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.canUseDOM=Tt.SafeNodeList=Tt.SafeHTMLCollection=void 0;var $v=Vf(),Qv=zv($v);function zv(e){return e&&e.__esModule?e:{default:e}}var Bo=Qv.default,Yv=Bo.canUseDOM?window.HTMLElement:{},VC=Tt.SafeHTMLCollection=Bo.canUseDOM?window.HTMLCollection:{},$C=Tt.SafeNodeList=Bo.canUseDOM?window.NodeList:{},QC=Tt.canUseDOM=Bo.canUseDOM;Tt.default=Yv});var Wa=A(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.resetState=eg;gt.log=tg;gt.assertNodeList=$f;gt.setElement=rg;gt.validateElement=Ga;gt.hide=ng;gt.show=og;gt.documentNotReadyOrSSRTesting=ig;var Xv=Wf(),Kv=Jv(Xv),Zv=Ho();function Jv(e){return e&&e.__esModule?e:{default:e}}var Je=null;function eg(){Je&&(Je.removeAttribute?Je.removeAttribute("aria-hidden"):Je.length!=null?Je.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Je).forEach(function(e){return e.removeAttribute("aria-hidden")})),Je=null}function tg(){if(!1)var e}function $f(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function rg(e){var t=e;if(typeof t=="string"&&Zv.canUseDOM){var r=document.querySelectorAll(t);$f(r,t),t=r}return Je=t||Je,Je}function Ga(e){var t=e||Je;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,Kv.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(" ")),[])}function ng(e){var t=!0,r=!1,n=void 0;try{for(var o=Ga(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function og(e){var t=!0,r=!1,n=void 0;try{for(var o=Ga(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function ig(){Je=null}});var zf=A(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.resetState=ag;kr.log=sg;var En={},_n={};function Qf(e,t){e.classList.remove(t)}function ag(){var e=document.getElementsByTagName("html")[0];for(var t in En)Qf(e,En[t]);var r=document.body;for(var n in _n)Qf(r,_n[n]);En={},_n={}}function sg(){if(!1){var e,t;for(var r in En);for(var n in _n);}}var ug=function(t,r){return t[r]||(t[r]=0),t[r]+=1,r},lg=function(t,r){return t[r]&&(t[r]-=1),r},cg=function(t,r,n){n.forEach(function(o){ug(r,o),t.add(o)})},fg=function(t,r,n){n.forEach(function(o){lg(r,o),r[o]===0&&t.remove(o)})},XC=kr.add=function(t,r){return cg(t.classList,t.nodeName.toLowerCase()=="html"?En:_n,r.split(" "))},KC=kr.remove=function(t,r){return fg(t.classList,t.nodeName.toLowerCase()=="html"?En:_n,r.split(" "))}});var Va=A(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.log=dg;xn.resetState=mg;function pg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Yf=function e(){var t=this;pg(this,e),this.register=function(r){t.openInstances.indexOf(r)===-1&&(t.openInstances.push(r),t.emit("register"))},this.deregister=function(r){var n=t.openInstances.indexOf(r);n!==-1&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(r){t.subscribers.push(r)},this.emit=function(r){t.subscribers.forEach(function(n){return n(r,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},ko=new Yf;function dg(){console.log("portalOpenInstances ----------"),console.log(ko.openInstances.length),ko.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function mg(){ko=new Yf}xn.default=ko});var Kf=A(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.resetState=yg;Uo.log=bg;var hg=Va(),vg=gg(hg);function gg(e){return e&&e.__esModule?e:{default:e}}var Pe=void 0,at=void 0,nr=[];function yg(){for(var e=[Pe,at],t=0;t0?(document.body.firstChild!==Pe&&document.body.insertBefore(Pe,document.body.firstChild),document.body.lastChild!==at&&document.body.appendChild(at)):(Pe.parentElement&&Pe.parentElement.removeChild(Pe),at.parentElement&&at.parentElement.removeChild(at))}vg.default.subscribe(Eg)});var rp=A((Vo,tp)=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});var jo=Object.assign||function(e){for(var t=1;t0&&(Go-=1,Go===0&&Zf.show(i)),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(On.returnFocus(n.props.preventScroll),On.teardownScopedFocus()):On.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),ep.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(On.setupScopedFocus(n.node),On.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 o=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:o},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(o){o.keyCode===Dg&&(0,Sg.default)(n.content,o),n.props.shouldCloseOnEsc&&o.keyCode===Mg&&(o.stopPropagation(),n.requestClose(o))},n.handleOverlayOnClick=function(o){n.shouldClose===null&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(o):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(o){!n.props.shouldCloseOnOverlayClick&&o.target==n.overlay&&o.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(o){return n.ownerHandlesClose()&&n.props.onRequestClose(o)},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(o,i){var a=(typeof i>"u"?"undefined":_g(i))==="object"?i:{base:$a[o],afterOpen:$a[o]+"--after-open",beforeClose:$a[o]+"--before-close"},s=a.base;return n.state.afterOpen&&(s=s+" "+a.afterOpen),n.state.beforeClose&&(s=s+" "+a.beforeClose),typeof i=="string"&&i?s+" "+i:s},n.attributesFromObject=function(o,i){return Object.keys(i).reduce(function(a,s){return a[o+"-"+s]=i[s],a},{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return xg(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(n,o){this.props.isOpen&&!n.isOpen?this.open():!this.props.isOpen&&n.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!o.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var n=this.props,o=n.appElement,i=n.ariaHideApp,a=n.htmlOpenClassName,s=n.bodyOpenClassName;s&&qo.add(document.body,s),a&&qo.add(document.getElementsByTagName("html")[0],a),i&&(Go+=1,Zf.hide(o)),ep.default.register(this)}},{key:"render",value:function(){var n=this.props,o=n.id,i=n.className,a=n.overlayClassName,s=n.defaultStyles,u=n.children,c=i?{}:s.content,l=a?{}:s.overlay;if(this.shouldBeClosed())return null;var p={ref:this.setOverlayRef,className:this.buildClassName("overlay",a),style:jo({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},f=jo({id:o,ref:this.setContentRef,style:jo({},c,this.props.style.content),className:this.buildClassName("content",i),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",jo({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),m=this.props.contentElement(f,u);return this.props.overlayElement(p,m)}}]),t}(Og.Component);Ya.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}};Ya.propTypes={isOpen:H.default.bool.isRequired,defaultStyles:H.default.shape({content:H.default.object,overlay:H.default.object}),style:H.default.shape({content:H.default.object,overlay:H.default.object}),className:H.default.oneOfType([H.default.string,H.default.object]),overlayClassName:H.default.oneOfType([H.default.string,H.default.object]),bodyOpenClassName:H.default.string,htmlOpenClassName:H.default.string,ariaHideApp:H.default.bool,appElement:H.default.oneOfType([H.default.instanceOf(Jf.default),H.default.instanceOf(Qa.SafeHTMLCollection),H.default.instanceOf(Qa.SafeNodeList),H.default.arrayOf(H.default.instanceOf(Jf.default))]),onAfterOpen:H.default.func,onAfterClose:H.default.func,onRequestClose:H.default.func,closeTimeoutMS:H.default.number,shouldFocusAfterRender:H.default.bool,shouldCloseOnOverlayClick:H.default.bool,shouldReturnFocusAfterClose:H.default.bool,preventScroll:H.default.bool,role:H.default.string,contentLabel:H.default.string,aria:H.default.object,data:H.default.object,children:H.default.node,shouldCloseOnEsc:H.default.bool,overlayRef:H.default.func,contentRef:H.default.func,id:H.default.string,overlayElement:H.default.func,contentElement:H.default.func,testId:H.default.string};Vo.default=Ya;tp.exports=Vo.default});var ap={};Ss(ap,{polyfill:()=>Fg});function np(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function op(e){function t(r){var n=this.constructor.getDerivedStateFromProps(e,r);return n??null}this.setState(t.bind(this))}function ip(e,t){try{var r=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function Fg(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var r=null,n=null,o=null;if(typeof t.componentWillMount=="function"?r="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(r="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?n="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(n="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),r!==null||n!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. +"use strict";var TheliaMediaLibraryBlock=(()=>{var Ad=Object.create;var zr=Object.defineProperty;var Id=Object.getOwnPropertyDescriptor;var Rd=Object.getOwnPropertyNames;var Pd=Object.getPrototypeOf,Ld=Object.prototype.hasOwnProperty;var Nd=(e,t,r)=>t in e?zr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Dd=(e,t)=>()=>(e&&(t=e(e=0)),t);var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),As=(e,t)=>{for(var r in t)zr(e,r,{get:t[r],enumerable:!0})},Is=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rd(t))!Ld.call(e,o)&&o!==r&&zr(e,o,{get:()=>t[o],enumerable:!(n=Id(t,o))||n.enumerable});return e};var W=(e,t,r)=>(r=e!=null?Ad(Pd(e)):{},Is(t||!e||!e.__esModule?zr(r,"default",{value:e,enumerable:!0}):r,e)),Rs=e=>Is(zr({},"__esModule",{value:!0}),e);var Ps=(e,t,r)=>(Nd(e,typeof t!="symbol"?t+"":t,r),r);var jn=A((gb,Ls)=>{Ls.exports=TheliaBlocks});var J=A((yb,Ns)=>{Ns.exports=React});var tu=A((bb,Wn)=>{var Ds,Ms,Fs,Bs,Hs,ks,Us,js,qs,qn,hi,Gs,Ws,Vs,br,$s,Qs,zs,Ys,Xs,Ks,Zs,Js,eu,Gn;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Wn=="object"&&typeof Wn.exports=="object"?e(r(t,r(Wn.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};Ds=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},Ms=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;l--)(c=n[l])&&(u=(s<3?c(u):s>3?c(o,i,u):c(o,i))||u);return s>3&&u&&Object.defineProperty(o,i,u),u},Hs=function(n,o){return function(i,a){o(i,a,n)}},ks=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},Us=function(n,o,i,a){function s(u){return u instanceof i?u:new i(function(c){c(u)})}return new(i||(i=Promise))(function(u,c){function l(m){try{f(a.next(m))}catch(g){c(g)}}function p(m){try{f(a.throw(m))}catch(g){c(g)}}function f(m){m.done?u(m.value):s(m.value).then(l,p)}f((a=a.apply(n,o||[])).next())})},js=function(n,o){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},a,s,u,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(f){return function(m){return p([f,m])}}function p(f){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(u=f[0]&2?s.return:f[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,f[1])).done)return u;switch(s=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return i.label++,{value:f[1],done:!1};case 5:i.label++,s=f[1],f=[0];continue;case 7:f=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){i=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},hi=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,u=[],c;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)u.push(s.value)}catch(l){c={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(c)throw c.error}}return u},Gs=function(){for(var n=[],o=0;o1||l(v,b)})})}function l(v,b){try{p(a[v](b))}catch(E){g(u[0][3],E)}}function p(v){v.value instanceof br?Promise.resolve(v.value.v).then(f,m):g(u[0][2],v)}function f(v){l("next",v)}function m(v){l("throw",v)}function g(v,b){v(b),u.shift(),u.length&&l(u[0][0],u[0][1])}},Qs=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,u){o[s]=n[s]?function(c){return(i=!i)?{value:br(n[s](c)),done:s==="return"}:u?u(c):c}:u}},zs=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof qn=="function"?qn(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(u){i[u]=n[u]&&function(c){return new Promise(function(l,p){c=n[u](c),s(l,p,c.done,c.value)})}}function s(u,c,l,p){Promise.resolve(p).then(function(f){u({value:f,done:l})},c)}},Ys=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Xs=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Gn(o,n,i);return r(o,n),o},Ks=function(n){return n&&n.__esModule?n:{default:n}},Zs=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},Js=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},eu=function(n,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?o===n:n.has(o)},e("__extends",Ds),e("__assign",Ms),e("__rest",Fs),e("__decorate",Bs),e("__param",Hs),e("__metadata",ks),e("__awaiter",Us),e("__generator",js),e("__exportStar",qs),e("__createBinding",Gn),e("__values",qn),e("__read",hi),e("__spread",Gs),e("__spreadArrays",Ws),e("__spreadArray",Vs),e("__await",br),e("__asyncGenerator",$s),e("__asyncDelegator",Qs),e("__asyncValues",zs),e("__makeTemplateObject",Ys),e("__importStar",Xs),e("__importDefault",Ks),e("__classPrivateFieldGet",Zs),e("__classPrivateFieldSet",Js),e("__classPrivateFieldIn",eu)})});var ou=A(ee=>{"use strict";var Ee=typeof Symbol=="function"&&Symbol.for,gi=Ee?Symbol.for("react.element"):60103,yi=Ee?Symbol.for("react.portal"):60106,Vn=Ee?Symbol.for("react.fragment"):60107,$n=Ee?Symbol.for("react.strict_mode"):60108,Qn=Ee?Symbol.for("react.profiler"):60114,zn=Ee?Symbol.for("react.provider"):60109,Yn=Ee?Symbol.for("react.context"):60110,bi=Ee?Symbol.for("react.async_mode"):60111,Xn=Ee?Symbol.for("react.concurrent_mode"):60111,Kn=Ee?Symbol.for("react.forward_ref"):60112,Zn=Ee?Symbol.for("react.suspense"):60113,Md=Ee?Symbol.for("react.suspense_list"):60120,Jn=Ee?Symbol.for("react.memo"):60115,eo=Ee?Symbol.for("react.lazy"):60116,Fd=Ee?Symbol.for("react.block"):60121,Bd=Ee?Symbol.for("react.fundamental"):60117,Hd=Ee?Symbol.for("react.responder"):60118,kd=Ee?Symbol.for("react.scope"):60119;function qe(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case gi:switch(e=e.type,e){case bi:case Xn:case Vn:case Qn:case $n:case Zn:return e;default:switch(e=e&&e.$$typeof,e){case Yn:case Kn:case eo:case Jn:case zn:return e;default:return t}}case yi:return t}}}function nu(e){return qe(e)===Xn}ee.AsyncMode=bi;ee.ConcurrentMode=Xn;ee.ContextConsumer=Yn;ee.ContextProvider=zn;ee.Element=gi;ee.ForwardRef=Kn;ee.Fragment=Vn;ee.Lazy=eo;ee.Memo=Jn;ee.Portal=yi;ee.Profiler=Qn;ee.StrictMode=$n;ee.Suspense=Zn;ee.isAsyncMode=function(e){return nu(e)||qe(e)===bi};ee.isConcurrentMode=nu;ee.isContextConsumer=function(e){return qe(e)===Yn};ee.isContextProvider=function(e){return qe(e)===zn};ee.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===gi};ee.isForwardRef=function(e){return qe(e)===Kn};ee.isFragment=function(e){return qe(e)===Vn};ee.isLazy=function(e){return qe(e)===eo};ee.isMemo=function(e){return qe(e)===Jn};ee.isPortal=function(e){return qe(e)===yi};ee.isProfiler=function(e){return qe(e)===Qn};ee.isStrictMode=function(e){return qe(e)===$n};ee.isSuspense=function(e){return qe(e)===Zn};ee.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Vn||e===Xn||e===Qn||e===$n||e===Zn||e===Md||typeof e=="object"&&e!==null&&(e.$$typeof===eo||e.$$typeof===Jn||e.$$typeof===zn||e.$$typeof===Yn||e.$$typeof===Kn||e.$$typeof===Bd||e.$$typeof===Hd||e.$$typeof===kd||e.$$typeof===Fd)};ee.typeOf=qe});var au=A((Ub,iu)=>{"use strict";iu.exports=ou()});var du=A((jb,pu)=>{"use strict";var Ei=au(),Ud={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},jd={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},qd={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},cu={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},_i={};_i[Ei.ForwardRef]=qd;_i[Ei.Memo]=cu;function su(e){return Ei.isMemo(e)?cu:_i[e.$$typeof]||Ud}var Gd=Object.defineProperty,Wd=Object.getOwnPropertyNames,uu=Object.getOwnPropertySymbols,Vd=Object.getOwnPropertyDescriptor,$d=Object.getPrototypeOf,lu=Object.prototype;function fu(e,t,r){if(typeof t!="string"){if(lu){var n=$d(t);n&&n!==lu&&fu(e,n,r)}var o=Wd(t);uu&&(o=o.concat(uu(t)));for(var i=su(e),a=su(t),s=0;s{"use strict";var Hm="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";hl.exports=Hm});var El=A((U_,bl)=>{"use strict";var km=vl();function gl(){}function yl(){}yl.resetWarningCache=gl;bl.exports=function(){function e(n,o,i,a,s,u){if(u!==km){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var r={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:yl,resetWarningCache:gl};return r.PropTypes=r,r}});var bo=A((G_,_l)=>{_l.exports=El()();var j_,q_});var wl=A(Xi=>{"use strict";Xi.__esModule=!0;Xi.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return r.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?n.toLowerCase().endsWith(s):s.endsWith("/*")?i===s.replace(/\/.*$/,""):o===s})}return!0}});var To=A((wO,pc)=>{pc.exports=ReactDOM});var ya=A((uC,_c)=>{"use strict";_c.exports=function(t,r){return function(){for(var o=new Array(arguments.length),i=0;i{"use strict";var Dh=ya(),Ht=Object.prototype.toString;function _a(e){return Array.isArray(e)}function ba(e){return typeof e>"u"}function Mh(e){return e!==null&&!ba(e)&&e.constructor!==null&&!ba(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function xc(e){return Ht.call(e)==="[object ArrayBuffer]"}function Fh(e){return Ht.call(e)==="[object FormData]"}function Bh(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&xc(e.buffer),t}function Hh(e){return typeof e=="string"}function kh(e){return typeof e=="number"}function Oc(e){return e!==null&&typeof e=="object"}function Ao(e){if(Ht.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Uh(e){return Ht.call(e)==="[object Date]"}function jh(e){return Ht.call(e)==="[object File]"}function qh(e){return Ht.call(e)==="[object Blob]"}function Cc(e){return Ht.call(e)==="[object Function]"}function Gh(e){return Oc(e)&&Cc(e.pipe)}function Wh(e){return Ht.call(e)==="[object URLSearchParams]"}function Vh(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $h(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function xa(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),_a(e))for(var r=0,n=e.length;r{"use strict";var Dr=De();function wc(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Sc.exports=function(t,r,n){if(!r)return t;var o;if(n)o=n(r);else if(Dr.isURLSearchParams(r))o=r.toString();else{var i=[];Dr.forEach(r,function(u,c){u===null||typeof u>"u"||(Dr.isArray(u)?c=c+"[]":u=[u],Dr.forEach(u,function(p){Dr.isDate(p)?p=p.toISOString():Dr.isObject(p)&&(p=JSON.stringify(p)),i.push(wc(c)+"="+wc(p))}))}),o=i.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Ic=A((fC,Ac)=>{"use strict";var Yh=De();function Io(){this.handlers=[]}Io.prototype.use=function(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Io.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Io.prototype.forEach=function(t){Yh.forEach(this.handlers,function(n){n!==null&&t(n)})};Ac.exports=Io});var Pc=A((pC,Rc)=>{"use strict";var Xh=De();Rc.exports=function(t,r){Xh.forEach(t,function(o,i){i!==r&&i.toUpperCase()===r.toUpperCase()&&(t[r]=o,delete t[i])})}});var Ca=A((dC,Lc)=>{"use strict";Lc.exports=function(t,r,n,o,i){return t.config=r,n&&(t.code=n),t.request=o,t.response=i,t.isAxiosError=!0,t.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}},t}});var Ta=A((mC,Nc)=>{"use strict";var Kh=Ca();Nc.exports=function(t,r,n,o,i){var a=new Error(t);return Kh(a,r,n,o,i)}});var Mc=A((hC,Dc)=>{"use strict";var Zh=Ta();Dc.exports=function(t,r,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):r(Zh("Request failed with status code "+n.status,n.config,null,n.request,n))}});var Bc=A((vC,Fc)=>{"use strict";var Ro=De();Fc.exports=Ro.isStandardBrowserEnv()?function(){return{write:function(r,n,o,i,a,s){var u=[];u.push(r+"="+encodeURIComponent(n)),Ro.isNumber(o)&&u.push("expires="+new Date(o).toGMTString()),Ro.isString(i)&&u.push("path="+i),Ro.isString(a)&&u.push("domain="+a),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(r){var n=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var kc=A((gC,Hc)=>{"use strict";Hc.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var jc=A((yC,Uc)=>{"use strict";Uc.exports=function(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t}});var Gc=A((bC,qc)=>{"use strict";var Jh=kc(),ev=jc();qc.exports=function(t,r){return t&&!Jh(r)?ev(t,r):r}});var Vc=A((EC,Wc)=>{"use strict";var wa=De(),tv=["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"];Wc.exports=function(t){var r={},n,o,i;return t&&wa.forEach(t.split(` +`),function(s){if(i=s.indexOf(":"),n=wa.trim(s.substr(0,i)).toLowerCase(),o=wa.trim(s.substr(i+1)),n){if(r[n]&&tv.indexOf(n)>=0)return;n==="set-cookie"?r[n]=(r[n]?r[n]:[]).concat([o]):r[n]=r[n]?r[n]+", "+o:o}}),r}});var zc=A((_C,Qc)=>{"use strict";var $c=De();Qc.exports=$c.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),n;function o(i){var a=i;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=o(window.location.href),function(a){var s=$c.isString(a)?o(a):a;return s.protocol===n.protocol&&s.host===n.host}}():function(){return function(){return!0}}()});var mn=A((xC,Yc)=>{"use strict";function Sa(e){this.message=e}Sa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};Sa.prototype.__CANCEL__=!0;Yc.exports=Sa});var Ia=A((OC,Xc)=>{"use strict";var Po=De(),rv=Mc(),nv=Bc(),ov=Oa(),iv=Gc(),av=Vc(),sv=zc(),Aa=Ta(),uv=hn(),lv=mn();Xc.exports=function(t){return new Promise(function(n,o){var i=t.data,a=t.headers,s=t.responseType,u;function c(){t.cancelToken&&t.cancelToken.unsubscribe(u),t.signal&&t.signal.removeEventListener("abort",u)}Po.isFormData(i)&&delete a["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var p=t.auth.username||"",f=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(p+":"+f)}var m=iv(t.baseURL,t.url);l.open(t.method.toUpperCase(),ov(m,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function g(){if(!!l){var b="getAllResponseHeaders"in l?av(l.getAllResponseHeaders()):null,E=!s||s==="text"||s==="json"?l.responseText:l.response,x={data:E,status:l.status,statusText:l.statusText,headers:b,config:t,request:l};rv(function(d){n(d),c()},function(d){o(d),c()},x),l=null}}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){!l||(o(Aa("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){o(Aa("Network Error",t,null,l)),l=null},l.ontimeout=function(){var E=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",x=t.transitional||uv.transitional;t.timeoutErrorMessage&&(E=t.timeoutErrorMessage),o(Aa(E,t,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},Po.isStandardBrowserEnv()){var v=(t.withCredentials||sv(m))&&t.xsrfCookieName?nv.read(t.xsrfCookieName):void 0;v&&(a[t.xsrfHeaderName]=v)}"setRequestHeader"in l&&Po.forEach(a,function(E,x){typeof i>"u"&&x.toLowerCase()==="content-type"?delete a[x]:l.setRequestHeader(x,E)}),Po.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),s&&s!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(u=function(b){!l||(o(!b||b&&b.type?new lv("canceled"):b),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(u),t.signal&&(t.signal.aborted?u():t.signal.addEventListener("abort",u))),i||(i=null),l.send(i)})}});var hn=A((CC,Jc)=>{"use strict";var we=De(),Kc=Pc(),cv=Ca(),fv={"Content-Type":"application/x-www-form-urlencoded"};function Zc(e,t){!we.isUndefined(e)&&we.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function pv(){var e;return typeof XMLHttpRequest<"u"?e=Ia():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(e=Ia()),e}function dv(e,t,r){if(we.isString(e))try{return(t||JSON.parse)(e),we.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}var Lo={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:pv(),transformRequest:[function(t,r){return Kc(r,"Accept"),Kc(r,"Content-Type"),we.isFormData(t)||we.isArrayBuffer(t)||we.isBuffer(t)||we.isStream(t)||we.isFile(t)||we.isBlob(t)?t:we.isArrayBufferView(t)?t.buffer:we.isURLSearchParams(t)?(Zc(r,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):we.isObject(t)||r&&r["Content-Type"]==="application/json"?(Zc(r,"application/json"),dv(t)):t}],transformResponse:[function(t){var r=this.transitional||Lo.transitional,n=r&&r.silentJSONParsing,o=r&&r.forcedJSONParsing,i=!n&&this.responseType==="json";if(i||o&&we.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(i)throw a.name==="SyntaxError"?cv(a,this,"E_JSON_PARSE"):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};we.forEach(["delete","get","head"],function(t){Lo.headers[t]={}});we.forEach(["post","put","patch"],function(t){Lo.headers[t]=we.merge(fv)});Jc.exports=Lo});var tf=A((TC,ef)=>{"use strict";var mv=De(),hv=hn();ef.exports=function(t,r,n){var o=this||hv;return mv.forEach(n,function(a){t=a.call(o,t,r)}),t}});var Ra=A((wC,rf)=>{"use strict";rf.exports=function(t){return!!(t&&t.__CANCEL__)}});var af=A((SC,of)=>{"use strict";var nf=De(),Pa=tf(),vv=Ra(),gv=hn(),yv=mn();function La(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yv("canceled")}of.exports=function(t){La(t),t.headers=t.headers||{},t.data=Pa.call(t,t.data,t.headers,t.transformRequest),t.headers=nf.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),nf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var r=t.adapter||gv.adapter;return r(t).then(function(o){return La(t),o.data=Pa.call(t,o.data,o.headers,t.transformResponse),o},function(o){return vv(o)||(La(t),o&&o.response&&(o.response.data=Pa.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Na=A((AC,sf)=>{"use strict";var $e=De();sf.exports=function(t,r){r=r||{};var n={};function o(l,p){return $e.isPlainObject(l)&&$e.isPlainObject(p)?$e.merge(l,p):$e.isPlainObject(p)?$e.merge({},p):$e.isArray(p)?p.slice():p}function i(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(t[l],r[l])}function a(l){if(!$e.isUndefined(r[l]))return o(void 0,r[l])}function s(l){if($e.isUndefined(r[l])){if(!$e.isUndefined(t[l]))return o(void 0,t[l])}else return o(void 0,r[l])}function u(l){if(l in r)return o(t[l],r[l]);if(l in t)return o(void 0,t[l])}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return $e.forEach(Object.keys(t).concat(Object.keys(r)),function(p){var f=c[p]||i,m=f(p);$e.isUndefined(m)&&f!==u||(n[p]=m)}),n}});var Da=A((IC,uf)=>{uf.exports={version:"0.25.0"}});var ff=A((RC,cf)=>{"use strict";var bv=Da().version,Ma={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){Ma[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var lf={};Ma.transitional=function(t,r,n){function o(i,a){return"[Axios v"+bv+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return function(i,a,s){if(t===!1)throw new Error(o(a," has been removed"+(r?" in "+r:"")));return r&&!lf[a]&&(lf[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,s):!0}};function Ev(e,t,r){if(typeof e!="object")throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var s=e[i],u=s===void 0||a(s,i,e);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(r!==!0)throw Error("Unknown option "+i)}}cf.exports={assertOptions:Ev,validators:Ma}});var gf=A((PC,vf)=>{"use strict";var mf=De(),_v=Oa(),pf=Ic(),df=af(),No=Na(),hf=ff(),Mr=hf.validators;function vn(e){this.defaults=e,this.interceptors={request:new pf,response:new pf}}vn.prototype.request=function(t,r){if(typeof t=="string"?(r=r||{},r.url=t):r=t||{},!r.url)throw new Error("Provided config url is not valid");r=No(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&hf.assertOptions(n,{silentJSONParsing:Mr.transitional(Mr.boolean),forcedJSONParsing:Mr.transitional(Mr.boolean),clarifyTimeoutError:Mr.transitional(Mr.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(i=i&&m.synchronous,o.unshift(m.fulfilled,m.rejected))});var a=[];this.interceptors.response.forEach(function(m){a.push(m.fulfilled,m.rejected)});var s;if(!i){var u=[df,void 0];for(Array.prototype.unshift.apply(u,o),u=u.concat(a),s=Promise.resolve(r);u.length;)s=s.then(u.shift(),u.shift());return s}for(var c=r;o.length;){var l=o.shift(),p=o.shift();try{c=l(c)}catch(f){p(f);break}}try{s=df(c)}catch(f){return Promise.reject(f)}for(;a.length;)s=s.then(a.shift(),a.shift());return s};vn.prototype.getUri=function(t){if(!t.url)throw new Error("Provided config url is not valid");return t=No(this.defaults,t),_v(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")};mf.forEach(["delete","get","head","options"],function(t){vn.prototype[t]=function(r,n){return this.request(No(n||{},{method:t,url:r,data:(n||{}).data}))}});mf.forEach(["post","put","patch"],function(t){vn.prototype[t]=function(r,n,o){return this.request(No(o||{},{method:t,url:r,data:n}))}});vf.exports=vn});var bf=A((LC,yf)=>{"use strict";var xv=mn();function Fr(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var r=this;this.promise.then(function(n){if(!!r._listeners){var o,i=r._listeners.length;for(o=0;o{"use strict";Ef.exports=function(t){return function(n){return t.apply(null,n)}}});var Of=A((DC,xf)=>{"use strict";var Ov=De();xf.exports=function(t){return Ov.isObject(t)&&t.isAxiosError===!0}});var wf=A((MC,Fa)=>{"use strict";var Cf=De(),Cv=ya(),Do=gf(),Tv=Na(),wv=hn();function Tf(e){var t=new Do(e),r=Cv(Do.prototype.request,t);return Cf.extend(r,Do.prototype,t),Cf.extend(r,t),r.create=function(o){return Tf(Tv(e,o))},r}var gt=Tf(wv);gt.Axios=Do;gt.Cancel=mn();gt.CancelToken=bf();gt.isCancel=Ra();gt.VERSION=Da().version;gt.all=function(t){return Promise.all(t)};gt.spread=_f();gt.isAxiosError=Of();Fa.exports=gt;Fa.exports.default=gt});var Af=A((FC,Sf)=>{Sf.exports=wf()});var qa=A((Mo,Hf)=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.default=Bf;var Av=/input|select|textarea|button|object|iframe/;function Iv(e){var t=e.offsetWidth<=0&&e.offsetHeight<=0;if(t&&!e.innerHTML)return!0;try{var r=window.getComputedStyle(e);return t?r.getPropertyValue("overflow")!=="visible"||e.scrollWidth<=0&&e.scrollHeight<=0:r.getPropertyValue("display")=="none"}catch{return console.warn("Failed to inspect element style"),!1}}function Rv(e){for(var t=e,r=e.getRootNode&&e.getRootNode();t&&t!==document.body;){if(r&&t===r&&(t=r.host.parentNode),Iv(t))return!1;t=t.parentNode}return!0}function Pv(e,t){var r=e.nodeName.toLowerCase(),n=Av.test(r)&&!e.disabled||r==="a"&&e.href||t;return n&&Rv(e)}function Lv(e){var t=e.getAttribute("tabindex");t===null&&(t=void 0);var r=isNaN(t);return(r||t>=0)&&Pv(e,!r)}function Bf(e){var t=[].slice.call(e.querySelectorAll("*"),0).reduce(function(r,n){return r.concat(n.shadowRoot?Bf(n.shadowRoot):[n])},[]);return t.filter(Lv)}Hf.exports=Mo.default});var kf=A(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.resetState=Fv;at.log=Bv;at.handleBlur=yn;at.handleFocus=bn;at.markForFocusLater=Hv;at.returnFocus=kv;at.popWithoutFocus=Uv;at.setupScopedFocus=jv;at.teardownScopedFocus=qv;var Nv=qa(),Dv=Mv(Nv);function Mv(e){return e&&e.__esModule?e:{default:e}}var Hr=[],Br=null,Ga=!1;function Fv(){Hr=[]}function Bv(){}function yn(){Ga=!0}function bn(){if(Ga){if(Ga=!1,!Br)return;setTimeout(function(){if(!Br.contains(document.activeElement)){var e=(0,Dv.default)(Br)[0]||Br;e.focus()}},0)}}function Hv(){Hr.push(document.activeElement)}function kv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{Hr.length!==0&&(t=Hr.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function Uv(){Hr.length>0&&Hr.pop()}function jv(e){Br=e,window.addEventListener?(window.addEventListener("blur",yn,!1),document.addEventListener("focus",bn,!0)):(window.attachEvent("onBlur",yn),document.attachEvent("onFocus",bn))}function qv(){Br=null,window.addEventListener?(window.removeEventListener("blur",yn),document.removeEventListener("focus",bn)):(window.detachEvent("onBlur",yn),document.detachEvent("onFocus",bn))}});var qf=A((Fo,jf)=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.default=$v;var Gv=qa(),Wv=Vv(Gv);function Vv(e){return e&&e.__esModule?e:{default:e}}function Uf(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return e.activeElement.shadowRoot?Uf(e.activeElement.shadowRoot):e.activeElement}function $v(e,t){var r=(0,Wv.default)(e);if(!r.length){t.preventDefault();return}var n=void 0,o=t.shiftKey,i=r[0],a=r[r.length-1],s=Uf();if(e===s){if(!o)return;n=a}if(a===s&&!o&&(n=i),i===s&&o&&(n=a),n){t.preventDefault(),n.focus();return}var u=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),c=u!=null&&u[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!c){var l=r.indexOf(s);if(l>-1&&(l+=o?-1:1),n=r[l],typeof n>"u"){t.preventDefault(),n=o?a:i,n.focus();return}t.preventDefault(),n.focus()}}jf.exports=Fo.default});var $f=A(($C,Vf)=>{"use strict";var Qv=!1,Wf=function(){};Qv&&(Gf=function(t,r){var n=arguments.length;r=new Array(n>1?n-1:0);for(var o=1;o2?n-2:0);for(var o=2;o{(function(){"use strict";var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen};typeof define=="function"&&typeof define.amd=="object"&&define.amd?define(function(){return t}):typeof Bo<"u"&&Bo.exports?Bo.exports=t:window.ExecutionEnvironment=t})()});var ko=A(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.canUseDOM=wt.SafeNodeList=wt.SafeHTMLCollection=void 0;var zv=Qf(),Yv=Xv(zv);function Xv(e){return e&&e.__esModule?e:{default:e}}var Ho=Yv.default,Kv=Ho.canUseDOM?window.HTMLElement:{},zC=wt.SafeHTMLCollection=Ho.canUseDOM?window.HTMLCollection:{},YC=wt.SafeNodeList=Ho.canUseDOM?window.NodeList:{},XC=wt.canUseDOM=Ho.canUseDOM;wt.default=Kv});var Va=A(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.resetState=rg;yt.log=ng;yt.assertNodeList=zf;yt.setElement=og;yt.validateElement=Wa;yt.hide=ig;yt.show=ag;yt.documentNotReadyOrSSRTesting=sg;var Zv=$f(),Jv=tg(Zv),eg=ko();function tg(e){return e&&e.__esModule?e:{default:e}}var Je=null;function rg(){Je&&(Je.removeAttribute?Je.removeAttribute("aria-hidden"):Je.length!=null?Je.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Je).forEach(function(e){return e.removeAttribute("aria-hidden")})),Je=null}function ng(){if(!1)var e}function zf(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function og(e){var t=e;if(typeof t=="string"&&eg.canUseDOM){var r=document.querySelectorAll(t);zf(r,t),t=r}return Je=t||Je,Je}function Wa(e){var t=e||Je;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,Jv.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(" ")),[])}function ig(e){var t=!0,r=!1,n=void 0;try{for(var o=Wa(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function ag(e){var t=!0,r=!1,n=void 0;try{for(var o=Wa(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){r=!0,n=s}finally{try{!t&&o.return&&o.return()}finally{if(r)throw n}}}function sg(){Je=null}});var Xf=A(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.resetState=ug;kr.log=lg;var En={},_n={};function Yf(e,t){e.classList.remove(t)}function ug(){var e=document.getElementsByTagName("html")[0];for(var t in En)Yf(e,En[t]);var r=document.body;for(var n in _n)Yf(r,_n[n]);En={},_n={}}function lg(){if(!1){var e,t;for(var r in En);for(var n in _n);}}var cg=function(t,r){return t[r]||(t[r]=0),t[r]+=1,r},fg=function(t,r){return t[r]&&(t[r]-=1),r},pg=function(t,r,n){n.forEach(function(o){cg(r,o),t.add(o)})},dg=function(t,r,n){n.forEach(function(o){fg(r,o),r[o]===0&&t.remove(o)})},JC=kr.add=function(t,r){return pg(t.classList,t.nodeName.toLowerCase()=="html"?En:_n,r.split(" "))},e2=kr.remove=function(t,r){return dg(t.classList,t.nodeName.toLowerCase()=="html"?En:_n,r.split(" "))}});var $a=A(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.log=hg;xn.resetState=vg;function mg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Kf=function e(){var t=this;mg(this,e),this.register=function(r){t.openInstances.indexOf(r)===-1&&(t.openInstances.push(r),t.emit("register"))},this.deregister=function(r){var n=t.openInstances.indexOf(r);n!==-1&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(r){t.subscribers.push(r)},this.emit=function(r){t.subscribers.forEach(function(n){return n(r,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},Uo=new Kf;function hg(){console.log("portalOpenInstances ----------"),console.log(Uo.openInstances.length),Uo.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function vg(){Uo=new Kf}xn.default=Uo});var Jf=A(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.resetState=Eg;jo.log=_g;var gg=$a(),yg=bg(gg);function bg(e){return e&&e.__esModule?e:{default:e}}var Pe=void 0,st=void 0,nr=[];function Eg(){for(var e=[Pe,st],t=0;t0?(document.body.firstChild!==Pe&&document.body.insertBefore(Pe,document.body.firstChild),document.body.lastChild!==st&&document.body.appendChild(st)):(Pe.parentElement&&Pe.parentElement.removeChild(Pe),st.parentElement&&st.parentElement.removeChild(st))}yg.default.subscribe(xg)});var op=A(($o,np)=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});var qo=Object.assign||function(e){for(var t=1;t0&&(Wo-=1,Wo===0&&ep.show(i)),n.props.shouldFocusAfterRender&&(n.props.shouldReturnFocusAfterClose?(On.returnFocus(n.props.preventScroll),On.teardownScopedFocus()):On.popWithoutFocus()),n.props.onAfterClose&&n.props.onAfterClose(),rp.default.deregister(n)},n.open=function(){n.beforeOpen(),n.state.afterOpen&&n.state.beforeClose?(clearTimeout(n.closeTimer),n.setState({beforeClose:!1})):(n.props.shouldFocusAfterRender&&(On.setupScopedFocus(n.node),On.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 o=Date.now()+n.props.closeTimeoutMS;n.setState({beforeClose:!0,closesAt:o},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(o){o.keyCode===Fg&&(0,Ig.default)(n.content,o),n.props.shouldCloseOnEsc&&o.keyCode===Bg&&(o.stopPropagation(),n.requestClose(o))},n.handleOverlayOnClick=function(o){n.shouldClose===null&&(n.shouldClose=!0),n.shouldClose&&n.props.shouldCloseOnOverlayClick&&(n.ownerHandlesClose()?n.requestClose(o):n.focusContent()),n.shouldClose=null},n.handleContentOnMouseUp=function(){n.shouldClose=!1},n.handleOverlayOnMouseDown=function(o){!n.props.shouldCloseOnOverlayClick&&o.target==n.overlay&&o.preventDefault()},n.handleContentOnClick=function(){n.shouldClose=!1},n.handleContentOnMouseDown=function(){n.shouldClose=!1},n.requestClose=function(o){return n.ownerHandlesClose()&&n.props.onRequestClose(o)},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(o,i){var a=(typeof i>"u"?"undefined":Og(i))==="object"?i:{base:Qa[o],afterOpen:Qa[o]+"--after-open",beforeClose:Qa[o]+"--before-close"},s=a.base;return n.state.afterOpen&&(s=s+" "+a.afterOpen),n.state.beforeClose&&(s=s+" "+a.beforeClose),typeof i=="string"&&i?s+" "+i:s},n.attributesFromObject=function(o,i){return Object.keys(i).reduce(function(a,s){return a[o+"-"+s]=i[s],a},{})},n.state={afterOpen:!1,beforeClose:!1},n.shouldClose=null,n.moveFromContentToOverlay=null,n}return Cg(t,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(n,o){this.props.isOpen&&!n.isOpen?this.open():!this.props.isOpen&&n.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!o.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var n=this.props,o=n.appElement,i=n.ariaHideApp,a=n.htmlOpenClassName,s=n.bodyOpenClassName;s&&Go.add(document.body,s),a&&Go.add(document.getElementsByTagName("html")[0],a),i&&(Wo+=1,ep.hide(o)),rp.default.register(this)}},{key:"render",value:function(){var n=this.props,o=n.id,i=n.className,a=n.overlayClassName,s=n.defaultStyles,u=n.children,c=i?{}:s.content,l=a?{}:s.overlay;if(this.shouldBeClosed())return null;var p={ref:this.setOverlayRef,className:this.buildClassName("overlay",a),style:qo({},l,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},f=qo({id:o,ref:this.setContentRef,style:qo({},c,this.props.style.content),className:this.buildClassName("content",i),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",qo({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),m=this.props.contentElement(f,u);return this.props.overlayElement(p,m)}}]),t}(Tg.Component);Xa.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}};Xa.propTypes={isOpen:H.default.bool.isRequired,defaultStyles:H.default.shape({content:H.default.object,overlay:H.default.object}),style:H.default.shape({content:H.default.object,overlay:H.default.object}),className:H.default.oneOfType([H.default.string,H.default.object]),overlayClassName:H.default.oneOfType([H.default.string,H.default.object]),bodyOpenClassName:H.default.string,htmlOpenClassName:H.default.string,ariaHideApp:H.default.bool,appElement:H.default.oneOfType([H.default.instanceOf(tp.default),H.default.instanceOf(za.SafeHTMLCollection),H.default.instanceOf(za.SafeNodeList),H.default.arrayOf(H.default.instanceOf(tp.default))]),onAfterOpen:H.default.func,onAfterClose:H.default.func,onRequestClose:H.default.func,closeTimeoutMS:H.default.number,shouldFocusAfterRender:H.default.bool,shouldCloseOnOverlayClick:H.default.bool,shouldReturnFocusAfterClose:H.default.bool,preventScroll:H.default.bool,role:H.default.string,contentLabel:H.default.string,aria:H.default.object,data:H.default.object,children:H.default.node,shouldCloseOnEsc:H.default.bool,overlayRef:H.default.func,contentRef:H.default.func,id:H.default.string,overlayElement:H.default.func,contentElement:H.default.func,testId:H.default.string};$o.default=Xa;np.exports=$o.default});var up={};As(up,{polyfill:()=>Hg});function ip(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function ap(e){function t(r){var n=this.constructor.getDerivedStateFromProps(e,r);return n??null}this.setState(t.bind(this))}function sp(e,t){try{var r=this.props,n=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(r,n)}finally{this.props=r,this.state=n}}function Hg(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var r=null,n=null,o=null;if(typeof t.componentWillMount=="function"?r="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(r="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?n="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(n="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),r!==null||n!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+i+" uses "+a+" but also contains the following legacy lifecycles:"+(r!==null?` `+r:"")+(n!==null?` @@ -7,32 +7,32 @@ `+o:"")+` The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=np,t.componentWillReceiveProps=op),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=ip;var s=t.componentDidUpdate;t.componentDidUpdate=function(c,l,p){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:p;s.call(this,c,l,f)}}return e}var sp=Ld(()=>{np.__suppressDeprecationWarning=!0;op.__suppressDeprecationWarning=!0;ip.__suppressDeprecationWarning=!0});var hp=A(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.bodyOpenClassName=ir.portalClassName=void 0;var up=Object.assign||function(e){for(var t=1;t{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});var Yg=hp(),Xg=Kg(Yg);function Kg(e){return e&&e.__esModule?e:{default:e}}Yo.default=Xg.default;vp.exports=Yo.default});var Od=A((KA,xd)=>{xd.exports=TheliaBlocks});var db={};Ss(db,{UploadImage:()=>Ts,default:()=>pb});var qt=$(J());var eu=$(Js(),1),{__extends:Le,__assign:C,__rest:Er,__decorate:gb,__param:yb,__metadata:bb,__awaiter:zt,__generator:Yt,__exportStar:Eb,__createBinding:_b,__values:xb,__read:hi,__spread:Ob,__spreadArrays:Cb,__spreadArray:Ie,__await:Tb,__asyncGenerator:wb,__asyncDelegator:Sb,__asyncValues:Ab,__makeTemplateObject:Ib,__importStar:Rb,__importDefault:Pb,__classPrivateFieldGet:Lb,__classPrivateFieldSet:Nb,__classPrivateFieldIn:Db}=eu.default;var vo=$(J());var al=$(J());var ho=$(J()),Lm=$(fu());var po=$(J());function Yr(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}var W;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(W||(W={}));var ne;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(ne||(ne={}));var Xt;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xt||(Xt={}));function _i(e){return e.type===ne.literal}function pu(e){return e.type===ne.argument}function eo(e){return e.type===ne.number}function to(e){return e.type===ne.date}function ro(e){return e.type===ne.time}function no(e){return e.type===ne.select}function oo(e){return e.type===ne.plural}function du(e){return e.type===ne.pound}function io(e){return e.type===ne.tag}function ao(e){return!!(e&&typeof e=="object"&&e.type===Xt.number)}function Xr(e){return!!(e&&typeof e=="object"&&e.type===Xt.dateTime)}var xi=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var Vd=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function mu(e){var t={};return e.replace(Vd,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"short":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var hu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function bu(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(hu).filter(function(f){return f.length>0}),r=[],n=0,o=t;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Qd,function(u,c,l,p,f,m){if(c)t.minimumIntegerDigits=l.length;else{if(p&&f)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(_u.test(o.stem)){t.minimumIntegerDigits=o.stem.length;continue}if(vu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(vu,function(u,c,l,p,f,m){return l==="*"?t.minimumFractionDigits=c.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:f&&m?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+m.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});var i=o.options[0];i==="w"?t=C(C({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=C(C({},t),gu(i)));continue}if(Eu.test(o.stem)){t=C(C({},t),gu(o.stem));continue}var a=xu(o.stem);a&&(t=C(C({},t),a));var s=zd(o.stem);s&&(t=C(C({},t),s))}return t}var Kr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Cu(e,t){for(var r="",n=0;n>1),u="a",c=Yd(t);for((c=="H"||c=="k")&&(s=0);s-- >0;)r+=u;for(;a-- >0;)r=c+r}else o==="J"?r+="H":r+=o}return r}function Yd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var o=Kr[n||""]||Kr[r||""]||Kr["".concat(r,"-001")]||Kr["001"];return o[0]}var Oi,Xd=new RegExp("^".concat(xi.source,"*")),Kd=new RegExp("".concat(xi.source,"*$"));function X(e,t){return{start:e,end:t}}var Zd=!!String.prototype.startsWith,Jd=!!String.fromCodePoint,em=!!Object.fromEntries,tm=!!String.prototype.codePointAt,rm=!!String.prototype.trimStart,nm=!!String.prototype.trimEnd,om=!!Number.isSafeInteger,im=om?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ti=!0;try{Tu=Iu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ti=((Oi=Tu.exec("a"))===null||Oi===void 0?void 0:Oi[0])==="a"}catch{Ti=!1}var Tu,wu=Zd?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},wi=Jd?String.fromCodePoint:function(){for(var t=[],r=0;ri;){if(a=t[i++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},Su=em?Object.fromEntries:function(t){for(var r={},n=0,o=t;n=n)){var o=t.charCodeAt(r),i;return o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?o:(o-55296<<10)+(i-56320)+65536}},am=rm?function(t){return t.trimStart()}:function(t){return t.replace(Xd,"")},sm=nm?function(t){return t.trimEnd()}:function(t){return t.replace(Kd,"")};function Iu(e,t){return new RegExp(e,t)}var Si;Ti?(Ci=Iu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Si=function(t,r){var n;Ci.lastIndex=r;var o=Ci.exec(t);return(n=o[1])!==null&&n!==void 0?n:""}):Si=function(t,r){for(var n=[];;){var o=Au(t,r);if(o===void 0||Pu(o)||cm(o))break;n.push(o),r+=o>=65536?2:1}return wi.apply(void 0,n)};var Ci,Ru=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var o=[];!this.isEOF();){var i=this.char();if(i===123){var a=this.parseArgument(t,n);if(a.err)return a;o.push(a.val)}else{if(i===125&&t>0)break;if(i===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),o.push({type:ne.pound,location:X(s,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(W.UNMATCHED_CLOSING_TAG,X(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ai(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;o.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;o.push(a.val)}}}return{val:o,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ne.literal,value:"<".concat(o,"/>"),location:X(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,r,!0);if(i.err)return i;var a=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:ne.tag,value:o,children:a,location:X(n,this.clonePosition())},err:null}:this.error(W.INVALID_TAG,X(s,this.clonePosition())))}else return this.error(W.UNCLOSED_TAG,X(n,this.clonePosition()))}else return this.error(W.INVALID_TAG,X(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&lm(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),o="";;){var i=this.tryParseQuote(r);if(i){o+=i;continue}var a=this.tryParseUnquoted(t,r);if(a){o+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){o+=s;continue}break}var u=X(n,this.clonePosition());return{val:{type:ne.literal,value:o,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!um(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return wi.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),wi(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(W.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(W.EMPTY_ARGUMENT,X(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(W.MALFORMED_ARGUMENT,X(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(W.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ne.argument,value:o,location:X(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(W.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition())):this.parseArgumentOptions(t,r,o,n);default:return this.error(W.MALFORMED_ARGUMENT,X(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Si(this.message,r),o=r+n.length;this.bumpTo(o);var i=this.clonePosition(),a=X(t,i);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(s){case"":return this.error(W.EXPECT_ARGUMENT_TYPE,X(a,u));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=sm(p.val);if(f.length===0)return this.error(W.EXPECT_ARGUMENT_STYLE,X(this.clonePosition(),this.clonePosition()));var m=X(l,this.clonePosition());c={style:f,styleLocation:m}}var g=this.tryParseArgumentClose(o);if(g.err)return g;var v=X(o,this.clonePosition());if(c&&wu(c?.style,"::",0)){var b=am(c.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(b,c.styleLocation);return p.err?p:{val:{type:ne.number,value:n,location:v,style:p.val},err:null}}else{if(b.length===0)return this.error(W.EXPECT_DATE_TIME_SKELETON,v);var E=b;this.locale&&(E=Cu(b,this.locale));var f={type:Xt.dateTime,pattern:E,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?mu(E):{}},x=s==="date"?ne.date:ne.time;return{val:{type:x,value:n,location:v,style:f},err:null}}}return{val:{type:s==="number"?ne.number:s==="date"?ne.date:ne.time,value:n,location:v,style:(i=c?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var _=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(W.EXPECT_SELECT_ARGUMENT_OPTIONS,X(_,C({},_)));this.bumpSpace();var d=this.parseIdentifierIfPossible(),w=0;if(s!=="select"&&d.value==="offset"){if(!this.bumpIf(":"))return this.error(W.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,X(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(W.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,W.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),d=this.parseIdentifierIfPossible(),w=p.val}var y=this.tryParsePluralOrSelectOptions(t,s,r,d);if(y.err)return y;var g=this.tryParseArgumentClose(o);if(g.err)return g;var P=X(o,this.clonePosition());return s==="select"?{val:{type:ne.select,value:n,options:Su(y.val),location:P},err:null}:{val:{type:ne.plural,value:n,options:Su(y.val),offset:w,pluralType:s==="plural"?"cardinal":"ordinal",location:P},err:null}}default:return this.error(W.INVALID_ARGUMENT_TYPE,X(a,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(W.EXPECT_ARGUMENT_CLOSING_BRACE,X(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(W.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,X(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=bu(t)}catch{return this.error(W.INVALID_NUMBER_SKELETON,r)}return{val:{type:Xt.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Ou(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,o){for(var i,a=!1,s=[],u=new Set,c=o.value,l=o.location;;){if(c.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(W.EXPECT_PLURAL_ARGUMENT_SELECTOR,W.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;l=X(p,this.clonePosition()),c=this.message.slice(p.offset,this.offset())}else break}if(u.has(c))return this.error(r==="select"?W.DUPLICATE_SELECT_ARGUMENT_SELECTOR:W.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);c==="other"&&(a=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?W.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:W.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,X(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(t+1,r,n);if(g.err)return g;var v=this.tryParseArgumentClose(m);if(v.err)return v;s.push([c,{value:g.val,location:X(m,this.clonePosition())}]),u.add(c),this.bumpSpace(),i=this.parseIdentifierIfPossible(),c=i.value,l=i.location}return s.length===0?this.error(r==="select"?W.EXPECT_SELECT_ARGUMENT_SELECTOR:W.EXPECT_PLURAL_ARGUMENT_SELECTOR,X(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(W.MISSING_OTHER_CLAUSE,X(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)i=!0,a=a*10+(s-48),this.bump();else break}var u=X(o,this.clonePosition());return i?(a*=n,im(a)?{val:a,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=Au(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(wu(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Pu(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Ai(e){return e>=97&&e<=122||e>=65&&e<=90}function um(e){return Ai(e)||e===47}function lm(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Pu(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function cm(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Ii(e){e.forEach(function(t){if(delete t.location,no(t)||oo(t))for(var r in t.options)delete t.options[r].location,Ii(t.options[r].value);else eo(t)&&ao(t.style)||(to(t)||ro(t))&&Xr(t.style)?delete t.style.location:io(t)&&Ii(t.children)})}function Lu(e,t){t===void 0&&(t={}),t=C({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Ru(e,t).parse();if(r.err){var n=SyntaxError(W[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Ii(r.val),r.val}function Ge(e,t){var r=t&&t.cache?t.cache:vm,n=t&&t.serializer?t.serializer:hm,o=t&&t.strategy?t.strategy:pm;return o(e,{cache:r,serializer:n})}function fm(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Nu(e,t,r,n){var o=fm(n)?n:r(n),i=t.get(o);return typeof i>"u"&&(i=e.call(this,n),t.set(o,i)),i}function Du(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,n),t.set(o,i)),i}function Ri(e,t,r,n,o){return r.bind(t,e,n,o)}function pm(e,t){var r=e.length===1?Nu:Du;return Ri(e,this,r,t.cache.create(),t.serializer)}function dm(e,t){return Ri(e,this,Du,t.cache.create(),t.serializer)}function mm(e,t){return Ri(e,this,Nu,t.cache.create(),t.serializer)}var hm=function(){return JSON.stringify(arguments)};function Pi(){this.cache=Object.create(null)}Pi.prototype.get=function(e){return this.cache[e]};Pi.prototype.set=function(e,t){this.cache[e]=t};var vm={create:function(){return new Pi}},Ke={variadic:dm,monadic:mm};var Ne;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Ne||(Ne={}));var We=function(e){Le(t,e);function t(r,n,o){var i=e.call(this,r)||this;return i.code=n,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Li=function(e){Le(t,e);function t(r,n,o,i){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(o).join('", "'),'"'),Ne.INVALID_VALUE,i)||this}return t}(We);var Mu=function(e){Le(t,e);function t(r,n,o){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Ne.INVALID_VALUE,o)||this}return t}(We);var Fu=function(e){Le(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Ne.MISSING_VALUE,n)||this}return t}(We);var Re;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Re||(Re={}));function gm(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==Re.literal||r.type!==Re.literal?t.push(r):n.value+=r.value,t},[])}function Ni(e){return typeof e=="function"}function Zr(e,t,r,n,o,i,a){if(e.length===1&&_i(e[0]))return[{type:Re.literal,value:e[0].value}];for(var s=[],u=0,c=e;u{ip.__suppressDeprecationWarning=!0;ap.__suppressDeprecationWarning=!0;sp.__suppressDeprecationWarning=!0});var gp=A(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.bodyOpenClassName=ir.portalClassName=void 0;var cp=Object.assign||function(e){for(var t=1;t{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});var Kg=gp(),Zg=Jg(Kg);function Jg(e){return e&&e.__esModule?e:{default:e}}Xo.default=Zg.default;yp.exports=Xo.default});var hb={};As(hb,{UploadImage:()=>ws,default:()=>mb});var Cd=W(jn()),_t=W(J());var ru=W(tu(),1),{__extends:Le,__assign:C,__rest:Er,__decorate:Eb,__param:_b,__metadata:xb,__awaiter:zt,__generator:Yt,__exportStar:Ob,__createBinding:Cb,__values:Tb,__read:vi,__spread:wb,__spreadArrays:Sb,__spreadArray:Ie,__await:Ab,__asyncGenerator:Ib,__asyncDelegator:Rb,__asyncValues:Pb,__makeTemplateObject:Lb,__importStar:Nb,__importDefault:Db,__classPrivateFieldGet:Mb,__classPrivateFieldSet:Fb,__classPrivateFieldIn:Bb}=ru.default;var go=W(J());var ul=W(J());var vo=W(J()),Dm=W(du());var mo=W(J());function Yr(e,t,r){if(r===void 0&&(r=Error),!e)throw new r(t)}var V;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(V||(V={}));var ne;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(ne||(ne={}));var Xt;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Xt||(Xt={}));function xi(e){return e.type===ne.literal}function mu(e){return e.type===ne.argument}function to(e){return e.type===ne.number}function ro(e){return e.type===ne.date}function no(e){return e.type===ne.time}function oo(e){return e.type===ne.select}function io(e){return e.type===ne.plural}function hu(e){return e.type===ne.pound}function ao(e){return e.type===ne.tag}function so(e){return!!(e&&typeof e=="object"&&e.type===Xt.number)}function Xr(e){return!!(e&&typeof e=="object"&&e.type===Xt.dateTime)}var Oi=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var Qd=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function vu(e){var t={};return e.replace(Qd,function(r){var n=r.length;switch(r[0]){case"G":t.era=n===4?"long":n===5?"narrow":"short";break;case"y":t.year=n===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=n===4?"short":n===5?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var gu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function _u(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(gu).filter(function(f){return f.length>0}),r=[],n=0,o=t;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Yd,function(u,c,l,p,f,m){if(c)t.minimumIntegerDigits=l.length;else{if(p&&f)throw new Error("We currently do not support maximum integer digits");if(m)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ou.test(o.stem)){t.minimumIntegerDigits=o.stem.length;continue}if(yu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(yu,function(u,c,l,p,f,m){return l==="*"?t.minimumFractionDigits=c.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:f&&m?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+m.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""});var i=o.options[0];i==="w"?t=C(C({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=C(C({},t),bu(i)));continue}if(xu.test(o.stem)){t=C(C({},t),bu(o.stem));continue}var a=Cu(o.stem);a&&(t=C(C({},t),a));var s=Xd(o.stem);s&&(t=C(C({},t),s))}return t}var Kr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function wu(e,t){for(var r="",n=0;n>1),u="a",c=Kd(t);for((c=="H"||c=="k")&&(s=0);s-- >0;)r+=u;for(;a-- >0;)r=c+r}else o==="J"?r+="H":r+=o}return r}function Kd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var o=Kr[n||""]||Kr[r||""]||Kr["".concat(r,"-001")]||Kr["001"];return o[0]}var Ci,Zd=new RegExp("^".concat(Oi.source,"*")),Jd=new RegExp("".concat(Oi.source,"*$"));function X(e,t){return{start:e,end:t}}var em=!!String.prototype.startsWith,tm=!!String.fromCodePoint,rm=!!Object.fromEntries,nm=!!String.prototype.codePointAt,om=!!String.prototype.trimStart,im=!!String.prototype.trimEnd,am=!!Number.isSafeInteger,sm=am?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},wi=!0;try{Su=Pu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),wi=((Ci=Su.exec("a"))===null||Ci===void 0?void 0:Ci[0])==="a"}catch{wi=!1}var Su,Au=em?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Si=tm?String.fromCodePoint:function(){for(var t=[],r=0;ri;){if(a=t[i++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},Iu=rm?Object.fromEntries:function(t){for(var r={},n=0,o=t;n=n)){var o=t.charCodeAt(r),i;return o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?o:(o-55296<<10)+(i-56320)+65536}},um=om?function(t){return t.trimStart()}:function(t){return t.replace(Zd,"")},lm=im?function(t){return t.trimEnd()}:function(t){return t.replace(Jd,"")};function Pu(e,t){return new RegExp(e,t)}var Ai;wi?(Ti=Pu("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ai=function(t,r){var n;Ti.lastIndex=r;var o=Ti.exec(t);return(n=o[1])!==null&&n!==void 0?n:""}):Ai=function(t,r){for(var n=[];;){var o=Ru(t,r);if(o===void 0||Nu(o)||pm(o))break;n.push(o),r+=o>=65536?2:1}return Si.apply(void 0,n)};var Ti,Lu=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var o=[];!this.isEOF();){var i=this.char();if(i===123){var a=this.parseArgument(t,n);if(a.err)return a;o.push(a.val)}else{if(i===125&&t>0)break;if(i===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),o.push({type:ne.pound,location:X(s,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(V.UNMATCHED_CLOSING_TAG,X(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ii(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;o.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;o.push(a.val)}}}return{val:o,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ne.literal,value:"<".concat(o,"/>"),location:X(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,r,!0);if(i.err)return i;var a=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:ne.tag,value:o,children:a,location:X(n,this.clonePosition())},err:null}:this.error(V.INVALID_TAG,X(s,this.clonePosition())))}else return this.error(V.UNCLOSED_TAG,X(n,this.clonePosition()))}else return this.error(V.INVALID_TAG,X(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&fm(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),o="";;){var i=this.tryParseQuote(r);if(i){o+=i;continue}var a=this.tryParseUnquoted(t,r);if(a){o+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){o+=s;continue}break}var u=X(n,this.clonePosition());return{val:{type:ne.literal,value:o,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!cm(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Si.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Si(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(V.EMPTY_ARGUMENT,X(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(V.MALFORMED_ARGUMENT,X(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ne.argument,value:o,location:X(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(n,this.clonePosition())):this.parseArgumentOptions(t,r,o,n);default:return this.error(V.MALFORMED_ARGUMENT,X(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Ai(this.message,r),o=r+n.length;this.bumpTo(o);var i=this.clonePosition(),a=X(t,i);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,u=this.clonePosition();switch(s){case"":return this.error(V.EXPECT_ARGUMENT_TYPE,X(a,u));case"number":case"date":case"time":{this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=lm(p.val);if(f.length===0)return this.error(V.EXPECT_ARGUMENT_STYLE,X(this.clonePosition(),this.clonePosition()));var m=X(l,this.clonePosition());c={style:f,styleLocation:m}}var g=this.tryParseArgumentClose(o);if(g.err)return g;var v=X(o,this.clonePosition());if(c&&Au(c?.style,"::",0)){var b=um(c.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(b,c.styleLocation);return p.err?p:{val:{type:ne.number,value:n,location:v,style:p.val},err:null}}else{if(b.length===0)return this.error(V.EXPECT_DATE_TIME_SKELETON,v);var E=b;this.locale&&(E=wu(b,this.locale));var f={type:Xt.dateTime,pattern:E,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?vu(E):{}},x=s==="date"?ne.date:ne.time;return{val:{type:x,value:n,location:v,style:f},err:null}}}return{val:{type:s==="number"?ne.number:s==="date"?ne.date:ne.time,value:n,location:v,style:(i=c?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var _=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(V.EXPECT_SELECT_ARGUMENT_OPTIONS,X(_,C({},_)));this.bumpSpace();var d=this.parseIdentifierIfPossible(),w=0;if(s!=="select"&&d.value==="offset"){if(!this.bumpIf(":"))return this.error(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,X(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,V.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),d=this.parseIdentifierIfPossible(),w=p.val}var y=this.tryParsePluralOrSelectOptions(t,s,r,d);if(y.err)return y;var g=this.tryParseArgumentClose(o);if(g.err)return g;var P=X(o,this.clonePosition());return s==="select"?{val:{type:ne.select,value:n,options:Iu(y.val),location:P},err:null}:{val:{type:ne.plural,value:n,options:Iu(y.val),offset:w,pluralType:s==="plural"?"cardinal":"ordinal",location:P},err:null}}default:return this.error(V.INVALID_ARGUMENT_TYPE,X(a,u))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(V.EXPECT_ARGUMENT_CLOSING_BRACE,X(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(V.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,X(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=_u(t)}catch{return this.error(V.INVALID_NUMBER_SKELETON,r)}return{val:{type:Xt.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?Tu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,o){for(var i,a=!1,s=[],u=new Set,c=o.value,l=o.location;;){if(c.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(V.EXPECT_PLURAL_ARGUMENT_SELECTOR,V.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;l=X(p,this.clonePosition()),c=this.message.slice(p.offset,this.offset())}else break}if(u.has(c))return this.error(r==="select"?V.DUPLICATE_SELECT_ARGUMENT_SELECTOR:V.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);c==="other"&&(a=!0),this.bumpSpace();var m=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:V.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,X(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(t+1,r,n);if(g.err)return g;var v=this.tryParseArgumentClose(m);if(v.err)return v;s.push([c,{value:g.val,location:X(m,this.clonePosition())}]),u.add(c),this.bumpSpace(),i=this.parseIdentifierIfPossible(),c=i.value,l=i.location}return s.length===0?this.error(r==="select"?V.EXPECT_SELECT_ARGUMENT_SELECTOR:V.EXPECT_PLURAL_ARGUMENT_SELECTOR,X(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(V.MISSING_OTHER_CLAUSE,X(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)i=!0,a=a*10+(s-48),this.bump();else break}var u=X(o,this.clonePosition());return i?(a*=n,sm(a)?{val:a,err:null}:this.error(r,u)):this.error(t,u)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=Ru(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(Au(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Nu(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Ii(e){return e>=97&&e<=122||e>=65&&e<=90}function cm(e){return Ii(e)||e===47}function fm(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Nu(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function pm(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Ri(e){e.forEach(function(t){if(delete t.location,oo(t)||io(t))for(var r in t.options)delete t.options[r].location,Ri(t.options[r].value);else to(t)&&so(t.style)||(ro(t)||no(t))&&Xr(t.style)?delete t.style.location:ao(t)&&Ri(t.children)})}function Du(e,t){t===void 0&&(t={}),t=C({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new Lu(e,t).parse();if(r.err){var n=SyntaxError(V[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Ri(r.val),r.val}function Ge(e,t){var r=t&&t.cache?t.cache:ym,n=t&&t.serializer?t.serializer:gm,o=t&&t.strategy?t.strategy:mm;return o(e,{cache:r,serializer:n})}function dm(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Mu(e,t,r,n){var o=dm(n)?n:r(n),i=t.get(o);return typeof i>"u"&&(i=e.call(this,n),t.set(o,i)),i}function Fu(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,n),t.set(o,i)),i}function Pi(e,t,r,n,o){return r.bind(t,e,n,o)}function mm(e,t){var r=e.length===1?Mu:Fu;return Pi(e,this,r,t.cache.create(),t.serializer)}function hm(e,t){return Pi(e,this,Fu,t.cache.create(),t.serializer)}function vm(e,t){return Pi(e,this,Mu,t.cache.create(),t.serializer)}var gm=function(){return JSON.stringify(arguments)};function Li(){this.cache=Object.create(null)}Li.prototype.get=function(e){return this.cache[e]};Li.prototype.set=function(e,t){this.cache[e]=t};var ym={create:function(){return new Li}},Ke={variadic:hm,monadic:vm};var Ne;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Ne||(Ne={}));var We=function(e){Le(t,e);function t(r,n,o){var i=e.call(this,r)||this;return i.code=n,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Ni=function(e){Le(t,e);function t(r,n,o,i){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(o).join('", "'),'"'),Ne.INVALID_VALUE,i)||this}return t}(We);var Bu=function(e){Le(t,e);function t(r,n,o){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),Ne.INVALID_VALUE,o)||this}return t}(We);var Hu=function(e){Le(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),Ne.MISSING_VALUE,n)||this}return t}(We);var Re;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Re||(Re={}));function bm(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==Re.literal||r.type!==Re.literal?t.push(r):n.value+=r.value,t},[])}function Di(e){return typeof e=="function"}function Zr(e,t,r,n,o,i,a){if(e.length===1&&xi(e[0]))return[{type:Re.literal,value:e[0].value}];for(var s=[],u=0,c=e;u"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Lu,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var de;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(de||(de={}));var _e=function(e){Le(t,e);function t(r,n,o){var i=this,a=o?o instanceof Error?o:new Error(String(o)):void 0;return i=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,` +`,Ne.MISSING_INTL_API,a);var d=r.getPluralRules(t,{type:l.pluralType}).select(f-(l.offset||0));_=l.options[d]||l.options.other}if(!_)throw new Ni(l.value,f,Object.keys(l.options),a);s.push.apply(s,Zr(_.value,t,r,n,o,f-(l.offset||0)));continue}}return bm(s)}function Em(e,t){return t?C(C(C({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=C(C({},e[n]),t[n]||{}),r},{})):e}function _m(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=Em(e[n],t[n]),r},C({},e)):e}function Mi(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function xm(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ge(function(){for(var t,r=[],n=0;n"u")){var r=Intl.NumberFormat.supportedLocalesOf(t);return r.length>0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Du,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var de;(function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"})(de||(de={}));var _e=function(e){Le(t,e);function t(r,n,o){var i=this,a=o?o instanceof Error?o:new Error(String(o)):void 0;return i=e.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,` `).concat(a?` `.concat(a.message,` -`).concat(a.stack):""))||this,i.code=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(i,t),i}return t}(Error);var Bu=function(e){Le(t,e);function t(r,n){return e.call(this,de.UNSUPPORTED_FORMATTER,r,n)||this}return t}(_e);var Hu=function(e){Le(t,e);function t(r,n){return e.call(this,de.INVALID_CONFIG,r,n)||this}return t}(_e);var Mi=function(e){Le(t,e);function t(r,n){return e.call(this,de.MISSING_DATA,r,n)||this}return t}(_e);var Jr=function(e){Le(t,e);function t(r,n,o){return e.call(this,de.FORMAT_ERROR,"".concat(r,` +`).concat(a.stack):""))||this,i.code=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(i,t),i}return t}(Error);var ku=function(e){Le(t,e);function t(r,n){return e.call(this,de.UNSUPPORTED_FORMATTER,r,n)||this}return t}(_e);var Uu=function(e){Le(t,e);function t(r,n){return e.call(this,de.INVALID_CONFIG,r,n)||this}return t}(_e);var Fi=function(e){Le(t,e);function t(r,n){return e.call(this,de.MISSING_DATA,r,n)||this}return t}(_e);var Jr=function(e){Le(t,e);function t(r,n,o){return e.call(this,de.FORMAT_ERROR,"".concat(r,` Locale: `).concat(n,` -`),o)||this}return t}(_e);var uo=function(e){Le(t,e);function t(r,n,o,i){var a=e.call(this,"".concat(r,` +`),o)||this}return t}(_e);var lo=function(e){Le(t,e);function t(r,n,o,i){var a=e.call(this,"".concat(r,` MessageID: `).concat(o?.id,` Default Message: `).concat(o?.defaultMessage,` Description: `).concat(o?.description,` -`),n,i)||this;return a.descriptor=o,a}return t}(Jr);var ku=function(e){Le(t,e);function t(r,n){var o=e.call(this,de.MISSING_TRANSLATION,'Missing message: "'.concat(r.id,'" for locale "').concat(n,'", using ').concat(r.defaultMessage?"default message (".concat(typeof r.defaultMessage=="string"?r.defaultMessage:r.defaultMessage.map(function(i){var a;return(a=i.value)!==null&&a!==void 0?a:JSON.stringify(i)}).join(),")"):"id"," as fallback."))||this;return o.descriptor=r,o}return t}(_e);function ke(e,t,r){return r===void 0&&(r={}),t.reduce(function(n,o){return o in e?n[o]=e[o]:o in r&&(n[o]=r[o]),n},{})}var _m=function(e){},xm=function(e){},en={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:_m,onWarn:xm};function lo(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function Kt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function Fi(e){e===void 0&&(e=lo());var t=Intl.RelativeTimeFormat,r=Intl.ListFormat,n=Intl.DisplayNames,o=Ge(function(){for(var s,u=[],c=0;c needs to exist in the component ancestry.")}var ki=C(C({},en),{textComponent:po.Fragment});function rl(e){return function(t){return e(po.Children.toArray(t))}}function nl(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),o=r.length;if(n.length!==o)return!1;for(var i=0;igo.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},go.createElement("path",{d:"M19.86 15.26V2.47C19.8574 1.814 19.5949 1.18577 19.1301 0.722836C18.6653 0.259906 18.036 -5.33299e-06 17.38 0H2.5C2.16847 0.00126416 1.84048 0.068193 1.53497 0.196922C1.22945 0.32565 0.952464 0.513628 0.72 0.75C0.268046 1.20961 0.0102384 1.82548 1.31138e-09 2.47V17.38C-1.06443e-05 17.7074 0.0647931 18.0315 0.190674 18.3337C0.316554 18.6359 0.50102 18.9102 0.733432 19.1407C0.965844 19.3713 1.2416 19.5535 1.5448 19.677C1.848 19.8004 2.17264 19.8626 2.5 19.86H17.38C18.0369 19.8574 18.6662 19.5952 19.1307 19.1307C19.5952 18.6662 19.8574 18.0369 19.86 17.38V15.38V15.25V15.26ZM15.61 13.04L18.7 15.52L18.79 15.6V17.38C18.7821 17.7478 18.6298 18.0978 18.3659 18.3541C18.1021 18.6105 17.7479 18.7527 17.38 18.75H2.5C2.31454 18.7508 2.13075 18.715 1.95916 18.6446C1.78756 18.5743 1.63153 18.4707 1.5 18.34C1.36742 18.2098 1.26271 18.0541 1.19222 17.8821C1.12174 17.7102 1.08696 17.5258 1.09 17.34V16.47L1.18 16.39L6.25 12.14C6.39167 12.0175 6.5727 11.95 6.76 11.95C6.95222 11.9494 7.13771 12.0208 7.28 12.15L9.8 14.75C10.1157 15.0571 10.5305 15.2414 10.97 15.27C11.4102 15.304 11.8476 15.176 12.2 14.91L14.66 13C14.7961 12.8988 14.9604 12.8428 15.13 12.84C15.2999 12.8407 15.4649 12.8969 15.6 13L15.61 13.04ZM18.78 13.67V14.19L18.38 13.86L16.26 12.18C15.9416 11.9269 15.5468 11.7891 15.14 11.7891C14.7332 11.7891 14.3384 11.9269 14.02 12.18L11.56 13.97C11.4214 14.0831 11.2489 14.1465 11.07 14.15C10.8861 14.1476 10.7091 14.0803 10.57 13.96L8.02 11.44C7.6917 11.1055 7.24813 10.9089 6.77983 10.8904C6.31152 10.8718 5.85377 11.0326 5.5 11.34L1.5 14.75L1.09 15.1V2.47C1.09 2.28531 1.12654 2.10243 1.19752 1.93192C1.2685 1.76141 1.37252 1.60663 1.50358 1.4765C1.63464 1.34636 1.79016 1.24345 1.96117 1.17368C2.13218 1.10392 2.31531 1.06868 2.5 1.07H17.38C17.5658 1.06696 17.7502 1.10174 17.9221 1.17222C18.0941 1.24271 18.2498 1.34742 18.38 1.48C18.5107 1.61153 18.6143 1.76756 18.6846 1.93916C18.755 2.11075 18.7908 2.29454 18.79 2.48L18.78 13.67Z",fill:"#333333"}),go.createElement("path",{d:"M14.0707 4.37993C13.5919 4.18009 13.0647 4.12687 12.5557 4.22701C12.0467 4.32715 11.5788 4.57613 11.2115 4.94241C10.8441 5.30869 10.5938 5.77578 10.4922 6.28449C10.3905 6.7932 10.4422 7.32062 10.6407 7.79993C10.8466 8.2856 11.1953 8.69714 11.6407 8.97992C12.1453 9.31662 12.7511 9.46778 13.3547 9.4076C13.9584 9.34742 14.5224 9.07963 14.9507 8.64992C15.2546 8.34523 15.4788 7.97034 15.6035 7.5584C15.7281 7.14646 15.7494 6.71016 15.6654 6.28805C15.5813 5.86595 15.3946 5.47104 15.1217 5.13824C14.8488 4.80544 14.4981 4.545 14.1007 4.37993H14.0707ZM14.3507 7.65992C14.1855 7.91702 13.9443 8.11626 13.6607 8.22992C13.3763 8.34874 13.0629 8.38007 12.7607 8.31992C12.4597 8.25811 12.1824 8.11251 11.9607 7.89992C11.7994 7.73572 11.6763 7.53809 11.5999 7.32101C11.5235 7.10393 11.4958 6.87271 11.5187 6.64373C11.5416 6.41475 11.6146 6.1936 11.7324 5.99594C11.8502 5.79828 12.0101 5.62895 12.2007 5.49993C12.4548 5.32915 12.7544 5.23857 13.0607 5.23992C13.4736 5.24265 13.8687 5.40791 14.1607 5.69992C14.3062 5.84383 14.4217 6.01513 14.5007 6.20392C14.5796 6.39272 14.6204 6.59528 14.6207 6.79993C14.6216 7.10759 14.5273 7.40801 14.3507 7.65992Z",fill:"#333333"}));var $i=$(J()),fl=e=>$i.createElement("svg",{width:28,height:26,viewBox:"0 0 26 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},$i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 25C19.9036 25 25.5 19.4036 25.5 12.5C25.5 5.59644 19.9036 0 13 0C6.09644 0 0.5 5.59644 0.5 12.5C0.5 19.4036 6.09644 25 13 25ZM17.6328 15.9581L13.5555 19.9162C13.4826 19.9868 13.396 20.0428 13.3006 20.081C13.2053 20.1193 13.1031 20.1389 12.9998 20.1389C12.8966 20.1389 12.7944 20.1191 12.6991 20.0808C12.6038 20.0426 12.5172 19.9865 12.4444 19.9158L8.36709 15.9578C8.22042 15.8153 8.13834 15.6225 8.13889 15.4216C8.13944 15.2207 8.22258 15.0282 8.37002 14.8865C8.51747 14.7449 8.71713 14.6656 8.92509 14.6661C9.13305 14.6666 9.33228 14.7469 9.47894 14.8894L12.2162 17.5465V5.61856C12.2162 5.41767 12.2988 5.22501 12.4459 5.08296C12.5929 4.94091 12.7924 4.86111 13.0003 4.86111C13.2083 4.86111 13.4077 4.94091 13.5548 5.08296C13.7018 5.22501 13.7844 5.41767 13.7844 5.61856L13.7844 17.5465L16.5209 14.8894C16.5936 14.8189 16.6799 14.7628 16.7749 14.7245C16.87 14.6862 16.9719 14.6664 17.0749 14.6662C17.1779 14.6659 17.2799 14.6853 17.3752 14.7231C17.4704 14.761 17.557 14.8166 17.63 14.8867C17.703 14.9569 17.761 15.0403 17.8007 15.1321C17.8403 15.2239 17.8609 15.3224 17.8611 15.4219C17.8614 15.5214 17.8413 15.6199 17.8022 15.7119C17.763 15.804 17.7054 15.8876 17.6328 15.9581Z",fill:"#222222"}));var tn=$(J()),pl=e=>tn.createElement("svg",{width:28,height:26,viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},tn.createElement("path",{d:"M7.25281 20.4814C5.42678 20.4814 3.80262 19.3023 3.21296 17.5469L3.17304 17.4146C3.03389 16.9499 2.97572 16.5588 2.97572 16.1677V8.32471L0.20873 17.6401C-0.147124 19.0102 0.663812 20.4308 2.0245 20.8093L19.6609 25.5728C19.8811 25.6303 20.1012 25.6579 20.3179 25.6579C21.4539 25.6579 22.4918 24.8976 22.7826 23.7771L23.8103 20.4814H7.25281Z",fill:"#222222"}),tn.createElement("path",{d:"M10.3885 8.40309C11.6466 8.40309 12.6696 7.37124 12.6696 6.10242C12.6696 4.83361 11.6466 3.80176 10.3885 3.80176C9.1305 3.80176 8.10742 4.83361 8.10742 6.10242C8.10742 7.37124 9.1305 8.40309 10.3885 8.40309Z",fill:"#222222"}),tn.createElement("path",{d:"M24.6453 0.350098H7.53694C5.96525 0.350098 4.68555 1.64077 4.68555 3.22593V15.8796C4.68555 17.4648 5.96525 18.7554 7.53694 18.7554H24.6453C26.217 18.7554 27.4967 17.4648 27.4967 15.8796V3.22593C27.4967 1.64077 26.217 0.350098 24.6453 0.350098ZM7.53694 2.65076H24.6453C24.9601 2.65076 25.2156 2.90844 25.2156 3.22593V11.3921L21.6126 7.15202C21.2305 6.69994 20.6773 6.45837 20.0831 6.44456C19.4923 6.44801 18.938 6.71259 18.5593 7.17042L14.3233 12.2986L12.9432 10.9102C12.163 10.1233 10.8936 10.1233 10.1146 10.9102L6.96666 14.0839V3.22593C6.96666 2.90844 7.22215 2.65076 7.53694 2.65076Z",fill:"#222222"}));var Mm=()=>document.documentElement.lang||navigator.languages&&navigator.languages[0]||navigator.language||"en",Nt=Mm(),rn={fr:{BlockImage__DOWNLOAD:"T\xE9l\xE9charger une image",BlockImage__OR_DROP:"ou glisser-d\xE9poser une image",BlockImage__SELECT_BUTTON:"S\xE9lectionner une image",BlockImage__SELECT:"depuis votre m\xE9diath\xE8que",BlockImage__TITLE:"Titre de l'image",BlockImage__LINK:"Lien de l'image",BlockImage__LINK_PLACEHOLDER:"Lien au clic sur l'image",BlockImage__LIBRARY_MODAL_TITLE:"Rechercher une image",BlockImage__LIBRARY_MODAL_SEARCH:"Rechercher dans la m\xE9diath\xE8que",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrer par tag",BlockImage__LIBRARY_LOADING:"Chargement de la librairie...",BlockImage__TOAST_WRONG_FILE_TYPE:"Votre image n'a pas pu \xEAtre t\xE9l\xE9charg\xE9e. Veuillez v\xE9rifier que votre fichier est bien une image.",BlockImage__TOAST_MAX_FILE:"Veuillez uploader une seule image.",BlockImage__DROP_TO_UPLOAD:"Relacher pour uploader votre image",BlockImage__LIBRARY_NO_CONTENT:"Aucune image trouv\xE9e",BlockImage__LIBRARY_SEARCHING:"Recherche en cours...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configuration des tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Ajouter un ou plusieurs tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"S\xE9lectionnez un ou plusieurs tag",REPLACE:"Remplacer",REPLACE_IMAGE:"Remplacer l'image",OPTIONAL:"Optionnel",CANCEL:"Annuler",DELETE:"Supprimer",SEARCH_BY:"R\xE9f\xE9rence, nom, ...",LOADING:"Chargement...",DOWNLOADING:"T\xE9l\xE9chargement...",ALL_TAGS:"Tous les tags",CHOOSE:"Choisir"},en:{BlockImage__DOWNLOAD:"Download an image",BlockImage__OR_DROP:"or drop an image",BlockImage__SELECT_BUTTON:"Select an image",BlockImage__SELECT:"from your library",BlockImage__TITLE:"Image title",BlockImage__LINK:"Image link",BlockImage__LINK_PLACEHOLDER:"Link on click on image",BlockImage__LIBRARY_MODAL_TITLE:"Search an image",BlockImage__LIBRARY_MODAL_SEARCH:"Search in the library",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filter by tag",BlockImage__LIBRARY_LOADING:"Loading library...",BlockImage__TOAST_WRONG_FILE_TYPE:"Your image could not be uploaded. Please check that your file is an image.",BlockImage__TOAST_MAX_FILE:"Please upload only one image.",BlockImage__DROP_TO_UPLOAD:"Release to upload your image",BlockImage__LIBRARY_NO_CONTENT:"No image found",BlockImage__LIBRARY_SEARCHING:"Searching...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configure tags of",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Add one or more tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Select one or more tag",REPLACE:"Replace",REPLACE_IMAGE:"Replace image",OPTIONAL:"Optional",CANCEL:"Cancel",DELETE:"Delete",SEARCH_BY:"Reference, name, ...",LOADING:"Loading...",DOWNLOADING:"Downloading...",ALL_TAGS:"All tags",CHOOSE:"Choose"},es:{BlockImage__DOWNLOAD:"Descargar una imagen",BlockImage__OR_DROP:"o arrastrar una imagen",BlockImage__SELECT_BUTTON:"Seleccionar una imagen",BlockImage__SELECT:"de tu biblioteca",BlockImage__TITLE:"T\xEDtulo de la imagen",BlockImage__LINK:"Enlace de la imagen",BlockImage__LINK_PLACEHOLDER:"Enlace al hacer clic en la imagen",BlockImage__LIBRARY_MODAL_TITLE:"Buscar una imagen",BlockImage__LIBRARY_MODAL_SEARCH:"Buscar en la biblioteca",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrar por tag",BlockImage__LIBRARY_LOADING:"Cargando la biblioteca...",BlockImage__TOAST_WRONG_FILE_TYPE:"Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.",BlockImage__TOAST_MAX_FILE:"Por favor sube solo una imagen.",BlockImage__DROP_TO_UPLOAD:"Suelte para subir tu imagen",BlockImage__LIBRARY_NO_CONTENT:"No se encontraron imagenes",BlockImage__LIBRARY_SEARCHING:"Buscando...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configurar tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Agregar uno o m\xE1s tags",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleccionar uno o m\xE1s tags",REPLACE:"Reemplazar",REPLACE_IMAGE:"Reemplazar imagen",OPTIONAL:"Opcional",CANCEL:"Cancelar",DELETE:"Eliminar",SEARCH_BY:"Referencia, nombre, ...",LOADING:"Cargando...",DOWNLOADING:"Descargando...",ALL_TAGS:"Todos los tags",CHOOSE:"Elegir"},it:{BlockImage__DOWNLOAD:"Scarica un immagine",BlockImage__OR_DROP:"o trascina un immagine",BlockImage__SELECT_BUTTON:"Seleziona un immagine",BlockImage__SELECT:"dalla tua libreria",BlockImage__TITLE:"Titolo dell immagine",BlockImage__LINK:"Link dell immagine",BlockImage__LINK_PLACEHOLDER:"Link al click sull immagine",BlockImage__LIBRARY_MODAL_TITLE:"Cerca un immagine",BlockImage__LIBRARY_MODAL_SEARCH:"Cerca nella libreria",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtra per tag",BlockImage__LIBRARY_LOADING:"Caricamento della libreria...",BlockImage__TOAST_WRONG_FILE_TYPE:"La tua immagine non pu\xF2 essere caricata. Per favore verifica che il tuo file sia un immagine.",BlockImage__TOAST_MAX_FILE:"Per favore carica solo una immagine.",BlockImage__DROP_TO_UPLOAD:"Rilascia per caricare la tua immagine",BlockImage__LIBRARY_NO_CONTENT:"Nessuna immagine trovata",BlockImage__LIBRARY_SEARCHING:"Ricerca in corso...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configura i tag di",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Aggiungi uno o pi\xF9 tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleziona uno o pi\xF9 tag",REPLACE:"Sostituisci",REPLACE_IMAGE:"Sostituisci immagine",OPTIONAL:"Opzionale",CANCEL:"Annulla",DELETE:"Elimina",SEARCH_BY:"Riferimento, nome, ...",LOADING:"Caricamento...",DOWNLOADING:"Scaricare...",ALL_TAGS:"Tutti i tag",CHOOSE:"Scegli"}};var j=$(J()),re=$(yo());var Hm=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Tr(e,t){var r=km(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function km(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=Hm.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Um=[".DS_Store","Thumbs.db"];function zi(e){return zt(this,void 0,void 0,function(){return Yt(this,function(t){return bo(e)&&jm(e.dataTransfer)?[2,Vm(e.dataTransfer,e.type)]:qm(e)?[2,Gm(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,Wm(e)]:[2,[]]})})}function jm(e){return bo(e)}function qm(e){return bo(e)&&bo(e.target)}function bo(e){return typeof e=="object"&&e!==null}function Gm(e){return Qi(e.target.files).map(function(t){return Tr(t)})}function Wm(e){return zt(this,void 0,void 0,function(){var t;return Yt(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return Tr(n)})]}})})}function Vm(e,t){return zt(this,void 0,void 0,function(){var r,n;return Yt(this,function(o){switch(o.label){case 0:return e.items?(r=Qi(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map($m))]):[3,2];case 1:return n=o.sent(),[2,El(xl(n))];case 2:return[2,El(Qi(e.files).map(function(i){return Tr(i)}))]}})})}function El(e){return e.filter(function(t){return Um.indexOf(t.name)===-1})}function Qi(e){if(e===null)return[];for(var t=[],r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);rr)return[!1,Al(r)];if(e.sizer)return[!1,Al(r)]}return[!0,null]}function Jt(e){return e!=null}function Dl(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(u){var c=Ki(u,r),l=nn(c,1),p=l[0],f=Zi(u,n,o),m=nn(f,1),g=m[0],v=s?s(u):null;return p&&g&&!v})}function on(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function an(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Ji(e){e.preventDefault()}function ah(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function sh(e){return e.indexOf("Edge/")!==-1}function Ml(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return ah(e)||sh(e)}function ot(){for(var e=arguments.length,t=new Array(e),r=0;r1?o-1:0),a=1;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function bh(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var oa=(0,j.forwardRef)(function(e,t){var r=e.children,n=Eo(e,uh),o=ia(n),i=o.open,a=Eo(o,lh);return(0,j.useImperativeHandle)(t,function(){return{open:i}},[i]),j.default.createElement(j.Fragment,null,r(ae(ae({},a),{},{open:i})))});oa.displayName="Dropzone";var $l={disabled:!1,getFilesFromEvent:zi,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};oa.defaultProps=$l;oa.propTypes={children:re.default.func,accept:re.default.objectOf(re.default.arrayOf(re.default.string)),multiple:re.default.bool,preventDropOnDocument:re.default.bool,noClick:re.default.bool,noKeyboard:re.default.bool,noDrag:re.default.bool,noDragEventsBubbling:re.default.bool,minSize:re.default.number,maxSize:re.default.number,maxFiles:re.default.number,disabled:re.default.bool,getFilesFromEvent:re.default.func,onFileDialogCancel:re.default.func,onFileDialogOpen:re.default.func,useFsAccessApi:re.default.bool,autoFocus:re.default.bool,onDragEnter:re.default.func,onDragLeave:re.default.func,onDragOver:re.default.func,onDrop:re.default.func,onDropAccepted:re.default.func,onDropRejected:re.default.func,onError:re.default.func,validator:re.default.func};var na={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function ia(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ae(ae({},$l),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,c=t.onDragEnter,l=t.onDragLeave,p=t.onDragOver,f=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,b=t.onFileDialogOpen,E=t.useFsAccessApi,x=t.autoFocus,_=t.preventDropOnDocument,d=t.noClick,w=t.noKeyboard,y=t.noDrag,P=t.noDragEventsBubbling,z=t.onError,Z=t.validator,F=(0,j.useMemo)(function(){return Hl(r)},[r]),L=(0,j.useMemo)(function(){return Bl(r)},[r]),M=(0,j.useMemo)(function(){return typeof b=="function"?b:Wl},[b]),k=(0,j.useMemo)(function(){return typeof v=="function"?v:Wl},[v]),U=(0,j.useRef)(null),Y=(0,j.useRef)(null),B=(0,j.useReducer)(Eh,na),R=ea(B,2),V=R[0],q=R[1],ie=V.isFocused,ce=V.isFileDialogActive,te=(0,j.useRef)(typeof window<"u"&&window.isSecureContext&&E&&Fl()),pt=function(){!te.current&&ce&&setTimeout(function(){if(Y.current){var S=Y.current.files;S.length||(q({type:"closeDialog"}),k())}},300)};(0,j.useEffect)(function(){return window.addEventListener("focus",pt,!1),function(){window.removeEventListener("focus",pt,!1)}},[Y,ce,k,te]);var Ae=(0,j.useRef)([]),Be=function(S){U.current&&U.current.contains(S.target)||(S.preventDefault(),Ae.current=[])};(0,j.useEffect)(function(){return _&&(document.addEventListener("dragover",Ji,!1),document.addEventListener("drop",Be,!1)),function(){_&&(document.removeEventListener("dragover",Ji),document.removeEventListener("drop",Be))}},[U,_]),(0,j.useEffect)(function(){return!n&&x&&U.current&&U.current.focus(),function(){}},[U,x,n]);var Ce=(0,j.useCallback)(function(O){z?z(O):console.error(O)},[z]),_t=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[].concat(ph(Ae.current),[O.target]),an(O)&&Promise.resolve(o(O)).then(function(S){if(!(on(O)&&!P)){var oe=S.length,ue=oe>0&&Dl({files:S,accept:F,minSize:a,maxSize:i,multiple:s,maxFiles:u,validator:Z}),be=oe>0&&!ue;q({isDragAccept:ue,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),c&&c(O)}}).catch(function(S){return Ce(S)})},[o,c,Ce,P,F,a,i,s,u,Z]),ze=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var S=an(O);if(S&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return S&&p&&p(O),!1},[p,P]),xt=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var S=Ae.current.filter(function(ue){return U.current&&U.current.contains(ue)}),oe=S.indexOf(O.target);oe!==-1&&S.splice(oe,1),Ae.current=S,!(S.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),an(O)&&l&&l(O))},[U,l,P]),je=(0,j.useCallback)(function(O,S){var oe=[],ue=[];O.forEach(function(be){var $t=Ki(be,F),Lt=ea($t,2),Vr=Lt[0],$r=Lt[1],Qr=Zi(be,a,i),h=ea(Qr,2),T=h[0],I=h[1],K=Z?Z(be):null;if(Vr&&T&&!K)oe.push(be);else{var G=[$r,I];K&&(G=G.concat(K)),ue.push({file:be,errors:G.filter(function(Te){return Te})})}}),(!s&&oe.length>1||s&&u>=1&&oe.length>u)&&(oe.forEach(function(be){ue.push({file:be,errors:[Nl]})}),oe.splice(0)),q({acceptedFiles:oe,fileRejections:ue,type:"setFiles"}),f&&f(oe,ue,S),ue.length>0&&g&&g(ue,S),oe.length>0&&m&&m(oe,S)},[q,s,F,a,i,u,f,m,g,Z]),rt=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[],an(O)&&Promise.resolve(o(O)).then(function(S){on(O)&&!P||je(S,O)}).catch(function(S){return Ce(S)}),q({type:"reset"})},[o,je,Ce,P]),nt=(0,j.useCallback)(function(){if(te.current){q({type:"openDialog"}),M();var O={multiple:s,types:L};window.showOpenFilePicker(O).then(function(S){return o(S)}).then(function(S){je(S,null),q({type:"closeDialog"})}).catch(function(S){kl(S)?(k(S),q({type:"closeDialog"})):Ul(S)?(te.current=!1,Y.current?(Y.current.value=null,Y.current.click()):Ce(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Ce(S)});return}Y.current&&(q({type:"openDialog"}),M(),Y.current.value=null,Y.current.click())},[q,M,k,E,je,Ce,L,s]),It=(0,j.useCallback)(function(O){!U.current||!U.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),nt())},[U,nt]),Gt=(0,j.useCallback)(function(){q({type:"focus"})},[]),Wt=(0,j.useCallback)(function(){q({type:"blur"})},[]),Rt=(0,j.useCallback)(function(){d||(Ml()?setTimeout(nt,0):nt())},[d,nt]),Ye=function(S){return n?null:S},Pt=function(S){return w?null:Ye(S)},Ot=function(S){return y?null:Ye(S)},He=function(S){P&&S.stopPropagation()},dt=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=O.refKey,oe=S===void 0?"ref":S,ue=O.role,be=O.onKeyDown,$t=O.onFocus,Lt=O.onBlur,Vr=O.onClick,$r=O.onDragEnter,Qr=O.onDragOver,h=O.onDragLeave,T=O.onDrop,I=Eo(O,ch);return ae(ae(ra({onKeyDown:Pt(ot(be,It)),onFocus:Pt(ot($t,Gt)),onBlur:Pt(ot(Lt,Wt)),onClick:Ye(ot(Vr,Rt)),onDragEnter:Ot(ot($r,_t)),onDragOver:Ot(ot(Qr,ze)),onDragLeave:Ot(ot(h,xt)),onDrop:Ot(ot(T,rt)),role:typeof ue=="string"&&ue!==""?ue:"presentation"},oe,U),!n&&!w?{tabIndex:0}:{}),I)}},[U,It,Gt,Wt,Rt,_t,ze,xt,rt,w,y,n]),Vt=(0,j.useCallback)(function(O){O.stopPropagation()},[]),Ct=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=O.refKey,oe=S===void 0?"ref":S,ue=O.onChange,be=O.onClick,$t=Eo(O,fh),Lt=ra({accept:F,multiple:s,type:"file",style:{display:"none"},onChange:Ye(ot(ue,rt)),onClick:Ye(ot(be,Vt)),tabIndex:-1},oe,Y);return ae(ae({},Lt),$t)}},[Y,r,s,rt,n]);return ae(ae({},V),{},{isFocused:ie&&!n,getRootProps:dt,getInputProps:Ct,rootRef:U,inputRef:Y,open:Ye(nt)})}function Eh(e,t){switch(t.type){case"focus":return ae(ae({},e),{},{isFocused:!0});case"blur":return ae(ae({},e),{},{isFocused:!1});case"openDialog":return ae(ae({},na),{},{isFileDialogActive:!0});case"closeDialog":return ae(ae({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ae(ae({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ae(ae({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ae({},na);default:return e}}function Wl(){}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sn(e,t)}function Ve(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sn(e,t)}var Ze=function(){function e(){this.listeners=[]}var t=e.prototype;return t.subscribe=function(n){var o=this,i=n||function(){};return this.listeners.push(i),this.onSubscribe(),function(){o.listeners=o.listeners.filter(function(a){return a!==i}),o.onUnsubscribe()}},t.hasListeners=function(){return this.listeners.length>0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}();function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u";function se(){}function zl(e,t){return typeof e=="function"?e(t):e}function ln(e){return typeof e=="number"&&e>=0&&e!==1/0}function un(e){return Array.isArray(e)?e:[e]}function _o(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wr(e,t,r){return pn(e)?typeof t=="function"?N({},r,{queryKey:e,queryFn:t}):N({},t,{queryKey:e}):e}function Yl(e,t,r){return pn(e)?typeof t=="function"?N({},r,{mutationKey:e,mutationFn:t}):N({},t,{mutationKey:e}):typeof e=="function"?N({},t,{mutationFn:e}):N({},e)}function mt(e,t,r){return pn(e)?[N({},t,{queryKey:e}),r]:[e||{},t]}function _h(e,t){if(e===!0&&t===!0||e==null&&t==null)return"all";if(e===!1&&t===!1)return"none";var r=e??!t;return r?"active":"inactive"}function sa(e,t){var r=e.active,n=e.exact,o=e.fetching,i=e.inactive,a=e.predicate,s=e.queryKey,u=e.stale;if(pn(s)){if(n){if(t.queryHash!==cn(s,t.options))return!1}else if(!fn(t.queryKey,s))return!1}var c=_h(r,i);if(c==="none")return!1;if(c!=="all"){var l=t.isActive();if(c==="active"&&!l||c==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof o=="boolean"&&t.isFetching()!==o||a&&!a(t))}function ua(e,t){var r=e.exact,n=e.fetching,o=e.predicate,i=e.mutationKey;if(pn(i)){if(!t.options.mutationKey)return!1;if(r){if(Dt(t.options.mutationKey)!==Dt(i))return!1}else if(!fn(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function cn(e,t){var r=t?.queryKeyHashFn||Dt;return r(e)}function Dt(e){var t=un(e);return xh(t)}function xh(e){return JSON.stringify(e,function(t,r){return aa(r)?Object.keys(r).sort().reduce(function(n,o){return n[o]=r[o],n},{}):r})}function fn(e,t){return Xl(un(e),un(t))}function Xl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(function(r){return!Xl(e[r],t[r])}):!1}function Sr(e,t){if(e===t)return e;var r=Array.isArray(e)&&Array.isArray(t);if(r||aa(e)&&aa(t)){for(var n=r?e.length:Object.keys(e).length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{},s=0,u=0;u"u")return!0;var r=t.prototype;return!(!Ql(r)||!r.hasOwnProperty("isPrototypeOf"))}function Ql(e){return Object.prototype.toString.call(e)==="[object Object]"}function pn(e){return typeof e=="string"||Array.isArray(e)}function Zl(e){return new Promise(function(t){setTimeout(t,e)})}function la(e){Promise.resolve().then(e).catch(function(t){return setTimeout(function(){throw t})})}function xo(){if(typeof AbortController=="function")return new AbortController}var Oh=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!er&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",a,!1),function(){window.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setFocused(s):a.onFocus()})},r.setFocused=function(o){this.focused=o,o&&this.onFocus()},r.onFocus=function(){this.listeners.forEach(function(o){o()})},r.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},t}(Ze),Mt=new Oh;var Ch=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!er&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("online",a,!1),window.addEventListener("offline",a,!1),function(){window.removeEventListener("online",a),window.removeEventListener("offline",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setOnline(s):a.onOnline()})},r.setOnline=function(o){this.online=o,o&&this.onOnline()},r.onOnline=function(){this.listeners.forEach(function(o){o()})},r.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},t}(Ze),Ar=new Ch;function Th(e){return Math.min(1e3*Math.pow(2,e),3e4)}function dn(e){return typeof e?.cancel=="function"}var Jl=function(t){this.revert=t?.revert,this.silent=t?.silent};function Ir(e){return e instanceof Jl}var Oo=function(t){var r=this,n=!1,o,i,a,s;this.abort=t.abort,this.cancel=function(f){return o?.(f)},this.cancelRetry=function(){n=!0},this.continueRetry=function(){n=!1},this.continue=function(){return i?.()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(f,m){a=f,s=m});var u=function(m){r.isResolved||(r.isResolved=!0,t.onSuccess==null||t.onSuccess(m),i?.(),a(m))},c=function(m){r.isResolved||(r.isResolved=!0,t.onError==null||t.onError(m),i?.(),s(m))},l=function(){return new Promise(function(m){i=m,r.isPaused=!0,t.onPause==null||t.onPause()}).then(function(){i=void 0,r.isPaused=!1,t.onContinue==null||t.onContinue()})},p=function f(){if(!r.isResolved){var m;try{m=t.fn()}catch(g){m=Promise.reject(g)}o=function(v){if(!r.isResolved&&(c(new Jl(v)),r.abort==null||r.abort(),dn(m)))try{m.cancel()}catch{}},r.isTransportCancelable=dn(m),Promise.resolve(m).then(u).catch(function(g){var v,b;if(!r.isResolved){var E=(v=t.retry)!=null?v:3,x=(b=t.retryDelay)!=null?b:Th,_=typeof x=="function"?x(r.failureCount,g):x,d=E===!0||typeof E=="number"&&r.failureCount"u"&&(s.exact=!0),this.queries.find(function(u){return sa(s,u)})},r.findAll=function(o,i){var a=mt(o,i),s=a[0];return Object.keys(s).length>0?this.queries.filter(function(u){return sa(s,u)}):this.queries},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onFocus()})})},r.onOnline=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onOnline()})})},t}(Ze);var nc=function(){function e(r){this.options=N({},r.defaultOptions,r.options),this.mutationId=r.mutationId,this.mutationCache=r.mutationCache,this.observers=[],this.state=r.state||fa(),this.meta=r.meta}var t=e.prototype;return t.setState=function(n){this.dispatch({type:"setState",state:n})},t.addObserver=function(n){this.observers.indexOf(n)===-1&&this.observers.push(n)},t.removeObserver=function(n){this.observers=this.observers.filter(function(o){return o!==n})},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(se).catch(se)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var n=this,o,i=this.state.status==="loading",a=Promise.resolve();return i||(this.dispatch({type:"loading",variables:this.options.variables}),a=a.then(function(){n.mutationCache.config.onMutate==null||n.mutationCache.config.onMutate(n.state.variables,n)}).then(function(){return n.options.onMutate==null?void 0:n.options.onMutate(n.state.variables)}).then(function(s){s!==n.state.context&&n.dispatch({type:"loading",context:s,variables:n.state.variables})})),a.then(function(){return n.executeMutation()}).then(function(s){o=s,n.mutationCache.config.onSuccess==null||n.mutationCache.config.onSuccess(o,n.state.variables,n.state.context,n)}).then(function(){return n.options.onSuccess==null?void 0:n.options.onSuccess(o,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(o,null,n.state.variables,n.state.context)}).then(function(){return n.dispatch({type:"success",data:o}),o}).catch(function(s){return n.mutationCache.config.onError==null||n.mutationCache.config.onError(s,n.state.variables,n.state.context,n),tr().error(s),Promise.resolve().then(function(){return n.options.onError==null?void 0:n.options.onError(s,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(void 0,s,n.state.variables,n.state.context)}).then(function(){throw n.dispatch({type:"error",error:s}),s})})},t.executeMutation=function(){var n=this,o;return this.retryer=new Oo({fn:function(){return n.options.mutationFn?n.options.mutationFn(n.state.variables):Promise.reject("No mutationFn found")},onFail:function(){n.dispatch({type:"failed"})},onPause:function(){n.dispatch({type:"pause"})},onContinue:function(){n.dispatch({type:"continue"})},retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(n){var o=this;this.state=Sh(this.state,n),Q.batch(function(){o.observers.forEach(function(i){i.onMutationUpdate(n)}),o.mutationCache.notify(o)})},e}();function fa(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function Sh(e,t){switch(t.type){case"failed":return N({},e,{failureCount:e.failureCount+1});case"pause":return N({},e,{isPaused:!0});case"continue":return N({},e,{isPaused:!1});case"loading":return N({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return N({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return N({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return N({},e,t.state);default:return e}}var oc=function(e){Ve(t,e);function t(n){var o;return o=e.call(this)||this,o.config=n||{},o.mutations=[],o.mutationId=0,o}var r=t.prototype;return r.build=function(o,i,a){var s=new nc({mutationCache:this,mutationId:++this.mutationId,options:o.defaultMutationOptions(i),state:a,defaultOptions:i.mutationKey?o.getMutationDefaults(i.mutationKey):void 0,meta:i.meta});return this.add(s),s},r.add=function(o){this.mutations.push(o),this.notify(o)},r.remove=function(o){this.mutations=this.mutations.filter(function(i){return i!==o}),o.cancel(),this.notify(o)},r.clear=function(){var o=this;Q.batch(function(){o.mutations.forEach(function(i){o.remove(i)})})},r.getAll=function(){return this.mutations},r.find=function(o){return typeof o.exact>"u"&&(o.exact=!0),this.mutations.find(function(i){return ua(o,i)})},r.findAll=function(o){return this.mutations.filter(function(i){return ua(o,i)})},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){this.resumePausedMutations()},r.onOnline=function(){this.resumePausedMutations()},r.resumePausedMutations=function(){var o=this.mutations.filter(function(i){return i.state.isPaused});return Q.batch(function(){return o.reduce(function(i,a){return i.then(function(){return a.continue().catch(se)})},Promise.resolve())})},t}(Ze);function ac(){return{onFetch:function(t){t.fetchFn=function(){var r,n,o,i,a,s,u=(r=t.fetchOptions)==null||(n=r.meta)==null?void 0:n.refetchPage,c=(o=t.fetchOptions)==null||(i=o.meta)==null?void 0:i.fetchMore,l=c?.pageParam,p=c?.direction==="forward",f=c?.direction==="backward",m=((a=t.state.data)==null?void 0:a.pages)||[],g=((s=t.state.data)==null?void 0:s.pageParams)||[],v=xo(),b=v?.signal,E=g,x=!1,_=t.options.queryFn||function(){return Promise.reject("Missing queryFn")},d=function(U,Y,B,R){return E=R?[Y].concat(E):[].concat(E,[Y]),R?[B].concat(U):[].concat(U,[B])},w=function(U,Y,B,R){if(x)return Promise.reject("Cancelled");if(typeof B>"u"&&!Y&&U.length)return Promise.resolve(U);var V={queryKey:t.queryKey,signal:b,pageParam:B,meta:t.meta},q=_(V),ie=Promise.resolve(q).then(function(te){return d(U,B,te,R)});if(dn(q)){var ce=ie;ce.cancel=q.cancel}return ie},y;if(!m.length)y=w([]);else if(p){var P=typeof l<"u",z=P?l:ic(t.options,m);y=w(m,P,z)}else if(f){var Z=typeof l<"u",F=Z?l:Ah(t.options,m);y=w(m,Z,F,!0)}else(function(){E=[];var k=typeof t.options.getNextPageParam>"u",U=u&&m[0]?u(m[0],0,m):!0;y=U?w([],k,g[0]):Promise.resolve(d([],g[0],m[0]));for(var Y=function(V){y=y.then(function(q){var ie=u&&m[V]?u(m[V],V,m):!0;if(ie){var ce=k?g[V]:ic(t.options,q);return w(q,k,ce)}return Promise.resolve(d(q,g[V],m[V]))})},B=1;B"u"&&(l.revert=!0);var p=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.cancel(l)})});return Promise.all(p).then(se).catch(se)},t.invalidateQueries=function(n,o,i){var a,s,u,c=this,l=mt(n,o,i),p=l[0],f=l[1],m=N({},p,{active:(a=(s=p.refetchActive)!=null?s:p.active)!=null?a:!0,inactive:(u=p.refetchInactive)!=null?u:!1});return Q.batch(function(){return c.queryCache.findAll(p).forEach(function(g){g.invalidate()}),c.refetchQueries(m,f)})},t.refetchQueries=function(n,o,i){var a=this,s=mt(n,o,i),u=s[0],c=s[1],l=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.fetch(void 0,N({},c,{meta:{refetchPage:u?.refetchPage}}))})}),p=Promise.all(l).then(se);return c?.throwOnError||(p=p.catch(se)),p},t.fetchQuery=function(n,o,i){var a=wr(n,o,i),s=this.defaultQueryOptions(a);typeof s.retry>"u"&&(s.retry=!1);var u=this.queryCache.build(this,s);return u.isStaleByTime(s.staleTime)?u.fetch(s):Promise.resolve(u.state.data)},t.prefetchQuery=function(n,o,i){return this.fetchQuery(n,o,i).then(se).catch(se)},t.fetchInfiniteQuery=function(n,o,i){var a=wr(n,o,i);return a.behavior=ac(),this.fetchQuery(a)},t.prefetchInfiniteQuery=function(n,o,i){return this.fetchInfiniteQuery(n,o,i).then(se).catch(se)},t.cancelMutations=function(){var n=this,o=Q.batch(function(){return n.mutationCache.getAll().map(function(i){return i.cancel()})});return Promise.all(o).then(se).catch(se)},t.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},t.executeMutation=function(n){return this.mutationCache.build(this,n).execute()},t.getQueryCache=function(){return this.queryCache},t.getMutationCache=function(){return this.mutationCache},t.getDefaultOptions=function(){return this.defaultOptions},t.setDefaultOptions=function(n){this.defaultOptions=n},t.setQueryDefaults=function(n,o){var i=this.queryDefaults.find(function(a){return Dt(n)===Dt(a.queryKey)});i?i.defaultOptions=o:this.queryDefaults.push({queryKey:n,defaultOptions:o})},t.getQueryDefaults=function(n){var o;return n?(o=this.queryDefaults.find(function(i){return fn(n,i.queryKey)}))==null?void 0:o.defaultOptions:void 0},t.setMutationDefaults=function(n,o){var i=this.mutationDefaults.find(function(a){return Dt(n)===Dt(a.mutationKey)});i?i.defaultOptions=o:this.mutationDefaults.push({mutationKey:n,defaultOptions:o})},t.getMutationDefaults=function(n){var o;return n?(o=this.mutationDefaults.find(function(i){return fn(n,i.mutationKey)}))==null?void 0:o.defaultOptions:void 0},t.defaultQueryOptions=function(n){if(n?._defaulted)return n;var o=N({},this.defaultOptions.queries,this.getQueryDefaults(n?.queryKey),n,{_defaulted:!0});return!o.queryHash&&o.queryKey&&(o.queryHash=cn(o.queryKey,o)),o},t.defaultQueryObserverOptions=function(n){return this.defaultQueryOptions(n)},t.defaultMutationOptions=function(n){return n?._defaulted?n:N({},this.defaultOptions.mutations,this.getMutationDefaults(n?.mutationKey),n,{_defaulted:!0})},t.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},e}();var ma=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.options=o,i.trackedProps=[],i.selectError=null,i.bindMethods(),i.setOptions(o),i}var r=t.prototype;return r.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},r.onSubscribe=function(){this.listeners.length===1&&(this.currentQuery.addObserver(this),sc(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},r.onUnsubscribe=function(){this.listeners.length||this.destroy()},r.shouldFetchOnReconnect=function(){return da(this.currentQuery,this.options,this.options.refetchOnReconnect)},r.shouldFetchOnWindowFocus=function(){return da(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},r.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},r.setOptions=function(o,i){var a=this.options,s=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(o),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),this.updateQuery();var u=this.hasListeners();u&&uc(this.currentQuery,s,this.options,a)&&this.executeFetch(),this.updateResult(i),u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},r.getOptimisticResult=function(o){var i=this.client.defaultQueryObserverOptions(o),a=this.client.getQueryCache().build(this.client,i);return this.createResult(a,i)},r.getCurrentResult=function(){return this.currentResult},r.trackResult=function(o,i){var a=this,s={},u=function(l){a.trackedProps.includes(l)||a.trackedProps.push(l)};return Object.keys(o).forEach(function(c){Object.defineProperty(s,c,{configurable:!1,enumerable:!0,get:function(){return u(c),o[c]}})}),(i.useErrorBoundary||i.suspense)&&u("error"),s},r.getNextResult=function(o){var i=this;return new Promise(function(a,s){var u=i.subscribe(function(c){c.isFetching||(u(),c.isError&&o?.throwOnError?s(c.error):a(c))})})},r.getCurrentQuery=function(){return this.currentQuery},r.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},r.refetch=function(o){return this.fetch(N({},o,{meta:{refetchPage:o?.refetchPage}}))},r.fetchOptimistic=function(o){var i=this,a=this.client.defaultQueryObserverOptions(o),s=this.client.getQueryCache().build(this.client,a);return s.fetch().then(function(){return i.createResult(s,a)})},r.fetch=function(o){var i=this;return this.executeFetch(o).then(function(){return i.updateResult(),i.currentResult})},r.executeFetch=function(o){this.updateQuery();var i=this.currentQuery.fetch(this.options,o);return o?.throwOnError||(i=i.catch(se)),i},r.updateStaleTimeout=function(){var o=this;if(this.clearStaleTimeout(),!(er||this.currentResult.isStale||!ln(this.options.staleTime))){var i=_o(this.currentResult.dataUpdatedAt,this.options.staleTime),a=i+1;this.staleTimeoutId=setTimeout(function(){o.currentResult.isStale||o.updateResult()},a)}},r.computeRefetchInterval=function(){var o;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(o=this.options.refetchInterval)!=null?o:!1},r.updateRefetchInterval=function(o){var i=this;this.clearRefetchInterval(),this.currentRefetchInterval=o,!(er||this.options.enabled===!1||!ln(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(i.options.refetchIntervalInBackground||Mt.isFocused())&&i.executeFetch()},this.currentRefetchInterval))},r.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},r.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},r.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},r.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},r.createResult=function(o,i){var a=this.currentQuery,s=this.options,u=this.currentResult,c=this.currentResultState,l=this.currentResultOptions,p=o!==a,f=p?o.state:this.currentQueryInitialState,m=p?this.currentResult:this.previousQueryResult,g=o.state,v=g.dataUpdatedAt,b=g.error,E=g.errorUpdatedAt,x=g.isFetching,_=g.status,d=!1,w=!1,y;if(i.optimisticResults){var P=this.hasListeners(),z=!P&&sc(o,i),Z=P&&uc(o,a,i,s);(z||Z)&&(x=!0,v||(_="loading"))}if(i.keepPreviousData&&!g.dataUpdateCount&&m?.isSuccess&&_!=="error")y=m.data,v=m.dataUpdatedAt,_=m.status,d=!0;else if(i.select&&typeof g.data<"u")if(u&&g.data===c?.data&&i.select===this.selectFn)y=this.selectResult;else try{this.selectFn=i.select,y=i.select(g.data),i.structuralSharing!==!1&&(y=Sr(u?.data,y)),this.selectResult=y,this.selectError=null}catch(M){tr().error(M),this.selectError=M}else y=g.data;if(typeof i.placeholderData<"u"&&typeof y>"u"&&(_==="loading"||_==="idle")){var F;if(u?.isPlaceholderData&&i.placeholderData===l?.placeholderData)F=u.data;else if(F=typeof i.placeholderData=="function"?i.placeholderData():i.placeholderData,i.select&&typeof F<"u")try{F=i.select(F),i.structuralSharing!==!1&&(F=Sr(u?.data,F)),this.selectError=null}catch(M){tr().error(M),this.selectError=M}typeof F<"u"&&(_="success",y=F,w=!0)}this.selectError&&(b=this.selectError,y=this.selectResult,E=Date.now(),_="error");var L={status:_,isLoading:_==="loading",isSuccess:_==="success",isError:_==="error",isIdle:_==="idle",data:y,dataUpdatedAt:v,error:b,errorUpdatedAt:E,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:x,isRefetching:x&&_!=="loading",isLoadingError:_==="error"&&g.dataUpdatedAt===0,isPlaceholderData:w,isPreviousData:d,isRefetchError:_==="error"&&g.dataUpdatedAt!==0,isStale:ha(o,i),refetch:this.refetch,remove:this.remove};return L},r.shouldNotifyListeners=function(o,i){if(!i)return!0;var a=this.options,s=a.notifyOnChangeProps,u=a.notifyOnChangePropsExclusions;if(!s&&!u||s==="tracked"&&!this.trackedProps.length)return!0;var c=s==="tracked"?this.trackedProps:s;return Object.keys(o).some(function(l){var p=l,f=o[p]!==i[p],m=c?.some(function(v){return v===l}),g=u?.some(function(v){return v===l});return f&&!g&&(!c||m)})},r.updateResult=function(o){var i=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!Kl(this.currentResult,i)){var a={cache:!0};o?.listeners!==!1&&this.shouldNotifyListeners(this.currentResult,i)&&(a.listeners=!0),this.notify(N({},a,o))}},r.updateQuery=function(){var o=this.client.getQueryCache().build(this.client,this.options);if(o!==this.currentQuery){var i=this.currentQuery;this.currentQuery=o,this.currentQueryInitialState=o.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(i?.removeObserver(this),o.addObserver(this))}},r.onQueryUpdate=function(o){var i={};o.type==="success"?i.onSuccess=!0:o.type==="error"&&!Ir(o.error)&&(i.onError=!0),this.updateResult(i),this.hasListeners()&&this.updateTimers()},r.notify=function(o){var i=this;Q.batch(function(){o.onSuccess?(i.options.onSuccess==null||i.options.onSuccess(i.currentResult.data),i.options.onSettled==null||i.options.onSettled(i.currentResult.data,null)):o.onError&&(i.options.onError==null||i.options.onError(i.currentResult.error),i.options.onSettled==null||i.options.onSettled(void 0,i.currentResult.error)),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)}),o.cache&&i.client.getQueryCache().notify({query:i.currentQuery,type:"observerResultsUpdated"})})},t}(Ze);function Ih(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sc(e,t){return Ih(e,t)||e.state.dataUpdatedAt>0&&da(e,t,t.refetchOnMount)}function da(e,t,r){if(t.enabled!==!1){var n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ha(e,t)}return!1}function uc(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&ha(e,r)}function ha(e,t){return e.isStaleByTime(t.staleTime)}var lc=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.setOptions(o),i.bindMethods(),i.updateResult(),i}var r=t.prototype;return r.bindMethods=function(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)},r.setOptions=function(o){this.options=this.client.defaultMutationOptions(o)},r.onUnsubscribe=function(){if(!this.listeners.length){var o;(o=this.currentMutation)==null||o.removeObserver(this)}},r.onMutationUpdate=function(o){this.updateResult();var i={listeners:!0};o.type==="success"?i.onSuccess=!0:o.type==="error"&&(i.onError=!0),this.notify(i)},r.getCurrentResult=function(){return this.currentResult},r.reset=function(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})},r.mutate=function(o,i){return this.mutateOptions=i,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,N({},this.options,{variables:typeof o<"u"?o:this.options.variables})),this.currentMutation.addObserver(this),this.currentMutation.execute()},r.updateResult=function(){var o=this.currentMutation?this.currentMutation.state:fa(),i=N({},o,{isLoading:o.status==="loading",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset});this.currentResult=i},r.notify=function(o){var i=this;Q.batch(function(){i.mutateOptions&&(o.onSuccess?(i.mutateOptions.onSuccess==null||i.mutateOptions.onSuccess(i.currentResult.data,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(i.currentResult.data,null,i.currentResult.variables,i.currentResult.context)):o.onError&&(i.mutateOptions.onError==null||i.mutateOptions.onError(i.currentResult.error,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(void 0,i.currentResult.error,i.currentResult.variables,i.currentResult.context))),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)})})},t}(Ze);var fc=$(Co()),pc=fc.default.unstable_batchedUpdates;Q.setBatchNotifyFunction(pc);var dc=console;ca(dc);var Ft=$(J()),mc=Ft.default.createContext(void 0),hc=Ft.default.createContext(!1);function vc(e){return e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=mc),window.ReactQueryClientContext):mc}var ht=function(){var t=Ft.default.useContext(vc(Ft.default.useContext(hc)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Rr=function(t){var r=t.client,n=t.contextSharing,o=n===void 0?!1:n,i=t.children;Ft.default.useEffect(function(){return r.mount(),function(){r.unmount()}},[r]);var a=vc(o);return Ft.default.createElement(hc.Provider,{value:o},Ft.default.createElement(a.Provider,{value:r},i))};var va=$(J());function Rh(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var Ph=va.default.createContext(Rh()),gc=function(){return va.default.useContext(Ph)};var Pr=$(J());function To(e,t,r){return typeof t=="function"?t.apply(void 0,r):typeof t=="boolean"?t:!!e}function Lr(e,t,r){var n=Pr.default.useRef(!1),o=Pr.default.useState(0),i=o[1],a=Yl(e,t,r),s=ht(),u=Pr.default.useRef();u.current?u.current.setOptions(a):u.current=new lc(s,a);var c=u.current.getCurrentResult();Pr.default.useEffect(function(){n.current=!0;var p=u.current.subscribe(Q.batchCalls(function(){n.current&&i(function(f){return f+1})}));return function(){n.current=!1,p()}},[]);var l=Pr.default.useCallback(function(p,f){u.current.mutate(p,f).catch(se)},[]);if(c.error&&To(void 0,u.current.options.useErrorBoundary,[c.error]))throw c.error;return N({},c,{mutate:l,mutateAsync:c.mutate})}var Nr=$(J());function yc(e,t){var r=Nr.default.useRef(!1),n=Nr.default.useState(0),o=n[1],i=ht(),a=gc(),s=i.defaultQueryObserverOptions(e);s.optimisticResults=!0,s.onError&&(s.onError=Q.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Q.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Q.batchCalls(s.onSettled)),s.suspense&&(typeof s.staleTime!="number"&&(s.staleTime=1e3),s.cacheTime===0&&(s.cacheTime=1)),(s.suspense||s.useErrorBoundary)&&(a.isReset()||(s.retryOnMount=!1));var u=Nr.default.useState(function(){return new t(i,s)}),c=u[0],l=c.getOptimisticResult(s);if(Nr.default.useEffect(function(){r.current=!0,a.clearReset();var p=c.subscribe(Q.batchCalls(function(){r.current&&o(function(f){return f+1})}));return c.updateResult(),function(){r.current=!1,p()}},[a,c]),Nr.default.useEffect(function(){c.setOptions(s,{listeners:!1})},[s,c]),s.suspense&&l.isLoading)throw c.fetchOptimistic(s).then(function(p){var f=p.data;s.onSuccess==null||s.onSuccess(f),s.onSettled==null||s.onSettled(f,null)}).catch(function(p){a.clearReset(),s.onError==null||s.onError(p),s.onSettled==null||s.onSettled(void 0,p)});if(l.isError&&!a.isReset()&&!l.isFetching&&To(s.suspense,s.useErrorBoundary,[l.error,c.getCurrentQuery()]))throw l.error;return s.notifyOnChangeProps==="tracked"&&(l=c.trackResult(l,s)),l}function wo(e,t,r){var n=wr(e,t,r);return yc(n,ma)}var Sf=$(wf(),1);var Tv=Sf.default.create(),gn=new pa({defaultOptions:{queries:{suspense:!0,refetchOnWindowFocus:!1,cacheTime:1/0}}});async function rr(e,t={}){try{return(await Tv({url:e,withCredentials:!0,...t})).data}catch(r){throw Error(r)}}function Af(e){return wo(["LibraryImage",e],()=>rr("/open_api/library/image",{method:"GET",params:{id:e.id||null,limit:e.limit||5,offset:e.offset||0,title:e.title||null,tagId:e.tagId||null}}),{keepPreviousData:!0,onSuccess:t=>{}})}function If(){let e=ht();return Lr(t=>rr("/open_api/library/image",{method:"POST",headers:{"content-type":"multipart/form-data"},data:t}),{onSuccess:t=>{e.setQueryData(["LibraryImage"],r=>r&&Array.isArray(r)?[...r,t]:r)}})}function Rf(){let e=ht();return Lr(t=>rr(`/open_api/library/image/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.filter(o=>o.id!==r):n)}})}function Fa(){return wo(["LibraryTag"],()=>rr("/open_api/library/tag",{method:"GET"}),{keepPreviousData:!0,onSuccess:e=>{}})}function Pf(){let e=ht();return Lr(t=>rr(`/open_api/library/image_tag/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.map(o=>o.tags&&o.tags.length?{...o,tags:o.tags.filter(({imageTag:i})=>i.id!==r)}:o):n)}})}function Lf(){let e=ht();return Lr(t=>rr("/open_api/library/image_tag",{method:"POST",data:t}),{onSuccess:t=>{e.setQueriesData(["LibraryImage"],r=>r&&Array.isArray(r)?r.map(n=>n.id===t.imageTag.imageId?{...n,tags:[...n.tags,t]}:n):r)}})}var Ba=$(J()),Ha=e=>Ba.createElement("svg",{width:19,height:18,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ba.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var ka=$(J()),Nf=e=>ka.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ka.createElement("path",{d:"M3.91875 0.498484C4.04531 0.257609 4.30547 0.105469 4.58906 0.105469H7.41094C7.69453 0.105469 7.95469 0.257609 8.08125 0.498484L8.25 0.816406H10.5C10.9148 0.816406 11.25 1.13477 11.25 1.52734C11.25 1.91991 10.9148 2.23828 10.5 2.23828H1.5C1.08586 2.23828 0.75 1.91991 0.75 1.52734C0.75 1.13477 1.08586 0.816406 1.5 0.816406H3.75L3.91875 0.498484ZM1.47891 2.94922H10.5V10.0586C10.5 10.8428 9.82734 11.4805 9 11.4805H2.97891C2.17148 11.4805 1.47891 10.8428 1.47891 10.0586V2.94922ZM3.35391 4.72656V9.70312C3.35391 9.89863 3.54375 10.0586 3.72891 10.0586C3.95625 10.0586 4.10391 9.89863 4.10391 9.70312V4.72656C4.10391 4.53105 3.95625 4.37109 3.72891 4.37109C3.54375 4.37109 3.35391 4.53105 3.35391 4.72656ZM5.60391 4.72656V9.70312C5.60391 9.89863 5.79375 10.0586 5.97891 10.0586C6.20625 10.0586 6.375 9.89863 6.375 9.70312V4.72656C6.375 4.53105 6.20625 4.37109 5.97891 4.37109C5.79375 4.37109 5.60391 4.53105 5.60391 4.72656ZM7.875 4.72656V9.70312C7.875 9.89863 8.04375 10.0586 8.25 10.0586C8.45625 10.0586 8.625 9.89863 8.625 9.70312V4.72656C8.625 4.53105 8.45625 4.37109 8.25 4.37109C8.04375 4.37109 7.875 4.53105 7.875 4.72656Z",fill:"white"}));var Ua=$(J()),Df=e=>Ua.createElement("svg",{width:8,height:8,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ua.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var _s=$(gp()),Et=$(J());var fd=$(J());var le="top",ge="bottom",me="right",fe="left",Xo="auto",kt=[le,ge,me,fe],wt="start",ar="end",yp="clippingParents",Ko="viewport",Ur="popper",bp="reference",Xa=kt.reduce(function(e,t){return e.concat([t+"-"+wt,t+"-"+ar])},[]),Zo=[].concat(kt,[Xo]).reduce(function(e,t){return e.concat([t,t+"-"+wt,t+"-"+ar])},[]),Zg="beforeRead",Jg="read",ey="afterRead",ty="beforeMain",ry="main",ny="afterMain",oy="beforeWrite",iy="write",ay="afterWrite",Ep=[Zg,Jg,ey,ty,ry,ny,oy,iy,ay];function xe(e){return e?(e.nodeName||"").toLowerCase():null}function pe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function yt(e){var t=pe(e).Element;return e instanceof t||e instanceof Element}function ye(e){var t=pe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function jr(e){if(typeof ShadowRoot>"u")return!1;var t=pe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function sy(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!ye(i)||!xe(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function uy(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(u,c){return u[c]="",u},{});!ye(o)||!xe(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(u){o.removeAttribute(u)}))})}}var wn={name:"applyStyles",enabled:!0,phase:"write",fn:sy,effect:uy,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var st=Math.max,sr=Math.min,St=Math.round;function et(e,t){t===void 0&&(t=!1);var r=e.getBoundingClientRect(),n=1,o=1;if(ye(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(n=St(r.width)/a||1),i>0&&(o=St(r.height)/i||1)}return{width:r.width/n,height:r.height/o,top:r.top/o,right:r.right/n,bottom:r.bottom/o,left:r.left/n,x:r.left/n,y:r.top/o}}function ur(e){var t=et(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Sn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&jr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Me(e){return pe(e).getComputedStyle(e)}function Ka(e){return["table","td","th"].indexOf(xe(e))>=0}function Se(e){return((yt(e)?e.ownerDocument:e.document)||window.document).documentElement}function At(e){return xe(e)==="html"?e:e.assignedSlot||e.parentNode||(jr(e)?e.host:null)||Se(e)}function _p(e){return!ye(e)||Me(e).position==="fixed"?null:e.offsetParent}function ly(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&ye(e)){var n=Me(e);if(n.position==="fixed")return null}var o=At(e);for(jr(o)&&(o=o.host);ye(o)&&["html","body"].indexOf(xe(o))<0;){var i=Me(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function ut(e){for(var t=pe(e),r=_p(e);r&&Ka(r)&&Me(r).position==="static";)r=_p(r);return r&&(xe(r)==="html"||xe(r)==="body"&&Me(r).position==="static")?t:r||ly(e)||t}function lr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cr(e,t,r){return st(e,sr(t,r))}function xp(e,t,r){var n=cr(e,t,r);return n>r?r:n}function An(){return{top:0,right:0,bottom:0,left:0}}function In(e){return Object.assign({},An(),e)}function Rn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var cy=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,In(typeof t!="number"?t:Rn(t,kt))};function fy(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=Oe(r.placement),u=lr(s),c=[fe,me].indexOf(s)>=0,l=c?"height":"width";if(!(!i||!a)){var p=cy(o.padding,r),f=ur(i),m=u==="y"?le:fe,g=u==="y"?ge:me,v=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],b=a[u]-r.rects.reference[u],E=ut(i),x=E?u==="y"?E.clientHeight||0:E.clientWidth||0:0,_=v/2-b/2,d=p[m],w=x-f[l]-p[g],y=x/2-f[l]/2+_,P=cr(d,y,w),z=u;r.modifiersData[n]=(t={},t[z]=P,t.centerOffset=P-y,t)}}function py(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!Sn(t.elements.popper,o)||(t.elements.arrow=o))}var Op={name:"arrow",enabled:!0,phase:"main",fn:fy,effect:py,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tt(e){return e.split("-")[1]}var dy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function my(e){var t=e.x,r=e.y,n=window,o=n.devicePixelRatio||1;return{x:St(t*o)/o||0,y:St(r*o)/o||0}}function Cp(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,p=e.isFixed,f=a.x,m=f===void 0?0:f,g=a.y,v=g===void 0?0:g,b=typeof l=="function"?l({x:m,y:v}):{x:m,y:v};m=b.x,v=b.y;var E=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),_=fe,d=le,w=window;if(c){var y=ut(r),P="clientHeight",z="clientWidth";if(y===pe(r)&&(y=Se(r),Me(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",z="scrollWidth")),y=y,o===le||(o===fe||o===me)&&i===ar){d=ge;var Z=p&&y===w&&w.visualViewport?w.visualViewport.height:y[P];v-=Z-n.height,v*=u?1:-1}if(o===fe||(o===le||o===ge)&&i===ar){_=me;var F=p&&y===w&&w.visualViewport?w.visualViewport.width:y[z];m-=F-n.width,m*=u?1:-1}}var L=Object.assign({position:s},c&&dy),M=l===!0?my({x:m,y:v}):{x:m,y:v};if(m=M.x,v=M.y,u){var k;return Object.assign({},L,(k={},k[d]=x?"0":"",k[_]=E?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",k))}return Object.assign({},L,(t={},t[d]=x?v+"px":"",t[_]=E?m+"px":"",t.transform="",t))}function hy(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,s=r.roundOffsets,u=s===void 0?!0:s;if(!1)var c;var l={placement:Oe(t.placement),variation:tt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Cp(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Cp(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Tp={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:hy,data:{}};var Jo={passive:!0};function vy(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,a=n.resize,s=a===void 0?!0:a,u=pe(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",r.update,Jo)}),s&&u.addEventListener("resize",r.update,Jo),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",r.update,Jo)}),s&&u.removeEventListener("resize",r.update,Jo)}}var wp={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vy,data:{}};var gy={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(e){return e.replace(/left|right|bottom|top/g,function(t){return gy[t]})}var yy={start:"end",end:"start"};function ei(e){return e.replace(/start|end/g,function(t){return yy[t]})}function fr(e){var t=pe(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function pr(e){return et(Se(e)).left+fr(e).scrollLeft}function Za(e){var t=pe(e),r=Se(e),n=t.visualViewport,o=r.clientWidth,i=r.clientHeight,a=0,s=0;return n&&(o=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,s=n.offsetTop)),{width:o,height:i,x:a+pr(e),y:s}}function Ja(e){var t,r=Se(e),n=fr(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=st(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=st(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+pr(e),u=-n.scrollTop;return Me(o||r).direction==="rtl"&&(s+=st(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}function dr(e){var t=Me(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function ti(e){return["html","body","#document"].indexOf(xe(e))>=0?e.ownerDocument.body:ye(e)&&dr(e)?e:ti(At(e))}function Ut(e,t){var r;t===void 0&&(t=[]);var n=ti(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pe(n),a=o?[i].concat(i.visualViewport||[],dr(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(Ut(At(a)))}function Gr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function by(e){var t=et(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Sp(e,t){return t===Ko?Gr(Za(e)):yt(t)?by(t):Gr(Ja(Se(e)))}function Ey(e){var t=Ut(At(e)),r=["absolute","fixed"].indexOf(Me(e).position)>=0,n=r&&ye(e)?ut(e):e;return yt(n)?t.filter(function(o){return yt(o)&&Sn(o,n)&&xe(o)!=="body"}):[]}function es(e,t,r){var n=t==="clippingParents"?Ey(e):[].concat(t),o=[].concat(n,[r]),i=o[0],a=o.reduce(function(s,u){var c=Sp(e,u);return s.top=st(c.top,s.top),s.right=sr(c.right,s.right),s.bottom=sr(c.bottom,s.bottom),s.left=st(c.left,s.left),s},Sp(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Pn(e){var t=e.reference,r=e.element,n=e.placement,o=n?Oe(n):null,i=n?tt(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,u;switch(o){case le:u={x:a,y:t.y-r.height};break;case ge:u={x:a,y:t.y+t.height};break;case me:u={x:t.x+t.width,y:s};break;case fe:u={x:t.x-r.width,y:s};break;default:u={x:t.x,y:t.y}}var c=o?lr(o):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case wt:u[c]=u[c]-(t[l]/2-r[l]/2);break;case ar:u[c]=u[c]+(t[l]/2-r[l]/2);break;default:}}return u}function lt(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.boundary,a=i===void 0?yp:i,s=r.rootBoundary,u=s===void 0?Ko:s,c=r.elementContext,l=c===void 0?Ur:c,p=r.altBoundary,f=p===void 0?!1:p,m=r.padding,g=m===void 0?0:m,v=In(typeof g!="number"?g:Rn(g,kt)),b=l===Ur?bp:Ur,E=e.rects.popper,x=e.elements[f?b:l],_=es(yt(x)?x:x.contextElement||Se(e.elements.popper),a,u),d=et(e.elements.reference),w=Pn({reference:d,element:E,strategy:"absolute",placement:o}),y=Gr(Object.assign({},E,w)),P=l===Ur?y:d,z={top:_.top-P.top+v.top,bottom:P.bottom-_.bottom+v.bottom,left:_.left-P.left+v.left,right:P.right-_.right+v.right},Z=e.modifiersData.offset;if(l===Ur&&Z){var F=Z[o];Object.keys(z).forEach(function(L){var M=[me,ge].indexOf(L)>=0?1:-1,k=[le,ge].indexOf(L)>=0?"y":"x";z[L]+=F[k]*M})}return z}function ts(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,u=r.allowedAutoPlacements,c=u===void 0?Zo:u,l=tt(n),p=l?s?Xa:Xa.filter(function(g){return tt(g)===l}):kt,f=p.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=p);var m=f.reduce(function(g,v){return g[v]=lt(e,{placement:v,boundary:o,rootBoundary:i,padding:a})[Oe(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function _y(e){if(Oe(e)===Xo)return[];var t=qr(e);return[ei(e),t,ei(t)]}function xy(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!0:a,u=r.fallbackPlacements,c=r.padding,l=r.boundary,p=r.rootBoundary,f=r.altBoundary,m=r.flipVariations,g=m===void 0?!0:m,v=r.allowedAutoPlacements,b=t.options.placement,E=Oe(b),x=E===b,_=u||(x||!g?[qr(b)]:_y(b)),d=[b].concat(_).reduce(function(Ae,Be){return Ae.concat(Oe(Be)===Xo?ts(t,{placement:Be,boundary:l,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:v}):Be)},[]),w=t.rects.reference,y=t.rects.popper,P=new Map,z=!0,Z=d[0],F=0;F=0,Y=U?"width":"height",B=lt(t,{placement:L,boundary:l,rootBoundary:p,altBoundary:f,padding:c}),R=U?k?me:fe:k?ge:le;w[Y]>y[Y]&&(R=qr(R));var V=qr(R),q=[];if(i&&q.push(B[M]<=0),s&&q.push(B[R]<=0,B[V]<=0),q.every(function(Ae){return Ae})){Z=L,z=!1;break}P.set(L,q)}if(z)for(var ie=g?3:1,ce=function(Be){var Ce=d.find(function(_t){var ze=P.get(_t);if(ze)return ze.slice(0,Be).every(function(xt){return xt})});if(Ce)return Z=Ce,"break"},te=ie;te>0;te--){var pt=ce(te);if(pt==="break")break}t.placement!==Z&&(t.modifiersData[n]._skip=!0,t.placement=Z,t.reset=!0)}}var Ap={name:"flip",enabled:!0,phase:"main",fn:xy,requiresIfExists:["offset"],data:{_skip:!1}};function Ip(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Rp(e){return[le,me,ge,fe].some(function(t){return e[t]>=0})}function Oy(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=lt(t,{elementContext:"reference"}),s=lt(t,{altBoundary:!0}),u=Ip(a,n),c=Ip(s,o,i),l=Rp(u),p=Rp(c);t.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}var Pp={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Oy};function Cy(e,t,r){var n=Oe(e),o=[fe,le].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[fe,me].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function Ty(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,a=Zo.reduce(function(l,p){return l[p]=Cy(p,t.rects,i),l},{}),s=a[t.placement],u=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}var Lp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ty};function wy(e){var t=e.state,r=e.name;t.modifiersData[r]=Pn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Np={name:"popperOffsets",enabled:!0,phase:"read",fn:wy,data:{}};function rs(e){return e==="x"?"y":"x"}function Sy(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!1:a,u=r.boundary,c=r.rootBoundary,l=r.altBoundary,p=r.padding,f=r.tether,m=f===void 0?!0:f,g=r.tetherOffset,v=g===void 0?0:g,b=lt(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),E=Oe(t.placement),x=tt(t.placement),_=!x,d=lr(E),w=rs(d),y=t.modifiersData.popperOffsets,P=t.rects.reference,z=t.rects.popper,Z=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,F=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(!!y){if(i){var k,U=d==="y"?le:fe,Y=d==="y"?ge:me,B=d==="y"?"height":"width",R=y[d],V=R+b[U],q=R-b[Y],ie=m?-z[B]/2:0,ce=x===wt?P[B]:z[B],te=x===wt?-z[B]:-P[B],pt=t.elements.arrow,Ae=m&&pt?ur(pt):{width:0,height:0},Be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:An(),Ce=Be[U],_t=Be[Y],ze=cr(0,P[B],Ae[B]),xt=_?P[B]/2-ie-ze-Ce-F.mainAxis:ce-ze-Ce-F.mainAxis,je=_?-P[B]/2+ie+ze+_t+F.mainAxis:te+ze+_t+F.mainAxis,rt=t.elements.arrow&&ut(t.elements.arrow),nt=rt?d==="y"?rt.clientTop||0:rt.clientLeft||0:0,It=(k=L?.[d])!=null?k:0,Gt=R+xt-It-nt,Wt=R+je-It,Rt=cr(m?sr(V,Gt):V,R,m?st(q,Wt):q);y[d]=Rt,M[d]=Rt-R}if(s){var Ye,Pt=d==="x"?le:fe,Ot=d==="x"?ge:me,He=y[w],dt=w==="y"?"height":"width",Vt=He+b[Pt],Ct=He-b[Ot],O=[le,fe].indexOf(E)!==-1,S=(Ye=L?.[w])!=null?Ye:0,oe=O?Vt:He-P[dt]-z[dt]-S+F.altAxis,ue=O?He+P[dt]+z[dt]-S-F.altAxis:Ct,be=m&&O?xp(oe,He,ue):cr(m?oe:Vt,He,m?ue:Ct);y[w]=be,M[w]=be-He}t.modifiersData[n]=M}}var Dp={name:"preventOverflow",enabled:!0,phase:"main",fn:Sy,requiresIfExists:["offset"]};function ns(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function os(e){return e===pe(e)||!ye(e)?fr(e):ns(e)}function Ay(e){var t=e.getBoundingClientRect(),r=St(t.width)/e.offsetWidth||1,n=St(t.height)/e.offsetHeight||1;return r!==1||n!==1}function is(e,t,r){r===void 0&&(r=!1);var n=ye(t),o=ye(t)&&Ay(t),i=Se(t),a=et(e,o),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(n||!n&&!r)&&((xe(t)!=="body"||dr(i))&&(s=os(t)),ye(t)?(u=et(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=pr(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function Iy(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var u=t.get(s);u&&o(u)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function as(e){var t=Iy(e);return Ep.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function ss(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function us(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Mp={placement:"bottom",modifiers:[],strategy:"absolute"};function Fp(){for(var e=arguments.length,t=new Array(e),r=0;r-1}function Kp(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Hp(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function Ny(e){return e.split(/\s+/).filter(Boolean)}function Wr(e){return[].concat(e)}function kp(e,t){e.indexOf(t)===-1&&e.push(t)}function Dy(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function My(e){return e.split("-")[0]}function ni(e){return[].slice.call(e)}function Up(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function Ln(){return document.createElement("div")}function oi(e){return["Element","Fragment"].some(function(t){return vs(e,t)})}function Fy(e){return vs(e,"NodeList")}function By(e){return vs(e,"MouseEvent")}function Hy(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function ky(e){return oi(e)?[e]:Fy(e)?ni(e):Array.isArray(e)?e:ni(document.querySelectorAll(e))}function fs(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function jp(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function Uy(e){var t,r=Wr(e),n=r[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function jy(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,a=o.popperState,s=o.props,u=s.interactiveBorder,c=My(a.placement),l=a.modifiersData.offset;if(!l)return!0;var p=c==="bottom"?l.top.y:0,f=c==="top"?l.bottom.y:0,m=c==="right"?l.left.x:0,g=c==="left"?l.right.x:0,v=i.top-n+p>u,b=n-i.bottom-f>u,E=i.left-r+m>u,x=r-i.right-g>u;return v||b||E||x})}function ps(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}function qp(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var bt={isTouch:!1},Gp=0;function qy(){bt.isTouch||(bt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zp))}function Zp(){var e=performance.now();e-Gp<20&&(bt.isTouch=!1,document.removeEventListener("mousemove",Zp)),Gp=e}function Gy(){var e=document.activeElement;if(Hy(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Wy(){document.addEventListener("touchstart",qy,mr),window.addEventListener("blur",Gy)}var Vy=typeof window<"u"&&typeof document<"u",$y=Vy?!!window.msCrypto:!1;var Qy={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},zy={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ct=Object.assign({appendTo:Xp,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Qy,zy),Yy=Object.keys(ct),Xy=function(t){var r=Object.keys(t);r.forEach(function(n){ct[n]=t[n]})};function Jp(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,a=o.defaultValue;if(i){var s;n[i]=e[i]!==void 0?e[i]:(s=ct[i])!=null?s:a}return n},{});return Object.assign({},e,r)}function Ky(e,t){var r=t?Object.keys(Jp(Object.assign({},ct,{plugins:t}))):Yy,n=r.reduce(function(o,i){var a=(e.getAttribute("data-tippy-"+i)||"").trim();if(!a)return o;if(i==="content")o[i]=a;else try{o[i]=JSON.parse(a)}catch{o[i]=a}return o},{});return n}function Wp(e,t){var r=Object.assign({},t,{content:Kp(t.content,[e])},t.ignoreAttributes?{}:Ky(e,t.plugins));return r.aria=Object.assign({},ct.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var Zy=function(){return"innerHTML"};function ms(e,t){e[Zy()]=t}function Vp(e){var t=Ln();return e===!0?t.className=zp:(t.className=Yp,oi(e)?t.appendChild(e):ms(t,e)),t}function $p(e,t){oi(t.content)?(ms(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?ms(e,t.content):e.textContent=t.content)}function hs(e){var t=e.firstElementChild,r=ni(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(Qp)}),arrow:r.find(function(n){return n.classList.contains(zp)||n.classList.contains(Yp)}),backdrop:r.find(function(n){return n.classList.contains(Ly)})}}function ed(e){var t=Ln(),r=Ln();r.className=Py,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=Ln();n.className=Qp,n.setAttribute("data-state","hidden"),$p(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,a){var s=hs(t),u=s.box,c=s.content,l=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(i.content!==a.content||i.allowHTML!==a.allowHTML)&&$p(c,e.props),a.arrow?l?i.arrow!==a.arrow&&(u.removeChild(l),u.appendChild(Vp(a.arrow))):u.appendChild(Vp(a.arrow)):l&&u.removeChild(l)}return{popper:t,onUpdate:o}}ed.$$tippy=!0;var Jy=1,ri=[],ds=[];function e0(e,t){var r=Wp(e,Object.assign({},ct,Jp(Up(t)))),n,o,i,a=!1,s=!1,u=!1,c=!1,l,p,f,m=[],g=Hp(Gt,r.interactiveDebounce),v,b=Jy++,E=null,x=Dy(r.plugins),_={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},d={id:b,reference:e,popper:Ln(),popperInstance:E,props:r,state:_,plugins:x,clearDelayTimeouts:oe,setProps:ue,setContent:be,show:$t,hide:Lt,hideWithInteractivity:Vr,enable:O,disable:S,unmount:$r,destroy:Qr};if(!r.render)return d;var w=r.render(d),y=w.popper,P=w.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+d.id,d.popper=y,e._tippy=d,y._tippy=d;var z=x.map(function(h){return h.fn(d)}),Z=e.hasAttribute("aria-expanded");return rt(),ie(),R(),V("onCreate",[d]),r.showOnCreate&&Vt(),y.addEventListener("mouseenter",function(){d.props.interactive&&d.state.isVisible&&d.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){d.props.interactive&&d.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",g)}),d;function F(){var h=d.props.touch;return Array.isArray(h)?h:[h,0]}function L(){return F()[0]==="hold"}function M(){var h;return!!((h=d.props.render)!=null&&h.$$tippy)}function k(){return v||e}function U(){var h=k().parentNode;return h?Uy(h):document}function Y(){return hs(y)}function B(h){return d.state.isMounted&&!d.state.isVisible||bt.isTouch||l&&l.type==="focus"?0:cs(d.props.delay,h?0:1,ct.delay)}function R(h){h===void 0&&(h=!1),y.style.pointerEvents=d.props.interactive&&!h?"":"none",y.style.zIndex=""+d.props.zIndex}function V(h,T,I){if(I===void 0&&(I=!0),z.forEach(function(G){G[h]&&G[h].apply(G,T)}),I){var K;(K=d.props)[h].apply(K,T)}}function q(){var h=d.props.aria;if(!!h.content){var T="aria-"+h.content,I=y.id,K=Wr(d.props.triggerTarget||e);K.forEach(function(G){var Te=G.getAttribute(T);if(d.state.isVisible)G.setAttribute(T,Te?Te+" "+I:I);else{var Xe=Te&&Te.replace(I,"").trim();Xe?G.setAttribute(T,Xe):G.removeAttribute(T)}})}}function ie(){if(!(Z||!d.props.aria.expanded)){var h=Wr(d.props.triggerTarget||e);h.forEach(function(T){d.props.interactive?T.setAttribute("aria-expanded",d.state.isVisible&&T===k()?"true":"false"):T.removeAttribute("aria-expanded")})}}function ce(){U().removeEventListener("mousemove",g),ri=ri.filter(function(h){return h!==g})}function te(h){if(!(bt.isTouch&&(u||h.type==="mousedown"))){var T=h.composedPath&&h.composedPath()[0]||h.target;if(!(d.props.interactive&&qp(y,T))){if(Wr(d.props.triggerTarget||e).some(function(I){return qp(I,T)})){if(bt.isTouch||d.state.isVisible&&d.props.trigger.indexOf("click")>=0)return}else V("onClickOutside",[d,h]);d.props.hideOnClick===!0&&(d.clearDelayTimeouts(),d.hide(),s=!0,setTimeout(function(){s=!1}),d.state.isMounted||Ce())}}}function pt(){u=!0}function Ae(){u=!1}function Be(){var h=U();h.addEventListener("mousedown",te,!0),h.addEventListener("touchend",te,mr),h.addEventListener("touchstart",Ae,mr),h.addEventListener("touchmove",pt,mr)}function Ce(){var h=U();h.removeEventListener("mousedown",te,!0),h.removeEventListener("touchend",te,mr),h.removeEventListener("touchstart",Ae,mr),h.removeEventListener("touchmove",pt,mr)}function _t(h,T){xt(h,function(){!d.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&T()})}function ze(h,T){xt(h,T)}function xt(h,T){var I=Y().box;function K(G){G.target===I&&(ps(I,"remove",K),T())}if(h===0)return T();ps(I,"remove",p),ps(I,"add",K),p=K}function je(h,T,I){I===void 0&&(I=!1);var K=Wr(d.props.triggerTarget||e);K.forEach(function(G){G.addEventListener(h,T,I),m.push({node:G,eventType:h,handler:T,options:I})})}function rt(){L()&&(je("touchstart",It,{passive:!0}),je("touchend",Wt,{passive:!0})),Ny(d.props.trigger).forEach(function(h){if(h!=="manual")switch(je(h,It),h){case"mouseenter":je("mouseleave",Wt);break;case"focus":je($y?"focusout":"blur",Rt);break;case"focusin":je("focusout",Rt);break}})}function nt(){m.forEach(function(h){var T=h.node,I=h.eventType,K=h.handler,G=h.options;T.removeEventListener(I,K,G)}),m=[]}function It(h){var T,I=!1;if(!(!d.state.isEnabled||Ye(h)||s)){var K=((T=l)==null?void 0:T.type)==="focus";l=h,v=h.currentTarget,ie(),!d.state.isVisible&&By(h)&&ri.forEach(function(G){return G(h)}),h.type==="click"&&(d.props.trigger.indexOf("mouseenter")<0||a)&&d.props.hideOnClick!==!1&&d.state.isVisible?I=!0:Vt(h),h.type==="click"&&(a=!I),I&&!K&&Ct(h)}}function Gt(h){var T=h.target,I=k().contains(T)||y.contains(T);if(!(h.type==="mousemove"&&I)){var K=dt().concat(y).map(function(G){var Te,Xe=G._tippy,gr=(Te=Xe.popperInstance)==null?void 0:Te.state;return gr?{popperRect:G.getBoundingClientRect(),popperState:gr,props:r}:null}).filter(Boolean);jy(K,h)&&(ce(),Ct(h))}}function Wt(h){var T=Ye(h)||d.props.trigger.indexOf("click")>=0&&a;if(!T){if(d.props.interactive){d.hideWithInteractivity(h);return}Ct(h)}}function Rt(h){d.props.trigger.indexOf("focusin")<0&&h.target!==k()||d.props.interactive&&h.relatedTarget&&y.contains(h.relatedTarget)||Ct(h)}function Ye(h){return bt.isTouch?L()!==h.type.indexOf("touch")>=0:!1}function Pt(){Ot();var h=d.props,T=h.popperOptions,I=h.placement,K=h.offset,G=h.getReferenceClientRect,Te=h.moveTransition,Xe=M()?hs(y).arrow:null,gr=G?{getBoundingClientRect:G,contextElement:G.contextElement||k()}:e,ws={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kn){var yr=kn.state;if(M()){var Td=Y(),di=Td.box;["placement","reference-hidden","escaped"].forEach(function(Un){Un==="placement"?di.setAttribute("data-placement",yr.placement):yr.attributes.popper["data-popper-"+Un]?di.setAttribute("data-"+Un,""):di.removeAttribute("data-"+Un)}),yr.attributes.popper={}}}},Qt=[{name:"offset",options:{offset:K}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Te}},ws];M()&&Xe&&Qt.push({name:"arrow",options:{element:Xe,padding:3}}),Qt.push.apply(Qt,T?.modifiers||[]),d.popperInstance=ls(gr,y,Object.assign({},T,{placement:I,onFirstUpdate:f,modifiers:Qt}))}function Ot(){d.popperInstance&&(d.popperInstance.destroy(),d.popperInstance=null)}function He(){var h=d.props.appendTo,T,I=k();d.props.interactive&&h===Xp||h==="parent"?T=I.parentNode:T=Kp(h,[I]),T.contains(y)||T.appendChild(y),d.state.isMounted=!0,Pt()}function dt(){return ni(y.querySelectorAll("[data-tippy-root]"))}function Vt(h){d.clearDelayTimeouts(),h&&V("onTrigger",[d,h]),Be();var T=B(!0),I=F(),K=I[0],G=I[1];bt.isTouch&&K==="hold"&&G&&(T=G),T?n=setTimeout(function(){d.show()},T):d.show()}function Ct(h){if(d.clearDelayTimeouts(),V("onUntrigger",[d,h]),!d.state.isVisible){Ce();return}if(!(d.props.trigger.indexOf("mouseenter")>=0&&d.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(h.type)>=0&&a)){var T=B(!1);T?o=setTimeout(function(){d.state.isVisible&&d.hide()},T):i=requestAnimationFrame(function(){d.hide()})}}function O(){d.state.isEnabled=!0}function S(){d.hide(),d.state.isEnabled=!1}function oe(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function ue(h){if(!d.state.isDestroyed){V("onBeforeUpdate",[d,h]),nt();var T=d.props,I=Wp(e,Object.assign({},T,Up(h),{ignoreAttributes:!0}));d.props=I,rt(),T.interactiveDebounce!==I.interactiveDebounce&&(ce(),g=Hp(Gt,I.interactiveDebounce)),T.triggerTarget&&!I.triggerTarget?Wr(T.triggerTarget).forEach(function(K){K.removeAttribute("aria-expanded")}):I.triggerTarget&&e.removeAttribute("aria-expanded"),ie(),R(),P&&P(T,I),d.popperInstance&&(Pt(),dt().forEach(function(K){requestAnimationFrame(K._tippy.popperInstance.forceUpdate)})),V("onAfterUpdate",[d,h])}}function be(h){d.setProps({content:h})}function $t(){var h=d.state.isVisible,T=d.state.isDestroyed,I=!d.state.isEnabled,K=bt.isTouch&&!d.props.touch,G=cs(d.props.duration,0,ct.duration);if(!(h||T||I||K)&&!k().hasAttribute("disabled")&&(V("onShow",[d],!1),d.props.onShow(d)!==!1)){if(d.state.isVisible=!0,M()&&(y.style.visibility="visible"),R(),Be(),d.state.isMounted||(y.style.transition="none"),M()){var Te=Y(),Xe=Te.box,gr=Te.content;fs([Xe,gr],0)}f=function(){var Qt;if(!(!d.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=d.props.moveTransition,M()&&d.props.animation){var pi=Y(),kn=pi.box,yr=pi.content;fs([kn,yr],G),jp([kn,yr],"visible")}q(),ie(),kp(ds,d),(Qt=d.popperInstance)==null||Qt.forceUpdate(),V("onMount",[d]),d.props.animation&&M()&&ze(G,function(){d.state.isShown=!0,V("onShown",[d])})}},He()}}function Lt(){var h=!d.state.isVisible,T=d.state.isDestroyed,I=!d.state.isEnabled,K=cs(d.props.duration,1,ct.duration);if(!(h||T||I)&&(V("onHide",[d],!1),d.props.onHide(d)!==!1)){if(d.state.isVisible=!1,d.state.isShown=!1,c=!1,a=!1,M()&&(y.style.visibility="hidden"),ce(),Ce(),R(!0),M()){var G=Y(),Te=G.box,Xe=G.content;d.props.animation&&(fs([Te,Xe],K),jp([Te,Xe],"hidden"))}q(),ie(),d.props.animation?M()&&_t(K,d.unmount):d.unmount()}}function Vr(h){U().addEventListener("mousemove",g),kp(ri,g),g(h)}function $r(){d.state.isVisible&&d.hide(),d.state.isMounted&&(Ot(),dt().forEach(function(h){h._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),ds=ds.filter(function(h){return h!==d}),d.state.isMounted=!1,V("onHidden",[d]))}function Qr(){d.state.isDestroyed||(d.clearDelayTimeouts(),d.unmount(),nt(),delete e._tippy,d.state.isDestroyed=!0,V("onDestroy",[d]))}}function Nn(e,t){t===void 0&&(t={});var r=ct.plugins.concat(t.plugins||[]);Wy();var n=Object.assign({},t,{plugins:r}),o=ky(e);if(!1)var i,a;var s=o.reduce(function(u,c){var l=c&&e0(c,n);return l&&u.push(l),u},[]);return oi(e)?s[0]:s}Nn.defaultProps=ct;Nn.setDefaultProps=Xy;Nn.currentInput=bt;var VS=Object.assign({},wn,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});Nn.setDefaultProps({render:ed});var td=Nn;var he=$(J()),od=$(Co());function id(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var ad=typeof window<"u"&&typeof document<"u";function ys(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function rd(){return ad&&document.createElement("div")}function t0(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function sd(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!sd(e[r],t[r]))return!1}else return!1;return!0}else return!1}function r0(e){var t=[];return e.forEach(function(r){t.find(function(n){return sd(r,n)})||t.push(r)}),t}function n0(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:r0([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var gs=ad?he.useLayoutEffect:he.useEffect;function o0(e){var t=(0,he.useRef)();return t.current||(t.current=typeof e=="function"?e():e),t.current}function nd(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var i0={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function o(){t.props.className&&!n()||nd(r,"add",t.props.className)}function i(){n()&&nd(r,"remove",t.props.className)}return{onCreate:o,onBeforeUpdate:i,onAfterUpdate:o}}};function a0(e){function t(r){var n=r.children,o=r.content,i=r.visible,a=r.singleton,s=r.render,u=r.reference,c=r.disabled,l=c===void 0?!1:c,p=r.ignoreAttributes,f=p===void 0?!0:p,m=r.__source,g=r.__self,v=id(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),b=i!==void 0,E=a!==void 0,x=(0,he.useState)(!1),_=x[0],d=x[1],w=(0,he.useState)({}),y=w[0],P=w[1],z=(0,he.useState)(),Z=z[0],F=z[1],L=o0(function(){return{container:rd(),renders:1}}),M=Object.assign({ignoreAttributes:f},v,{content:L.container});b&&(M.trigger="manual",M.hideOnClick=!1),E&&(l=!0);var k=M,U=M.plugins||[];s&&(k=Object.assign({},M,{plugins:E&&a.data!=null?[].concat(U,[{fn:function(){return{onTrigger:function(V,q){var ie=a.data.children.find(function(ce){var te=ce.instance;return te.reference===q.currentTarget});V.state.$$activeSingletonInstance=ie.instance,F(ie.content)}}}}]):U,render:function(){return{popper:L.container}}}));var Y=[u].concat(n?[n.type]:[]);return gs(function(){var B=u;u&&u.hasOwnProperty("current")&&(B=u.current);var R=e(B||L.ref||rd(),Object.assign({},k,{plugins:[i0].concat(M.plugins||[])}));return L.instance=R,l&&R.disable(),i&&R.show(),E&&a.hook({instance:R,content:o,props:k,setSingletonContent:F}),d(!0),function(){R.destroy(),a?.cleanup(R)}},Y),gs(function(){var B;if(L.renders===1){L.renders++;return}var R=L.instance;R.setProps(n0(R.props,k)),(B=R.popperInstance)==null||B.forceUpdate(),l?R.disable():R.enable(),b&&(i?R.show():R.hide()),E&&a.hook({instance:R,content:o,props:k,setSingletonContent:F})}),gs(function(){var B;if(!!s){var R=L.instance;R.setProps({popperOptions:Object.assign({},R.props.popperOptions,{modifiers:[].concat((((B=R.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function(V){var q=V.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var ie,ce=q.state,te=(ie=ce.modifiersData)==null?void 0:ie.hide;(y.placement!==ce.placement||y.referenceHidden!==te?.isReferenceHidden||y.escaped!==te?.hasPopperEscaped)&&P({placement:ce.placement,referenceHidden:te?.isReferenceHidden,escaped:te?.hasPopperEscaped}),ce.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(Y)),he.default.createElement(he.default.Fragment,null,n?(0,he.cloneElement)(n,{ref:function(R){L.ref=R,ys(n.ref,R)}}):null,_&&(0,od.createPortal)(s?s(t0(y),Z,L.instance):o,L.container))}return t}var s0=function(e,t){return(0,he.forwardRef)(function(n,o){var i=n.children,a=id(n,["children"]);return he.default.createElement(e,Object.assign({},t,a),i?(0,he.cloneElement)(i,{ref:function(u){ys(o,u),ys(i.ref,u)}}):null)})};var u0=s0(a0(td)),ud=u0;var l0=({children:e,label:t,error:r,info:n,id:o})=>React.createElement("div",{className:"Input__Wrapper"},React.createElement("div",{className:"Input__Wrapper__Header"},t&&React.createElement("label",{htmlFor:o},t),n&&React.createElement(ud,{delay:[700,0],content:n},React.createElement("i",{className:"fa fa-info-circle"}))),e,r&&React.createElement("div",{className:"Input__Wrapper__Error"},r)),ld=l0;var cd=({icon:e,alignment:t="left"})=>React.createElement("span",{className:`Input__Icon Input__Icon${t==="left"?"--left":"--right"}`},e),c0=(0,fd.forwardRef)(({value:e,onChange:t,className:r="",emphasize:n,placeholder:o,icon:i,iconAlignment:a="left",type:s="text",isValid:u,label:c,id:l,info:p,error:f,...m},g)=>React.createElement(ld,{id:l,label:c,error:f,info:p},React.createElement("div",{className:"Input__Text__Wrapper"},React.createElement("input",{ref:g,type:s,value:e,id:l,onChange:t,className:`Input__Text ${n?"Input__Text--emphasize":""} ${a==="left"&&i?"Input__Text--withIcon":i&&u?"Input__Text--withIcons":""}`,placeholder:o,...m}),i&&React.createElement(cd,{alignment:a,icon:i}),i&&u&&a==="left"&&React.createElement(cd,{alignment:a,icon:React.createElement("i",{className:"fas fa-check"})})))),bs=c0;var pd=$(J()),Es=class extends pd.Component{constructor(){super(...arguments);Rs(this,"state",{hasError:!1})}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,n){}render(){return this.state.hasError?(console.log(this.state),React.createElement("span",{className:"block p-8 text-2xl text-center text-red"},"Une erreur est survenue")):this.props.children}},dd=Es;var f0=({currentTags:e,onUpdate:t})=>{let{data:r}=Fa(),n=r?.filter(o=>!e.find(({tag:i})=>i.id===o.id))||[];return React.createElement("ul",{className:"TagList"},n?.length>0?n.map(o=>React.createElement("li",{key:o.id,onClick:()=>{t(o)},className:"TagList__Item"},React.createElement("span",null,o.title))):React.createElement("li",{className:"TagList__Item"},React.createElement("span",null,"No tags available.")))},p0=({isOpen:e,setIsOpen:t,image:r})=>{let[n,o]=(0,Et.useState)(!1),i=ve(),a=Pf(),s=Lf();return React.createElement(_s.default,{isOpen:e,onRequestClose:()=>{t(!1)},className:"Modal-Tags",overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>{t(!1)},className:"Modal__Header__Close"},React.createElement(Ha,null)),React.createElement("div",{className:"Modal__Header__Title"},i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_TAG_CONFIG"})," ",r.title)),React.createElement("div",{className:"Modal__Content",style:{overflow:"inherit"}},React.createElement("div",null,React.createElement("label",null,i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_ADD_TAG"})),React.createElement("div",{className:"BlockImage__TagSelector"},React.createElement("div",{className:"BlockImage__TagSelector__Tags",style:{paddingLeft:r.tags.length<1?"14px":"0"}},r.tags.length?r.tags.map(({tag:u,imageTag:c})=>React.createElement("div",{key:u.id,className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,u.title),React.createElement("button",{className:"BlockImage__TagSelector__Tag__Remove",onClick:()=>a.mutate(c.id||57)},React.createElement(Df,null)))):s.isLoading?null:i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_SELECT_TAG"}),s.isLoading&&React.createElement("div",{className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,React.createElement("i",{className:"fa fa-circle-notch fa-spin"})))),React.createElement("button",{className:"BlockImage__TagSelector__Add",onClick:()=>o(!n),disabled:s.isLoading||a.isLoading},React.createElement("i",{className:"block fas fa-plus"})),n?React.createElement(Et.Suspense,{fallback:React.createElement("div",{className:"BlockProduct__Loader"},React.createElement("i",{className:"fa fa-circle-notch fa-spin"}))},React.createElement(f0,{currentTags:r.tags,onUpdate:u=>{s.mutate({imageId:r.id,tagId:u.id}),o(!1)}})):null)))))},d0=()=>{let e=ve(),{data:t}=Fa();return React.createElement(React.Fragment,null,React.createElement("option",{value:""},e.formatMessage({id:"ALL_TAGS"})),t?.map(r=>React.createElement("option",{key:r.id,value:r.id},r.title)))},m0=({setTagId:e})=>{let t=ve();return React.createElement("div",{className:"Select__Wrapper"},React.createElement("div",{className:"Input__Select__Separator"}),React.createElement("label",{htmlFor:"tag-filter"},t.formatMessage({id:"BlockImage__LIBRARY_MODAL_TAG_FILTER"})),React.createElement("select",{className:"Input__Select",name:"tag-filter",id:"tag-filter",onChange:r=>e(r.target.value)},React.createElement(Et.Suspense,{fallback:React.createElement("option",null,t.formatMessage({id:"LOADING"}))},React.createElement(d0,null))))},h0=({image:e,onSelect:t})=>{let[r,n]=(0,Et.useState)(!1),o=ve(),i=Rf();return React.createElement(React.Fragment,null,React.createElement("div",{className:"Library__Image"},React.createElement("div",{className:"Library__Image__Tags"},e.tags?.map(({tag:a})=>React.createElement("span",{key:a.id,style:{border:`1px solid ${a.colorCode}`,color:a.colorCode},className:"Library__Image__Tag"},a.title))),React.createElement("img",{width:"150",height:"150",loading:"lazy",src:`/image-library/${e.id}/full/^!150,150/0/default.webp`}),React.createElement("span",{className:"Library__Image__Title"},e.title),React.createElement("div",{className:"Library__Image__Actions"},React.createElement("span",{className:"Library__Image__Action__Title"},e.title),React.createElement("button",{className:"Library__Image__Select__Action",style:{marginTop:"12px",marginBottom:"6px"},onClick:()=>t(e)},o.formatMessage({id:"CHOOSE"})),React.createElement("div",{className:"flex gap-2"},React.createElement("button",{className:"Library__Image__Tag__Action",onClick:()=>n(!0)},React.createElement("i",{className:"fas fa-tag"})),React.createElement("button",{className:"Library__Image__Delete__Action",onClick:()=>i.mutate(e.id)},React.createElement(Nf,null))))),React.createElement(p0,{image:e,isOpen:r,setIsOpen:n}))},v0=({limit:e=20,onSelect:t})=>{let[r,n]=(0,Et.useState)(0),[o,i]=(0,Et.useState)(""),[a,s]=(0,Et.useState)(),{data:u=[],isFetching:c,isPreviousData:l}=Af({offset:r,limit:e,title:o,tagId:a}),p=ve();return React.createElement("div",{className:"Library"},React.createElement("div",{className:"Library__Filters"},React.createElement(bs,{placeholder:p.formatMessage({id:"SEARCH_BY"}),type:"text",name:"library-search",id:"library-search",value:o,onChange:f=>i(f.target.value),label:p.formatMessage({id:"BlockImage__LIBRARY_MODAL_SEARCH"}),icon:React.createElement("i",{className:"fa fa-search emphasize"}),iconAlignment:"right"}),React.createElement(m0,{setTagId:s})),React.createElement("div",{className:"Library__Content"},c?React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,p.formatMessage({id:"BlockImage__LIBRARY_SEARCHING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):u.length>0?u?.map(f=>React.createElement(h0,{key:f.id,image:f,onSelect:t})):React.createElement("div",{className:"Library__NoContent"},React.createElement("span",null,p.formatMessage({id:"BlockImage__LIBRARY_NO_CONTENT"})))),React.createElement("div",{className:"Pagination"},React.createElement("button",{className:"Pagination__Button Pagination__Button--previous",onClick:()=>n(f=>Math.max(f-e,0)),disabled:r===0},React.createElement("i",{className:"fa fa-chevron-left"})),React.createElement("div",{className:"Pagination__Button Pagination__Button--page"},r/e+1),React.createElement("button",{className:"Pagination__Button Pagination__Button--next",onClick:()=>{!l&&(u?.length||0)>=e&&n(f=>f+e)},disabled:l||(u?.length||0)t(!1),className:"Modal-Library",ariaHideApp:!1,overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>t(!1),className:"Modal__Header__Close"},React.createElement(Ha,null)),React.createElement("div",{className:"Modal__Header__Title"},o.formatMessage({id:"BlockImage__LIBRARY_MODAL_TITLE"}))),React.createElement("div",{className:"Modal__Content"},React.createElement(Et.Suspense,{fallback:React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,o.formatMessage({id:"BlockImage__LIBRARY_LOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"}))},React.createElement(dd,null,React.createElement(v0,{onSelect:n,limit:r}))))))}function Dn(e){return React.createElement(Cr,{messages:rn[Nt],locale:Nt},React.createElement(Rr,{client:gn},React.createElement(g0,{...e})))}var ci=$(J(),1),fi=$(J(),1),ft=$(J(),1);var y0={data:""},b0=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||y0;var E0=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_0=/\/\*[^]*?\*\/| +/g,md=/\n+/g,jt=(e,t)=>{let r="",n="",o="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+a+";":n+=i[1]=="f"?jt(a,i):i+"{"+jt(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=jt(a,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=jt.p?jt.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Mn={},hd=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+hd(e[r]);return t}return e},x0=(e,t,r,n,o)=>{let i=hd(e),a=Mn[i]||(Mn[i]=(s=>{let u=0,c=11;for(;u>>0;return"go"+c})(i));if(!Mn[a]){let s=i!==e?e:(u=>{let c,l,p=[{}];for(;c=E0.exec(u.replace(_0,""));)c[4]?p.shift():c[3]?(l=c[3].replace(md," ").trim(),p.unshift(p[0][l]=p[0][l]||{})):p[0][c[1]]=c[2].replace(md," ").trim();return p[0]})(e);Mn[a]=jt(o?{["@keyframes "+a]:s}:s,r?"":"."+a)}return((s,u,c)=>{u.data.indexOf(s)==-1&&(u.data=c?s+u.data:u.data+s)})(Mn[a],t,n),a},O0=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let s=a(r),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":jt(s,""):s===!1?"":s}return n+o+(a??"")},"");function Fn(e){let t=this||{},r=e.call?e(t.p):e;return x0(r.unshift?r.raw?O0(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,b0(t.target),t.g,t.o,t.k)}var vd,xs,Os,SA=Fn.bind({g:1}),Ue=Fn.bind({k:1});function gd(e,t,r,n){jt.p=t,vd=e,xs=r,Os=n}function Qe(e,t){let r=this||{};return function(){let n=arguments;function o(i,a){let s=Object.assign({},i),u=s.className||o.className;r.p=Object.assign({theme:xs&&xs()},s),r.o=/ *go\d+/.test(u),s.className=Fn.apply(r,n)+(u?" "+u:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),Os&&c[0]&&Os(s),vd(c,s)}return t?t(o):o}}var hr=$(J(),1);var Bn=$(J(),1),C0=e=>typeof e=="function",li=(e,t)=>C0(e)?e(t):e,T0=(()=>{let e=0;return()=>(++e).toString()})(),w0=e=>t=>{t&&setTimeout(()=>{let r=t.getBoundingClientRect();e(r)})},bd=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),S0=20,ai=new Map,yd=e=>{if(ai.has(e))return;let t=setTimeout(()=>{ai.delete(e),vr({type:4,toastId:e})},1e3);ai.set(e,t)},A0=e=>{let t=ai.get(e);t&&clearTimeout(t)},Cs=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,S0)};case 1:return t.toast.id&&A0(t.toast.id),{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:r}=t;return e.toasts.find(i=>i.id===r.id)?Cs(e,{type:1,toast:r}):Cs(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?yd(n):e.toasts.forEach(i=>{yd(i.id)}),{...e,toasts:e.toasts.map(i=>i.id===n||n===void 0?{...i,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+o}))}}},si=[],ui={toasts:[],pausedAt:void 0},vr=e=>{ui=Cs(ui,e),si.forEach(t=>{t(ui)})},I0={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},R0=(e={})=>{let[t,r]=(0,ci.useState)(ui);(0,ci.useEffect)(()=>(si.push(r),()=>{let o=si.indexOf(r);o>-1&&si.splice(o,1)}),[t]);let n=t.toasts.map(o=>{var i,a;return{...e,...e[o.type],...o,duration:o.duration||((i=e[o.type])==null?void 0:i.duration)||e?.duration||I0[o.type],style:{...e.style,...(a=e[o.type])==null?void 0:a.style,...o.style}}});return{...t,toasts:n}},P0=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||T0()}),Hn=e=>(t,r)=>{let n=P0(t,e,r);return vr({type:2,toast:n}),n.id},Fe=(e,t)=>Hn("blank")(e,t);Fe.error=Hn("error");Fe.success=Hn("success");Fe.loading=Hn("loading");Fe.custom=Hn("custom");Fe.dismiss=e=>{vr({type:3,toastId:e})};Fe.remove=e=>vr({type:4,toastId:e});Fe.promise=(e,t,r)=>{let n=Fe.loading(t.loading,{...r,...r?.loading});return e.then(o=>(Fe.success(li(t.success,o),{id:n,...r,...r?.success}),o)).catch(o=>{Fe.error(li(t.error,o),{id:n,...r,...r?.error})}),e};var L0=e=>{let{toasts:t,pausedAt:r}=R0(e);(0,fi.useEffect)(()=>{if(r)return;let o=Date.now(),i=t.map(a=>{if(a.duration===1/0)return;let s=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(s<0){a.visible&&Fe.dismiss(a.id);return}return setTimeout(()=>Fe.dismiss(a.id),s)});return()=>{i.forEach(a=>a&&clearTimeout(a))}},[t,r]);let n=(0,fi.useMemo)(()=>({startPause:()=>{vr({type:5,time:Date.now()})},endPause:()=>{r&&vr({type:6,time:Date.now()})},updateHeight:(o,i)=>vr({type:1,toast:{id:o,height:i}}),calculateOffset:(o,i)=>{let{reverseOrder:a=!1,gutter:s=8,defaultPosition:u}=i||{},c=t.filter(f=>(f.position||u)===(o.position||u)&&f.height),l=c.findIndex(f=>f.id===o.id),p=c.filter((f,m)=>mf.visible).slice(...a?[p+1]:[0,p]).reduce((f,m)=>f+(m.height||0)+s,0)}}),[t,r]);return{toasts:t,handlers:n}},N0=Ue` +For more details see https://formatjs.io/docs/getting-started/message-distribution`)}function ki(e,t){var r=Bi(t),n=C(C({},en),e),o=n.locale,i=n.defaultLocale,a=n.onError;return o?!Intl.NumberFormat.supportedLocalesOf(o).length&&a?a(new Fi('Missing locale data for locale: "'.concat(o,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(o).length&&a&&a(new Fi('Missing locale data for locale: "'.concat(o,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(a&&a(new Uu('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),n.locale=n.defaultLocale||"en"),Nm(n),C(C({},n),{formatters:r,formatNumber:rl.bind(null,n,r.getNumberFormat),formatNumberToParts:nl.bind(null,n,r.getNumberFormat),formatRelativeTime:el.bind(null,n,r.getRelativeTimeFormat),formatDate:Vu.bind(null,n,r.getDateTimeFormat),formatDateToParts:zu.bind(null,n,r.getDateTimeFormat),formatTime:$u.bind(null,n,r.getDateTimeFormat),formatDateTimeRange:Qu.bind(null,n,r.getDateTimeFormat),formatTimeToParts:Yu.bind(null,n,r.getDateTimeFormat),formatPlural:Ju.bind(null,n,r.getPluralRules),formatMessage:_r.bind(null,n,r),$t:_r.bind(null,n,r),formatList:Zu.bind(null,n,r.getListFormat),formatListToParts:Hi.bind(null,n,r.getListFormat),formatDisplayName:Xu.bind(null,n,r.getDisplayNames)})}function ho(e){Yr(e,"[React Intl] Could not find required `intl` object. needs to exist in the component ancestry.")}var Ui=C(C({},en),{textComponent:mo.Fragment});function ol(e){return function(t){return e(mo.Children.toArray(t))}}function il(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),o=r.length;if(n.length!==o)return!1;for(var i=0;iyo.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},yo.createElement("path",{d:"M19.86 15.26V2.47C19.8574 1.814 19.5949 1.18577 19.1301 0.722836C18.6653 0.259906 18.036 -5.33299e-06 17.38 0H2.5C2.16847 0.00126416 1.84048 0.068193 1.53497 0.196922C1.22945 0.32565 0.952464 0.513628 0.72 0.75C0.268046 1.20961 0.0102384 1.82548 1.31138e-09 2.47V17.38C-1.06443e-05 17.7074 0.0647931 18.0315 0.190674 18.3337C0.316554 18.6359 0.50102 18.9102 0.733432 19.1407C0.965844 19.3713 1.2416 19.5535 1.5448 19.677C1.848 19.8004 2.17264 19.8626 2.5 19.86H17.38C18.0369 19.8574 18.6662 19.5952 19.1307 19.1307C19.5952 18.6662 19.8574 18.0369 19.86 17.38V15.38V15.25V15.26ZM15.61 13.04L18.7 15.52L18.79 15.6V17.38C18.7821 17.7478 18.6298 18.0978 18.3659 18.3541C18.1021 18.6105 17.7479 18.7527 17.38 18.75H2.5C2.31454 18.7508 2.13075 18.715 1.95916 18.6446C1.78756 18.5743 1.63153 18.4707 1.5 18.34C1.36742 18.2098 1.26271 18.0541 1.19222 17.8821C1.12174 17.7102 1.08696 17.5258 1.09 17.34V16.47L1.18 16.39L6.25 12.14C6.39167 12.0175 6.5727 11.95 6.76 11.95C6.95222 11.9494 7.13771 12.0208 7.28 12.15L9.8 14.75C10.1157 15.0571 10.5305 15.2414 10.97 15.27C11.4102 15.304 11.8476 15.176 12.2 14.91L14.66 13C14.7961 12.8988 14.9604 12.8428 15.13 12.84C15.2999 12.8407 15.4649 12.8969 15.6 13L15.61 13.04ZM18.78 13.67V14.19L18.38 13.86L16.26 12.18C15.9416 11.9269 15.5468 11.7891 15.14 11.7891C14.7332 11.7891 14.3384 11.9269 14.02 12.18L11.56 13.97C11.4214 14.0831 11.2489 14.1465 11.07 14.15C10.8861 14.1476 10.7091 14.0803 10.57 13.96L8.02 11.44C7.6917 11.1055 7.24813 10.9089 6.77983 10.8904C6.31152 10.8718 5.85377 11.0326 5.5 11.34L1.5 14.75L1.09 15.1V2.47C1.09 2.28531 1.12654 2.10243 1.19752 1.93192C1.2685 1.76141 1.37252 1.60663 1.50358 1.4765C1.63464 1.34636 1.79016 1.24345 1.96117 1.17368C2.13218 1.10392 2.31531 1.06868 2.5 1.07H17.38C17.5658 1.06696 17.7502 1.10174 17.9221 1.17222C18.0941 1.24271 18.2498 1.34742 18.38 1.48C18.5107 1.61153 18.6143 1.76756 18.6846 1.93916C18.755 2.11075 18.7908 2.29454 18.79 2.48L18.78 13.67Z",fill:"#333333"}),yo.createElement("path",{d:"M14.0707 4.37993C13.5919 4.18009 13.0647 4.12687 12.5557 4.22701C12.0467 4.32715 11.5788 4.57613 11.2115 4.94241C10.8441 5.30869 10.5938 5.77578 10.4922 6.28449C10.3905 6.7932 10.4422 7.32062 10.6407 7.79993C10.8466 8.2856 11.1953 8.69714 11.6407 8.97992C12.1453 9.31662 12.7511 9.46778 13.3547 9.4076C13.9584 9.34742 14.5224 9.07963 14.9507 8.64992C15.2546 8.34523 15.4788 7.97034 15.6035 7.5584C15.7281 7.14646 15.7494 6.71016 15.6654 6.28805C15.5813 5.86595 15.3946 5.47104 15.1217 5.13824C14.8488 4.80544 14.4981 4.545 14.1007 4.37993H14.0707ZM14.3507 7.65992C14.1855 7.91702 13.9443 8.11626 13.6607 8.22992C13.3763 8.34874 13.0629 8.38007 12.7607 8.31992C12.4597 8.25811 12.1824 8.11251 11.9607 7.89992C11.7994 7.73572 11.6763 7.53809 11.5999 7.32101C11.5235 7.10393 11.4958 6.87271 11.5187 6.64373C11.5416 6.41475 11.6146 6.1936 11.7324 5.99594C11.8502 5.79828 12.0101 5.62895 12.2007 5.49993C12.4548 5.32915 12.7544 5.23857 13.0607 5.23992C13.4736 5.24265 13.8687 5.40791 14.1607 5.69992C14.3062 5.84383 14.4217 6.01513 14.5007 6.20392C14.5796 6.39272 14.6204 6.59528 14.6207 6.79993C14.6216 7.10759 14.5273 7.40801 14.3507 7.65992Z",fill:"#333333"}));var Qi=W(J()),dl=e=>Qi.createElement("svg",{width:28,height:26,viewBox:"0 0 26 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Qi.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 25C19.9036 25 25.5 19.4036 25.5 12.5C25.5 5.59644 19.9036 0 13 0C6.09644 0 0.5 5.59644 0.5 12.5C0.5 19.4036 6.09644 25 13 25ZM17.6328 15.9581L13.5555 19.9162C13.4826 19.9868 13.396 20.0428 13.3006 20.081C13.2053 20.1193 13.1031 20.1389 12.9998 20.1389C12.8966 20.1389 12.7944 20.1191 12.6991 20.0808C12.6038 20.0426 12.5172 19.9865 12.4444 19.9158L8.36709 15.9578C8.22042 15.8153 8.13834 15.6225 8.13889 15.4216C8.13944 15.2207 8.22258 15.0282 8.37002 14.8865C8.51747 14.7449 8.71713 14.6656 8.92509 14.6661C9.13305 14.6666 9.33228 14.7469 9.47894 14.8894L12.2162 17.5465V5.61856C12.2162 5.41767 12.2988 5.22501 12.4459 5.08296C12.5929 4.94091 12.7924 4.86111 13.0003 4.86111C13.2083 4.86111 13.4077 4.94091 13.5548 5.08296C13.7018 5.22501 13.7844 5.41767 13.7844 5.61856L13.7844 17.5465L16.5209 14.8894C16.5936 14.8189 16.6799 14.7628 16.7749 14.7245C16.87 14.6862 16.9719 14.6664 17.0749 14.6662C17.1779 14.6659 17.2799 14.6853 17.3752 14.7231C17.4704 14.761 17.557 14.8166 17.63 14.8867C17.703 14.9569 17.761 15.0403 17.8007 15.1321C17.8403 15.2239 17.8609 15.3224 17.8611 15.4219C17.8614 15.5214 17.8413 15.6199 17.8022 15.7119C17.763 15.804 17.7054 15.8876 17.6328 15.9581Z",fill:"#222222"}));var tn=W(J()),ml=e=>tn.createElement("svg",{width:28,height:26,viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},tn.createElement("path",{d:"M7.25281 20.4814C5.42678 20.4814 3.80262 19.3023 3.21296 17.5469L3.17304 17.4146C3.03389 16.9499 2.97572 16.5588 2.97572 16.1677V8.32471L0.20873 17.6401C-0.147124 19.0102 0.663812 20.4308 2.0245 20.8093L19.6609 25.5728C19.8811 25.6303 20.1012 25.6579 20.3179 25.6579C21.4539 25.6579 22.4918 24.8976 22.7826 23.7771L23.8103 20.4814H7.25281Z",fill:"#222222"}),tn.createElement("path",{d:"M10.3885 8.40309C11.6466 8.40309 12.6696 7.37124 12.6696 6.10242C12.6696 4.83361 11.6466 3.80176 10.3885 3.80176C9.1305 3.80176 8.10742 4.83361 8.10742 6.10242C8.10742 7.37124 9.1305 8.40309 10.3885 8.40309Z",fill:"#222222"}),tn.createElement("path",{d:"M24.6453 0.350098H7.53694C5.96525 0.350098 4.68555 1.64077 4.68555 3.22593V15.8796C4.68555 17.4648 5.96525 18.7554 7.53694 18.7554H24.6453C26.217 18.7554 27.4967 17.4648 27.4967 15.8796V3.22593C27.4967 1.64077 26.217 0.350098 24.6453 0.350098ZM7.53694 2.65076H24.6453C24.9601 2.65076 25.2156 2.90844 25.2156 3.22593V11.3921L21.6126 7.15202C21.2305 6.69994 20.6773 6.45837 20.0831 6.44456C19.4923 6.44801 18.938 6.71259 18.5593 7.17042L14.3233 12.2986L12.9432 10.9102C12.163 10.1233 10.8936 10.1233 10.1146 10.9102L6.96666 14.0839V3.22593C6.96666 2.90844 7.22215 2.65076 7.53694 2.65076Z",fill:"#222222"}));var Bm=()=>document.documentElement.lang||navigator.languages&&navigator.languages[0]||navigator.language||"en",Dt=Bm(),rn={fr:{BlockImage__DOWNLOAD:"T\xE9l\xE9charger une image",BlockImage__OR_DROP:"ou glisser-d\xE9poser une image",BlockImage__SELECT_BUTTON:"S\xE9lectionner une image",BlockImage__SELECT:"depuis votre m\xE9diath\xE8que",BlockImage__TITLE:"Titre de l'image",BlockImage__LINK:"Lien de l'image",BlockImage__LINK_PLACEHOLDER:"Lien au clic sur l'image",BlockImage__LIBRARY_MODAL_TITLE:"Rechercher une image",BlockImage__LIBRARY_MODAL_SEARCH:"Rechercher dans la m\xE9diath\xE8que",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrer par tag",BlockImage__LIBRARY_LOADING:"Chargement de la librairie...",BlockImage__TOAST_WRONG_FILE_TYPE:"Votre image n'a pas pu \xEAtre t\xE9l\xE9charg\xE9e. Veuillez v\xE9rifier que votre fichier est bien une image.",BlockImage__TOAST_MAX_FILE:"Veuillez uploader une seule image.",BlockImage__DROP_TO_UPLOAD:"Relacher pour uploader votre image",BlockImage__LIBRARY_NO_CONTENT:"Aucune image trouv\xE9e",BlockImage__LIBRARY_SEARCHING:"Recherche en cours...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configuration des tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Ajouter un ou plusieurs tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"S\xE9lectionnez un ou plusieurs tag",REPLACE:"Remplacer",REPLACE_IMAGE:"Remplacer l'image",OPTIONAL:"Optionnel",CANCEL:"Annuler",DELETE:"Supprimer",SEARCH_BY:"R\xE9f\xE9rence, nom, ...",LOADING:"Chargement...",DOWNLOADING:"T\xE9l\xE9chargement...",ALL_TAGS:"Tous les tags",CHOOSE:"Choisir"},en:{BlockImage__DOWNLOAD:"Download an image",BlockImage__OR_DROP:"or drop an image",BlockImage__SELECT_BUTTON:"Select an image",BlockImage__SELECT:"from your library",BlockImage__TITLE:"Image title",BlockImage__LINK:"Image link",BlockImage__LINK_PLACEHOLDER:"Link on click on image",BlockImage__LIBRARY_MODAL_TITLE:"Search an image",BlockImage__LIBRARY_MODAL_SEARCH:"Search in the library",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filter by tag",BlockImage__LIBRARY_LOADING:"Loading library...",BlockImage__TOAST_WRONG_FILE_TYPE:"Your image could not be uploaded. Please check that your file is an image.",BlockImage__TOAST_MAX_FILE:"Please upload only one image.",BlockImage__DROP_TO_UPLOAD:"Release to upload your image",BlockImage__LIBRARY_NO_CONTENT:"No image found",BlockImage__LIBRARY_SEARCHING:"Searching...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configure tags of",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Add one or more tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Select one or more tag",REPLACE:"Replace",REPLACE_IMAGE:"Replace image",OPTIONAL:"Optional",CANCEL:"Cancel",DELETE:"Delete",SEARCH_BY:"Reference, name, ...",LOADING:"Loading...",DOWNLOADING:"Downloading...",ALL_TAGS:"All tags",CHOOSE:"Choose"},es:{BlockImage__DOWNLOAD:"Descargar una imagen",BlockImage__OR_DROP:"o arrastrar una imagen",BlockImage__SELECT_BUTTON:"Seleccionar una imagen",BlockImage__SELECT:"de tu biblioteca",BlockImage__TITLE:"T\xEDtulo de la imagen",BlockImage__LINK:"Enlace de la imagen",BlockImage__LINK_PLACEHOLDER:"Enlace al hacer clic en la imagen",BlockImage__LIBRARY_MODAL_TITLE:"Buscar una imagen",BlockImage__LIBRARY_MODAL_SEARCH:"Buscar en la biblioteca",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtrar por tag",BlockImage__LIBRARY_LOADING:"Cargando la biblioteca...",BlockImage__TOAST_WRONG_FILE_TYPE:"Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.",BlockImage__TOAST_MAX_FILE:"Por favor sube solo una imagen.",BlockImage__DROP_TO_UPLOAD:"Suelte para subir tu imagen",BlockImage__LIBRARY_NO_CONTENT:"No se encontraron imagenes",BlockImage__LIBRARY_SEARCHING:"Buscando...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configurar tags de",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Agregar uno o m\xE1s tags",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleccionar uno o m\xE1s tags",REPLACE:"Reemplazar",REPLACE_IMAGE:"Reemplazar imagen",OPTIONAL:"Opcional",CANCEL:"Cancelar",DELETE:"Eliminar",SEARCH_BY:"Referencia, nombre, ...",LOADING:"Cargando...",DOWNLOADING:"Descargando...",ALL_TAGS:"Todos los tags",CHOOSE:"Elegir"},it:{BlockImage__DOWNLOAD:"Scarica un immagine",BlockImage__OR_DROP:"o trascina un immagine",BlockImage__SELECT_BUTTON:"Seleziona un immagine",BlockImage__SELECT:"dalla tua libreria",BlockImage__TITLE:"Titolo dell immagine",BlockImage__LINK:"Link dell immagine",BlockImage__LINK_PLACEHOLDER:"Link al click sull immagine",BlockImage__LIBRARY_MODAL_TITLE:"Cerca un immagine",BlockImage__LIBRARY_MODAL_SEARCH:"Cerca nella libreria",BlockImage__LIBRARY_MODAL_TAG_FILTER:"Filtra per tag",BlockImage__LIBRARY_LOADING:"Caricamento della libreria...",BlockImage__TOAST_WRONG_FILE_TYPE:"La tua immagine non pu\xF2 essere caricata. Per favore verifica che il tuo file sia un immagine.",BlockImage__TOAST_MAX_FILE:"Per favore carica solo una immagine.",BlockImage__DROP_TO_UPLOAD:"Rilascia per caricare la tua immagine",BlockImage__LIBRARY_NO_CONTENT:"Nessuna immagine trovata",BlockImage__LIBRARY_SEARCHING:"Ricerca in corso...",BlockImage__LIBRARY_IMAGE_TAG_CONFIG:"Configura i tag di",BlockImage__LIBRARY_IMAGE_ADD_TAG:"Aggiungi uno o pi\xF9 tag",BlockImage__LIBRARY_IMAGE_SELECT_TAG:"Seleziona uno o pi\xF9 tag",REPLACE:"Sostituisci",REPLACE_IMAGE:"Sostituisci immagine",OPTIONAL:"Opzionale",CANCEL:"Annulla",DELETE:"Elimina",SEARCH_BY:"Riferimento, nome, ...",LOADING:"Caricamento...",DOWNLOADING:"Scaricare...",ALL_TAGS:"Tutti i tag",CHOOSE:"Scegli"}};var j=W(J()),re=W(bo());var Um=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Tr(e,t){var r=jm(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function jm(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=Um.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var qm=[".DS_Store","Thumbs.db"];function Yi(e){return zt(this,void 0,void 0,function(){return Yt(this,function(t){return Eo(e)&&Gm(e.dataTransfer)?[2,Qm(e.dataTransfer,e.type)]:Wm(e)?[2,Vm(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,$m(e)]:[2,[]]})})}function Gm(e){return Eo(e)}function Wm(e){return Eo(e)&&Eo(e.target)}function Eo(e){return typeof e=="object"&&e!==null}function Vm(e){return zi(e.target.files).map(function(t){return Tr(t)})}function $m(e){return zt(this,void 0,void 0,function(){var t;return Yt(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return Tr(n)})]}})})}function Qm(e,t){return zt(this,void 0,void 0,function(){var r,n;return Yt(this,function(o){switch(o.label){case 0:return e.items?(r=zi(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(zm))]):[3,2];case 1:return n=o.sent(),[2,xl(Cl(n))];case 2:return[2,xl(zi(e.files).map(function(i){return Tr(i)}))]}})})}function xl(e){return e.filter(function(t){return qm.indexOf(t.name)===-1})}function zi(e){if(e===null)return[];for(var t=[],r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);rr)return[!1,Rl(r)];if(e.sizer)return[!1,Rl(r)]}return[!0,null]}function Jt(e){return e!=null}function Fl(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(u){var c=Zi(u,r),l=nn(c,1),p=l[0],f=Ji(u,n,o),m=nn(f,1),g=m[0],v=s?s(u):null;return p&&g&&!v})}function on(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function an(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function ea(e){e.preventDefault()}function uh(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function lh(e){return e.indexOf("Edge/")!==-1}function Bl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return uh(e)||lh(e)}function it(){for(var e=arguments.length,t=new Array(e),r=0;r1?o-1:0),a=1;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(r[n]=e[n]))}return r}function _h(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var ia=(0,j.forwardRef)(function(e,t){var r=e.children,n=_o(e,ch),o=aa(n),i=o.open,a=_o(o,fh);return(0,j.useImperativeHandle)(t,function(){return{open:i}},[i]),j.default.createElement(j.Fragment,null,r(ae(ae({},a),{},{open:i})))});ia.displayName="Dropzone";var zl={disabled:!1,getFilesFromEvent:Yi,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};ia.defaultProps=zl;ia.propTypes={children:re.default.func,accept:re.default.objectOf(re.default.arrayOf(re.default.string)),multiple:re.default.bool,preventDropOnDocument:re.default.bool,noClick:re.default.bool,noKeyboard:re.default.bool,noDrag:re.default.bool,noDragEventsBubbling:re.default.bool,minSize:re.default.number,maxSize:re.default.number,maxFiles:re.default.number,disabled:re.default.bool,getFilesFromEvent:re.default.func,onFileDialogCancel:re.default.func,onFileDialogOpen:re.default.func,useFsAccessApi:re.default.bool,autoFocus:re.default.bool,onDragEnter:re.default.func,onDragLeave:re.default.func,onDragOver:re.default.func,onDrop:re.default.func,onDropAccepted:re.default.func,onDropRejected:re.default.func,onError:re.default.func,validator:re.default.func};var oa={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function aa(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ae(ae({},zl),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,u=t.maxFiles,c=t.onDragEnter,l=t.onDragLeave,p=t.onDragOver,f=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,b=t.onFileDialogOpen,E=t.useFsAccessApi,x=t.autoFocus,_=t.preventDropOnDocument,d=t.noClick,w=t.noKeyboard,y=t.noDrag,P=t.noDragEventsBubbling,z=t.onError,Z=t.validator,F=(0,j.useMemo)(function(){return Ul(r)},[r]),L=(0,j.useMemo)(function(){return kl(r)},[r]),M=(0,j.useMemo)(function(){return typeof b=="function"?b:$l},[b]),k=(0,j.useMemo)(function(){return typeof v=="function"?v:$l},[v]),U=(0,j.useRef)(null),Y=(0,j.useRef)(null),B=(0,j.useReducer)(xh,oa),R=ta(B,2),$=R[0],q=R[1],ie=$.isFocused,ce=$.isFileDialogActive,te=(0,j.useRef)(typeof window<"u"&&window.isSecureContext&&E&&Hl()),dt=function(){!te.current&&ce&&setTimeout(function(){if(Y.current){var S=Y.current.files;S.length||(q({type:"closeDialog"}),k())}},300)};(0,j.useEffect)(function(){return window.addEventListener("focus",dt,!1),function(){window.removeEventListener("focus",dt,!1)}},[Y,ce,k,te]);var Ae=(0,j.useRef)([]),Be=function(S){U.current&&U.current.contains(S.target)||(S.preventDefault(),Ae.current=[])};(0,j.useEffect)(function(){return _&&(document.addEventListener("dragover",ea,!1),document.addEventListener("drop",Be,!1)),function(){_&&(document.removeEventListener("dragover",ea),document.removeEventListener("drop",Be))}},[U,_]),(0,j.useEffect)(function(){return!n&&x&&U.current&&U.current.focus(),function(){}},[U,x,n]);var Ce=(0,j.useCallback)(function(O){z?z(O):console.error(O)},[z]),xt=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[].concat(mh(Ae.current),[O.target]),an(O)&&Promise.resolve(o(O)).then(function(S){if(!(on(O)&&!P)){var oe=S.length,ue=oe>0&&Fl({files:S,accept:F,minSize:a,maxSize:i,multiple:s,maxFiles:u,validator:Z}),be=oe>0&&!ue;q({isDragAccept:ue,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),c&&c(O)}}).catch(function(S){return Ce(S)})},[o,c,Ce,P,F,a,i,s,u,Z]),ze=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var S=an(O);if(S&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return S&&p&&p(O),!1},[p,P]),Ot=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O);var S=Ae.current.filter(function(ue){return U.current&&U.current.contains(ue)}),oe=S.indexOf(O.target);oe!==-1&&S.splice(oe,1),Ae.current=S,!(S.length>0)&&(q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),an(O)&&l&&l(O))},[U,l,P]),je=(0,j.useCallback)(function(O,S){var oe=[],ue=[];O.forEach(function(be){var $t=Zi(be,F),Nt=ta($t,2),Vr=Nt[0],$r=Nt[1],Qr=Ji(be,a,i),h=ta(Qr,2),T=h[0],I=h[1],K=Z?Z(be):null;if(Vr&&T&&!K)oe.push(be);else{var G=[$r,I];K&&(G=G.concat(K)),ue.push({file:be,errors:G.filter(function(Te){return Te})})}}),(!s&&oe.length>1||s&&u>=1&&oe.length>u)&&(oe.forEach(function(be){ue.push({file:be,errors:[Ml]})}),oe.splice(0)),q({acceptedFiles:oe,fileRejections:ue,type:"setFiles"}),f&&f(oe,ue,S),ue.length>0&&g&&g(ue,S),oe.length>0&&m&&m(oe,S)},[q,s,F,a,i,u,f,m,g,Z]),nt=(0,j.useCallback)(function(O){O.preventDefault(),O.persist(),He(O),Ae.current=[],an(O)&&Promise.resolve(o(O)).then(function(S){on(O)&&!P||je(S,O)}).catch(function(S){return Ce(S)}),q({type:"reset"})},[o,je,Ce,P]),ot=(0,j.useCallback)(function(){if(te.current){q({type:"openDialog"}),M();var O={multiple:s,types:L};window.showOpenFilePicker(O).then(function(S){return o(S)}).then(function(S){je(S,null),q({type:"closeDialog"})}).catch(function(S){jl(S)?(k(S),q({type:"closeDialog"})):ql(S)?(te.current=!1,Y.current?(Y.current.value=null,Y.current.click()):Ce(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Ce(S)});return}Y.current&&(q({type:"openDialog"}),M(),Y.current.value=null,Y.current.click())},[q,M,k,E,je,Ce,L,s]),Rt=(0,j.useCallback)(function(O){!U.current||!U.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),ot())},[U,ot]),Gt=(0,j.useCallback)(function(){q({type:"focus"})},[]),Wt=(0,j.useCallback)(function(){q({type:"blur"})},[]),Pt=(0,j.useCallback)(function(){d||(Bl()?setTimeout(ot,0):ot())},[d,ot]),Ye=function(S){return n?null:S},Lt=function(S){return w?null:Ye(S)},Ct=function(S){return y?null:Ye(S)},He=function(S){P&&S.stopPropagation()},mt=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=O.refKey,oe=S===void 0?"ref":S,ue=O.role,be=O.onKeyDown,$t=O.onFocus,Nt=O.onBlur,Vr=O.onClick,$r=O.onDragEnter,Qr=O.onDragOver,h=O.onDragLeave,T=O.onDrop,I=_o(O,ph);return ae(ae(na({onKeyDown:Lt(it(be,Rt)),onFocus:Lt(it($t,Gt)),onBlur:Lt(it(Nt,Wt)),onClick:Ye(it(Vr,Pt)),onDragEnter:Ct(it($r,xt)),onDragOver:Ct(it(Qr,ze)),onDragLeave:Ct(it(h,Ot)),onDrop:Ct(it(T,nt)),role:typeof ue=="string"&&ue!==""?ue:"presentation"},oe,U),!n&&!w?{tabIndex:0}:{}),I)}},[U,Rt,Gt,Wt,Pt,xt,ze,Ot,nt,w,y,n]),Vt=(0,j.useCallback)(function(O){O.stopPropagation()},[]),Tt=(0,j.useMemo)(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=O.refKey,oe=S===void 0?"ref":S,ue=O.onChange,be=O.onClick,$t=_o(O,dh),Nt=na({accept:F,multiple:s,type:"file",style:{display:"none"},onChange:Ye(it(ue,nt)),onClick:Ye(it(be,Vt)),tabIndex:-1},oe,Y);return ae(ae({},Nt),$t)}},[Y,r,s,nt,n]);return ae(ae({},$),{},{isFocused:ie&&!n,getRootProps:mt,getInputProps:Tt,rootRef:U,inputRef:Y,open:Ye(ot)})}function xh(e,t){switch(t.type){case"focus":return ae(ae({},e),{},{isFocused:!0});case"blur":return ae(ae({},e),{},{isFocused:!1});case"openDialog":return ae(ae({},oa),{},{isFileDialogActive:!0});case"closeDialog":return ae(ae({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ae(ae({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ae(ae({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ae({},oa);default:return e}}function $l(){}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sn(e,t)}function Ve(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sn(e,t)}var Ze=function(){function e(){this.listeners=[]}var t=e.prototype;return t.subscribe=function(n){var o=this,i=n||function(){};return this.listeners.push(i),this.onSubscribe(),function(){o.listeners=o.listeners.filter(function(a){return a!==i}),o.onUnsubscribe()}},t.hasListeners=function(){return this.listeners.length>0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}();function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u";function se(){}function Xl(e,t){return typeof e=="function"?e(t):e}function ln(e){return typeof e=="number"&&e>=0&&e!==1/0}function un(e){return Array.isArray(e)?e:[e]}function xo(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wr(e,t,r){return pn(e)?typeof t=="function"?N({},r,{queryKey:e,queryFn:t}):N({},t,{queryKey:e}):e}function Kl(e,t,r){return pn(e)?typeof t=="function"?N({},r,{mutationKey:e,mutationFn:t}):N({},t,{mutationKey:e}):typeof e=="function"?N({},t,{mutationFn:e}):N({},e)}function ht(e,t,r){return pn(e)?[N({},t,{queryKey:e}),r]:[e||{},t]}function Oh(e,t){if(e===!0&&t===!0||e==null&&t==null)return"all";if(e===!1&&t===!1)return"none";var r=e??!t;return r?"active":"inactive"}function ua(e,t){var r=e.active,n=e.exact,o=e.fetching,i=e.inactive,a=e.predicate,s=e.queryKey,u=e.stale;if(pn(s)){if(n){if(t.queryHash!==cn(s,t.options))return!1}else if(!fn(t.queryKey,s))return!1}var c=Oh(r,i);if(c==="none")return!1;if(c!=="all"){var l=t.isActive();if(c==="active"&&!l||c==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof o=="boolean"&&t.isFetching()!==o||a&&!a(t))}function la(e,t){var r=e.exact,n=e.fetching,o=e.predicate,i=e.mutationKey;if(pn(i)){if(!t.options.mutationKey)return!1;if(r){if(Mt(t.options.mutationKey)!==Mt(i))return!1}else if(!fn(t.options.mutationKey,i))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||o&&!o(t))}function cn(e,t){var r=t?.queryKeyHashFn||Mt;return r(e)}function Mt(e){var t=un(e);return Ch(t)}function Ch(e){return JSON.stringify(e,function(t,r){return sa(r)?Object.keys(r).sort().reduce(function(n,o){return n[o]=r[o],n},{}):r})}function fn(e,t){return Zl(un(e),un(t))}function Zl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(function(r){return!Zl(e[r],t[r])}):!1}function Sr(e,t){if(e===t)return e;var r=Array.isArray(e)&&Array.isArray(t);if(r||sa(e)&&sa(t)){for(var n=r?e.length:Object.keys(e).length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{},s=0,u=0;u"u")return!0;var r=t.prototype;return!(!Yl(r)||!r.hasOwnProperty("isPrototypeOf"))}function Yl(e){return Object.prototype.toString.call(e)==="[object Object]"}function pn(e){return typeof e=="string"||Array.isArray(e)}function ec(e){return new Promise(function(t){setTimeout(t,e)})}function ca(e){Promise.resolve().then(e).catch(function(t){return setTimeout(function(){throw t})})}function Oo(){if(typeof AbortController=="function")return new AbortController}var Th=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!er&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",a,!1),function(){window.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setFocused(s):a.onFocus()})},r.setFocused=function(o){this.focused=o,o&&this.onFocus()},r.onFocus=function(){this.listeners.forEach(function(o){o()})},r.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},t}(Ze),Ft=new Th;var wh=function(e){Ve(t,e);function t(){var n;return n=e.call(this)||this,n.setup=function(o){var i;if(!er&&((i=window)==null?void 0:i.addEventListener)){var a=function(){return o()};return window.addEventListener("online",a,!1),window.addEventListener("offline",a,!1),function(){window.removeEventListener("online",a),window.removeEventListener("offline",a)}}},n}var r=t.prototype;return r.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},r.onUnsubscribe=function(){if(!this.hasListeners()){var o;(o=this.cleanup)==null||o.call(this),this.cleanup=void 0}},r.setEventListener=function(o){var i,a=this;this.setup=o,(i=this.cleanup)==null||i.call(this),this.cleanup=o(function(s){typeof s=="boolean"?a.setOnline(s):a.onOnline()})},r.setOnline=function(o){this.online=o,o&&this.onOnline()},r.onOnline=function(){this.listeners.forEach(function(o){o()})},r.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},t}(Ze),Ar=new wh;function Sh(e){return Math.min(1e3*Math.pow(2,e),3e4)}function dn(e){return typeof e?.cancel=="function"}var tc=function(t){this.revert=t?.revert,this.silent=t?.silent};function Ir(e){return e instanceof tc}var Co=function(t){var r=this,n=!1,o,i,a,s;this.abort=t.abort,this.cancel=function(f){return o?.(f)},this.cancelRetry=function(){n=!0},this.continueRetry=function(){n=!1},this.continue=function(){return i?.()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(f,m){a=f,s=m});var u=function(m){r.isResolved||(r.isResolved=!0,t.onSuccess==null||t.onSuccess(m),i?.(),a(m))},c=function(m){r.isResolved||(r.isResolved=!0,t.onError==null||t.onError(m),i?.(),s(m))},l=function(){return new Promise(function(m){i=m,r.isPaused=!0,t.onPause==null||t.onPause()}).then(function(){i=void 0,r.isPaused=!1,t.onContinue==null||t.onContinue()})},p=function f(){if(!r.isResolved){var m;try{m=t.fn()}catch(g){m=Promise.reject(g)}o=function(v){if(!r.isResolved&&(c(new tc(v)),r.abort==null||r.abort(),dn(m)))try{m.cancel()}catch{}},r.isTransportCancelable=dn(m),Promise.resolve(m).then(u).catch(function(g){var v,b;if(!r.isResolved){var E=(v=t.retry)!=null?v:3,x=(b=t.retryDelay)!=null?b:Sh,_=typeof x=="function"?x(r.failureCount,g):x,d=E===!0||typeof E=="number"&&r.failureCount"u"&&(s.exact=!0),this.queries.find(function(u){return ua(s,u)})},r.findAll=function(o,i){var a=ht(o,i),s=a[0];return Object.keys(s).length>0?this.queries.filter(function(u){return ua(s,u)}):this.queries},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onFocus()})})},r.onOnline=function(){var o=this;Q.batch(function(){o.queries.forEach(function(i){i.onOnline()})})},t}(Ze);var ic=function(){function e(r){this.options=N({},r.defaultOptions,r.options),this.mutationId=r.mutationId,this.mutationCache=r.mutationCache,this.observers=[],this.state=r.state||pa(),this.meta=r.meta}var t=e.prototype;return t.setState=function(n){this.dispatch({type:"setState",state:n})},t.addObserver=function(n){this.observers.indexOf(n)===-1&&this.observers.push(n)},t.removeObserver=function(n){this.observers=this.observers.filter(function(o){return o!==n})},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(se).catch(se)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var n=this,o,i=this.state.status==="loading",a=Promise.resolve();return i||(this.dispatch({type:"loading",variables:this.options.variables}),a=a.then(function(){n.mutationCache.config.onMutate==null||n.mutationCache.config.onMutate(n.state.variables,n)}).then(function(){return n.options.onMutate==null?void 0:n.options.onMutate(n.state.variables)}).then(function(s){s!==n.state.context&&n.dispatch({type:"loading",context:s,variables:n.state.variables})})),a.then(function(){return n.executeMutation()}).then(function(s){o=s,n.mutationCache.config.onSuccess==null||n.mutationCache.config.onSuccess(o,n.state.variables,n.state.context,n)}).then(function(){return n.options.onSuccess==null?void 0:n.options.onSuccess(o,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(o,null,n.state.variables,n.state.context)}).then(function(){return n.dispatch({type:"success",data:o}),o}).catch(function(s){return n.mutationCache.config.onError==null||n.mutationCache.config.onError(s,n.state.variables,n.state.context,n),tr().error(s),Promise.resolve().then(function(){return n.options.onError==null?void 0:n.options.onError(s,n.state.variables,n.state.context)}).then(function(){return n.options.onSettled==null?void 0:n.options.onSettled(void 0,s,n.state.variables,n.state.context)}).then(function(){throw n.dispatch({type:"error",error:s}),s})})},t.executeMutation=function(){var n=this,o;return this.retryer=new Co({fn:function(){return n.options.mutationFn?n.options.mutationFn(n.state.variables):Promise.reject("No mutationFn found")},onFail:function(){n.dispatch({type:"failed"})},onPause:function(){n.dispatch({type:"pause"})},onContinue:function(){n.dispatch({type:"continue"})},retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(n){var o=this;this.state=Ih(this.state,n),Q.batch(function(){o.observers.forEach(function(i){i.onMutationUpdate(n)}),o.mutationCache.notify(o)})},e}();function pa(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function Ih(e,t){switch(t.type){case"failed":return N({},e,{failureCount:e.failureCount+1});case"pause":return N({},e,{isPaused:!0});case"continue":return N({},e,{isPaused:!1});case"loading":return N({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return N({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return N({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return N({},e,t.state);default:return e}}var ac=function(e){Ve(t,e);function t(n){var o;return o=e.call(this)||this,o.config=n||{},o.mutations=[],o.mutationId=0,o}var r=t.prototype;return r.build=function(o,i,a){var s=new ic({mutationCache:this,mutationId:++this.mutationId,options:o.defaultMutationOptions(i),state:a,defaultOptions:i.mutationKey?o.getMutationDefaults(i.mutationKey):void 0,meta:i.meta});return this.add(s),s},r.add=function(o){this.mutations.push(o),this.notify(o)},r.remove=function(o){this.mutations=this.mutations.filter(function(i){return i!==o}),o.cancel(),this.notify(o)},r.clear=function(){var o=this;Q.batch(function(){o.mutations.forEach(function(i){o.remove(i)})})},r.getAll=function(){return this.mutations},r.find=function(o){return typeof o.exact>"u"&&(o.exact=!0),this.mutations.find(function(i){return la(o,i)})},r.findAll=function(o){return this.mutations.filter(function(i){return la(o,i)})},r.notify=function(o){var i=this;Q.batch(function(){i.listeners.forEach(function(a){a(o)})})},r.onFocus=function(){this.resumePausedMutations()},r.onOnline=function(){this.resumePausedMutations()},r.resumePausedMutations=function(){var o=this.mutations.filter(function(i){return i.state.isPaused});return Q.batch(function(){return o.reduce(function(i,a){return i.then(function(){return a.continue().catch(se)})},Promise.resolve())})},t}(Ze);function uc(){return{onFetch:function(t){t.fetchFn=function(){var r,n,o,i,a,s,u=(r=t.fetchOptions)==null||(n=r.meta)==null?void 0:n.refetchPage,c=(o=t.fetchOptions)==null||(i=o.meta)==null?void 0:i.fetchMore,l=c?.pageParam,p=c?.direction==="forward",f=c?.direction==="backward",m=((a=t.state.data)==null?void 0:a.pages)||[],g=((s=t.state.data)==null?void 0:s.pageParams)||[],v=Oo(),b=v?.signal,E=g,x=!1,_=t.options.queryFn||function(){return Promise.reject("Missing queryFn")},d=function(U,Y,B,R){return E=R?[Y].concat(E):[].concat(E,[Y]),R?[B].concat(U):[].concat(U,[B])},w=function(U,Y,B,R){if(x)return Promise.reject("Cancelled");if(typeof B>"u"&&!Y&&U.length)return Promise.resolve(U);var $={queryKey:t.queryKey,signal:b,pageParam:B,meta:t.meta},q=_($),ie=Promise.resolve(q).then(function(te){return d(U,B,te,R)});if(dn(q)){var ce=ie;ce.cancel=q.cancel}return ie},y;if(!m.length)y=w([]);else if(p){var P=typeof l<"u",z=P?l:sc(t.options,m);y=w(m,P,z)}else if(f){var Z=typeof l<"u",F=Z?l:Rh(t.options,m);y=w(m,Z,F,!0)}else(function(){E=[];var k=typeof t.options.getNextPageParam>"u",U=u&&m[0]?u(m[0],0,m):!0;y=U?w([],k,g[0]):Promise.resolve(d([],g[0],m[0]));for(var Y=function($){y=y.then(function(q){var ie=u&&m[$]?u(m[$],$,m):!0;if(ie){var ce=k?g[$]:sc(t.options,q);return w(q,k,ce)}return Promise.resolve(d(q,g[$],m[$]))})},B=1;B"u"&&(l.revert=!0);var p=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.cancel(l)})});return Promise.all(p).then(se).catch(se)},t.invalidateQueries=function(n,o,i){var a,s,u,c=this,l=ht(n,o,i),p=l[0],f=l[1],m=N({},p,{active:(a=(s=p.refetchActive)!=null?s:p.active)!=null?a:!0,inactive:(u=p.refetchInactive)!=null?u:!1});return Q.batch(function(){return c.queryCache.findAll(p).forEach(function(g){g.invalidate()}),c.refetchQueries(m,f)})},t.refetchQueries=function(n,o,i){var a=this,s=ht(n,o,i),u=s[0],c=s[1],l=Q.batch(function(){return a.queryCache.findAll(u).map(function(f){return f.fetch(void 0,N({},c,{meta:{refetchPage:u?.refetchPage}}))})}),p=Promise.all(l).then(se);return c?.throwOnError||(p=p.catch(se)),p},t.fetchQuery=function(n,o,i){var a=wr(n,o,i),s=this.defaultQueryOptions(a);typeof s.retry>"u"&&(s.retry=!1);var u=this.queryCache.build(this,s);return u.isStaleByTime(s.staleTime)?u.fetch(s):Promise.resolve(u.state.data)},t.prefetchQuery=function(n,o,i){return this.fetchQuery(n,o,i).then(se).catch(se)},t.fetchInfiniteQuery=function(n,o,i){var a=wr(n,o,i);return a.behavior=uc(),this.fetchQuery(a)},t.prefetchInfiniteQuery=function(n,o,i){return this.fetchInfiniteQuery(n,o,i).then(se).catch(se)},t.cancelMutations=function(){var n=this,o=Q.batch(function(){return n.mutationCache.getAll().map(function(i){return i.cancel()})});return Promise.all(o).then(se).catch(se)},t.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},t.executeMutation=function(n){return this.mutationCache.build(this,n).execute()},t.getQueryCache=function(){return this.queryCache},t.getMutationCache=function(){return this.mutationCache},t.getDefaultOptions=function(){return this.defaultOptions},t.setDefaultOptions=function(n){this.defaultOptions=n},t.setQueryDefaults=function(n,o){var i=this.queryDefaults.find(function(a){return Mt(n)===Mt(a.queryKey)});i?i.defaultOptions=o:this.queryDefaults.push({queryKey:n,defaultOptions:o})},t.getQueryDefaults=function(n){var o;return n?(o=this.queryDefaults.find(function(i){return fn(n,i.queryKey)}))==null?void 0:o.defaultOptions:void 0},t.setMutationDefaults=function(n,o){var i=this.mutationDefaults.find(function(a){return Mt(n)===Mt(a.mutationKey)});i?i.defaultOptions=o:this.mutationDefaults.push({mutationKey:n,defaultOptions:o})},t.getMutationDefaults=function(n){var o;return n?(o=this.mutationDefaults.find(function(i){return fn(n,i.mutationKey)}))==null?void 0:o.defaultOptions:void 0},t.defaultQueryOptions=function(n){if(n?._defaulted)return n;var o=N({},this.defaultOptions.queries,this.getQueryDefaults(n?.queryKey),n,{_defaulted:!0});return!o.queryHash&&o.queryKey&&(o.queryHash=cn(o.queryKey,o)),o},t.defaultQueryObserverOptions=function(n){return this.defaultQueryOptions(n)},t.defaultMutationOptions=function(n){return n?._defaulted?n:N({},this.defaultOptions.mutations,this.getMutationDefaults(n?.mutationKey),n,{_defaulted:!0})},t.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},e}();var ha=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.options=o,i.trackedProps=[],i.selectError=null,i.bindMethods(),i.setOptions(o),i}var r=t.prototype;return r.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},r.onSubscribe=function(){this.listeners.length===1&&(this.currentQuery.addObserver(this),lc(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},r.onUnsubscribe=function(){this.listeners.length||this.destroy()},r.shouldFetchOnReconnect=function(){return ma(this.currentQuery,this.options,this.options.refetchOnReconnect)},r.shouldFetchOnWindowFocus=function(){return ma(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},r.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},r.setOptions=function(o,i){var a=this.options,s=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(o),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),this.updateQuery();var u=this.hasListeners();u&&cc(this.currentQuery,s,this.options,a)&&this.executeFetch(),this.updateResult(i),u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();u&&(this.currentQuery!==s||this.options.enabled!==a.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},r.getOptimisticResult=function(o){var i=this.client.defaultQueryObserverOptions(o),a=this.client.getQueryCache().build(this.client,i);return this.createResult(a,i)},r.getCurrentResult=function(){return this.currentResult},r.trackResult=function(o,i){var a=this,s={},u=function(l){a.trackedProps.includes(l)||a.trackedProps.push(l)};return Object.keys(o).forEach(function(c){Object.defineProperty(s,c,{configurable:!1,enumerable:!0,get:function(){return u(c),o[c]}})}),(i.useErrorBoundary||i.suspense)&&u("error"),s},r.getNextResult=function(o){var i=this;return new Promise(function(a,s){var u=i.subscribe(function(c){c.isFetching||(u(),c.isError&&o?.throwOnError?s(c.error):a(c))})})},r.getCurrentQuery=function(){return this.currentQuery},r.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},r.refetch=function(o){return this.fetch(N({},o,{meta:{refetchPage:o?.refetchPage}}))},r.fetchOptimistic=function(o){var i=this,a=this.client.defaultQueryObserverOptions(o),s=this.client.getQueryCache().build(this.client,a);return s.fetch().then(function(){return i.createResult(s,a)})},r.fetch=function(o){var i=this;return this.executeFetch(o).then(function(){return i.updateResult(),i.currentResult})},r.executeFetch=function(o){this.updateQuery();var i=this.currentQuery.fetch(this.options,o);return o?.throwOnError||(i=i.catch(se)),i},r.updateStaleTimeout=function(){var o=this;if(this.clearStaleTimeout(),!(er||this.currentResult.isStale||!ln(this.options.staleTime))){var i=xo(this.currentResult.dataUpdatedAt,this.options.staleTime),a=i+1;this.staleTimeoutId=setTimeout(function(){o.currentResult.isStale||o.updateResult()},a)}},r.computeRefetchInterval=function(){var o;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(o=this.options.refetchInterval)!=null?o:!1},r.updateRefetchInterval=function(o){var i=this;this.clearRefetchInterval(),this.currentRefetchInterval=o,!(er||this.options.enabled===!1||!ln(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(i.options.refetchIntervalInBackground||Ft.isFocused())&&i.executeFetch()},this.currentRefetchInterval))},r.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},r.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},r.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},r.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},r.createResult=function(o,i){var a=this.currentQuery,s=this.options,u=this.currentResult,c=this.currentResultState,l=this.currentResultOptions,p=o!==a,f=p?o.state:this.currentQueryInitialState,m=p?this.currentResult:this.previousQueryResult,g=o.state,v=g.dataUpdatedAt,b=g.error,E=g.errorUpdatedAt,x=g.isFetching,_=g.status,d=!1,w=!1,y;if(i.optimisticResults){var P=this.hasListeners(),z=!P&&lc(o,i),Z=P&&cc(o,a,i,s);(z||Z)&&(x=!0,v||(_="loading"))}if(i.keepPreviousData&&!g.dataUpdateCount&&m?.isSuccess&&_!=="error")y=m.data,v=m.dataUpdatedAt,_=m.status,d=!0;else if(i.select&&typeof g.data<"u")if(u&&g.data===c?.data&&i.select===this.selectFn)y=this.selectResult;else try{this.selectFn=i.select,y=i.select(g.data),i.structuralSharing!==!1&&(y=Sr(u?.data,y)),this.selectResult=y,this.selectError=null}catch(M){tr().error(M),this.selectError=M}else y=g.data;if(typeof i.placeholderData<"u"&&typeof y>"u"&&(_==="loading"||_==="idle")){var F;if(u?.isPlaceholderData&&i.placeholderData===l?.placeholderData)F=u.data;else if(F=typeof i.placeholderData=="function"?i.placeholderData():i.placeholderData,i.select&&typeof F<"u")try{F=i.select(F),i.structuralSharing!==!1&&(F=Sr(u?.data,F)),this.selectError=null}catch(M){tr().error(M),this.selectError=M}typeof F<"u"&&(_="success",y=F,w=!0)}this.selectError&&(b=this.selectError,y=this.selectResult,E=Date.now(),_="error");var L={status:_,isLoading:_==="loading",isSuccess:_==="success",isError:_==="error",isIdle:_==="idle",data:y,dataUpdatedAt:v,error:b,errorUpdatedAt:E,failureCount:g.fetchFailureCount,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:x,isRefetching:x&&_!=="loading",isLoadingError:_==="error"&&g.dataUpdatedAt===0,isPlaceholderData:w,isPreviousData:d,isRefetchError:_==="error"&&g.dataUpdatedAt!==0,isStale:va(o,i),refetch:this.refetch,remove:this.remove};return L},r.shouldNotifyListeners=function(o,i){if(!i)return!0;var a=this.options,s=a.notifyOnChangeProps,u=a.notifyOnChangePropsExclusions;if(!s&&!u||s==="tracked"&&!this.trackedProps.length)return!0;var c=s==="tracked"?this.trackedProps:s;return Object.keys(o).some(function(l){var p=l,f=o[p]!==i[p],m=c?.some(function(v){return v===l}),g=u?.some(function(v){return v===l});return f&&!g&&(!c||m)})},r.updateResult=function(o){var i=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!Jl(this.currentResult,i)){var a={cache:!0};o?.listeners!==!1&&this.shouldNotifyListeners(this.currentResult,i)&&(a.listeners=!0),this.notify(N({},a,o))}},r.updateQuery=function(){var o=this.client.getQueryCache().build(this.client,this.options);if(o!==this.currentQuery){var i=this.currentQuery;this.currentQuery=o,this.currentQueryInitialState=o.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(i?.removeObserver(this),o.addObserver(this))}},r.onQueryUpdate=function(o){var i={};o.type==="success"?i.onSuccess=!0:o.type==="error"&&!Ir(o.error)&&(i.onError=!0),this.updateResult(i),this.hasListeners()&&this.updateTimers()},r.notify=function(o){var i=this;Q.batch(function(){o.onSuccess?(i.options.onSuccess==null||i.options.onSuccess(i.currentResult.data),i.options.onSettled==null||i.options.onSettled(i.currentResult.data,null)):o.onError&&(i.options.onError==null||i.options.onError(i.currentResult.error),i.options.onSettled==null||i.options.onSettled(void 0,i.currentResult.error)),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)}),o.cache&&i.client.getQueryCache().notify({query:i.currentQuery,type:"observerResultsUpdated"})})},t}(Ze);function Ph(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function lc(e,t){return Ph(e,t)||e.state.dataUpdatedAt>0&&ma(e,t,t.refetchOnMount)}function ma(e,t,r){if(t.enabled!==!1){var n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&va(e,t)}return!1}function cc(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&va(e,r)}function va(e,t){return e.isStaleByTime(t.staleTime)}var fc=function(e){Ve(t,e);function t(n,o){var i;return i=e.call(this)||this,i.client=n,i.setOptions(o),i.bindMethods(),i.updateResult(),i}var r=t.prototype;return r.bindMethods=function(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)},r.setOptions=function(o){this.options=this.client.defaultMutationOptions(o)},r.onUnsubscribe=function(){if(!this.listeners.length){var o;(o=this.currentMutation)==null||o.removeObserver(this)}},r.onMutationUpdate=function(o){this.updateResult();var i={listeners:!0};o.type==="success"?i.onSuccess=!0:o.type==="error"&&(i.onError=!0),this.notify(i)},r.getCurrentResult=function(){return this.currentResult},r.reset=function(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})},r.mutate=function(o,i){return this.mutateOptions=i,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,N({},this.options,{variables:typeof o<"u"?o:this.options.variables})),this.currentMutation.addObserver(this),this.currentMutation.execute()},r.updateResult=function(){var o=this.currentMutation?this.currentMutation.state:pa(),i=N({},o,{isLoading:o.status==="loading",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset});this.currentResult=i},r.notify=function(o){var i=this;Q.batch(function(){i.mutateOptions&&(o.onSuccess?(i.mutateOptions.onSuccess==null||i.mutateOptions.onSuccess(i.currentResult.data,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(i.currentResult.data,null,i.currentResult.variables,i.currentResult.context)):o.onError&&(i.mutateOptions.onError==null||i.mutateOptions.onError(i.currentResult.error,i.currentResult.variables,i.currentResult.context),i.mutateOptions.onSettled==null||i.mutateOptions.onSettled(void 0,i.currentResult.error,i.currentResult.variables,i.currentResult.context))),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)})})},t}(Ze);var dc=W(To()),mc=dc.default.unstable_batchedUpdates;Q.setBatchNotifyFunction(mc);var hc=console;fa(hc);var Bt=W(J()),vc=Bt.default.createContext(void 0),gc=Bt.default.createContext(!1);function yc(e){return e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=vc),window.ReactQueryClientContext):vc}var vt=function(){var t=Bt.default.useContext(yc(Bt.default.useContext(gc)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Rr=function(t){var r=t.client,n=t.contextSharing,o=n===void 0?!1:n,i=t.children;Bt.default.useEffect(function(){return r.mount(),function(){r.unmount()}},[r]);var a=yc(o);return Bt.default.createElement(gc.Provider,{value:o},Bt.default.createElement(a.Provider,{value:r},i))};var ga=W(J());function Lh(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var Nh=ga.default.createContext(Lh()),bc=function(){return ga.default.useContext(Nh)};var Pr=W(J());function wo(e,t,r){return typeof t=="function"?t.apply(void 0,r):typeof t=="boolean"?t:!!e}function Lr(e,t,r){var n=Pr.default.useRef(!1),o=Pr.default.useState(0),i=o[1],a=Kl(e,t,r),s=vt(),u=Pr.default.useRef();u.current?u.current.setOptions(a):u.current=new fc(s,a);var c=u.current.getCurrentResult();Pr.default.useEffect(function(){n.current=!0;var p=u.current.subscribe(Q.batchCalls(function(){n.current&&i(function(f){return f+1})}));return function(){n.current=!1,p()}},[]);var l=Pr.default.useCallback(function(p,f){u.current.mutate(p,f).catch(se)},[]);if(c.error&&wo(void 0,u.current.options.useErrorBoundary,[c.error]))throw c.error;return N({},c,{mutate:l,mutateAsync:c.mutate})}var Nr=W(J());function Ec(e,t){var r=Nr.default.useRef(!1),n=Nr.default.useState(0),o=n[1],i=vt(),a=bc(),s=i.defaultQueryObserverOptions(e);s.optimisticResults=!0,s.onError&&(s.onError=Q.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Q.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Q.batchCalls(s.onSettled)),s.suspense&&(typeof s.staleTime!="number"&&(s.staleTime=1e3),s.cacheTime===0&&(s.cacheTime=1)),(s.suspense||s.useErrorBoundary)&&(a.isReset()||(s.retryOnMount=!1));var u=Nr.default.useState(function(){return new t(i,s)}),c=u[0],l=c.getOptimisticResult(s);if(Nr.default.useEffect(function(){r.current=!0,a.clearReset();var p=c.subscribe(Q.batchCalls(function(){r.current&&o(function(f){return f+1})}));return c.updateResult(),function(){r.current=!1,p()}},[a,c]),Nr.default.useEffect(function(){c.setOptions(s,{listeners:!1})},[s,c]),s.suspense&&l.isLoading)throw c.fetchOptimistic(s).then(function(p){var f=p.data;s.onSuccess==null||s.onSuccess(f),s.onSettled==null||s.onSettled(f,null)}).catch(function(p){a.clearReset(),s.onError==null||s.onError(p),s.onSettled==null||s.onSettled(void 0,p)});if(l.isError&&!a.isReset()&&!l.isFetching&&wo(s.suspense,s.useErrorBoundary,[l.error,c.getCurrentQuery()]))throw l.error;return s.notifyOnChangeProps==="tracked"&&(l=c.trackResult(l,s)),l}function So(e,t,r){var n=wr(e,t,r);return Ec(n,ha)}var If=W(Af(),1);var Sv=If.default.create(),gn=new da({defaultOptions:{queries:{suspense:!0,refetchOnWindowFocus:!1,cacheTime:1/0}}});async function rr(e,t={}){try{return(await Sv({url:e,withCredentials:!0,...t})).data}catch(r){throw Error(r)}}function Rf(e){return So(["LibraryImage",e],()=>rr("/open_api/library/image",{method:"GET",params:{id:e.id||null,limit:e.limit||5,offset:e.offset||0,title:e.title||null,tagId:e.tagId||null}}),{keepPreviousData:!0,onSuccess:t=>{}})}function Pf(){let e=vt();return Lr(t=>rr("/open_api/library/image",{method:"POST",headers:{"content-type":"multipart/form-data"},data:t}),{onSuccess:t=>{e.setQueryData(["LibraryImage"],r=>r&&Array.isArray(r)?[...r,t]:r)}})}function Lf(){let e=vt();return Lr(t=>rr(`/open_api/library/image/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.filter(o=>o.id!==r):n)}})}function Ba(){return So(["LibraryTag"],()=>rr("/open_api/library/tag",{method:"GET"}),{keepPreviousData:!0,onSuccess:e=>{}})}function Nf(){let e=vt();return Lr(t=>rr(`/open_api/library/image_tag/${t}`,{method:"DELETE"}),{onSuccess:(t,r)=>{e.setQueriesData(["LibraryImage"],n=>n&&Array.isArray(n)?n.map(o=>o.tags&&o.tags.length?{...o,tags:o.tags.filter(({imageTag:i})=>i.id!==r)}:o):n)}})}function Df(){let e=vt();return Lr(t=>rr("/open_api/library/image_tag",{method:"POST",data:t}),{onSuccess:t=>{e.setQueriesData(["LibraryImage"],r=>r&&Array.isArray(r)?r.map(n=>n.id===t.imageTag.imageId?{...n,tags:[...n.tags,t]}:n):r)}})}var Ha=W(J()),ka=e=>Ha.createElement("svg",{width:19,height:18,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ha.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var Ua=W(J()),Mf=e=>Ua.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},Ua.createElement("path",{d:"M3.91875 0.498484C4.04531 0.257609 4.30547 0.105469 4.58906 0.105469H7.41094C7.69453 0.105469 7.95469 0.257609 8.08125 0.498484L8.25 0.816406H10.5C10.9148 0.816406 11.25 1.13477 11.25 1.52734C11.25 1.91991 10.9148 2.23828 10.5 2.23828H1.5C1.08586 2.23828 0.75 1.91991 0.75 1.52734C0.75 1.13477 1.08586 0.816406 1.5 0.816406H3.75L3.91875 0.498484ZM1.47891 2.94922H10.5V10.0586C10.5 10.8428 9.82734 11.4805 9 11.4805H2.97891C2.17148 11.4805 1.47891 10.8428 1.47891 10.0586V2.94922ZM3.35391 4.72656V9.70312C3.35391 9.89863 3.54375 10.0586 3.72891 10.0586C3.95625 10.0586 4.10391 9.89863 4.10391 9.70312V4.72656C4.10391 4.53105 3.95625 4.37109 3.72891 4.37109C3.54375 4.37109 3.35391 4.53105 3.35391 4.72656ZM5.60391 4.72656V9.70312C5.60391 9.89863 5.79375 10.0586 5.97891 10.0586C6.20625 10.0586 6.375 9.89863 6.375 9.70312V4.72656C6.375 4.53105 6.20625 4.37109 5.97891 4.37109C5.79375 4.37109 5.60391 4.53105 5.60391 4.72656ZM7.875 4.72656V9.70312C7.875 9.89863 8.04375 10.0586 8.25 10.0586C8.45625 10.0586 8.625 9.89863 8.625 9.70312V4.72656C8.625 4.53105 8.45625 4.37109 8.25 4.37109C8.04375 4.37109 7.875 4.53105 7.875 4.72656Z",fill:"white"}));var ja=W(J()),Ff=e=>ja.createElement("svg",{width:8,height:8,viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ja.createElement("path",{d:"M17.5913 15.0762L10.9713 8.67623L17.6013 2.27623C17.728 2.15573 17.829 2.0107 17.898 1.84996C17.9669 1.68923 18.0025 1.51614 18.0025 1.34123C18.0025 1.16632 17.9669 0.993238 17.898 0.832502C17.829 0.671767 17.728 0.526739 17.6013 0.406233C17.3305 0.151704 16.9729 0.00999999 16.6013 0.00999999C16.2296 0.00999999 15.872 0.151704 15.6013 0.406233L9.00125 6.77623L2.40125 0.396233C2.13049 0.141704 1.77286 0 1.40125 0C1.02964 0 0.672011 0.141704 0.401251 0.396233C0.275468 0.518481 0.17531 0.664572 0.10663 0.825969C0.0379507 0.987366 0.00212641 1.16083 0.00125089 1.33623C0.000992191 1.51181 0.0363014 1.68561 0.105048 1.84717C0.173796 2.00873 0.274556 2.15468 0.401251 2.27623L7.03125 8.67623L0.401251 15.0762C0.274474 15.1967 0.173528 15.3418 0.104549 15.5025C0.0355706 15.6632 0 15.8363 0 16.0112C0 16.1861 0.0355706 16.3592 0.104549 16.52C0.173528 16.6807 0.274474 16.8257 0.401251 16.9462C0.675245 17.1943 1.03165 17.3317 1.40125 17.3317C1.77085 17.3317 2.12726 17.1943 2.40125 16.9462L9.00125 10.5762L15.6013 16.9462C15.8731 17.1986 16.2303 17.3388 16.6013 17.3388C16.9722 17.3388 17.3294 17.1986 17.6013 16.9462C17.7307 16.8273 17.834 16.6828 17.9046 16.5218C17.9753 16.3609 18.0118 16.187 18.0118 16.0112C18.0118 15.8355 17.9753 15.6616 17.9046 15.5007C17.834 15.3397 17.7307 15.1952 17.6013 15.0762H17.5913Z",fill:"currentcolor"}));var xs=W(bp()),rt=W(J());var dd=W(J());var le="top",ge="bottom",me="right",fe="left",Ko="auto",Ut=[le,ge,me,fe],St="start",ar="end",Ep="clippingParents",Zo="viewport",Ur="popper",_p="reference",Ka=Ut.reduce(function(e,t){return e.concat([t+"-"+St,t+"-"+ar])},[]),Jo=[].concat(Ut,[Ko]).reduce(function(e,t){return e.concat([t,t+"-"+St,t+"-"+ar])},[]),ey="beforeRead",ty="read",ry="afterRead",ny="beforeMain",oy="main",iy="afterMain",ay="beforeWrite",sy="write",uy="afterWrite",xp=[ey,ty,ry,ny,oy,iy,ay,sy,uy];function xe(e){return e?(e.nodeName||"").toLowerCase():null}function pe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function bt(e){var t=pe(e).Element;return e instanceof t||e instanceof Element}function ye(e){var t=pe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function jr(e){if(typeof ShadowRoot>"u")return!1;var t=pe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ly(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!ye(i)||!xe(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function cy(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(u,c){return u[c]="",u},{});!ye(o)||!xe(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(u){o.removeAttribute(u)}))})}}var wn={name:"applyStyles",enabled:!0,phase:"write",fn:ly,effect:cy,requires:["computeStyles"]};function Oe(e){return e.split("-")[0]}var ut=Math.max,sr=Math.min,At=Math.round;function et(e,t){t===void 0&&(t=!1);var r=e.getBoundingClientRect(),n=1,o=1;if(ye(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(n=At(r.width)/a||1),i>0&&(o=At(r.height)/i||1)}return{width:r.width/n,height:r.height/o,top:r.top/o,right:r.right/n,bottom:r.bottom/o,left:r.left/n,x:r.left/n,y:r.top/o}}function ur(e){var t=et(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Sn(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&jr(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Me(e){return pe(e).getComputedStyle(e)}function Za(e){return["table","td","th"].indexOf(xe(e))>=0}function Se(e){return((bt(e)?e.ownerDocument:e.document)||window.document).documentElement}function It(e){return xe(e)==="html"?e:e.assignedSlot||e.parentNode||(jr(e)?e.host:null)||Se(e)}function Op(e){return!ye(e)||Me(e).position==="fixed"?null:e.offsetParent}function fy(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&ye(e)){var n=Me(e);if(n.position==="fixed")return null}var o=It(e);for(jr(o)&&(o=o.host);ye(o)&&["html","body"].indexOf(xe(o))<0;){var i=Me(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function lt(e){for(var t=pe(e),r=Op(e);r&&Za(r)&&Me(r).position==="static";)r=Op(r);return r&&(xe(r)==="html"||xe(r)==="body"&&Me(r).position==="static")?t:r||fy(e)||t}function lr(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function cr(e,t,r){return ut(e,sr(t,r))}function Cp(e,t,r){var n=cr(e,t,r);return n>r?r:n}function An(){return{top:0,right:0,bottom:0,left:0}}function In(e){return Object.assign({},An(),e)}function Rn(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var py=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,In(typeof t!="number"?t:Rn(t,Ut))};function dy(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=Oe(r.placement),u=lr(s),c=[fe,me].indexOf(s)>=0,l=c?"height":"width";if(!(!i||!a)){var p=py(o.padding,r),f=ur(i),m=u==="y"?le:fe,g=u==="y"?ge:me,v=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],b=a[u]-r.rects.reference[u],E=lt(i),x=E?u==="y"?E.clientHeight||0:E.clientWidth||0:0,_=v/2-b/2,d=p[m],w=x-f[l]-p[g],y=x/2-f[l]/2+_,P=cr(d,y,w),z=u;r.modifiersData[n]=(t={},t[z]=P,t.centerOffset=P-y,t)}}function my(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!Sn(t.elements.popper,o)||(t.elements.arrow=o))}var Tp={name:"arrow",enabled:!0,phase:"main",fn:dy,effect:my,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tt(e){return e.split("-")[1]}var hy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function vy(e){var t=e.x,r=e.y,n=window,o=n.devicePixelRatio||1;return{x:At(t*o)/o||0,y:At(r*o)/o||0}}function wp(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,p=e.isFixed,f=a.x,m=f===void 0?0:f,g=a.y,v=g===void 0?0:g,b=typeof l=="function"?l({x:m,y:v}):{x:m,y:v};m=b.x,v=b.y;var E=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),_=fe,d=le,w=window;if(c){var y=lt(r),P="clientHeight",z="clientWidth";if(y===pe(r)&&(y=Se(r),Me(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",z="scrollWidth")),y=y,o===le||(o===fe||o===me)&&i===ar){d=ge;var Z=p&&y===w&&w.visualViewport?w.visualViewport.height:y[P];v-=Z-n.height,v*=u?1:-1}if(o===fe||(o===le||o===ge)&&i===ar){_=me;var F=p&&y===w&&w.visualViewport?w.visualViewport.width:y[z];m-=F-n.width,m*=u?1:-1}}var L=Object.assign({position:s},c&&hy),M=l===!0?vy({x:m,y:v}):{x:m,y:v};if(m=M.x,v=M.y,u){var k;return Object.assign({},L,(k={},k[d]=x?"0":"",k[_]=E?"0":"",k.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",k))}return Object.assign({},L,(t={},t[d]=x?v+"px":"",t[_]=E?m+"px":"",t.transform="",t))}function gy(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,s=r.roundOffsets,u=s===void 0?!0:s;if(!1)var c;var l={placement:Oe(t.placement),variation:tt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,wp(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,wp(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Sp={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:gy,data:{}};var ei={passive:!0};function yy(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,a=n.resize,s=a===void 0?!0:a,u=pe(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",r.update,ei)}),s&&u.addEventListener("resize",r.update,ei),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",r.update,ei)}),s&&u.removeEventListener("resize",r.update,ei)}}var Ap={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:yy,data:{}};var by={left:"right",right:"left",bottom:"top",top:"bottom"};function qr(e){return e.replace(/left|right|bottom|top/g,function(t){return by[t]})}var Ey={start:"end",end:"start"};function ti(e){return e.replace(/start|end/g,function(t){return Ey[t]})}function fr(e){var t=pe(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function pr(e){return et(Se(e)).left+fr(e).scrollLeft}function Ja(e){var t=pe(e),r=Se(e),n=t.visualViewport,o=r.clientWidth,i=r.clientHeight,a=0,s=0;return n&&(o=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=n.offsetLeft,s=n.offsetTop)),{width:o,height:i,x:a+pr(e),y:s}}function es(e){var t,r=Se(e),n=fr(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ut(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ut(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+pr(e),u=-n.scrollTop;return Me(o||r).direction==="rtl"&&(s+=ut(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:u}}function dr(e){var t=Me(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function ri(e){return["html","body","#document"].indexOf(xe(e))>=0?e.ownerDocument.body:ye(e)&&dr(e)?e:ri(It(e))}function jt(e,t){var r;t===void 0&&(t=[]);var n=ri(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pe(n),a=o?[i].concat(i.visualViewport||[],dr(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(jt(It(a)))}function Gr(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _y(e){var t=et(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ip(e,t){return t===Zo?Gr(Ja(e)):bt(t)?_y(t):Gr(es(Se(e)))}function xy(e){var t=jt(It(e)),r=["absolute","fixed"].indexOf(Me(e).position)>=0,n=r&&ye(e)?lt(e):e;return bt(n)?t.filter(function(o){return bt(o)&&Sn(o,n)&&xe(o)!=="body"}):[]}function ts(e,t,r){var n=t==="clippingParents"?xy(e):[].concat(t),o=[].concat(n,[r]),i=o[0],a=o.reduce(function(s,u){var c=Ip(e,u);return s.top=ut(c.top,s.top),s.right=sr(c.right,s.right),s.bottom=sr(c.bottom,s.bottom),s.left=ut(c.left,s.left),s},Ip(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Pn(e){var t=e.reference,r=e.element,n=e.placement,o=n?Oe(n):null,i=n?tt(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,u;switch(o){case le:u={x:a,y:t.y-r.height};break;case ge:u={x:a,y:t.y+t.height};break;case me:u={x:t.x+t.width,y:s};break;case fe:u={x:t.x-r.width,y:s};break;default:u={x:t.x,y:t.y}}var c=o?lr(o):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case St:u[c]=u[c]-(t[l]/2-r[l]/2);break;case ar:u[c]=u[c]+(t[l]/2-r[l]/2);break;default:}}return u}function ct(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.boundary,a=i===void 0?Ep:i,s=r.rootBoundary,u=s===void 0?Zo:s,c=r.elementContext,l=c===void 0?Ur:c,p=r.altBoundary,f=p===void 0?!1:p,m=r.padding,g=m===void 0?0:m,v=In(typeof g!="number"?g:Rn(g,Ut)),b=l===Ur?_p:Ur,E=e.rects.popper,x=e.elements[f?b:l],_=ts(bt(x)?x:x.contextElement||Se(e.elements.popper),a,u),d=et(e.elements.reference),w=Pn({reference:d,element:E,strategy:"absolute",placement:o}),y=Gr(Object.assign({},E,w)),P=l===Ur?y:d,z={top:_.top-P.top+v.top,bottom:P.bottom-_.bottom+v.bottom,left:_.left-P.left+v.left,right:P.right-_.right+v.right},Z=e.modifiersData.offset;if(l===Ur&&Z){var F=Z[o];Object.keys(z).forEach(function(L){var M=[me,ge].indexOf(L)>=0?1:-1,k=[le,ge].indexOf(L)>=0?"y":"x";z[L]+=F[k]*M})}return z}function rs(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,u=r.allowedAutoPlacements,c=u===void 0?Jo:u,l=tt(n),p=l?s?Ka:Ka.filter(function(g){return tt(g)===l}):Ut,f=p.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=p);var m=f.reduce(function(g,v){return g[v]=ct(e,{placement:v,boundary:o,rootBoundary:i,padding:a})[Oe(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function Oy(e){if(Oe(e)===Ko)return[];var t=qr(e);return[ti(e),t,ti(t)]}function Cy(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!0:a,u=r.fallbackPlacements,c=r.padding,l=r.boundary,p=r.rootBoundary,f=r.altBoundary,m=r.flipVariations,g=m===void 0?!0:m,v=r.allowedAutoPlacements,b=t.options.placement,E=Oe(b),x=E===b,_=u||(x||!g?[qr(b)]:Oy(b)),d=[b].concat(_).reduce(function(Ae,Be){return Ae.concat(Oe(Be)===Ko?rs(t,{placement:Be,boundary:l,rootBoundary:p,padding:c,flipVariations:g,allowedAutoPlacements:v}):Be)},[]),w=t.rects.reference,y=t.rects.popper,P=new Map,z=!0,Z=d[0],F=0;F=0,Y=U?"width":"height",B=ct(t,{placement:L,boundary:l,rootBoundary:p,altBoundary:f,padding:c}),R=U?k?me:fe:k?ge:le;w[Y]>y[Y]&&(R=qr(R));var $=qr(R),q=[];if(i&&q.push(B[M]<=0),s&&q.push(B[R]<=0,B[$]<=0),q.every(function(Ae){return Ae})){Z=L,z=!1;break}P.set(L,q)}if(z)for(var ie=g?3:1,ce=function(Be){var Ce=d.find(function(xt){var ze=P.get(xt);if(ze)return ze.slice(0,Be).every(function(Ot){return Ot})});if(Ce)return Z=Ce,"break"},te=ie;te>0;te--){var dt=ce(te);if(dt==="break")break}t.placement!==Z&&(t.modifiersData[n]._skip=!0,t.placement=Z,t.reset=!0)}}var Rp={name:"flip",enabled:!0,phase:"main",fn:Cy,requiresIfExists:["offset"],data:{_skip:!1}};function Pp(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Lp(e){return[le,me,ge,fe].some(function(t){return e[t]>=0})}function Ty(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ct(t,{elementContext:"reference"}),s=ct(t,{altBoundary:!0}),u=Pp(a,n),c=Pp(s,o,i),l=Lp(u),p=Lp(c);t.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":p})}var Np={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ty};function wy(e,t,r){var n=Oe(e),o=[fe,le].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[fe,me].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function Sy(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,a=Jo.reduce(function(l,p){return l[p]=wy(p,t.rects,i),l},{}),s=a[t.placement],u=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}var Dp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sy};function Ay(e){var t=e.state,r=e.name;t.modifiersData[r]=Pn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Mp={name:"popperOffsets",enabled:!0,phase:"read",fn:Ay,data:{}};function ns(e){return e==="x"?"y":"x"}function Iy(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!1:a,u=r.boundary,c=r.rootBoundary,l=r.altBoundary,p=r.padding,f=r.tether,m=f===void 0?!0:f,g=r.tetherOffset,v=g===void 0?0:g,b=ct(t,{boundary:u,rootBoundary:c,padding:p,altBoundary:l}),E=Oe(t.placement),x=tt(t.placement),_=!x,d=lr(E),w=ns(d),y=t.modifiersData.popperOffsets,P=t.rects.reference,z=t.rects.popper,Z=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,F=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(!!y){if(i){var k,U=d==="y"?le:fe,Y=d==="y"?ge:me,B=d==="y"?"height":"width",R=y[d],$=R+b[U],q=R-b[Y],ie=m?-z[B]/2:0,ce=x===St?P[B]:z[B],te=x===St?-z[B]:-P[B],dt=t.elements.arrow,Ae=m&&dt?ur(dt):{width:0,height:0},Be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:An(),Ce=Be[U],xt=Be[Y],ze=cr(0,P[B],Ae[B]),Ot=_?P[B]/2-ie-ze-Ce-F.mainAxis:ce-ze-Ce-F.mainAxis,je=_?-P[B]/2+ie+ze+xt+F.mainAxis:te+ze+xt+F.mainAxis,nt=t.elements.arrow&<(t.elements.arrow),ot=nt?d==="y"?nt.clientTop||0:nt.clientLeft||0:0,Rt=(k=L?.[d])!=null?k:0,Gt=R+Ot-Rt-ot,Wt=R+je-Rt,Pt=cr(m?sr($,Gt):$,R,m?ut(q,Wt):q);y[d]=Pt,M[d]=Pt-R}if(s){var Ye,Lt=d==="x"?le:fe,Ct=d==="x"?ge:me,He=y[w],mt=w==="y"?"height":"width",Vt=He+b[Lt],Tt=He-b[Ct],O=[le,fe].indexOf(E)!==-1,S=(Ye=L?.[w])!=null?Ye:0,oe=O?Vt:He-P[mt]-z[mt]-S+F.altAxis,ue=O?He+P[mt]+z[mt]-S-F.altAxis:Tt,be=m&&O?Cp(oe,He,ue):cr(m?oe:Vt,He,m?ue:Tt);y[w]=be,M[w]=be-He}t.modifiersData[n]=M}}var Fp={name:"preventOverflow",enabled:!0,phase:"main",fn:Iy,requiresIfExists:["offset"]};function os(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function is(e){return e===pe(e)||!ye(e)?fr(e):os(e)}function Ry(e){var t=e.getBoundingClientRect(),r=At(t.width)/e.offsetWidth||1,n=At(t.height)/e.offsetHeight||1;return r!==1||n!==1}function as(e,t,r){r===void 0&&(r=!1);var n=ye(t),o=ye(t)&&Ry(t),i=Se(t),a=et(e,o),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(n||!n&&!r)&&((xe(t)!=="body"||dr(i))&&(s=is(t)),ye(t)?(u=et(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=pr(i))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function Py(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var u=t.get(s);u&&o(u)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function ss(e){var t=Py(e);return xp.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function us(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function ls(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var Bp={placement:"bottom",modifiers:[],strategy:"absolute"};function Hp(){for(var e=arguments.length,t=new Array(e),r=0;r-1}function Jp(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Up(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function My(e){return e.split(/\s+/).filter(Boolean)}function Wr(e){return[].concat(e)}function jp(e,t){e.indexOf(t)===-1&&e.push(t)}function Fy(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function By(e){return e.split("-")[0]}function oi(e){return[].slice.call(e)}function qp(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function Ln(){return document.createElement("div")}function ii(e){return["Element","Fragment"].some(function(t){return gs(e,t)})}function Hy(e){return gs(e,"NodeList")}function ky(e){return gs(e,"MouseEvent")}function Uy(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function jy(e){return ii(e)?[e]:Hy(e)?oi(e):Array.isArray(e)?e:oi(document.querySelectorAll(e))}function ps(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function Gp(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function qy(e){var t,r=Wr(e),n=r[0];return n!=null&&(t=n.ownerDocument)!=null&&t.body?n.ownerDocument:document}function Gy(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,a=o.popperState,s=o.props,u=s.interactiveBorder,c=By(a.placement),l=a.modifiersData.offset;if(!l)return!0;var p=c==="bottom"?l.top.y:0,f=c==="top"?l.bottom.y:0,m=c==="right"?l.left.x:0,g=c==="left"?l.right.x:0,v=i.top-n+p>u,b=n-i.bottom-f>u,E=i.left-r+m>u,x=r-i.right-g>u;return v||b||E||x})}function ds(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}function Wp(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=r.getRootNode==null||(n=r.getRootNode())==null?void 0:n.host}return!1}var Et={isTouch:!1},Vp=0;function Wy(){Et.isTouch||(Et.isTouch=!0,window.performance&&document.addEventListener("mousemove",ed))}function ed(){var e=performance.now();e-Vp<20&&(Et.isTouch=!1,document.removeEventListener("mousemove",ed)),Vp=e}function Vy(){var e=document.activeElement;if(Uy(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function $y(){document.addEventListener("touchstart",Wy,mr),window.addEventListener("blur",Vy)}var Qy=typeof window<"u"&&typeof document<"u",zy=Qy?!!window.msCrypto:!1;var Yy={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Xy={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ft=Object.assign({appendTo:Zp,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Yy,Xy),Ky=Object.keys(ft),Zy=function(t){var r=Object.keys(t);r.forEach(function(n){ft[n]=t[n]})};function td(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,a=o.defaultValue;if(i){var s;n[i]=e[i]!==void 0?e[i]:(s=ft[i])!=null?s:a}return n},{});return Object.assign({},e,r)}function Jy(e,t){var r=t?Object.keys(td(Object.assign({},ft,{plugins:t}))):Ky,n=r.reduce(function(o,i){var a=(e.getAttribute("data-tippy-"+i)||"").trim();if(!a)return o;if(i==="content")o[i]=a;else try{o[i]=JSON.parse(a)}catch{o[i]=a}return o},{});return n}function $p(e,t){var r=Object.assign({},t,{content:Jp(t.content,[e])},t.ignoreAttributes?{}:Jy(e,t.plugins));return r.aria=Object.assign({},ft.aria,r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var e0=function(){return"innerHTML"};function hs(e,t){e[e0()]=t}function Qp(e){var t=Ln();return e===!0?t.className=Xp:(t.className=Kp,ii(e)?t.appendChild(e):hs(t,e)),t}function zp(e,t){ii(t.content)?(hs(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?hs(e,t.content):e.textContent=t.content)}function vs(e){var t=e.firstElementChild,r=oi(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(Yp)}),arrow:r.find(function(n){return n.classList.contains(Xp)||n.classList.contains(Kp)}),backdrop:r.find(function(n){return n.classList.contains(Dy)})}}function rd(e){var t=Ln(),r=Ln();r.className=Ny,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=Ln();n.className=Yp,n.setAttribute("data-state","hidden"),zp(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,a){var s=vs(t),u=s.box,c=s.content,l=s.arrow;a.theme?u.setAttribute("data-theme",a.theme):u.removeAttribute("data-theme"),typeof a.animation=="string"?u.setAttribute("data-animation",a.animation):u.removeAttribute("data-animation"),a.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?u.setAttribute("role",a.role):u.removeAttribute("role"),(i.content!==a.content||i.allowHTML!==a.allowHTML)&&zp(c,e.props),a.arrow?l?i.arrow!==a.arrow&&(u.removeChild(l),u.appendChild(Qp(a.arrow))):u.appendChild(Qp(a.arrow)):l&&u.removeChild(l)}return{popper:t,onUpdate:o}}rd.$$tippy=!0;var t0=1,ni=[],ms=[];function r0(e,t){var r=$p(e,Object.assign({},ft,td(qp(t)))),n,o,i,a=!1,s=!1,u=!1,c=!1,l,p,f,m=[],g=Up(Gt,r.interactiveDebounce),v,b=t0++,E=null,x=Fy(r.plugins),_={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},d={id:b,reference:e,popper:Ln(),popperInstance:E,props:r,state:_,plugins:x,clearDelayTimeouts:oe,setProps:ue,setContent:be,show:$t,hide:Nt,hideWithInteractivity:Vr,enable:O,disable:S,unmount:$r,destroy:Qr};if(!r.render)return d;var w=r.render(d),y=w.popper,P=w.onUpdate;y.setAttribute("data-tippy-root",""),y.id="tippy-"+d.id,d.popper=y,e._tippy=d,y._tippy=d;var z=x.map(function(h){return h.fn(d)}),Z=e.hasAttribute("aria-expanded");return nt(),ie(),R(),$("onCreate",[d]),r.showOnCreate&&Vt(),y.addEventListener("mouseenter",function(){d.props.interactive&&d.state.isVisible&&d.clearDelayTimeouts()}),y.addEventListener("mouseleave",function(){d.props.interactive&&d.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",g)}),d;function F(){var h=d.props.touch;return Array.isArray(h)?h:[h,0]}function L(){return F()[0]==="hold"}function M(){var h;return!!((h=d.props.render)!=null&&h.$$tippy)}function k(){return v||e}function U(){var h=k().parentNode;return h?qy(h):document}function Y(){return vs(y)}function B(h){return d.state.isMounted&&!d.state.isVisible||Et.isTouch||l&&l.type==="focus"?0:fs(d.props.delay,h?0:1,ft.delay)}function R(h){h===void 0&&(h=!1),y.style.pointerEvents=d.props.interactive&&!h?"":"none",y.style.zIndex=""+d.props.zIndex}function $(h,T,I){if(I===void 0&&(I=!0),z.forEach(function(G){G[h]&&G[h].apply(G,T)}),I){var K;(K=d.props)[h].apply(K,T)}}function q(){var h=d.props.aria;if(!!h.content){var T="aria-"+h.content,I=y.id,K=Wr(d.props.triggerTarget||e);K.forEach(function(G){var Te=G.getAttribute(T);if(d.state.isVisible)G.setAttribute(T,Te?Te+" "+I:I);else{var Xe=Te&&Te.replace(I,"").trim();Xe?G.setAttribute(T,Xe):G.removeAttribute(T)}})}}function ie(){if(!(Z||!d.props.aria.expanded)){var h=Wr(d.props.triggerTarget||e);h.forEach(function(T){d.props.interactive?T.setAttribute("aria-expanded",d.state.isVisible&&T===k()?"true":"false"):T.removeAttribute("aria-expanded")})}}function ce(){U().removeEventListener("mousemove",g),ni=ni.filter(function(h){return h!==g})}function te(h){if(!(Et.isTouch&&(u||h.type==="mousedown"))){var T=h.composedPath&&h.composedPath()[0]||h.target;if(!(d.props.interactive&&Wp(y,T))){if(Wr(d.props.triggerTarget||e).some(function(I){return Wp(I,T)})){if(Et.isTouch||d.state.isVisible&&d.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[d,h]);d.props.hideOnClick===!0&&(d.clearDelayTimeouts(),d.hide(),s=!0,setTimeout(function(){s=!1}),d.state.isMounted||Ce())}}}function dt(){u=!0}function Ae(){u=!1}function Be(){var h=U();h.addEventListener("mousedown",te,!0),h.addEventListener("touchend",te,mr),h.addEventListener("touchstart",Ae,mr),h.addEventListener("touchmove",dt,mr)}function Ce(){var h=U();h.removeEventListener("mousedown",te,!0),h.removeEventListener("touchend",te,mr),h.removeEventListener("touchstart",Ae,mr),h.removeEventListener("touchmove",dt,mr)}function xt(h,T){Ot(h,function(){!d.state.isVisible&&y.parentNode&&y.parentNode.contains(y)&&T()})}function ze(h,T){Ot(h,T)}function Ot(h,T){var I=Y().box;function K(G){G.target===I&&(ds(I,"remove",K),T())}if(h===0)return T();ds(I,"remove",p),ds(I,"add",K),p=K}function je(h,T,I){I===void 0&&(I=!1);var K=Wr(d.props.triggerTarget||e);K.forEach(function(G){G.addEventListener(h,T,I),m.push({node:G,eventType:h,handler:T,options:I})})}function nt(){L()&&(je("touchstart",Rt,{passive:!0}),je("touchend",Wt,{passive:!0})),My(d.props.trigger).forEach(function(h){if(h!=="manual")switch(je(h,Rt),h){case"mouseenter":je("mouseleave",Wt);break;case"focus":je(zy?"focusout":"blur",Pt);break;case"focusin":je("focusout",Pt);break}})}function ot(){m.forEach(function(h){var T=h.node,I=h.eventType,K=h.handler,G=h.options;T.removeEventListener(I,K,G)}),m=[]}function Rt(h){var T,I=!1;if(!(!d.state.isEnabled||Ye(h)||s)){var K=((T=l)==null?void 0:T.type)==="focus";l=h,v=h.currentTarget,ie(),!d.state.isVisible&&ky(h)&&ni.forEach(function(G){return G(h)}),h.type==="click"&&(d.props.trigger.indexOf("mouseenter")<0||a)&&d.props.hideOnClick!==!1&&d.state.isVisible?I=!0:Vt(h),h.type==="click"&&(a=!I),I&&!K&&Tt(h)}}function Gt(h){var T=h.target,I=k().contains(T)||y.contains(T);if(!(h.type==="mousemove"&&I)){var K=mt().concat(y).map(function(G){var Te,Xe=G._tippy,gr=(Te=Xe.popperInstance)==null?void 0:Te.state;return gr?{popperRect:G.getBoundingClientRect(),popperState:gr,props:r}:null}).filter(Boolean);Gy(K,h)&&(ce(),Tt(h))}}function Wt(h){var T=Ye(h)||d.props.trigger.indexOf("click")>=0&&a;if(!T){if(d.props.interactive){d.hideWithInteractivity(h);return}Tt(h)}}function Pt(h){d.props.trigger.indexOf("focusin")<0&&h.target!==k()||d.props.interactive&&h.relatedTarget&&y.contains(h.relatedTarget)||Tt(h)}function Ye(h){return Et.isTouch?L()!==h.type.indexOf("touch")>=0:!1}function Lt(){Ct();var h=d.props,T=h.popperOptions,I=h.placement,K=h.offset,G=h.getReferenceClientRect,Te=h.moveTransition,Xe=M()?vs(y).arrow:null,gr=G?{getBoundingClientRect:G,contextElement:G.contextElement||k()}:e,Ss={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kn){var yr=kn.state;if(M()){var Sd=Y(),mi=Sd.box;["placement","reference-hidden","escaped"].forEach(function(Un){Un==="placement"?mi.setAttribute("data-placement",yr.placement):yr.attributes.popper["data-popper-"+Un]?mi.setAttribute("data-"+Un,""):mi.removeAttribute("data-"+Un)}),yr.attributes.popper={}}}},Qt=[{name:"offset",options:{offset:K}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Te}},Ss];M()&&Xe&&Qt.push({name:"arrow",options:{element:Xe,padding:3}}),Qt.push.apply(Qt,T?.modifiers||[]),d.popperInstance=cs(gr,y,Object.assign({},T,{placement:I,onFirstUpdate:f,modifiers:Qt}))}function Ct(){d.popperInstance&&(d.popperInstance.destroy(),d.popperInstance=null)}function He(){var h=d.props.appendTo,T,I=k();d.props.interactive&&h===Zp||h==="parent"?T=I.parentNode:T=Jp(h,[I]),T.contains(y)||T.appendChild(y),d.state.isMounted=!0,Lt()}function mt(){return oi(y.querySelectorAll("[data-tippy-root]"))}function Vt(h){d.clearDelayTimeouts(),h&&$("onTrigger",[d,h]),Be();var T=B(!0),I=F(),K=I[0],G=I[1];Et.isTouch&&K==="hold"&&G&&(T=G),T?n=setTimeout(function(){d.show()},T):d.show()}function Tt(h){if(d.clearDelayTimeouts(),$("onUntrigger",[d,h]),!d.state.isVisible){Ce();return}if(!(d.props.trigger.indexOf("mouseenter")>=0&&d.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(h.type)>=0&&a)){var T=B(!1);T?o=setTimeout(function(){d.state.isVisible&&d.hide()},T):i=requestAnimationFrame(function(){d.hide()})}}function O(){d.state.isEnabled=!0}function S(){d.hide(),d.state.isEnabled=!1}function oe(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function ue(h){if(!d.state.isDestroyed){$("onBeforeUpdate",[d,h]),ot();var T=d.props,I=$p(e,Object.assign({},T,qp(h),{ignoreAttributes:!0}));d.props=I,nt(),T.interactiveDebounce!==I.interactiveDebounce&&(ce(),g=Up(Gt,I.interactiveDebounce)),T.triggerTarget&&!I.triggerTarget?Wr(T.triggerTarget).forEach(function(K){K.removeAttribute("aria-expanded")}):I.triggerTarget&&e.removeAttribute("aria-expanded"),ie(),R(),P&&P(T,I),d.popperInstance&&(Lt(),mt().forEach(function(K){requestAnimationFrame(K._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[d,h])}}function be(h){d.setProps({content:h})}function $t(){var h=d.state.isVisible,T=d.state.isDestroyed,I=!d.state.isEnabled,K=Et.isTouch&&!d.props.touch,G=fs(d.props.duration,0,ft.duration);if(!(h||T||I||K)&&!k().hasAttribute("disabled")&&($("onShow",[d],!1),d.props.onShow(d)!==!1)){if(d.state.isVisible=!0,M()&&(y.style.visibility="visible"),R(),Be(),d.state.isMounted||(y.style.transition="none"),M()){var Te=Y(),Xe=Te.box,gr=Te.content;ps([Xe,gr],0)}f=function(){var Qt;if(!(!d.state.isVisible||c)){if(c=!0,y.offsetHeight,y.style.transition=d.props.moveTransition,M()&&d.props.animation){var di=Y(),kn=di.box,yr=di.content;ps([kn,yr],G),Gp([kn,yr],"visible")}q(),ie(),jp(ms,d),(Qt=d.popperInstance)==null||Qt.forceUpdate(),$("onMount",[d]),d.props.animation&&M()&&ze(G,function(){d.state.isShown=!0,$("onShown",[d])})}},He()}}function Nt(){var h=!d.state.isVisible,T=d.state.isDestroyed,I=!d.state.isEnabled,K=fs(d.props.duration,1,ft.duration);if(!(h||T||I)&&($("onHide",[d],!1),d.props.onHide(d)!==!1)){if(d.state.isVisible=!1,d.state.isShown=!1,c=!1,a=!1,M()&&(y.style.visibility="hidden"),ce(),Ce(),R(!0),M()){var G=Y(),Te=G.box,Xe=G.content;d.props.animation&&(ps([Te,Xe],K),Gp([Te,Xe],"hidden"))}q(),ie(),d.props.animation?M()&&xt(K,d.unmount):d.unmount()}}function Vr(h){U().addEventListener("mousemove",g),jp(ni,g),g(h)}function $r(){d.state.isVisible&&d.hide(),d.state.isMounted&&(Ct(),mt().forEach(function(h){h._tippy.unmount()}),y.parentNode&&y.parentNode.removeChild(y),ms=ms.filter(function(h){return h!==d}),d.state.isMounted=!1,$("onHidden",[d]))}function Qr(){d.state.isDestroyed||(d.clearDelayTimeouts(),d.unmount(),ot(),delete e._tippy,d.state.isDestroyed=!0,$("onDestroy",[d]))}}function Nn(e,t){t===void 0&&(t={});var r=ft.plugins.concat(t.plugins||[]);$y();var n=Object.assign({},t,{plugins:r}),o=jy(e);if(!1)var i,a;var s=o.reduce(function(u,c){var l=c&&r0(c,n);return l&&u.push(l),u},[]);return ii(e)?s[0]:s}Nn.defaultProps=ft;Nn.setDefaultProps=Zy;Nn.currentInput=Et;var zS=Object.assign({},wn,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});Nn.setDefaultProps({render:rd});var nd=Nn;var he=W(J()),ad=W(To());function sd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}var ud=typeof window<"u"&&typeof document<"u";function bs(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function od(){return ud&&document.createElement("div")}function n0(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function ld(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(t.hasOwnProperty(r)){if(!ld(e[r],t[r]))return!1}else return!1;return!0}else return!1}function o0(e){var t=[];return e.forEach(function(r){t.find(function(n){return ld(r,n)})||t.push(r)}),t}function i0(e,t){var r,n;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:o0([].concat(((r=e.popperOptions)==null?void 0:r.modifiers)||[],((n=t.popperOptions)==null?void 0:n.modifiers)||[]))})})}var ys=ud?he.useLayoutEffect:he.useEffect;function a0(e){var t=(0,he.useRef)();return t.current||(t.current=typeof e=="function"?e():e),t.current}function id(e,t,r){r.split(/\s+/).forEach(function(n){n&&e.classList[t](n)})}var s0={name:"className",defaultValue:"",fn:function(t){var r=t.popper.firstElementChild,n=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function o(){t.props.className&&!n()||id(r,"add",t.props.className)}function i(){n()&&id(r,"remove",t.props.className)}return{onCreate:o,onBeforeUpdate:i,onAfterUpdate:o}}};function u0(e){function t(r){var n=r.children,o=r.content,i=r.visible,a=r.singleton,s=r.render,u=r.reference,c=r.disabled,l=c===void 0?!1:c,p=r.ignoreAttributes,f=p===void 0?!0:p,m=r.__source,g=r.__self,v=sd(r,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),b=i!==void 0,E=a!==void 0,x=(0,he.useState)(!1),_=x[0],d=x[1],w=(0,he.useState)({}),y=w[0],P=w[1],z=(0,he.useState)(),Z=z[0],F=z[1],L=a0(function(){return{container:od(),renders:1}}),M=Object.assign({ignoreAttributes:f},v,{content:L.container});b&&(M.trigger="manual",M.hideOnClick=!1),E&&(l=!0);var k=M,U=M.plugins||[];s&&(k=Object.assign({},M,{plugins:E&&a.data!=null?[].concat(U,[{fn:function(){return{onTrigger:function($,q){var ie=a.data.children.find(function(ce){var te=ce.instance;return te.reference===q.currentTarget});$.state.$$activeSingletonInstance=ie.instance,F(ie.content)}}}}]):U,render:function(){return{popper:L.container}}}));var Y=[u].concat(n?[n.type]:[]);return ys(function(){var B=u;u&&u.hasOwnProperty("current")&&(B=u.current);var R=e(B||L.ref||od(),Object.assign({},k,{plugins:[s0].concat(M.plugins||[])}));return L.instance=R,l&&R.disable(),i&&R.show(),E&&a.hook({instance:R,content:o,props:k,setSingletonContent:F}),d(!0),function(){R.destroy(),a?.cleanup(R)}},Y),ys(function(){var B;if(L.renders===1){L.renders++;return}var R=L.instance;R.setProps(i0(R.props,k)),(B=R.popperInstance)==null||B.forceUpdate(),l?R.disable():R.enable(),b&&(i?R.show():R.hide()),E&&a.hook({instance:R,content:o,props:k,setSingletonContent:F})}),ys(function(){var B;if(!!s){var R=L.instance;R.setProps({popperOptions:Object.assign({},R.props.popperOptions,{modifiers:[].concat((((B=R.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function($){var q=$.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var ie,ce=q.state,te=(ie=ce.modifiersData)==null?void 0:ie.hide;(y.placement!==ce.placement||y.referenceHidden!==te?.isReferenceHidden||y.escaped!==te?.hasPopperEscaped)&&P({placement:ce.placement,referenceHidden:te?.isReferenceHidden,escaped:te?.hasPopperEscaped}),ce.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(Y)),he.default.createElement(he.default.Fragment,null,n?(0,he.cloneElement)(n,{ref:function(R){L.ref=R,bs(n.ref,R)}}):null,_&&(0,ad.createPortal)(s?s(n0(y),Z,L.instance):o,L.container))}return t}var l0=function(e,t){return(0,he.forwardRef)(function(n,o){var i=n.children,a=sd(n,["children"]);return he.default.createElement(e,Object.assign({},t,a),i?(0,he.cloneElement)(i,{ref:function(u){bs(o,u),bs(i.ref,u)}}):null)})};var c0=l0(u0(nd)),cd=c0;var f0=({children:e,label:t,error:r,info:n,id:o})=>React.createElement("div",{className:"Input__Wrapper"},React.createElement("div",{className:"Input__Wrapper__Header"},t&&React.createElement("label",{htmlFor:o},t),n&&React.createElement(cd,{delay:[700,0],content:n},React.createElement("i",{className:"fa fa-info-circle"}))),e,r&&React.createElement("div",{className:"Input__Wrapper__Error"},r)),fd=f0;var pd=({icon:e,alignment:t="left"})=>React.createElement("span",{className:`Input__Icon Input__Icon${t==="left"?"--left":"--right"}`},e),p0=(0,dd.forwardRef)(({value:e,onChange:t,className:r="",emphasize:n,placeholder:o,icon:i,iconAlignment:a="left",type:s="text",isValid:u,label:c,id:l,info:p,error:f,...m},g)=>React.createElement(fd,{id:l,label:c,error:f,info:p},React.createElement("div",{className:"Input__Text__Wrapper"},React.createElement("input",{ref:g,type:s,value:e,id:l,onChange:t,className:`Input__Text ${n?"Input__Text--emphasize":""} ${a==="left"&&i?"Input__Text--withIcon":i&&u?"Input__Text--withIcons":""}`,placeholder:o,...m}),i&&React.createElement(pd,{alignment:a,icon:i}),i&&u&&a==="left"&&React.createElement(pd,{alignment:a,icon:React.createElement("i",{className:"fas fa-check"})})))),Es=p0;var md=W(J()),_s=class extends md.Component{constructor(){super(...arguments);Ps(this,"state",{hasError:!1})}static getDerivedStateFromError(r){return{hasError:!0}}componentDidCatch(r,n){}render(){return this.state.hasError?(console.log(this.state),React.createElement("span",{className:"block p-8 text-2xl text-center text-red"},"Une erreur est survenue")):this.props.children}},hd=_s;var vd=W(jn()),d0=({currentTags:e,onUpdate:t})=>{let{data:r}=Ba(),n=r?.filter(o=>!e.find(({tag:i})=>i.id===o.id))||[];return React.createElement("ul",{className:"TagList"},n?.length>0?n.map(o=>React.createElement("li",{key:o.id,onClick:()=>{t(o)},className:"TagList__Item"},React.createElement("span",null,o.title))):React.createElement("li",{className:"TagList__Item"},React.createElement("span",null,"No tags available.")))},m0=({isOpen:e,setIsOpen:t,image:r})=>{let[n,o]=(0,rt.useState)(!1),i=ve(),a=Nf(),s=Df();return React.createElement(xs.default,{isOpen:e,onRequestClose:()=>{t(!1)},className:"Modal-Tags",overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>{t(!1)},className:"Modal__Header__Close"},React.createElement(ka,null)),React.createElement("div",{className:"Modal__Header__Title"},i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_TAG_CONFIG"})," ",r.title)),React.createElement("div",{className:"Modal__Content",style:{overflow:"inherit"}},React.createElement("div",null,React.createElement("label",null,i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_ADD_TAG"})),React.createElement("div",{className:"BlockImage__TagSelector"},React.createElement("div",{className:"BlockImage__TagSelector__Tags",style:{paddingLeft:r.tags.length<1?"14px":"0"}},r.tags.length?r.tags.map(({tag:u,imageTag:c})=>React.createElement("div",{key:u.id,className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,u.title),React.createElement("button",{className:"BlockImage__TagSelector__Tag__Remove",onClick:()=>a.mutate(c.id||57)},React.createElement(Ff,null)))):s.isLoading?null:i.formatMessage({id:"BlockImage__LIBRARY_IMAGE_SELECT_TAG"}),s.isLoading&&React.createElement("div",{className:"BlockImage__TagSelector__Tag"},React.createElement("span",null,React.createElement("i",{className:"fa fa-circle-notch fa-spin"})))),React.createElement("button",{className:"BlockImage__TagSelector__Add",onClick:()=>o(!n),disabled:s.isLoading||a.isLoading},React.createElement("i",{className:"block fas fa-plus"})),n?React.createElement(rt.Suspense,{fallback:React.createElement("div",{className:"BlockProduct__Loader"},React.createElement("i",{className:"fa fa-circle-notch fa-spin"}))},React.createElement(d0,{currentTags:r.tags,onUpdate:u=>{s.mutate({imageId:r.id,tagId:u.id}),o(!1)}})):null)))))},h0=()=>{let e=ve(),{data:t}=Ba();return React.createElement(React.Fragment,null,React.createElement("option",{value:""},e.formatMessage({id:"ALL_TAGS"})),t?.map(r=>React.createElement("option",{key:r.id,value:r.id},r.title)))},v0=({setTagId:e})=>{let t=ve();return React.createElement("div",{className:"Select__Wrapper"},React.createElement("div",{className:"Input__Select__Separator"}),React.createElement("label",{htmlFor:"tag-filter"},t.formatMessage({id:"BlockImage__LIBRARY_MODAL_TAG_FILTER"})),React.createElement("select",{className:"Input__Select",name:"tag-filter",id:"tag-filter",onChange:r=>e(r.target.value)},React.createElement(rt.Suspense,{fallback:React.createElement("option",null,t.formatMessage({id:"LOADING"}))},React.createElement(h0,null))))},g0=({image:e,onSelect:t})=>{let[r,n]=(0,rt.useState)(!1),o=ve(),i=Lf(),{getUrlWithPrefix:a}=(0,rt.useContext)(vd.LocaleContext);return React.createElement(React.Fragment,null,React.createElement("div",{className:"Library__Image"},React.createElement("div",{className:"Library__Image__Tags"},e.tags?.map(({tag:s})=>React.createElement("span",{key:s.id,style:{border:`1px solid ${s.colorCode}`,color:s.colorCode},className:"Library__Image__Tag"},s.title))),React.createElement("img",{width:"150",height:"150",loading:"lazy",src:a(`/image-library/${e.id}/full/^!150,150/0/default.webp`)}),React.createElement("span",{className:"Library__Image__Title"},e.title),React.createElement("div",{className:"Library__Image__Actions"},React.createElement("span",{className:"Library__Image__Action__Title"},e.title),React.createElement("button",{className:"Library__Image__Select__Action",style:{marginTop:"12px",marginBottom:"6px"},onClick:()=>t(e)},o.formatMessage({id:"CHOOSE"})),React.createElement("div",{className:"flex gap-2"},React.createElement("button",{className:"Library__Image__Tag__Action",onClick:()=>n(!0)},React.createElement("i",{className:"fas fa-tag"})),React.createElement("button",{className:"Library__Image__Delete__Action",onClick:()=>i.mutate(e.id)},React.createElement(Mf,null))))),React.createElement(m0,{image:e,isOpen:r,setIsOpen:n}))},y0=({limit:e=20,onSelect:t})=>{let[r,n]=(0,rt.useState)(0),[o,i]=(0,rt.useState)(""),[a,s]=(0,rt.useState)(),{data:u=[],isFetching:c,isPreviousData:l}=Rf({offset:r,limit:e,title:o,tagId:a}),p=ve();return React.createElement("div",{className:"Library"},React.createElement("div",{className:"Library__Filters"},React.createElement(Es,{placeholder:p.formatMessage({id:"SEARCH_BY"}),type:"text",name:"library-search",id:"library-search",value:o,onChange:f=>i(f.target.value),label:p.formatMessage({id:"BlockImage__LIBRARY_MODAL_SEARCH"}),icon:React.createElement("i",{className:"fa fa-search emphasize"}),iconAlignment:"right"}),React.createElement(v0,{setTagId:s})),React.createElement("div",{className:"Library__Content"},c?React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,p.formatMessage({id:"BlockImage__LIBRARY_SEARCHING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):u.length>0?u?.map(f=>React.createElement(g0,{key:f.id,image:f,onSelect:t})):React.createElement("div",{className:"Library__NoContent"},React.createElement("span",null,p.formatMessage({id:"BlockImage__LIBRARY_NO_CONTENT"})))),React.createElement("div",{className:"Pagination"},React.createElement("button",{className:"Pagination__Button Pagination__Button--previous",onClick:()=>n(f=>Math.max(f-e,0)),disabled:r===0},React.createElement("i",{className:"fa fa-chevron-left"})),React.createElement("div",{className:"Pagination__Button Pagination__Button--page"},r/e+1),React.createElement("button",{className:"Pagination__Button Pagination__Button--next",onClick:()=>{!l&&(u?.length||0)>=e&&n(f=>f+e)},disabled:l||(u?.length||0)t(!1),className:"Modal-Library",ariaHideApp:!1,overlayClassName:"Overlay"},React.createElement("div",{className:"Modal__Wrapper"},React.createElement("div",{className:"Modal__Header"},React.createElement("button",{onClick:()=>t(!1),className:"Modal__Header__Close"},React.createElement(ka,null)),React.createElement("div",{className:"Modal__Header__Title"},o.formatMessage({id:"BlockImage__LIBRARY_MODAL_TITLE"}))),React.createElement("div",{className:"Modal__Content"},React.createElement(rt.Suspense,{fallback:React.createElement("div",{className:"Modal__Content__Loader"},React.createElement("span",null,o.formatMessage({id:"BlockImage__LIBRARY_LOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"}))},React.createElement(hd,null,React.createElement(y0,{onSelect:n,limit:r}))))))}function Dn(e){return React.createElement(Cr,{messages:rn[Dt],locale:Dt},React.createElement(Rr,{client:gn},React.createElement(b0,{...e})))}var fi=W(J(),1),pi=W(J(),1),pt=W(J(),1);var E0={data:""},_0=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||E0;var x0=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,O0=/\/\*[^]*?\*\/| +/g,gd=/\n+/g,qt=(e,t)=>{let r="",n="",o="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+a+";":n+=i[1]=="f"?qt(a,i):i+"{"+qt(a,i[1]=="k"?"":t)+"}":typeof a=="object"?n+=qt(a,t?t.replace(/([^,])+/g,s=>i.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):i):a!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=qt.p?qt.p(i,a):i+":"+a+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Mn={},yd=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+yd(e[r]);return t}return e},C0=(e,t,r,n,o)=>{let i=yd(e),a=Mn[i]||(Mn[i]=(s=>{let u=0,c=11;for(;u>>0;return"go"+c})(i));if(!Mn[a]){let s=i!==e?e:(u=>{let c,l,p=[{}];for(;c=x0.exec(u.replace(O0,""));)c[4]?p.shift():c[3]?(l=c[3].replace(gd," ").trim(),p.unshift(p[0][l]=p[0][l]||{})):p[0][c[1]]=c[2].replace(gd," ").trim();return p[0]})(e);Mn[a]=qt(o?{["@keyframes "+a]:s}:s,r?"":"."+a)}return((s,u,c)=>{u.data.indexOf(s)==-1&&(u.data=c?s+u.data:u.data+s)})(Mn[a],t,n),a},T0=(e,t,r)=>e.reduce((n,o,i)=>{let a=t[i];if(a&&a.call){let s=a(r),u=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=u?"."+u:s&&typeof s=="object"?s.props?"":qt(s,""):s===!1?"":s}return n+o+(a??"")},"");function Fn(e){let t=this||{},r=e.call?e(t.p):e;return C0(r.unshift?r.raw?T0(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,_0(t.target),t.g,t.o,t.k)}var bd,Os,Cs,RA=Fn.bind({g:1}),Ue=Fn.bind({k:1});function Ed(e,t,r,n){qt.p=t,bd=e,Os=r,Cs=n}function Qe(e,t){let r=this||{};return function(){let n=arguments;function o(i,a){let s=Object.assign({},i),u=s.className||o.className;r.p=Object.assign({theme:Os&&Os()},s),r.o=/ *go\d+/.test(u),s.className=Fn.apply(r,n)+(u?" "+u:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),Cs&&c[0]&&Cs(s),bd(c,s)}return t?t(o):o}}var hr=W(J(),1);var Bn=W(J(),1),w0=e=>typeof e=="function",ci=(e,t)=>w0(e)?e(t):e,S0=(()=>{let e=0;return()=>(++e).toString()})(),A0=e=>t=>{t&&setTimeout(()=>{let r=t.getBoundingClientRect();e(r)})},xd=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),I0=20,si=new Map,_d=e=>{if(si.has(e))return;let t=setTimeout(()=>{si.delete(e),vr({type:4,toastId:e})},1e3);si.set(e,t)},R0=e=>{let t=si.get(e);t&&clearTimeout(t)},Ts=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,I0)};case 1:return t.toast.id&&R0(t.toast.id),{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:r}=t;return e.toasts.find(i=>i.id===r.id)?Ts(e,{type:1,toast:r}):Ts(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?_d(n):e.toasts.forEach(i=>{_d(i.id)}),{...e,toasts:e.toasts.map(i=>i.id===n||n===void 0?{...i,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+o}))}}},ui=[],li={toasts:[],pausedAt:void 0},vr=e=>{li=Ts(li,e),ui.forEach(t=>{t(li)})},P0={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},L0=(e={})=>{let[t,r]=(0,fi.useState)(li);(0,fi.useEffect)(()=>(ui.push(r),()=>{let o=ui.indexOf(r);o>-1&&ui.splice(o,1)}),[t]);let n=t.toasts.map(o=>{var i,a;return{...e,...e[o.type],...o,duration:o.duration||((i=e[o.type])==null?void 0:i.duration)||e?.duration||P0[o.type],style:{...e.style,...(a=e[o.type])==null?void 0:a.style,...o.style}}});return{...t,toasts:n}},N0=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||S0()}),Hn=e=>(t,r)=>{let n=N0(t,e,r);return vr({type:2,toast:n}),n.id},Fe=(e,t)=>Hn("blank")(e,t);Fe.error=Hn("error");Fe.success=Hn("success");Fe.loading=Hn("loading");Fe.custom=Hn("custom");Fe.dismiss=e=>{vr({type:3,toastId:e})};Fe.remove=e=>vr({type:4,toastId:e});Fe.promise=(e,t,r)=>{let n=Fe.loading(t.loading,{...r,...r?.loading});return e.then(o=>(Fe.success(ci(t.success,o),{id:n,...r,...r?.success}),o)).catch(o=>{Fe.error(ci(t.error,o),{id:n,...r,...r?.error})}),e};var D0=e=>{let{toasts:t,pausedAt:r}=L0(e);(0,pi.useEffect)(()=>{if(r)return;let o=Date.now(),i=t.map(a=>{if(a.duration===1/0)return;let s=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(s<0){a.visible&&Fe.dismiss(a.id);return}return setTimeout(()=>Fe.dismiss(a.id),s)});return()=>{i.forEach(a=>a&&clearTimeout(a))}},[t,r]);let n=(0,pi.useMemo)(()=>({startPause:()=>{vr({type:5,time:Date.now()})},endPause:()=>{r&&vr({type:6,time:Date.now()})},updateHeight:(o,i)=>vr({type:1,toast:{id:o,height:i}}),calculateOffset:(o,i)=>{let{reverseOrder:a=!1,gutter:s=8,defaultPosition:u}=i||{},c=t.filter(f=>(f.position||u)===(o.position||u)&&f.height),l=c.findIndex(f=>f.id===o.id),p=c.filter((f,m)=>mf.visible).slice(...a?[p+1]:[0,p]).reduce((f,m)=>f+(m.height||0)+s,0)}}),[t,r]);return{toasts:t,handlers:n}},M0=Ue` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -40,7 +40,7 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,D0=Ue` +}`,F0=Ue` from { transform: scale(0); opacity: 0; @@ -48,7 +48,7 @@ from { to { transform: scale(1); opacity: 1; -}`,M0=Ue` +}`,B0=Ue` from { transform: scale(0) rotate(90deg); opacity: 0; @@ -56,7 +56,7 @@ from { to { transform: scale(1) rotate(90deg); opacity: 1; -}`,F0=Qe("div")` +}`,H0=Qe("div")` width: 20px; opacity: 0; height: 20px; @@ -65,14 +65,14 @@ to { position: relative; transform: rotate(45deg); - animation: ${N0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${M0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; - animation: ${D0} 0.15s ease-out forwards; + animation: ${F0} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; @@ -85,18 +85,18 @@ to { } &:before { - animation: ${M0} 0.15s ease-out forwards; + animation: ${B0} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } -`,B0=Ue` +`,k0=Ue` from { transform: rotate(0deg); } to { transform: rotate(360deg); } -`,H0=Qe("div")` +`,U0=Qe("div")` width: 12px; height: 12px; box-sizing: border-box; @@ -104,8 +104,8 @@ to { border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; - animation: ${B0} 1s linear infinite; -`,k0=Ue` + animation: ${k0} 1s linear infinite; +`,j0=Ue` from { transform: scale(0) rotate(45deg); opacity: 0; @@ -113,7 +113,7 @@ from { to { transform: scale(1) rotate(45deg); opacity: 1; -}`,U0=Ue` +}`,q0=Ue` 0% { height: 0; width: 0; @@ -127,7 +127,7 @@ to { 100% { opacity: 1; height: 10px; -}`,j0=Qe("div")` +}`,G0=Qe("div")` width: 20px; opacity: 0; height: 20px; @@ -136,13 +136,13 @@ to { position: relative; transform: rotate(45deg); - animation: ${k0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${j0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; - animation: ${U0} 0.2s ease-out forwards; + animation: ${q0} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; @@ -154,16 +154,16 @@ to { height: 10px; width: 6px; } -`,q0=Qe("div")` +`,W0=Qe("div")` position: absolute; -`,G0=Qe("div")` +`,V0=Qe("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; -`,W0=Ue` +`,$0=Ue` from { transform: scale(0.6); opacity: 0.4; @@ -171,20 +171,20 @@ from { to { transform: scale(1); opacity: 1; -}`,V0=Qe("div")` +}`,Q0=Qe("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; - animation: ${W0} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) + animation: ${$0} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; -`,$0=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?hr.createElement(V0,null,t):t:r==="blank"?null:hr.createElement(G0,null,hr.createElement(H0,{...n}),r!=="loading"&&hr.createElement(q0,null,r==="error"?hr.createElement(F0,{...n}):hr.createElement(j0,{...n})))},Q0=e=>` +`,z0=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?hr.createElement(Q0,null,t):t:r==="blank"?null:hr.createElement(V0,null,hr.createElement(U0,{...n}),r!=="loading"&&hr.createElement(W0,null,r==="error"?hr.createElement(H0,{...n}):hr.createElement(G0,{...n})))},Y0=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} -`,z0=e=>` +`,X0=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} -`,Y0="0%{opacity:0;} 100%{opacity:1;}",X0="0%{opacity:1;} 100%{opacity:0;}",K0=Qe("div",ft.forwardRef)` +`,K0="0%{opacity:0;} 100%{opacity:1;}",Z0="0%{opacity:1;} 100%{opacity:0;}",J0=Qe("div",pt.forwardRef)` display: flex; align-items: center; background: #fff; @@ -196,19 +196,19 @@ to { pointer-events: auto; padding: 8px 10px; border-radius: 8px; -`,Z0=Qe("div")` +`,eb=Qe("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; -`,J0=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=bd()?[Y0,X0]:[Q0(r),z0(r)];return{animation:t?`${Ue(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ue(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},eb=ft.memo(({toast:e,position:t,style:r,children:n})=>{let o=e!=null&&e.height?J0(e.position||t||"top-center",e.visible):{opacity:0},i=ft.createElement($0,{toast:e}),a=ft.createElement(Z0,{...e.ariaProps},li(e.message,e));return ft.createElement(K0,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:a}):ft.createElement(ft.Fragment,null,i,a))});gd(Bn.createElement);var tb=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:bd()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},rb=Fn` +`,tb=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=xd()?[K0,Z0]:[Y0(r),X0(r)];return{animation:t?`${Ue(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ue(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},rb=pt.memo(({toast:e,position:t,style:r,children:n})=>{let o=e!=null&&e.height?tb(e.position||t||"top-center",e.visible):{opacity:0},i=pt.createElement(z0,{toast:e}),a=pt.createElement(eb,{...e.ariaProps},ci(e.message,e));return pt.createElement(J0,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:a}):pt.createElement(pt.Fragment,null,i,a))});Ed(Bn.createElement);var nb=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:xd()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},ob=Fn` z-index: 9999; > * { pointer-events: auto; } -`,ii=16,Ed=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,containerStyle:i,containerClassName:a})=>{let{toasts:s,handlers:u}=L0(r);return Bn.createElement("div",{style:{position:"fixed",zIndex:9999,top:ii,left:ii,right:ii,bottom:ii,pointerEvents:"none",...i},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map(c=>{let l=c.position||t,p=u.calculateOffset(c,{reverseOrder:e,gutter:n,defaultPosition:t}),f=tb(l,p),m=c.height?void 0:w0(g=>{u.updateHeight(c.id,g.height)});return Bn.createElement("div",{ref:m,className:c.visible?rb:"",key:c.id,style:f},c.type==="custom"?li(c.message,c):o?o(c):Bn.createElement(eb,{toast:c,position:l}))}))};var nb=({onSelect:e})=>{let t=ve(),r=If(),{getRootProps:n,isDragActive:o}=ia({multiple:!1,accept:{"image/*":["*"]},noClick:!0,maxFiles:1,onDrop:async i=>{if(i){let a=new FormData;a.append("image",i[0]);let s=await r.mutateAsync(a);e(s)}},onDropRejected:i=>{i.length>1?Fe.error(t.formatMessage({id:"BlockImage__TOAST_MAX_FILE"})):Fe.error(t.formatMessage({id:"BlockImage__TOAST_WRONG_FILE_TYPE"}))}});return React.createElement("div",{className:`BlockImage__FromLocal ${o?"BlockImage__FromLocal--active":""}`,...n()},React.createElement("div",{className:"BlockImage__FromLocal__Icon"},React.createElement(fl,null)),o?t.formatMessage({id:"BlockImage__DROP_TO_UPLOAD"}):r.isLoading?React.createElement(React.Fragment,null,React.createElement("span",null,t.formatMessage({id:"DOWNLOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):React.createElement(React.Fragment,null,React.createElement("form",{onSubmit:i=>{i.preventDefault()}},React.createElement("label",{className:"BlockImage__Button",htmlFor:"image"},t.formatMessage({id:"BlockImage__DOWNLOAD"})),React.createElement("input",{className:"BlockImage__FromLocal__FileInput",type:"file",accept:"image/*",name:"image",id:"image",onChange:async i=>{if(i.target.files){let a=new FormData;a.append("image",i.target.files[0]);let s=await r.mutateAsync(a);e(s)}}}),React.createElement("span",null,t.formatMessage({id:"BlockImage__OR_DROP"})))))},ob=({onSelect:e})=>{let[t,r]=(0,qt.useState)(!1),n=ve();return React.createElement("div",{className:"BlockImage__FromLibrary"},React.createElement("div",{className:"BlockImage__FromLibrary__Icon"},React.createElement(pl,null)),React.createElement("button",{className:"BlockImage__Button",style:{marginBottom:"0.25rem"},onClick:()=>{r(!0)}},React.createElement("span",null,n.formatMessage({id:"BlockImage__SELECT_BUTTON"}))),React.createElement("span",null,n.formatMessage({id:"BlockImage__SELECT"})),t?React.createElement(Dn,{isOpen:t,setIsOpen:r,onSelect:o=>{r(!1),e(o)}}):null)},ib=({id:e,fileName:t,setEditMode:r})=>{let n=ve();return e?React.createElement("div",{className:"BlockImage__Preview"},React.createElement("img",{src:`/image-library/${e}/full/^!220,220/0/default.webp`,alt:"",loading:"lazy",onError:o=>o.target.src="https://via.placeholder.com/220"}),React.createElement("div",{className:"BlockImage__Preview__Infos"},React.createElement("span",{className:"BlockImage__Preview__FileName"},t),React.createElement("button",{className:"BlockImage__Button",onClick:()=>{r(!0)}},n.formatMessage({id:"REPLACE"})))):null},ab=({image:e,onChange:t})=>{let[r,n]=(0,qt.useState)(e.title),[o,i]=(0,qt.useState)(e.link?.url||""),a=ve();return React.createElement("form",{className:"BlockImage__Infos__Form",onSubmit:s=>{s.preventDefault()}},React.createElement("div",null,React.createElement("label",null,a.formatMessage({id:"BlockImage__TITLE"})),React.createElement("input",{className:"Input__Text",type:"text",name:"title",value:r,placeholder:a.formatMessage({id:"BlockImage__TITLE"}),onChange:s=>n(s.target.value),onBlur:()=>t({title:r})})),React.createElement("div",null,React.createElement("label",null,a.formatMessage({id:"BlockImage__LINK"})," (",a.formatMessage({id:"OPTIONAL"}),")"),React.createElement("input",{className:"Input__Text",type:"text",name:"linkUrl",value:o,placeholder:a.formatMessage({id:"BlockImage__LINK_PLACEHOLDER"}),onChange:s=>i(s.target.value),onBlur:()=>t({link:{url:o}})})))},Ts=({onSelect:e,compact:t})=>React.createElement(Cr,{messages:rn[Nt],locale:Nt},React.createElement(Rr,{client:gn},React.createElement("div",{className:`BlockImage__Upload__Wrapper ${t?"BlockImage__Upload--light":""}`},React.createElement(nb,{onSelect:e}),React.createElement(ob,{onSelect:e})))),sb=e=>{let{data:t,onUpdate:r}=e,[n,o]=(0,qt.useState)(null),[i,a]=(0,qt.useState)(!1),s=ve();(0,qt.useEffect)(()=>{if(t.id){o(t);return}a(!0)},[t]);let u=c=>{r(c),a(!1)};return React.createElement("div",{className:"BlockImage"},n&&!i?React.createElement("div",{className:"BlockImage__Infos"},React.createElement(ib,{id:n.id,fileName:n.fileName,setEditMode:a}),React.createElement(ab,{image:n,onChange:c=>{r({...t,...c})}})):null,i?React.createElement(React.Fragment,null,n?.id?React.createElement("span",{style:{marginBottom:"15px",display:"block",fontWeight:800,fontSize:"18px"}},s.formatMessage({id:"REPLACE_IMAGE"}),' "',n.title,'"'):null,React.createElement(Ts,{onSelect:u}),n?.id?React.createElement("button",{onClick:()=>{a(!1)},style:{marginTop:"15px"},className:"BlockImage__Button"},s.formatMessage({id:"CANCEL"})):null):null)},ub=e=>React.createElement(Cr,{messages:rn[Nt],locale:Nt},React.createElement(Rr,{client:gn},React.createElement(Ed,{toastOptions:{success:{style:{background:"#EAFBF5",border:"1px solid #005A3A"}},error:{style:{background:"#FFEDED",border:"1px solid #D21919"}}}}),React.createElement(sb,{...e}))),lb={url:null,id:null,title:"",fileName:"",tags:[]},cb={id:"blockImage"},fb={type:cb,component:ub,initialData:lb,title:{default:"Image",fr:"Image",en:"Image",es:"Imagen",it:"Immagine"},description:{default:"Display an image",fr:"Affiche une image",en:"Display an image",es:"Mostrar una imagen",it:"Mostra un immagine"},icon:cl,image:{default:""}},_d=fb;var Cd=$(Od());(0,Cd.registerPlugin)(_d);var pb=Dn;return Is(db);})(); +`,ai=16,Od=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,containerStyle:i,containerClassName:a})=>{let{toasts:s,handlers:u}=D0(r);return Bn.createElement("div",{style:{position:"fixed",zIndex:9999,top:ai,left:ai,right:ai,bottom:ai,pointerEvents:"none",...i},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},s.map(c=>{let l=c.position||t,p=u.calculateOffset(c,{reverseOrder:e,gutter:n,defaultPosition:t}),f=nb(l,p),m=c.height?void 0:A0(g=>{u.updateHeight(c.id,g.height)});return Bn.createElement("div",{ref:m,className:c.visible?ob:"",key:c.id,style:f},c.type==="custom"?ci(c.message,c):o?o(c):Bn.createElement(rb,{toast:c,position:l}))}))};var ib=({onSelect:e})=>{let t=ve(),r=Pf(),{getRootProps:n,isDragActive:o}=aa({multiple:!1,accept:{"image/*":[".png",".gif",".jpeg",".jpg",".webp",".svg"]},noClick:!0,maxFiles:1,onDrop:async i=>{if(i){let a=new FormData;a.append("image",i[0]);let s=await r.mutateAsync(a);e(s)}},onDropRejected:i=>{i.length>1?Fe.error(t.formatMessage({id:"BlockImage__TOAST_MAX_FILE"})):Fe.error(t.formatMessage({id:"BlockImage__TOAST_WRONG_FILE_TYPE"}))}});return React.createElement("div",{className:`BlockImage__FromLocal ${o?"BlockImage__FromLocal--active":""}`,...n()},React.createElement("div",{className:"BlockImage__FromLocal__Icon"},React.createElement(dl,null)),o?t.formatMessage({id:"BlockImage__DROP_TO_UPLOAD"}):r.isLoading?React.createElement(React.Fragment,null,React.createElement("span",null,t.formatMessage({id:"DOWNLOADING"})),React.createElement("i",{className:"Loader fa fa-circle-notch fa-spin"})):React.createElement(React.Fragment,null,React.createElement("form",{onSubmit:i=>{i.preventDefault()}},React.createElement("label",{className:"BlockImage__Button",htmlFor:"image"},t.formatMessage({id:"BlockImage__DOWNLOAD"})),React.createElement("input",{className:"BlockImage__FromLocal__FileInput",type:"file",accept:"image/*",name:"image",id:"image",onChange:async i=>{if(i.target.files){let a=new FormData;a.append("image",i.target.files[0]);let s=await r.mutateAsync(a);e(s)}}}),React.createElement("span",null,t.formatMessage({id:"BlockImage__OR_DROP"})))))},ab=({onSelect:e})=>{let[t,r]=(0,_t.useState)(!1),n=ve();return React.createElement("div",{className:"BlockImage__FromLibrary"},React.createElement("div",{className:"BlockImage__FromLibrary__Icon"},React.createElement(ml,null)),React.createElement("button",{className:"BlockImage__Button",style:{marginBottom:"0.25rem"},onClick:()=>{r(!0)}},React.createElement("span",null,n.formatMessage({id:"BlockImage__SELECT_BUTTON"}))),React.createElement("span",null,n.formatMessage({id:"BlockImage__SELECT"})),t?React.createElement(Dn,{isOpen:t,setIsOpen:r,onSelect:o=>{r(!1),e(o)}}):null)},sb=({id:e,fileName:t,setEditMode:r})=>{let n=ve(),{getUrlWithPrefix:o}=(0,_t.useContext)(Cd.LocaleContext);return e?React.createElement("div",{className:"BlockImage__Preview"},React.createElement("img",{src:o(`/image-library/${e}/full/^!220,220/0/default.webp`),alt:"",loading:"lazy",onError:i=>i.target.src="https://via.placeholder.com/220"}),React.createElement("div",{className:"BlockImage__Preview__Infos"},React.createElement("span",{className:"BlockImage__Preview__FileName"},t),React.createElement("button",{className:"BlockImage__Button",onClick:()=>{r(!0)}},n.formatMessage({id:"REPLACE"})))):null},ub=({image:e,onChange:t})=>{let[r,n]=(0,_t.useState)(e.title),[o,i]=(0,_t.useState)(e.link?.url||""),a=ve();return React.createElement("form",{className:"BlockImage__Infos__Form",onSubmit:s=>{s.preventDefault()}},React.createElement("div",null,React.createElement("label",null,a.formatMessage({id:"BlockImage__TITLE"})),React.createElement("input",{className:"Input__Text",type:"text",name:"title",value:r,placeholder:a.formatMessage({id:"BlockImage__TITLE"}),onChange:s=>n(s.target.value),onBlur:()=>t({title:r})})),React.createElement("div",null,React.createElement("label",null,a.formatMessage({id:"BlockImage__LINK"})," (",a.formatMessage({id:"OPTIONAL"}),")"),React.createElement("input",{className:"Input__Text",type:"text",name:"linkUrl",value:o,placeholder:a.formatMessage({id:"BlockImage__LINK_PLACEHOLDER"}),onChange:s=>i(s.target.value),onBlur:()=>t({link:{url:o}})})))},ws=({onSelect:e,compact:t})=>React.createElement(Cr,{messages:rn[Dt],locale:Dt},React.createElement(Rr,{client:gn},React.createElement("div",{className:`BlockImage__Upload__Wrapper ${t?"BlockImage__Upload--light":""}`},React.createElement(ib,{onSelect:e}),React.createElement(ab,{onSelect:e})))),lb=e=>{let{data:t,onUpdate:r}=e,[n,o]=(0,_t.useState)(null),[i,a]=(0,_t.useState)(!1),s=ve();(0,_t.useEffect)(()=>{if(t.id){o(t);return}a(!0)},[t]);let u=c=>{r(c),a(!1)};return React.createElement("div",{className:"BlockImage"},n&&!i?React.createElement("div",{className:"BlockImage__Infos"},React.createElement(sb,{id:n.id,fileName:n.fileName,setEditMode:a}),React.createElement(ub,{image:n,onChange:c=>{r({...t,...c})}})):null,i?React.createElement(React.Fragment,null,n?.id?React.createElement("span",{style:{marginBottom:"15px",display:"block",fontWeight:800,fontSize:"18px"}},s.formatMessage({id:"REPLACE_IMAGE"}),' "',n.title,'"'):null,React.createElement(ws,{onSelect:u}),n?.id?React.createElement("button",{onClick:()=>{a(!1)},style:{marginTop:"15px"},className:"BlockImage__Button"},s.formatMessage({id:"CANCEL"})):null):null)},cb=e=>React.createElement(Cr,{messages:rn[Dt],locale:Dt},React.createElement(Rr,{client:gn},React.createElement(Od,{toastOptions:{success:{style:{background:"#EAFBF5",border:"1px solid #005A3A"}},error:{style:{background:"#FFEDED",border:"1px solid #D21919"}}}}),React.createElement(lb,{...e}))),fb={id:null,title:"",fileName:"",tags:[]},pb={id:"blockImage"},db={type:pb,component:cb,initialData:fb,title:{default:"Image",fr:"Image",en:"Image",es:"Imagen",it:"Immagine"},description:{default:"Display an image",fr:"Affiche une image",en:"Display an image",es:"Mostrar una imagen",it:"Mostra un immagine"},icon:pl,image:{default:""}},Td=db;var wd=W(jn());(0,wd.registerPlugin)(Td);var mb=Dn;return Rs(hb);})(); /*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. diff --git a/templates/backOffice/default/tb-plugin/vendor/index.global.js.map b/templates/backOffice/default/tb-plugin/vendor/index.global.js.map index e98dc71..9dffffe 100644 --- a/templates/backOffice/default/tb-plugin/vendor/index.global.js.map +++ b/templates/backOffice/default/tb-plugin/vendor/index.global.js.map @@ -1 +1 @@ -{"version":3,"sources":["external-global:react","../../../node_modules/tslib/tslib.js","../../../node_modules/react-is/cjs/react-is.production.min.js","../../../node_modules/react-is/index.js","../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/prop-types/index.js","../../../node_modules/attr-accept/dist/es/index.js","external-global:react-dom","../../../node_modules/axios/lib/helpers/bind.js","../../../node_modules/axios/lib/utils.js","../../../node_modules/axios/lib/helpers/buildURL.js","../../../node_modules/axios/lib/core/InterceptorManager.js","../../../node_modules/axios/lib/helpers/normalizeHeaderName.js","../../../node_modules/axios/lib/core/enhanceError.js","../../../node_modules/axios/lib/core/createError.js","../../../node_modules/axios/lib/core/settle.js","../../../node_modules/axios/lib/helpers/cookies.js","../../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../node_modules/axios/lib/helpers/combineURLs.js","../../../node_modules/axios/lib/core/buildFullPath.js","../../../node_modules/axios/lib/helpers/parseHeaders.js","../../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../node_modules/axios/lib/cancel/Cancel.js","../../../node_modules/axios/lib/adapters/xhr.js","../../../node_modules/axios/lib/defaults.js","../../../node_modules/axios/lib/core/transformData.js","../../../node_modules/axios/lib/cancel/isCancel.js","../../../node_modules/axios/lib/core/dispatchRequest.js","../../../node_modules/axios/lib/core/mergeConfig.js","../../../node_modules/axios/lib/env/data.js","../../../node_modules/axios/lib/helpers/validator.js","../../../node_modules/axios/lib/core/Axios.js","../../../node_modules/axios/lib/cancel/CancelToken.js","../../../node_modules/axios/lib/helpers/spread.js","../../../node_modules/axios/lib/helpers/isAxiosError.js","../../../node_modules/axios/lib/axios.js","../../../node_modules/axios/index.js","../../../node_modules/react-modal/lib/helpers/tabbable.js","../../../node_modules/react-modal/lib/helpers/focusManager.js","../../../node_modules/react-modal/lib/helpers/scopeTab.js","../../../node_modules/warning/warning.js","../../../node_modules/exenv/index.js","../../../node_modules/react-modal/lib/helpers/safeHTMLElement.js","../../../node_modules/react-modal/lib/helpers/ariaAppHider.js","../../../node_modules/react-modal/lib/helpers/classList.js","../../../node_modules/react-modal/lib/helpers/portalOpenInstances.js","../../../node_modules/react-modal/lib/helpers/bodyTrap.js","../../../node_modules/react-modal/lib/components/ModalPortal.js","../../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../../../node_modules/react-modal/lib/components/Modal.js","../../../node_modules/react-modal/lib/index.js","external-global:@thelia/blocks-editor","../src/index.tsx","../src/Image/index.tsx","../../../node_modules/tslib/modules/index.js","../../../node_modules/react-intl/lib/src/components/createFormattedComponent.js","../../../node_modules/react-intl/lib/src/components/useIntl.js","../../../node_modules/react-intl/lib/src/components/injectIntl.js","../../../node_modules/react-intl/lib/src/utils.js","../../../node_modules/@formatjs/ecma402-abstract/lib/utils.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../node_modules/@formatjs/fast-memoize/lib/index.js","../../../node_modules/intl-messageformat/lib/src/error.js","../../../node_modules/intl-messageformat/lib/src/formatters.js","../../../node_modules/intl-messageformat/lib/src/core.js","../../../node_modules/@formatjs/intl/lib/src/error.js","../../../node_modules/@formatjs/intl/lib/src/utils.js","../../../node_modules/@formatjs/intl/lib/src/message.js","../../../node_modules/@formatjs/intl/lib/src/dateTime.js","../../../node_modules/@formatjs/intl/lib/src/displayName.js","../../../node_modules/@formatjs/intl/lib/src/list.js","../../../node_modules/@formatjs/intl/lib/src/plural.js","../../../node_modules/@formatjs/intl/lib/src/relativeTime.js","../../../node_modules/@formatjs/intl/lib/src/number.js","../../../node_modules/@formatjs/intl/lib/src/create-intl.js","../../../node_modules/react-intl/lib/src/components/provider.js","../../../node_modules/react-intl/lib/index.js","../src/Image/assets/image.svg","../src/Image/assets/download.svg","../src/Image/assets/mediatheque.svg","../src/utils/intl.ts","../../../node_modules/react-dropzone/dist/es/index.js","../../../node_modules/file-selector/src/file.ts","../../../node_modules/file-selector/src/file-selector.ts","../../../node_modules/react-dropzone/dist/es/utils/index.js","../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../node_modules/react-query/es/core/subscribable.js","../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../node_modules/react-query/es/core/utils.js","../../../node_modules/react-query/es/core/focusManager.js","../../../node_modules/react-query/es/core/onlineManager.js","../../../node_modules/react-query/es/core/retryer.js","../../../node_modules/react-query/es/core/notifyManager.js","../../../node_modules/react-query/es/core/logger.js","../../../node_modules/react-query/es/core/query.js","../../../node_modules/react-query/es/core/queryCache.js","../../../node_modules/react-query/es/core/mutation.js","../../../node_modules/react-query/es/core/mutationCache.js","../../../node_modules/react-query/es/core/infiniteQueryBehavior.js","../../../node_modules/react-query/es/core/queryClient.js","../../../node_modules/react-query/es/core/queryObserver.js","../../../node_modules/react-query/es/core/mutationObserver.js","../../../node_modules/react-query/es/react/reactBatchedUpdates.js","../../../node_modules/react-query/es/react/setBatchUpdatesFn.js","../../../node_modules/react-query/es/react/logger.js","../../../node_modules/react-query/es/react/setLogger.js","../../../node_modules/react-query/es/react/QueryClientProvider.js","../../../node_modules/react-query/es/react/QueryErrorResetBoundary.js","../../../node_modules/react-query/es/react/useMutation.js","../../../node_modules/react-query/es/react/utils.js","../../../node_modules/react-query/es/react/useBaseQuery.js","../../../node_modules/react-query/es/react/useQuery.js","../../fetcher/src/index.ts","../src/utils/queries.tsx","../src/Library/assets/xmark.svg","../src/Library/assets/trash.svg","../src/Library/assets/tag-xmark.svg","../src/Library/index.tsx","../src/Input/Input.tsx","../../../node_modules/@popperjs/core/lib/enums.js","../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../../node_modules/@popperjs/core/lib/utils/math.js","../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../../node_modules/@popperjs/core/lib/utils/within.js","../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../../node_modules/@popperjs/core/lib/utils/debounce.js","../../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../../node_modules/@popperjs/core/lib/createPopper.js","../../../node_modules/@popperjs/core/lib/popper.js","../../../node_modules/tippy.js/src/constants.ts","../../../node_modules/tippy.js/src/utils.ts","../../../node_modules/tippy.js/src/dom-utils.ts","../../../node_modules/tippy.js/src/bindGlobalEventListeners.ts","../../../node_modules/tippy.js/src/browser.ts","../../../node_modules/tippy.js/src/validation.ts","../../../node_modules/tippy.js/src/props.ts","../../../node_modules/tippy.js/src/template.ts","../../../node_modules/tippy.js/src/createTippy.ts","../../../node_modules/tippy.js/src/index.ts","../../../node_modules/tippy.js/src/addons/createSingleton.ts","../../../node_modules/tippy.js/src/addons/delegate.ts","../../../node_modules/tippy.js/src/plugins/animateFill.ts","../../../node_modules/tippy.js/src/plugins/followCursor.ts","../../../node_modules/tippy.js/src/plugins/inlinePositioning.ts","../../../node_modules/tippy.js/src/plugins/sticky.ts","../../../node_modules/tippy.js/build/base.js","../../../node_modules/@tippyjs/react/src/utils.js","../../../node_modules/@tippyjs/react/src/util-hooks.js","../../../node_modules/@tippyjs/react/src/className-plugin.js","../../../node_modules/@tippyjs/react/src/Tippy.js","../../../node_modules/@tippyjs/react/src/useSingleton.js","../../../node_modules/@tippyjs/react/src/forwardRef.js","../../../node_modules/@tippyjs/react/src/index.js","../src/Input/InputWrapper.tsx","../src/ErrorBoundary.tsx","../../../node_modules/react-hot-toast/src/core/types.ts","../../../node_modules/react-hot-toast/src/core/utils.ts","../../../node_modules/react-hot-toast/src/core/store.ts","../../../node_modules/react-hot-toast/src/core/toast.ts","../../../node_modules/react-hot-toast/src/core/use-toaster.ts","../../../node_modules/react-hot-toast/src/components/toast-bar.tsx","../../../node_modules/react-hot-toast/src/components/toast-icon.tsx","../../../node_modules/react-hot-toast/src/components/error.tsx","../../../node_modules/react-hot-toast/src/components/loader.tsx","../../../node_modules/react-hot-toast/src/components/checkmark.tsx","../../../node_modules/react-hot-toast/src/components/toaster.tsx","../../../node_modules/react-hot-toast/src/index.ts","../../../node_modules/goober/dist/goober.modern.js"],"sourcesContent":["module.exports = React;","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n});\r\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (file, acceptedFiles) {\n if (file && acceptedFiles) {\n var acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(',');\n var fileName = file.name || '';\n var mimeType = (file.type || '').toLowerCase();\n var baseMimeType = mimeType.replace(/\\/.*$/, '');\n return acceptedFilesArray.some(function (type) {\n var validType = type.trim().toLowerCase();\n\n if (validType.charAt(0) === '.') {\n return fileName.toLowerCase().endsWith(validType);\n } else if (validType.endsWith('/*')) {\n // This is something like a image/* mime type\n return baseMimeType === validType.replace(/\\/.*$/, '');\n }\n\n return mimeType === validType;\n });\n }\n\n return true;\n};","module.exports = ReactDOM;","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.25.0\"\n};","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n if (!config.url) {\n throw new Error('Provided config url is not valid');\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n if (!config.url) {\n throw new Error('Provided config url is not valid');\n }\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = findTabbableDescendants;\n/*!\n * Adapted from jQuery UI core\n *\n * http://jqueryui.com\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/category/ui-core/\n */\n\nvar tabbableNode = /input|select|textarea|button|object|iframe/;\n\nfunction hidesContents(element) {\n var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;\n\n // If the node is empty, this is good enough\n if (zeroSize && !element.innerHTML) return true;\n\n try {\n // Otherwise we need to check some styles\n var style = window.getComputedStyle(element);\n return zeroSize ? style.getPropertyValue(\"overflow\") !== \"visible\" ||\n // if 'overflow: visible' set, check if there is actually any overflow\n element.scrollWidth <= 0 && element.scrollHeight <= 0 : style.getPropertyValue(\"display\") == \"none\";\n } catch (exception) {\n // eslint-disable-next-line no-console\n console.warn(\"Failed to inspect element style\");\n return false;\n }\n}\n\nfunction visible(element) {\n var parentElement = element;\n var rootNode = element.getRootNode && element.getRootNode();\n while (parentElement) {\n if (parentElement === document.body) break;\n\n // if we are not hidden yet, skip to checking outside the Web Component\n if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;\n\n if (hidesContents(parentElement)) return false;\n parentElement = parentElement.parentNode;\n }\n return true;\n}\n\nfunction focusable(element, isTabIndexNotNaN) {\n var nodeName = element.nodeName.toLowerCase();\n var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === \"a\" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\n\nfunction tabbable(element) {\n var tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) tabIndex = undefined;\n var isTabIndexNaN = isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);\n}\n\nfunction findTabbableDescendants(element) {\n var descendants = [].slice.call(element.querySelectorAll(\"*\"), 0).reduce(function (finished, el) {\n return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));\n }, []);\n return descendants.filter(tabbable);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n focusLaterElements = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n console.log(\"focusManager ----------\");\n focusLaterElements.forEach(function (f) {\n var check = f || {};\n console.log(check.nodeName, check.className, check.id);\n });\n console.log(\"end focusManager ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getActiveElement() {\n var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n\n return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;\n}\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n var activeElement = getActiveElement();\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;\n\nvar _exenv = require(\"exenv\");\n\nvar _exenv2 = _interopRequireDefault(_exenv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar EE = _exenv2.default;\n\nvar SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};\n\nvar SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};\n\nvar SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};\n\nvar canUseDOM = exports.canUseDOM = EE.canUseDOM;\n\nexports.default = SafeHTMLElement;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nexports.assertNodeList = assertNodeList;\nexports.setElement = setElement;\nexports.validateElement = validateElement;\nexports.hide = hide;\nexports.show = show;\nexports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;\n\nvar _warning = require(\"warning\");\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _safeHTMLElement = require(\"./safeHTMLElement\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar globalElement = null;\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n if (globalElement) {\n if (globalElement.removeAttribute) {\n globalElement.removeAttribute(\"aria-hidden\");\n } else if (globalElement.length != null) {\n globalElement.forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n } else {\n document.querySelectorAll(globalElement).forEach(function (element) {\n return element.removeAttribute(\"aria-hidden\");\n });\n }\n }\n globalElement = null;\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var check = globalElement || {};\n console.log(\"ariaAppHider ----------\");\n console.log(check.nodeName, check.className, check.id);\n console.log(\"end ariaAppHider ----------\");\n }\n}\n/* eslint-enable no-console */\n\nfunction assertNodeList(nodeList, selector) {\n if (!nodeList || !nodeList.length) {\n throw new Error(\"react-modal: No elements were found for selector \" + selector + \".\");\n }\n}\n\nfunction setElement(element) {\n var useElement = element;\n if (typeof useElement === \"string\" && _safeHTMLElement.canUseDOM) {\n var el = document.querySelectorAll(useElement);\n assertNodeList(el, useElement);\n useElement = el;\n }\n globalElement = useElement || globalElement;\n return globalElement;\n}\n\nfunction validateElement(appElement) {\n var el = appElement || globalElement;\n if (el) {\n return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];\n } else {\n (0, _warning2.default)(false, [\"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(\" \"));\n\n return [];\n }\n}\n\nfunction hide(appElement) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var el = _step.value;\n\n el.setAttribute(\"aria-hidden\", \"true\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\n\nfunction show(appElement) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var el = _step2.value;\n\n el.removeAttribute(\"aria-hidden\");\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n}\n\nfunction documentNotReadyOrSSRTesting() {\n globalElement = null;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction removeClass(at, cls) {\n at.classList.remove(cls);\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n var htmlElement = document.getElementsByTagName(\"html\")[0];\n for (var cls in htmlClassList) {\n removeClass(htmlElement, htmlClassList[cls]);\n }\n\n var body = document.body;\n for (var _cls in docBodyClassList) {\n removeClass(body, docBodyClassList[_cls]);\n }\n\n htmlClassList = {};\n docBodyClassList = {};\n}\n\n/* istanbul ignore next */\nfunction log() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n \";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n \";\n }\n\n classes = document.body.className;\n\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n \";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n \";\n }\n\n buffer += \"\\n\";\n\n console.log(buffer);\n }\n}\n/* eslint-enable no-console */\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.log = log;\nexports.resetState = resetState;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// Tracks portals that are open and emits events to subscribers\n\nvar PortalOpenInstances = function PortalOpenInstances() {\n var _this = this;\n\n _classCallCheck(this, PortalOpenInstances);\n\n this.register = function (openInstance) {\n if (_this.openInstances.indexOf(openInstance) !== -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Cannot register modal instance that's already open\");\n }\n return;\n }\n _this.openInstances.push(openInstance);\n _this.emit(\"register\");\n };\n\n this.deregister = function (openInstance) {\n var index = _this.openInstances.indexOf(openInstance);\n if (index === -1) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Unable to deregister \" + openInstance + \" as \" + \"it was never registered\");\n }\n return;\n }\n _this.openInstances.splice(index, 1);\n _this.emit(\"deregister\");\n };\n\n this.subscribe = function (callback) {\n _this.subscribers.push(callback);\n };\n\n this.emit = function (eventType) {\n _this.subscribers.forEach(function (subscriber) {\n return subscriber(eventType,\n // shallow copy to avoid accidental mutation\n _this.openInstances.slice());\n });\n };\n\n this.openInstances = [];\n this.subscribers = [];\n};\n\nvar portalOpenInstances = new PortalOpenInstances();\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction log() {\n console.log(\"portalOpenInstances ----------\");\n console.log(portalOpenInstances.openInstances.length);\n portalOpenInstances.openInstances.forEach(function (p) {\n return console.log(p);\n });\n console.log(\"end portalOpenInstances ----------\");\n}\n\n/* istanbul ignore next */\nfunction resetState() {\n portalOpenInstances = new PortalOpenInstances();\n}\n/* eslint-enable no-console */\n\nexports.default = portalOpenInstances;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resetState = resetState;\nexports.log = log;\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\n/* eslint-disable no-console */\n/* istanbul ignore next */\nfunction resetState() {\n var _arr = [before, after];\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var item = _arr[_i];\n if (!item) continue;\n item.parentNode && item.parentNode.removeChild(item);\n }\n before = after = null;\n instances = [];\n}\n\n/* istanbul ignore next */\nfunction log() {\n console.log(\"bodyTrap ----------\");\n console.log(instances.length);\n var _arr2 = [before, after];\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var item = _arr2[_i2];\n var check = item || {};\n console.log(check.nodeName, check.className, check.id);\n }\n console.log(\"edn bodyTrap ----------\");\n}\n/* eslint-enable no-console */\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before && !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.openAnimationFrame = requestAnimationFrame(function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n cancelAnimationFrame(this.openAnimationFrame);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n }\n // Binding \"this\" is important for shallow renderer support.\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(\n prevProps,\n prevState\n );\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n}\n\n// React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (\n typeof Component.getDerivedStateFromProps !== 'function' &&\n typeof prototype.getSnapshotBeforeUpdate !== 'function'\n ) {\n return Component;\n }\n\n // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n if (\n foundWillMountName !== null ||\n foundWillReceivePropsName !== null ||\n foundWillUpdateName !== null\n ) {\n var componentName = Component.displayName || Component.name;\n var newApiName =\n typeof Component.getDerivedStateFromProps === 'function'\n ? 'getDerivedStateFromProps()'\n : 'getSnapshotBeforeUpdate()';\n\n throw Error(\n 'Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' +\n componentName +\n ' uses ' +\n newApiName +\n ' but also contains the following legacy lifecycles:' +\n (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') +\n (foundWillReceivePropsName !== null\n ? '\\n ' + foundWillReceivePropsName\n : '') +\n (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') +\n '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' +\n 'https://fb.me/react-async-component-lifecycle-hooks'\n );\n }\n\n // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n }\n\n // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error(\n 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'\n );\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(\n prevProps,\n prevState,\n maybeSnapshot\n ) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag\n ? this.__reactInternalSnapshot\n : maybeSnapshot;\n\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar createHTMLElement = function createHTMLElement(name) {\n return document.createElement(name);\n};\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n 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.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = createHTMLElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nif (process.env.NODE_ENV !== \"production\") {\n Modal.setCreateHTMLElement = function (fn) {\n return createHTMLElement = fn;\n };\n}\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require(\"./components/Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _Modal2.default;\nmodule.exports = exports[\"default\"];","module.exports = TheliaBlocks;","import Image, { UploadImage } from \"./Image\";\nimport { registerPlugin } from \"@thelia/blocks-editor\";\nimport Library from \"./Library\";\nimport { LibraryImage } from \"./types/types\";\n\nregisterPlugin(Image);\n\nexport default Library;\nexport { UploadImage };\nexport type { LibraryImage };\n","import { BlockModuleComponentProps, BlockPluginDefinition } from \"@thelia/blocks-editor\";\nimport { useEffect, useState } from \"react\";\nimport { IntlProvider, useIntl } from \"react-intl\";\nimport { ReactComponent as Icon } from \"./assets/image.svg\";\nimport { ReactComponent as DownloadIcon } from \"./assets/download.svg\";\nimport { ReactComponent as MediathequeIcon } from \"./assets/mediatheque.svg\";\nimport { locale, messages } from \"../utils/intl\";\nimport { useDropzone } from \"react-dropzone\";\nimport Library from \"../Library\";\nimport { LibraryImage } from \"../types/types\";\nimport { QueryClientProvider } from \"react-query\";\nimport { useCreateImage } from \"../utils/queries\";\nimport { Toaster, toast } from \"react-hot-toast\";\nimport { queryClient } from \"@thelia/fetcher\";\n\nimport \"./Image.css\";\n\nconst FromLocal = ({ onSelect }: { onSelect: (value: LibraryImage) => void }) => {\n const intl = useIntl();\n const createImage = useCreateImage();\n\n const { getRootProps, isDragActive } = useDropzone({\n multiple: false,\n accept: {\n \"image/*\": [\"*\"],\n },\n noClick: true,\n maxFiles: 1,\n onDrop: async (acceptedFiles) => {\n if (acceptedFiles) {\n const formData = new FormData();\n formData.append(\"image\", acceptedFiles[0]);\n const res = await createImage.mutateAsync(formData);\n\n onSelect(res);\n }\n },\n onDropRejected: (rejectedFiles) => {\n rejectedFiles.length > 1\n ? toast.error(intl.formatMessage({ id: \"BlockImage__TOAST_MAX_FILE\" }))\n : toast.error(intl.formatMessage({ id: \"BlockImage__TOAST_WRONG_FILE_TYPE\" }));\n },\n });\n\n return (\n \n
\n \n
\n {isDragActive ? (\n intl.formatMessage({ id: \"BlockImage__DROP_TO_UPLOAD\" })\n ) : !createImage.isLoading ? (\n <>\n {\n e.preventDefault();\n }}\n >\n \n {\n if (e.target.files) {\n const formData = new FormData();\n formData.append(\"image\", e.target.files[0]);\n const res = await createImage.mutateAsync(formData);\n\n onSelect(res);\n }\n }}\n />\n {intl.formatMessage({ id: \"BlockImage__OR_DROP\" })}\n \n \n ) : (\n <>\n {intl.formatMessage({ id: \"DOWNLOADING\" })}\n \n \n )}\n \n );\n};\n\nconst FromLibrary = ({ onSelect }: { onSelect: (value: LibraryImage) => void }) => {\n const [isOpen, setIsOpen] = useState(false);\n const intl = useIntl();\n\n return (\n
\n
\n \n
\n {\n setIsOpen(true);\n }}\n >\n {intl.formatMessage({ id: \"BlockImage__SELECT_BUTTON\" })}\n \n\n {intl.formatMessage({ id: \"BlockImage__SELECT\" })}\n\n {isOpen ? (\n {\n setIsOpen(false);\n onSelect(image);\n }}\n />\n ) : null}\n
\n );\n};\n\nconst Preview = ({\n id,\n fileName,\n setEditMode,\n}: {\n id: LibraryImage[\"id\"] | null;\n fileName: LibraryImage[\"fileName\"];\n setEditMode: Function;\n}) => {\n const intl = useIntl();\n\n if (!id) return null;\n\n return (\n
\n \n ((e.target as HTMLImageElement).src = `https://via.placeholder.com/220`)\n }\n />\n\n
\n {fileName}\n {\n setEditMode(true);\n }}\n >\n {intl.formatMessage({ id: \"REPLACE\" })}\n \n
\n
\n );\n};\n\nconst ImageInfos = ({\n image,\n onChange,\n}: {\n image: LibraryImage;\n onChange: (data: Partial) => void;\n}) => {\n const [title, setTitle] = useState(image.title);\n const [url, setUrl] = useState(image.link?.url || \"\");\n\n const intl = useIntl();\n\n return (\n {\n e.preventDefault();\n }}\n >\n
\n \n setTitle(e.target.value)}\n onBlur={() => onChange({ title: title })}\n />\n
\n
\n \n setUrl(e.target.value)}\n onBlur={() => onChange({ link: { url: url } })}\n />\n
\n \n );\n};\n\nexport const UploadImage = ({\n onSelect,\n compact,\n}: {\n onSelect: (image: LibraryImage) => void;\n compact?: boolean;\n}) => {\n return (\n \n \n \n \n \n \n \n \n );\n};\n\nconst BlockImageComponent = (props: BlockModuleComponentProps) => {\n const { data, onUpdate } = props;\n\n const [image, setImage] = useState(null);\n const [isEditMode, setEditMode] = useState(false);\n\n const intl = useIntl();\n\n useEffect(() => {\n if (data.id) {\n setImage(data);\n return;\n }\n\n setEditMode(true);\n }, [data]);\n\n const onSelect = (image: LibraryImage) => {\n onUpdate(image);\n setEditMode(false);\n };\n\n return (\n
\n {image && !isEditMode ? (\n
\n \n\n {\n onUpdate({ ...data, ...values });\n }}\n />\n
\n ) : null}\n {isEditMode ? (\n <>\n {image?.id ? (\n \n {intl.formatMessage({ id: \"REPLACE_IMAGE\" })} \"{image.title}\"\n \n ) : null}\n \n {image?.id ? (\n {\n setEditMode(false);\n }}\n style={{ marginTop: \"15px\" }}\n className=\"BlockImage__Button\"\n >\n {intl.formatMessage({ id: \"CANCEL\" })}\n \n ) : null}\n \n ) : null}\n
\n );\n};\n\nconst WrappedComponent = (props: BlockModuleComponentProps) => {\n return (\n \n \n \n \n \n \n );\n};\n\nconst initialData: LibraryImage = {\n url: null,\n id: null,\n title: \"\",\n fileName: \"\",\n tags: [],\n};\n\nconst moduleType = {\n id: \"blockImage\",\n};\n\nconst blockImage: BlockPluginDefinition = {\n type: moduleType,\n component: WrappedComponent,\n initialData,\n title: {\n default: \"Image\",\n fr: \"Image\",\n en: \"Image\",\n es: \"Imagen\",\n it: \"Immagine\",\n },\n description: {\n default: \"Display an image\",\n fr: \"Affiche une image\",\n en: \"Display an image\",\n es: \"Mostrar una imagen\",\n it: \"Mostra un immagine\",\n },\n icon: Icon,\n image: {\n default: \"\",\n },\n};\n\nexport default blockImage;\n","import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n};\r\n","import { __rest } from \"tslib\";\nimport * as React from 'react';\nimport useIntl from './useIntl';\nvar DisplayName;\n(function (DisplayName) {\n DisplayName[\"formatDate\"] = \"FormattedDate\";\n DisplayName[\"formatTime\"] = \"FormattedTime\";\n DisplayName[\"formatNumber\"] = \"FormattedNumber\";\n DisplayName[\"formatList\"] = \"FormattedList\";\n // Note that this DisplayName is the locale display name, not to be confused with\n // the name of the enum, which is for React component display name in dev tools.\n DisplayName[\"formatDisplayName\"] = \"FormattedDisplayName\";\n})(DisplayName || (DisplayName = {}));\nvar DisplayNameParts;\n(function (DisplayNameParts) {\n DisplayNameParts[\"formatDate\"] = \"FormattedDateParts\";\n DisplayNameParts[\"formatTime\"] = \"FormattedTimeParts\";\n DisplayNameParts[\"formatNumber\"] = \"FormattedNumberParts\";\n DisplayNameParts[\"formatList\"] = \"FormattedListParts\";\n})(DisplayNameParts || (DisplayNameParts = {}));\nexport var FormattedNumberParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatNumberToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport var FormattedListParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatListToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport function createFormattedDateTimePartsComponent(name) {\n var ComponentParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n var formattedParts = name === 'formatDate'\n ? intl.formatDateToParts(date, formatProps)\n : intl.formatTimeToParts(date, formatProps);\n return children(formattedParts);\n };\n ComponentParts.displayName = DisplayNameParts[name];\n return ComponentParts;\n}\nexport function createFormattedComponent(name) {\n var Component = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props\n // TODO: fix TS type definition for localeMatcher upstream\n , [\"value\", \"children\"]);\n // TODO: fix TS type definition for localeMatcher upstream\n var formattedValue = intl[name](value, formatProps);\n if (typeof children === 'function') {\n return children(formattedValue);\n }\n var Text = intl.textComponent || React.Fragment;\n return React.createElement(Text, null, formattedValue);\n };\n Component.displayName = DisplayName[name];\n return Component;\n}\n","import * as React from 'react';\nimport { Context } from './injectIntl';\nimport { invariantIntlContext } from '../utils';\nexport default function useIntl() {\n var intl = React.useContext(Context);\n invariantIntlContext(intl);\n return intl;\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariantIntlContext } from '../utils';\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n}\n// TODO: We should provide initial value here\nvar IntlContext = React.createContext(null);\nvar IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;\nexport var Provider = IntlProvider;\nexport var Context = IntlContext;\nexport default function injectIntl(WrappedComponent, options) {\n var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;\n var WithIntl = function (props) { return (React.createElement(IntlConsumer, null, function (intl) {\n var _a;\n if (enforceContext) {\n invariantIntlContext(intl);\n }\n var intlProp = (_a = {}, _a[intlPropName] = intl, _a);\n return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));\n })); };\n WithIntl.displayName = \"injectIntl(\".concat(getDisplayName(WrappedComponent), \")\");\n WithIntl.WrappedComponent = WrappedComponent;\n if (forwardRef) {\n return hoistNonReactStatics(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);\n }\n return hoistNonReactStatics(WithIntl, WrappedComponent);\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG } from '@formatjs/intl';\nexport function invariantIntlContext(intl) {\n invariant(intl, '[React Intl] Could not find required `intl` object. ' +\n ' needs to exist in the component ancestry.');\n}\nexport var DEFAULT_INTL_CONFIG = __assign(__assign({}, CORE_DEFAULT_INTL_CONFIG), { textComponent: React.Fragment });\n/**\n * Takes a `formatXMLElementFn`, and composes it in function, which passes\n * argument `parts` through, assigning unique key to each part, to prevent\n * \"Each child in a list should have a unique \"key\"\" React error.\n * @param formatXMLElementFn\n */\nexport function assignUniqueKeysToParts(formatXMLElementFn) {\n return function (parts) {\n // eslint-disable-next-line prefer-rest-params\n return formatXMLElementFn(React.Children.toArray(parts));\n };\n}\nexport function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n if (!objA || !objB) {\n return false;\n }\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n if (bKeys.length !== len) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n if (objA[key] !== objB[key] ||\n !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n return true;\n}\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"AX\": [\n \"H\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"AR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CL\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BO\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-EC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-PE\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"GT\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"HN\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MX\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"NI\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"PY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"SV\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"UY\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"JP\": [\n \"H\",\n \"h\",\n \"K\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BO\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"EC\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"PE\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ]\n};\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith;\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n","//\n// Main\n//\nexport default function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __spreadArray } from \"tslib\";\nimport { parse } from '@formatjs/icu-messageformat-parser';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, {\n ignoreTag: opts === null || opts === void 0 ? void 0 : opts.ignoreTag,\n locale: this.resolvedLocale,\n });\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n return _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport memoize, { strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MissingTranslationError, MessageFormatError } from './error';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport var formatMessage = function (_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n};\n","import { __assign } from \"tslib\";\nimport { filterProps, getNamedFormat } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n 'fractionalSecondDigits',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var timeZone = config.timeZone, locale = config.locale, onError = config.onError;\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});\n try {\n return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date time range.', e));\n }\n return String(from);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting date.', e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting time.', e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlErrorCode, IntlError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'style',\n 'type',\n 'fallback',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting display name.', e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlError, IntlErrorCode } from './error';\nvar LIST_FORMAT_OPTIONS = [\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });\n });\n }\n catch (e) {\n onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting list.', e));\n }\n // @ts-ignore\n return values;\n}\n","import { filterProps } from './utils';\nimport { IntlFormatError } from './error';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nvar PLURAL_FORMAT_OPTIONS = ['type'];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { IntlError, IntlErrorCode } from './error';\nvar NUMBER_FORMAT_OPTIONS = [\n 'style',\n 'currency',\n 'currencyDisplay',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlError(IntlErrorCode.FORMAT_ERROR, 'Error formatting number.', e));\n }\n return [];\n}\n","import { __assign } from \"tslib\";\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatRelativeTime } from './relativeTime';\nimport { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';\nimport { formatPlural } from './plural';\nimport { formatMessage } from './message';\nimport { formatList, formatListToParts } from './list';\nimport { formatDisplayName } from './displayName';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __assign, __extends, __rest, __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { Provider } from './injectIntl';\nimport { DEFAULT_INTL_CONFIG, invariantIntlContext, assignUniqueKeysToParts, shallowEqual, } from '../utils';\nimport { formatMessage as coreFormatMessage, createIntl as coreCreateIntl, createIntlCache, } from '@formatjs/intl';\nimport { isFormatXMLElementFn, } from 'intl-messageformat';\nfunction processIntlConfig(config) {\n return {\n locale: config.locale,\n timeZone: config.timeZone,\n fallbackOnEmptyString: config.fallbackOnEmptyString,\n formats: config.formats,\n textComponent: config.textComponent,\n messages: config.messages,\n defaultLocale: config.defaultLocale,\n defaultFormats: config.defaultFormats,\n onError: config.onError,\n onWarn: config.onWarn,\n wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment,\n defaultRichTextElements: config.defaultRichTextElements,\n };\n}\nfunction assignUniqueKeysToFormatXMLElementFnArgument(values) {\n if (!values) {\n return values;\n }\n return Object.keys(values).reduce(function (acc, k) {\n var v = values[k];\n acc[k] = isFormatXMLElementFn(v)\n ? assignUniqueKeysToParts(v)\n : v;\n return acc;\n }, {});\n}\nvar formatMessage = function (config, formatters, descriptor, rawValues) {\n var rest = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n rest[_i - 4] = arguments[_i];\n }\n var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues);\n var chunks = coreFormatMessage.apply(void 0, __spreadArray([config,\n formatters,\n descriptor,\n values], rest, false));\n if (Array.isArray(chunks)) {\n return React.Children.toArray(chunks);\n }\n return chunks;\n};\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport var createIntl = function (_a, cache) {\n var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, [\"defaultRichTextElements\"]);\n var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);\n var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);\n var resolvedConfig = {\n locale: coreIntl.locale,\n timeZone: coreIntl.timeZone,\n fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,\n formats: coreIntl.formats,\n defaultLocale: coreIntl.defaultLocale,\n defaultFormats: coreIntl.defaultFormats,\n messages: coreIntl.messages,\n onError: coreIntl.onError,\n defaultRichTextElements: defaultRichTextElements,\n };\n return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });\n};\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cache = createIntlCache();\n _this.state = {\n cache: _this.cache,\n intl: createIntl(processIntlConfig(_this.props), _this.cache),\n prevConfig: processIntlConfig(_this.props),\n };\n return _this;\n }\n IntlProvider.getDerivedStateFromProps = function (props, _a) {\n var prevConfig = _a.prevConfig, cache = _a.cache;\n var config = processIntlConfig(props);\n if (!shallowEqual(prevConfig, config)) {\n return {\n intl: createIntl(config, cache),\n prevConfig: config,\n };\n }\n return null;\n };\n IntlProvider.prototype.render = function () {\n invariantIntlContext(this.state.intl);\n return React.createElement(Provider, { value: this.state.intl }, this.props.children);\n };\n IntlProvider.displayName = 'IntlProvider';\n IntlProvider.defaultProps = DEFAULT_INTL_CONFIG;\n return IntlProvider;\n}(React.PureComponent));\nexport default IntlProvider;\n","import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';\nimport injectIntl, { Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';\nimport useIntl from './src/components/useIntl';\nimport IntlProvider, { createIntl } from './src/components/provider';\nimport FormattedRelativeTime from './src/components/relative';\nimport FormattedPlural from './src/components/plural';\nimport FormattedMessage from './src/components/message';\nimport FormattedDateTimeRange from './src/components/dateTimeRange';\nexport { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, createIntl, injectIntl, useIntl, };\nexport { createIntlCache, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';\nexport function defineMessages(msgs) {\n return msgs;\n}\nexport function defineMessage(msg) {\n return msg;\n}\n// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`\nexport var FormattedDate = createFormattedComponent('formatDate');\nexport var FormattedTime = createFormattedComponent('formatTime');\n// @ts-ignore issue w/ TS Intl types\nexport var FormattedNumber = createFormattedComponent('formatNumber');\nexport var FormattedList = createFormattedComponent('formatList');\nexport var FormattedDisplayName = createFormattedComponent('formatDisplayName');\nexport var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');\nexport var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');\nexport { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';\n","import * as React from \"react\";\n\nconst SvgImage = props => ;\n\nexport { SvgImage as ReactComponent };","import * as React from \"react\";\n\nconst SvgDownload = props => ;\n\nexport { SvgDownload as ReactComponent };","import * as React from \"react\";\n\nconst SvgMediatheque = props => ;\n\nexport { SvgMediatheque as ReactComponent };","const getLocale = () => document.documentElement.lang || (navigator.languages && navigator.languages[0]) || navigator.language || 'en'\n\nexport const locale = getLocale()\n\nexport const messages: Record = {\n fr: {\n BlockImage__DOWNLOAD: \"Télécharger une image\",\n BlockImage__OR_DROP: \"ou glisser-déposer une image\",\n BlockImage__SELECT_BUTTON: \"Sélectionner une image\",\n BlockImage__SELECT: \"depuis votre médiathèque\",\n BlockImage__TITLE: \"Titre de l'image\",\n BlockImage__LINK: \"Lien de l'image\",\n BlockImage__LINK_PLACEHOLDER: \"Lien au clic sur l'image\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Rechercher une image\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Rechercher dans la médiathèque\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtrer par tag\",\n BlockImage__LIBRARY_LOADING: \"Chargement de la librairie...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Votre image n'a pas pu être téléchargée. Veuillez vérifier que votre fichier est bien une image.\",\n BlockImage__TOAST_MAX_FILE: \"Veuillez uploader une seule image.\",\n BlockImage__DROP_TO_UPLOAD: \"Relacher pour uploader votre image\",\n BlockImage__LIBRARY_NO_CONTENT: \"Aucune image trouvée\",\n BlockImage__LIBRARY_SEARCHING: \"Recherche en cours...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configuration des tags de\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Ajouter un ou plusieurs tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Sélectionnez un ou plusieurs tag\",\n\n REPLACE: \"Remplacer\",\n REPLACE_IMAGE: \"Remplacer l'image\",\n OPTIONAL: \"Optionnel\",\n CANCEL: \"Annuler\",\n DELETE: \"Supprimer\",\n SEARCH_BY: \"Référence, nom, ...\",\n LOADING: \"Chargement...\",\n DOWNLOADING: \"Téléchargement...\",\n ALL_TAGS: \"Tous les tags\",\n CHOOSE: \"Choisir\",\n },\n en: {\n BlockImage__DOWNLOAD: \"Download an image\",\n BlockImage__OR_DROP: \"or drop an image\",\n BlockImage__SELECT_BUTTON: \"Select an image\",\n BlockImage__SELECT: \"from your library\",\n BlockImage__TITLE: \"Image title\",\n BlockImage__LINK: \"Image link\",\n BlockImage__LINK_PLACEHOLDER: \"Link on click on image\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Search an image\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Search in the library\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filter by tag\",\n BlockImage__LIBRARY_LOADING: \"Loading library...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Your image could not be uploaded. Please check that your file is an image.\",\n BlockImage__TOAST_MAX_FILE: \"Please upload only one image.\",\n BlockImage__DROP_TO_UPLOAD: \"Release to upload your image\",\n BlockImage__LIBRARY_NO_CONTENT: \"No image found\",\n BlockImage__LIBRARY_SEARCHING: \"Searching...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configure tags of\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Add one or more tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Select one or more tag\",\n\n REPLACE: \"Replace\",\n REPLACE_IMAGE: \"Replace image\",\n OPTIONAL: \"Optional\",\n CANCEL: \"Cancel\",\n DELETE: \"Delete\",\n SEARCH_BY: \"Reference, name, ...\",\n LOADING: \"Loading...\",\n DOWNLOADING: \"Downloading...\",\n ALL_TAGS: \"All tags\",\n CHOOSE: \"Choose\",\n },\n es: {\n BlockImage__DOWNLOAD: \"Descargar una imagen\",\n BlockImage__OR_DROP: \"o arrastrar una imagen\",\n BlockImage__SELECT_BUTTON: \"Seleccionar una imagen\",\n BlockImage__SELECT: \"de tu biblioteca\",\n BlockImage__TITLE: \"Título de la imagen\",\n BlockImage__LINK: \"Enlace de la imagen\",\n BlockImage__LINK_PLACEHOLDER: \"Enlace al hacer clic en la imagen\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Buscar una imagen\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Buscar en la biblioteca\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtrar por tag\",\n BlockImage__LIBRARY_LOADING: \"Cargando la biblioteca...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"Tu imagen no pudo ser subida. Por favor verifica que tu archivo es una imagen.\",\n BlockImage__TOAST_MAX_FILE: \"Por favor sube solo una imagen.\",\n BlockImage__DROP_TO_UPLOAD: \"Suelte para subir tu imagen\",\n BlockImage__LIBRARY_NO_CONTENT: \"No se encontraron imagenes\",\n BlockImage__LIBRARY_SEARCHING: \"Buscando...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configurar tags de\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Agregar uno o más tags\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Seleccionar uno o más tags\",\n\n REPLACE: \"Reemplazar\",\n REPLACE_IMAGE: \"Reemplazar imagen\",\n OPTIONAL: \"Opcional\",\n CANCEL: \"Cancelar\",\n DELETE: \"Eliminar\",\n SEARCH_BY: \"Referencia, nombre, ...\",\n LOADING: \"Cargando...\",\n DOWNLOADING: \"Descargando...\",\n ALL_TAGS: \"Todos los tags\",\n CHOOSE: \"Elegir\",\n },\n it: {\n BlockImage__DOWNLOAD: \"Scarica un immagine\",\n BlockImage__OR_DROP: \"o trascina un immagine\",\n BlockImage__SELECT_BUTTON: \"Seleziona un immagine\",\n BlockImage__SELECT: \"dalla tua libreria\",\n BlockImage__TITLE: \"Titolo dell immagine\",\n BlockImage__LINK: \"Link dell immagine\",\n BlockImage__LINK_PLACEHOLDER: \"Link al click sull immagine\",\n BlockImage__LIBRARY_MODAL_TITLE: \"Cerca un immagine\",\n BlockImage__LIBRARY_MODAL_SEARCH: \"Cerca nella libreria\",\n BlockImage__LIBRARY_MODAL_TAG_FILTER: \"Filtra per tag\",\n BlockImage__LIBRARY_LOADING: \"Caricamento della libreria...\",\n BlockImage__TOAST_WRONG_FILE_TYPE: \"La tua immagine non può essere caricata. Per favore verifica che il tuo file sia un immagine.\",\n BlockImage__TOAST_MAX_FILE: \"Per favore carica solo una immagine.\",\n BlockImage__DROP_TO_UPLOAD: \"Rilascia per caricare la tua immagine\",\n BlockImage__LIBRARY_NO_CONTENT: \"Nessuna immagine trovata\",\n BlockImage__LIBRARY_SEARCHING: \"Ricerca in corso...\",\n BlockImage__LIBRARY_IMAGE_TAG_CONFIG: \"Configura i tag di\",\n BlockImage__LIBRARY_IMAGE_ADD_TAG: \"Aggiungi uno o più tag\",\n BlockImage__LIBRARY_IMAGE_SELECT_TAG: \"Seleziona uno o più tag\",\n\n REPLACE: \"Sostituisci\",\n REPLACE_IMAGE: \"Sostituisci immagine\",\n OPTIONAL: \"Opzionale\",\n CANCEL: \"Annulla\", \n DELETE: \"Elimina\",\n SEARCH_BY: \"Riferimento, nome, ...\",\n LOADING: \"Caricamento...\",\n DOWNLOADING: \"Scaricare...\",\n ALL_TAGS: \"Tutti i tag\",\n CHOOSE: \"Scegli\",\n }\n}","var _excluded = [\"children\"],\n _excluded2 = [\"open\"],\n _excluded3 = [\"refKey\", \"role\", \"onKeyDown\", \"onFocus\", \"onBlur\", \"onClick\", \"onDragEnter\", \"onDragOver\", \"onDragLeave\", \"onDrop\"],\n _excluded4 = [\"refKey\", \"onChange\", \"onClick\"];\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* eslint prefer-template: 0 */\nimport React, { forwardRef, Fragment, useCallback, useEffect, useImperativeHandle, useMemo, useReducer, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { fromEvent } from \"file-selector\";\nimport { acceptPropAsAcceptAttr, allFilesAccepted, composeEventHandlers, fileAccepted, fileMatchSize, canUseFileSystemAccessAPI, isAbort, isEvtWithFiles, isIeOrEdge, isPropagationStopped, isSecurityError, onDocumentDragOver, pickerOptionsFromAccept, TOO_MANY_FILES_REJECTION } from \"./utils/index\";\n/**\n * Convenience wrapper component for the `useDropzone` hook\n *\n * ```jsx\n * \n * {({getRootProps, getInputProps}) => (\n *
\n * \n *

Drag 'n' drop some files here, or click to select files

\n *
\n * )}\n *
\n * ```\n */\n\nvar Dropzone = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var children = _ref.children,\n params = _objectWithoutProperties(_ref, _excluded);\n\n var _useDropzone = useDropzone(params),\n open = _useDropzone.open,\n props = _objectWithoutProperties(_useDropzone, _excluded2);\n\n useImperativeHandle(ref, function () {\n return {\n open: open\n };\n }, [open]); // TODO: Figure out why react-styleguidist cannot create docs if we don't return a jsx element\n\n return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {\n open: open\n })));\n});\nDropzone.displayName = \"Dropzone\"; // Add default props for react-docgen\n\nvar defaultProps = {\n disabled: false,\n getFilesFromEvent: fromEvent,\n maxSize: Infinity,\n minSize: 0,\n multiple: true,\n maxFiles: 0,\n preventDropOnDocument: true,\n noClick: false,\n noKeyboard: false,\n noDrag: false,\n noDragEventsBubbling: false,\n validator: null,\n useFsAccessApi: true,\n autoFocus: false\n};\nDropzone.defaultProps = defaultProps;\nDropzone.propTypes = {\n /**\n * Render function that exposes the dropzone state and prop getter fns\n *\n * @param {object} params\n * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render\n * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render\n * @param {Function} params.open Open the native file selection dialog\n * @param {boolean} params.isFocused Dropzone area is in focus\n * @param {boolean} params.isFileDialogActive File dialog is opened\n * @param {boolean} params.isDragActive Active drag is in progress\n * @param {boolean} params.isDragAccept Dragged files are accepted\n * @param {boolean} params.isDragReject Some dragged files are rejected\n * @param {File[]} params.acceptedFiles Accepted files\n * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected\n */\n children: PropTypes.func,\n\n /**\n * Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n */\n accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),\n\n /**\n * Allow drag 'n' drop (or selection from the file dialog) of multiple files\n */\n multiple: PropTypes.bool,\n\n /**\n * If false, allow dropped items to take over the current browser window\n */\n preventDropOnDocument: PropTypes.bool,\n\n /**\n * If true, disables click to open the native file selection dialog\n */\n noClick: PropTypes.bool,\n\n /**\n * If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n */\n noKeyboard: PropTypes.bool,\n\n /**\n * If true, disables drag 'n' drop\n */\n noDrag: PropTypes.bool,\n\n /**\n * If true, stops drag event propagation to parents\n */\n noDragEventsBubbling: PropTypes.bool,\n\n /**\n * Minimum file size (in bytes)\n */\n minSize: PropTypes.number,\n\n /**\n * Maximum file size (in bytes)\n */\n maxSize: PropTypes.number,\n\n /**\n * Maximum accepted number of files\n * The default value is 0 which means there is no limitation to how many files are accepted.\n */\n maxFiles: PropTypes.number,\n\n /**\n * Enable/disable the dropzone\n */\n disabled: PropTypes.bool,\n\n /**\n * Use this to provide a custom file aggregator\n *\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n getFilesFromEvent: PropTypes.func,\n\n /**\n * Cb for when closing the file dialog with no selection\n */\n onFileDialogCancel: PropTypes.func,\n\n /**\n * Cb for when opening the file dialog\n */\n onFileDialogOpen: PropTypes.func,\n\n /**\n * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n */\n useFsAccessApi: PropTypes.bool,\n\n /**\n * Set to true to focus the root element on render\n */\n autoFocus: PropTypes.bool,\n\n /**\n * Cb for when the `dragenter` event occurs.\n *\n * @param {DragEvent} event\n */\n onDragEnter: PropTypes.func,\n\n /**\n * Cb for when the `dragleave` event occurs\n *\n * @param {DragEvent} event\n */\n onDragLeave: PropTypes.func,\n\n /**\n * Cb for when the `dragover` event occurs\n *\n * @param {DragEvent} event\n */\n onDragOver: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension.\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n *\n * @param {File[]} acceptedFiles\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n onDrop: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are accepted, this callback is not invoked.\n *\n * @param {File[]} files\n * @param {(DragEvent|Event)} event\n */\n onDropAccepted: PropTypes.func,\n\n /**\n * Cb for when the `drop` event occurs.\n * Note that if no files are rejected, this callback is not invoked.\n *\n * @param {FileRejection[]} fileRejections\n * @param {(DragEvent|Event)} event\n */\n onDropRejected: PropTypes.func,\n\n /**\n * Cb for when there's some error from any of the promises.\n *\n * @param {Error} error\n */\n onError: PropTypes.func,\n\n /**\n * Custom validation function. It must return null if there's no errors.\n * @param {File} file\n * @returns {FileError|FileError[]|null}\n */\n validator: PropTypes.func\n};\nexport default Dropzone;\n/**\n * A function that is invoked for the `dragenter`,\n * `dragover` and `dragleave` events.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dragCb\n * @param {DragEvent} event\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are not files (such as link, text, etc.).\n *\n * @callback dropCb\n * @param {File[]} acceptedFiles List of accepted files\n * @param {FileRejection[]} fileRejections List of rejected files and why they were rejected\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n * It is not invoked if the items are files (such as link, text, etc.).\n *\n * @callback dropAcceptedCb\n * @param {File[]} files List of accepted files that meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is invoked for the `drop` or input change event.\n *\n * @callback dropRejectedCb\n * @param {File[]} files List of rejected files that do not meet the given criteria\n * (`accept`, `multiple`, `minSize`, `maxSize`)\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n */\n\n/**\n * A function that is used aggregate files,\n * in a asynchronous fashion, from drag or input change events.\n *\n * @callback getFilesFromEvent\n * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)\n * @returns {(File[]|Promise)}\n */\n\n/**\n * An object with the current dropzone state.\n *\n * @typedef {object} DropzoneState\n * @property {boolean} isFocused Dropzone area is in focus\n * @property {boolean} isFileDialogActive File dialog is opened\n * @property {boolean} isDragActive Active drag is in progress\n * @property {boolean} isDragAccept Dragged files are accepted\n * @property {boolean} isDragReject Some dragged files are rejected\n * @property {File[]} acceptedFiles Accepted files\n * @property {FileRejection[]} fileRejections Rejected files and why they were rejected\n */\n\n/**\n * An object with the dropzone methods.\n *\n * @typedef {object} DropzoneMethods\n * @property {Function} getRootProps Returns the props you should apply to the root drop container you render\n * @property {Function} getInputProps Returns the props you should apply to hidden file input you render\n * @property {Function} open Open the native file selection dialog\n */\n\nvar initialState = {\n isFocused: false,\n isFileDialogActive: false,\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false,\n acceptedFiles: [],\n fileRejections: []\n};\n/**\n * A React hook that creates a drag 'n' drop area.\n *\n * ```jsx\n * function MyDropzone(props) {\n * const {getRootProps, getInputProps} = useDropzone({\n * onDrop: acceptedFiles => {\n * // do something with the File objects, e.g. upload to some server\n * }\n * });\n * return (\n *
\n * \n *

Drag and drop some files here, or click to select files

\n *
\n * )\n * }\n * ```\n *\n * @function useDropzone\n *\n * @param {object} props\n * @param {import(\"./utils\").AcceptProp} [props.accept] Set accepted file types.\n * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.\n * Keep in mind that mime type determination is not reliable across platforms. CSV files,\n * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under\n * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).\n * @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files\n * @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window\n * @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog\n * @param {boolean} [props.noKeyboard=false] If true, disables SPACE/ENTER to open the native file selection dialog.\n * Note that it also stops tracking the focus state.\n * @param {boolean} [props.noDrag=false] If true, disables drag 'n' drop\n * @param {boolean} [props.noDragEventsBubbling=false] If true, stops drag event propagation to parents\n * @param {number} [props.minSize=0] Minimum file size (in bytes)\n * @param {number} [props.maxSize=Infinity] Maximum file size (in bytes)\n * @param {boolean} [props.disabled=false] Enable/disable the dropzone\n * @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator\n * @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection\n * @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n * to open the file picker instead of using an `` click event.\n * @param {boolean} autoFocus Set to true to auto focus the root element.\n * @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog\n * @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.\n * @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs\n * @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs\n * @param {dropCb} [props.onDrop] Cb for when the `drop` event occurs.\n * Note that this callback is invoked after the `getFilesFromEvent` callback is done.\n *\n * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.\n * `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).\n * If `multiple` is set to false and additional files are dropped,\n * all files besides the first will be rejected.\n * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.\n *\n * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected.\n * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props.\n *\n * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server.\n * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library:\n *\n * ```js\n * function onDrop(acceptedFiles) {\n * const req = request.post('/upload')\n * acceptedFiles.forEach(file => {\n * req.attach(file.name, file)\n * })\n * req.end(callback)\n * }\n * ```\n * @param {dropAcceptedCb} [props.onDropAccepted]\n * @param {dropRejectedCb} [props.onDropRejected]\n * @param {(error: Error) => void} [props.onError]\n *\n * @returns {DropzoneState & DropzoneMethods}\n */\n\nexport function useDropzone() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),\n accept = _defaultProps$props.accept,\n disabled = _defaultProps$props.disabled,\n getFilesFromEvent = _defaultProps$props.getFilesFromEvent,\n maxSize = _defaultProps$props.maxSize,\n minSize = _defaultProps$props.minSize,\n multiple = _defaultProps$props.multiple,\n maxFiles = _defaultProps$props.maxFiles,\n onDragEnter = _defaultProps$props.onDragEnter,\n onDragLeave = _defaultProps$props.onDragLeave,\n onDragOver = _defaultProps$props.onDragOver,\n onDrop = _defaultProps$props.onDrop,\n onDropAccepted = _defaultProps$props.onDropAccepted,\n onDropRejected = _defaultProps$props.onDropRejected,\n onFileDialogCancel = _defaultProps$props.onFileDialogCancel,\n onFileDialogOpen = _defaultProps$props.onFileDialogOpen,\n useFsAccessApi = _defaultProps$props.useFsAccessApi,\n autoFocus = _defaultProps$props.autoFocus,\n preventDropOnDocument = _defaultProps$props.preventDropOnDocument,\n noClick = _defaultProps$props.noClick,\n noKeyboard = _defaultProps$props.noKeyboard,\n noDrag = _defaultProps$props.noDrag,\n noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,\n onError = _defaultProps$props.onError,\n validator = _defaultProps$props.validator;\n\n var acceptAttr = useMemo(function () {\n return acceptPropAsAcceptAttr(accept);\n }, [accept]);\n var pickerTypes = useMemo(function () {\n return pickerOptionsFromAccept(accept);\n }, [accept]);\n var onFileDialogOpenCb = useMemo(function () {\n return typeof onFileDialogOpen === \"function\" ? onFileDialogOpen : noop;\n }, [onFileDialogOpen]);\n var onFileDialogCancelCb = useMemo(function () {\n return typeof onFileDialogCancel === \"function\" ? onFileDialogCancel : noop;\n }, [onFileDialogCancel]);\n /**\n * @constant\n * @type {React.MutableRefObject}\n */\n\n var rootRef = useRef(null);\n var inputRef = useRef(null);\n\n var _useReducer = useReducer(reducer, initialState),\n _useReducer2 = _slicedToArray(_useReducer, 2),\n state = _useReducer2[0],\n dispatch = _useReducer2[1];\n\n var isFocused = state.isFocused,\n isFileDialogActive = state.isFileDialogActive;\n var fsAccessApiWorksRef = useRef(typeof window !== \"undefined\" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on\n\n var onWindowFocus = function onWindowFocus() {\n // Execute the timeout only if the file dialog is opened in the browser\n if (!fsAccessApiWorksRef.current && isFileDialogActive) {\n setTimeout(function () {\n if (inputRef.current) {\n var files = inputRef.current.files;\n\n if (!files.length) {\n dispatch({\n type: \"closeDialog\"\n });\n onFileDialogCancelCb();\n }\n }\n }, 300);\n }\n };\n\n useEffect(function () {\n window.addEventListener(\"focus\", onWindowFocus, false);\n return function () {\n window.removeEventListener(\"focus\", onWindowFocus, false);\n };\n }, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);\n var dragTargetsRef = useRef([]);\n\n var onDocumentDrop = function onDocumentDrop(event) {\n if (rootRef.current && rootRef.current.contains(event.target)) {\n // If we intercepted an event for our instance, let it propagate down to the instance's onDrop handler\n return;\n }\n\n event.preventDefault();\n dragTargetsRef.current = [];\n };\n\n useEffect(function () {\n if (preventDropOnDocument) {\n document.addEventListener(\"dragover\", onDocumentDragOver, false);\n document.addEventListener(\"drop\", onDocumentDrop, false);\n }\n\n return function () {\n if (preventDropOnDocument) {\n document.removeEventListener(\"dragover\", onDocumentDragOver);\n document.removeEventListener(\"drop\", onDocumentDrop);\n }\n };\n }, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true\n\n useEffect(function () {\n if (!disabled && autoFocus && rootRef.current) {\n rootRef.current.focus();\n }\n\n return function () {};\n }, [rootRef, autoFocus, disabled]);\n var onErrCb = useCallback(function (e) {\n if (onError) {\n onError(e);\n } else {\n // Let the user know something's gone wrong if they haven't provided the onError cb.\n console.error(e);\n }\n }, [onError]);\n var onDragEnterCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n var fileCount = files.length;\n var isDragAccept = fileCount > 0 && allFilesAccepted({\n files: files,\n accept: acceptAttr,\n minSize: minSize,\n maxSize: maxSize,\n multiple: multiple,\n maxFiles: maxFiles,\n validator: validator\n });\n var isDragReject = fileCount > 0 && !isDragAccept;\n dispatch({\n isDragAccept: isDragAccept,\n isDragReject: isDragReject,\n isDragActive: true,\n type: \"setDraggedFiles\"\n });\n\n if (onDragEnter) {\n onDragEnter(event);\n }\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n }, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);\n var onDragOverCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event);\n var hasFiles = isEvtWithFiles(event);\n\n if (hasFiles && event.dataTransfer) {\n try {\n event.dataTransfer.dropEffect = \"copy\";\n } catch (_unused) {}\n /* eslint-disable-line no-empty */\n\n }\n\n if (hasFiles && onDragOver) {\n onDragOver(event);\n }\n\n return false;\n }, [onDragOver, noDragEventsBubbling]);\n var onDragLeaveCb = useCallback(function (event) {\n event.preventDefault();\n event.persist();\n stopPropagation(event); // Only deactivate once the dropzone and all children have been left\n\n var targets = dragTargetsRef.current.filter(function (target) {\n return rootRef.current && rootRef.current.contains(target);\n }); // Make sure to remove a target present multiple times only once\n // (Firefox may fire dragenter/dragleave multiple times on the same element)\n\n var targetIdx = targets.indexOf(event.target);\n\n if (targetIdx !== -1) {\n targets.splice(targetIdx, 1);\n }\n\n dragTargetsRef.current = targets;\n\n if (targets.length > 0) {\n return;\n }\n\n dispatch({\n type: \"setDraggedFiles\",\n isDragActive: false,\n isDragAccept: false,\n isDragReject: false\n });\n\n if (isEvtWithFiles(event) && onDragLeave) {\n onDragLeave(event);\n }\n }, [rootRef, onDragLeave, noDragEventsBubbling]);\n var setFiles = useCallback(function (files, event) {\n var acceptedFiles = [];\n var fileRejections = [];\n files.forEach(function (file) {\n var _fileAccepted = fileAccepted(file, acceptAttr),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 2),\n accepted = _fileAccepted2[0],\n acceptError = _fileAccepted2[1];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 2),\n sizeMatch = _fileMatchSize2[0],\n sizeError = _fileMatchSize2[1];\n\n var customErrors = validator ? validator(file) : null;\n\n if (accepted && sizeMatch && !customErrors) {\n acceptedFiles.push(file);\n } else {\n var errors = [acceptError, sizeError];\n\n if (customErrors) {\n errors = errors.concat(customErrors);\n }\n\n fileRejections.push({\n file: file,\n errors: errors.filter(function (e) {\n return e;\n })\n });\n }\n });\n\n if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {\n // Reject everything and empty accepted files\n acceptedFiles.forEach(function (file) {\n fileRejections.push({\n file: file,\n errors: [TOO_MANY_FILES_REJECTION]\n });\n });\n acceptedFiles.splice(0);\n }\n\n dispatch({\n acceptedFiles: acceptedFiles,\n fileRejections: fileRejections,\n type: \"setFiles\"\n });\n\n if (onDrop) {\n onDrop(acceptedFiles, fileRejections, event);\n }\n\n if (fileRejections.length > 0 && onDropRejected) {\n onDropRejected(fileRejections, event);\n }\n\n if (acceptedFiles.length > 0 && onDropAccepted) {\n onDropAccepted(acceptedFiles, event);\n }\n }, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);\n var onDropCb = useCallback(function (event) {\n event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done\n\n event.persist();\n stopPropagation(event);\n dragTargetsRef.current = [];\n\n if (isEvtWithFiles(event)) {\n Promise.resolve(getFilesFromEvent(event)).then(function (files) {\n if (isPropagationStopped(event) && !noDragEventsBubbling) {\n return;\n }\n\n setFiles(files, event);\n }).catch(function (e) {\n return onErrCb(e);\n });\n }\n\n dispatch({\n type: \"reset\"\n });\n }, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically\n\n var openFileDialog = useCallback(function () {\n // No point to use FS access APIs if context is not secure\n // https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection\n if (fsAccessApiWorksRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n\n var opts = {\n multiple: multiple,\n types: pickerTypes\n };\n window.showOpenFilePicker(opts).then(function (handles) {\n return getFilesFromEvent(handles);\n }).then(function (files) {\n setFiles(files, null);\n dispatch({\n type: \"closeDialog\"\n });\n }).catch(function (e) {\n // AbortError means the user canceled\n if (isAbort(e)) {\n onFileDialogCancelCb(e);\n dispatch({\n type: \"closeDialog\"\n });\n } else if (isSecurityError(e)) {\n fsAccessApiWorksRef.current = false; // CORS, so cannot use this API\n // Try using the input\n\n if (inputRef.current) {\n inputRef.current.value = null;\n inputRef.current.click();\n } else {\n onErrCb(new Error(\"Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided.\"));\n }\n } else {\n onErrCb(e);\n }\n });\n return;\n }\n\n if (inputRef.current) {\n dispatch({\n type: \"openDialog\"\n });\n onFileDialogOpenCb();\n inputRef.current.value = null;\n inputRef.current.click();\n }\n }, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone\n\n var onKeyDownCb = useCallback(function (event) {\n // Ignore keyboard events bubbling up the DOM tree\n if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {\n return;\n }\n\n if (event.key === \" \" || event.key === \"Enter\" || event.keyCode === 32 || event.keyCode === 13) {\n event.preventDefault();\n openFileDialog();\n }\n }, [rootRef, openFileDialog]); // Update focus state for the dropzone\n\n var onFocusCb = useCallback(function () {\n dispatch({\n type: \"focus\"\n });\n }, []);\n var onBlurCb = useCallback(function () {\n dispatch({\n type: \"blur\"\n });\n }, []); // Cb to open the file dialog when click occurs on the dropzone\n\n var onClickCb = useCallback(function () {\n if (noClick) {\n return;\n } // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()\n // to ensure React can handle state changes\n // See: https://github.com/react-dropzone/react-dropzone/issues/450\n\n\n if (isIeOrEdge()) {\n setTimeout(openFileDialog, 0);\n } else {\n openFileDialog();\n }\n }, [noClick, openFileDialog]);\n\n var composeHandler = function composeHandler(fn) {\n return disabled ? null : fn;\n };\n\n var composeKeyboardHandler = function composeKeyboardHandler(fn) {\n return noKeyboard ? null : composeHandler(fn);\n };\n\n var composeDragHandler = function composeDragHandler(fn) {\n return noDrag ? null : composeHandler(fn);\n };\n\n var stopPropagation = function stopPropagation(event) {\n if (noDragEventsBubbling) {\n event.stopPropagation();\n }\n };\n\n var getRootProps = useMemo(function () {\n return function () {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? \"ref\" : _ref2$refKey,\n role = _ref2.role,\n onKeyDown = _ref2.onKeyDown,\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick,\n onDragEnter = _ref2.onDragEnter,\n onDragOver = _ref2.onDragOver,\n onDragLeave = _ref2.onDragLeave,\n onDrop = _ref2.onDrop,\n rest = _objectWithoutProperties(_ref2, _excluded3);\n\n return _objectSpread(_objectSpread(_defineProperty({\n onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),\n onFocus: composeKeyboardHandler(composeEventHandlers(onFocus, onFocusCb)),\n onBlur: composeKeyboardHandler(composeEventHandlers(onBlur, onBlurCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onClickCb)),\n onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),\n onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),\n onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),\n onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),\n role: typeof role === \"string\" && role !== \"\" ? role : \"presentation\"\n }, refKey, rootRef), !disabled && !noKeyboard ? {\n tabIndex: 0\n } : {}), rest);\n };\n }, [rootRef, onKeyDownCb, onFocusCb, onBlurCb, onClickCb, onDragEnterCb, onDragOverCb, onDragLeaveCb, onDropCb, noKeyboard, noDrag, disabled]);\n var onInputElementClick = useCallback(function (event) {\n event.stopPropagation();\n }, []);\n var getInputProps = useMemo(function () {\n return function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? \"ref\" : _ref3$refKey,\n onChange = _ref3.onChange,\n onClick = _ref3.onClick,\n rest = _objectWithoutProperties(_ref3, _excluded4);\n\n var inputProps = _defineProperty({\n accept: acceptAttr,\n multiple: multiple,\n type: \"file\",\n style: {\n display: \"none\"\n },\n onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),\n onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),\n tabIndex: -1\n }, refKey, inputRef);\n\n return _objectSpread(_objectSpread({}, inputProps), rest);\n };\n }, [inputRef, accept, multiple, onDropCb, disabled]);\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: isFocused && !disabled,\n getRootProps: getRootProps,\n getInputProps: getInputProps,\n rootRef: rootRef,\n inputRef: inputRef,\n open: composeHandler(openFileDialog)\n });\n}\n/**\n * @param {DropzoneState} state\n * @param {{type: string} & DropzoneState} action\n * @returns {DropzoneState}\n */\n\nfunction reducer(state, action) {\n /* istanbul ignore next */\n switch (action.type) {\n case \"focus\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: true\n });\n\n case \"blur\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFocused: false\n });\n\n case \"openDialog\":\n return _objectSpread(_objectSpread({}, initialState), {}, {\n isFileDialogActive: true\n });\n\n case \"closeDialog\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isFileDialogActive: false\n });\n\n case \"setDraggedFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n isDragActive: action.isDragActive,\n isDragAccept: action.isDragAccept,\n isDragReject: action.isDragReject\n });\n\n case \"setFiles\":\n return _objectSpread(_objectSpread({}, state), {}, {\n acceptedFiles: action.acceptedFiles,\n fileRejections: action.fileRejections\n });\n\n case \"reset\":\n return _objectSpread({}, initialState);\n\n default:\n return state;\n }\n}\n\nfunction noop() {}\n\nexport { ErrorCode } from \"./utils\";",null,null,"function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport accepts from \"attr-accept\"; // Error codes\n\nexport var FILE_INVALID_TYPE = \"file-invalid-type\";\nexport var FILE_TOO_LARGE = \"file-too-large\";\nexport var FILE_TOO_SMALL = \"file-too-small\";\nexport var TOO_MANY_FILES = \"too-many-files\";\nexport var ErrorCode = {\n FileInvalidType: FILE_INVALID_TYPE,\n FileTooLarge: FILE_TOO_LARGE,\n FileTooSmall: FILE_TOO_SMALL,\n TooManyFiles: TOO_MANY_FILES\n}; // File Errors\n\nexport var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {\n accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;\n var messageSuffix = Array.isArray(accept) ? \"one of \".concat(accept.join(\", \")) : accept;\n return {\n code: FILE_INVALID_TYPE,\n message: \"File type must be \".concat(messageSuffix)\n };\n};\nexport var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {\n return {\n code: FILE_TOO_LARGE,\n message: \"File is larger than \".concat(maxSize, \" \").concat(maxSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {\n return {\n code: FILE_TOO_SMALL,\n message: \"File is smaller than \".concat(minSize, \" \").concat(minSize === 1 ? \"byte\" : \"bytes\")\n };\n};\nexport var TOO_MANY_FILES_REJECTION = {\n code: TOO_MANY_FILES,\n message: \"Too many files\"\n}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with\n// that MIME type will always be accepted\n\nexport function fileAccepted(file, accept) {\n var isAcceptable = file.type === \"application/x-moz-file\" || accepts(file, accept);\n return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];\n}\nexport function fileMatchSize(file, minSize, maxSize) {\n if (isDefined(file.size)) {\n if (isDefined(minSize) && isDefined(maxSize)) {\n if (file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n if (file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];\n } else if (isDefined(minSize) && file.size < minSize) return [false, getTooSmallRejectionErr(minSize)];else if (isDefined(maxSize) && file.size > maxSize) return [false, getTooLargeRejectionErr(maxSize)];\n }\n\n return [true, null];\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n/**\n *\n * @param {object} options\n * @param {File[]} options.files\n * @param {string|string[]} [options.accept]\n * @param {number} [options.minSize]\n * @param {number} [options.maxSize]\n * @param {boolean} [options.multiple]\n * @param {number} [options.maxFiles]\n * @param {(f: File) => FileError|FileError[]|null} [options.validator]\n * @returns\n */\n\n\nexport function allFilesAccepted(_ref) {\n var files = _ref.files,\n accept = _ref.accept,\n minSize = _ref.minSize,\n maxSize = _ref.maxSize,\n multiple = _ref.multiple,\n maxFiles = _ref.maxFiles,\n validator = _ref.validator;\n\n if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {\n return false;\n }\n\n return files.every(function (file) {\n var _fileAccepted = fileAccepted(file, accept),\n _fileAccepted2 = _slicedToArray(_fileAccepted, 1),\n accepted = _fileAccepted2[0];\n\n var _fileMatchSize = fileMatchSize(file, minSize, maxSize),\n _fileMatchSize2 = _slicedToArray(_fileMatchSize, 1),\n sizeMatch = _fileMatchSize2[0];\n\n var customErrors = validator ? validator(file) : null;\n return accepted && sizeMatch && !customErrors;\n });\n} // React's synthetic events has event.isPropagationStopped,\n// but to remain compatibility with other libs (Preact) fall back\n// to check event.cancelBubble\n\nexport function isPropagationStopped(event) {\n if (typeof event.isPropagationStopped === \"function\") {\n return event.isPropagationStopped();\n } else if (typeof event.cancelBubble !== \"undefined\") {\n return event.cancelBubble;\n }\n\n return false;\n}\nexport function isEvtWithFiles(event) {\n if (!event.dataTransfer) {\n return !!event.target && !!event.target.files;\n } // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/types\n // https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#file\n\n\n return Array.prototype.some.call(event.dataTransfer.types, function (type) {\n return type === \"Files\" || type === \"application/x-moz-file\";\n });\n}\nexport function isKindFile(item) {\n return _typeof(item) === \"object\" && item !== null && item.kind === \"file\";\n} // allow the entire document to be a drag target\n\nexport function onDocumentDragOver(event) {\n event.preventDefault();\n}\n\nfunction isIe(userAgent) {\n return userAgent.indexOf(\"MSIE\") !== -1 || userAgent.indexOf(\"Trident/\") !== -1;\n}\n\nfunction isEdge(userAgent) {\n return userAgent.indexOf(\"Edge/\") !== -1;\n}\n\nexport function isIeOrEdge() {\n var userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.navigator.userAgent;\n return isIe(userAgent) || isEdge(userAgent);\n}\n/**\n * This is intended to be used to compose event handlers\n * They are executed in order until one of them calls `event.isPropagationStopped()`.\n * Note that the check is done on the first invoke too,\n * meaning that if propagation was stopped before invoking the fns,\n * no handlers will be executed.\n *\n * @param {Function} fns the event hanlder functions\n * @return {Function} the event handler to add to an element\n */\n\nexport function composeEventHandlers() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return fns.some(function (fn) {\n if (!isPropagationStopped(event) && fn) {\n fn.apply(void 0, [event].concat(args));\n }\n\n return isPropagationStopped(event);\n });\n };\n}\n/**\n * canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)\n * is supported by the browser.\n * @returns {boolean}\n */\n\nexport function canUseFileSystemAccessAPI() {\n return \"showOpenFilePicker\" in window;\n}\n/**\n * Convert the `{accept}` dropzone prop to the\n * `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker\n *\n * @param {AcceptProp} accept\n * @returns {{accept: string[]}[]}\n */\n\nexport function pickerOptionsFromAccept(accept) {\n if (isDefined(accept)) {\n var acceptForPicker = Object.entries(accept).filter(function (_ref2) {\n var _ref3 = _slicedToArray(_ref2, 2),\n mimeType = _ref3[0],\n ext = _ref3[1];\n\n var ok = true;\n\n if (!isMIMEType(mimeType)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.\"));\n ok = false;\n }\n\n if (!Array.isArray(ext) || !ext.every(isExt)) {\n console.warn(\"Skipped \\\"\".concat(mimeType, \"\\\" because an invalid file extension was provided.\"));\n ok = false;\n }\n\n return ok;\n }).reduce(function (agg, _ref4) {\n var _ref5 = _slicedToArray(_ref4, 2),\n mimeType = _ref5[0],\n ext = _ref5[1];\n\n return _objectSpread(_objectSpread({}, agg), {}, _defineProperty({}, mimeType, ext));\n }, {});\n return [{\n accept: acceptForPicker\n }];\n }\n\n return accept;\n}\n/**\n * Convert the `{accept}` dropzone prop to an array of MIME types/extensions.\n * @param {AcceptProp} accept\n * @returns {string}\n */\n\nexport function acceptPropAsAcceptAttr(accept) {\n if (isDefined(accept)) {\n return Object.entries(accept).reduce(function (a, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n mimeType = _ref7[0],\n ext = _ref7[1];\n\n return [].concat(_toConsumableArray(a), [mimeType], _toConsumableArray(ext));\n }, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these\n .filter(function (v) {\n return isMIMEType(v) || isExt(v);\n }).join(\",\");\n }\n\n return undefined;\n}\n/**\n * Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is an abort exception.\n */\n\nexport function isAbort(v) {\n return v instanceof DOMException && (v.name === \"AbortError\" || v.code === v.ABORT_ERR);\n}\n/**\n * Check if v is a security error.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.\n * @param {any} v\n * @returns {boolean} True if v is a security error.\n */\n\nexport function isSecurityError(v) {\n return v instanceof DOMException && (v.name === \"SecurityError\" || v.code === v.SECURITY_ERR);\n}\n/**\n * Check if v is a MIME type string.\n *\n * See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.\n *\n * @param {string} v\n */\n\nexport function isMIMEType(v) {\n return v === \"audio/*\" || v === \"video/*\" || v === \"image/*\" || v === \"text/*\" || /\\w+\\/[-+.\\w]+/g.test(v);\n}\n/**\n * Check if v is a file extension.\n * @param {string} v\n */\n\nexport function isExt(v) {\n return /^.*\\.[\\w]+$/.test(v);\n}\n/**\n * @typedef {Object.} AcceptProp\n */\n\n/**\n * @typedef {object} FileError\n * @property {string} message\n * @property {ErrorCode|string} code\n */\n\n/**\n * @typedef {\"file-invalid-type\"|\"file-too-large\"|\"file-too-small\"|\"too-many-files\"} ErrorCode\n */","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export var Subscribable = /*#__PURE__*/function () {\n function Subscribable() {\n this.listeners = [];\n }\n\n var _proto = Subscribable.prototype;\n\n _proto.subscribe = function subscribe(listener) {\n var _this = this;\n\n var callback = listener || function () {\n return undefined;\n };\n\n this.listeners.push(callback);\n this.onSubscribe();\n return function () {\n _this.listeners = _this.listeners.filter(function (x) {\n return x !== callback;\n });\n\n _this.onUnsubscribe();\n };\n };\n\n _proto.hasListeners = function hasListeners() {\n return this.listeners.length > 0;\n };\n\n _proto.onSubscribe = function onSubscribe() {// Do nothing\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {// Do nothing\n };\n\n return Subscribable;\n}();","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// TYPES\n// UTILS\nexport var isServer = typeof window === 'undefined';\nexport function noop() {\n return undefined;\n}\nexport function functionalUpdate(updater, input) {\n return typeof updater === 'function' ? updater(input) : updater;\n}\nexport function isValidTimeout(value) {\n return typeof value === 'number' && value >= 0 && value !== Infinity;\n}\nexport function ensureQueryKeyArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function difference(array1, array2) {\n return array1.filter(function (x) {\n return array2.indexOf(x) === -1;\n });\n}\nexport function replaceAt(array, index, value) {\n var copy = array.slice(0);\n copy[index] = value;\n return copy;\n}\nexport function timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nexport function parseQueryArgs(arg1, arg2, arg3) {\n if (!isQueryKey(arg1)) {\n return arg1;\n }\n\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n queryKey: arg1,\n queryFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n queryKey: arg1\n });\n}\nexport function parseMutationArgs(arg1, arg2, arg3) {\n if (isQueryKey(arg1)) {\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n mutationKey: arg1,\n mutationFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n mutationKey: arg1\n });\n }\n\n if (typeof arg1 === 'function') {\n return _extends({}, arg2, {\n mutationFn: arg1\n });\n }\n\n return _extends({}, arg1);\n}\nexport function parseFilterArgs(arg1, arg2, arg3) {\n return isQueryKey(arg1) ? [_extends({}, arg2, {\n queryKey: arg1\n }), arg3] : [arg1 || {}, arg2];\n}\nexport function parseMutationFilterArgs(arg1, arg2) {\n return isQueryKey(arg1) ? _extends({}, arg2, {\n mutationKey: arg1\n }) : arg1;\n}\nexport function mapQueryStatusFilter(active, inactive) {\n if (active === true && inactive === true || active == null && inactive == null) {\n return 'all';\n } else if (active === false && inactive === false) {\n return 'none';\n } else {\n // At this point, active|inactive can only be true|false or false|true\n // so, when only one value is provided, the missing one has to be the negated value\n var isActive = active != null ? active : !inactive;\n return isActive ? 'active' : 'inactive';\n }\n}\nexport function matchQuery(filters, query) {\n var active = filters.active,\n exact = filters.exact,\n fetching = filters.fetching,\n inactive = filters.inactive,\n predicate = filters.predicate,\n queryKey = filters.queryKey,\n stale = filters.stale;\n\n if (isQueryKey(queryKey)) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n\n var queryStatusFilter = mapQueryStatusFilter(active, inactive);\n\n if (queryStatusFilter === 'none') {\n return false;\n } else if (queryStatusFilter !== 'all') {\n var isActive = query.isActive();\n\n if (queryStatusFilter === 'active' && !isActive) {\n return false;\n }\n\n if (queryStatusFilter === 'inactive' && isActive) {\n return false;\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false;\n }\n\n if (typeof fetching === 'boolean' && query.isFetching() !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(query)) {\n return false;\n }\n\n return true;\n}\nexport function matchMutation(filters, mutation) {\n var exact = filters.exact,\n fetching = filters.fetching,\n predicate = filters.predicate,\n mutationKey = filters.mutationKey;\n\n if (isQueryKey(mutationKey)) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n\n if (exact) {\n if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n\n if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(mutation)) {\n return false;\n }\n\n return true;\n}\nexport function hashQueryKeyByOptions(queryKey, options) {\n var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;\n return hashFn(queryKey);\n}\n/**\n * Default query keys hash function.\n */\n\nexport function hashQueryKey(queryKey) {\n var asArray = ensureQueryKeyArray(queryKey);\n return stableValueHash(asArray);\n}\n/**\n * Hashes the value into a stable hash.\n */\n\nexport function stableValueHash(value) {\n return JSON.stringify(value, function (_, val) {\n return isPlainObject(val) ? Object.keys(val).sort().reduce(function (result, key) {\n result[key] = val[key];\n return result;\n }, {}) : val;\n });\n}\n/**\n * Checks if key `b` partially matches with key `a`.\n */\n\nexport function partialMatchKey(a, b) {\n return partialDeepEqual(ensureQueryKeyArray(a), ensureQueryKeyArray(b));\n}\n/**\n * Checks if `b` partially matches with `a`.\n */\n\nexport function partialDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some(function (key) {\n return !partialDeepEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\n\nexport function replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n\n var array = Array.isArray(a) && Array.isArray(b);\n\n if (array || isPlainObject(a) && isPlainObject(b)) {\n var aSize = array ? a.length : Object.keys(a).length;\n var bItems = array ? b : Object.keys(b);\n var bSize = bItems.length;\n var copy = array ? [] : {};\n var equalItems = 0;\n\n for (var i = 0; i < bSize; i++) {\n var key = array ? i : bItems[i];\n copy[key] = replaceEqualDeep(a[key], b[key]);\n\n if (copy[key] === a[key]) {\n equalItems++;\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n\n return b;\n}\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\n\nexport function shallowEqualObjects(a, b) {\n if (a && !b || b && !a) {\n return false;\n }\n\n for (var key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n} // Copied from: https://github.com/jonschlinkert/is-plain-object\n\nexport function isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n } // If has modified constructor\n\n\n var ctor = o.constructor;\n\n if (typeof ctor === 'undefined') {\n return true;\n } // If has modified prototype\n\n\n var prot = ctor.prototype;\n\n if (!hasObjectPrototype(prot)) {\n return false;\n } // If constructor does not have an Object-specific method\n\n\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false;\n } // Most likely a plain Object\n\n\n return true;\n}\n\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isQueryKey(value) {\n return typeof value === 'string' || Array.isArray(value);\n}\nexport function isError(value) {\n return value instanceof Error;\n}\nexport function sleep(timeout) {\n return new Promise(function (resolve) {\n setTimeout(resolve, timeout);\n });\n}\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\n\nexport function scheduleMicrotask(callback) {\n Promise.resolve().then(callback).catch(function (error) {\n return setTimeout(function () {\n throw error;\n });\n });\n}\nexport function getAbortController() {\n if (typeof AbortController === 'function') {\n return new AbortController();\n }\n}","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { Subscribable } from './subscribable';\nimport { isServer } from './utils';\nexport var FocusManager = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(FocusManager, _Subscribable);\n\n function FocusManager() {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n\n _this.setup = function (onFocus) {\n var _window;\n\n if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {\n var listener = function listener() {\n return onFocus();\n }; // Listen to visibillitychange and focus\n\n\n window.addEventListener('visibilitychange', listener, false);\n window.addEventListener('focus', listener, false);\n return function () {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener);\n window.removeEventListener('focus', listener);\n };\n }\n };\n\n return _this;\n }\n\n var _proto = FocusManager.prototype;\n\n _proto.onSubscribe = function onSubscribe() {\n if (!this.cleanup) {\n this.setEventListener(this.setup);\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.hasListeners()) {\n var _this$cleanup;\n\n (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n this.cleanup = undefined;\n }\n };\n\n _proto.setEventListener = function setEventListener(setup) {\n var _this$cleanup2,\n _this2 = this;\n\n this.setup = setup;\n (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n this.cleanup = setup(function (focused) {\n if (typeof focused === 'boolean') {\n _this2.setFocused(focused);\n } else {\n _this2.onFocus();\n }\n });\n };\n\n _proto.setFocused = function setFocused(focused) {\n this.focused = focused;\n\n if (focused) {\n this.onFocus();\n }\n };\n\n _proto.onFocus = function onFocus() {\n this.listeners.forEach(function (listener) {\n listener();\n });\n };\n\n _proto.isFocused = function isFocused() {\n if (typeof this.focused === 'boolean') {\n return this.focused;\n } // document global can be unavailable in react native\n\n\n if (typeof document === 'undefined') {\n return true;\n }\n\n return [undefined, 'visible', 'prerender'].includes(document.visibilityState);\n };\n\n return FocusManager;\n}(Subscribable);\nexport var focusManager = new FocusManager();","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { Subscribable } from './subscribable';\nimport { isServer } from './utils';\nexport var OnlineManager = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(OnlineManager, _Subscribable);\n\n function OnlineManager() {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n\n _this.setup = function (onOnline) {\n var _window;\n\n if (!isServer && ((_window = window) == null ? void 0 : _window.addEventListener)) {\n var listener = function listener() {\n return onOnline();\n }; // Listen to online\n\n\n window.addEventListener('online', listener, false);\n window.addEventListener('offline', listener, false);\n return function () {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', listener);\n window.removeEventListener('offline', listener);\n };\n }\n };\n\n return _this;\n }\n\n var _proto = OnlineManager.prototype;\n\n _proto.onSubscribe = function onSubscribe() {\n if (!this.cleanup) {\n this.setEventListener(this.setup);\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.hasListeners()) {\n var _this$cleanup;\n\n (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this);\n this.cleanup = undefined;\n }\n };\n\n _proto.setEventListener = function setEventListener(setup) {\n var _this$cleanup2,\n _this2 = this;\n\n this.setup = setup;\n (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this);\n this.cleanup = setup(function (online) {\n if (typeof online === 'boolean') {\n _this2.setOnline(online);\n } else {\n _this2.onOnline();\n }\n });\n };\n\n _proto.setOnline = function setOnline(online) {\n this.online = online;\n\n if (online) {\n this.onOnline();\n }\n };\n\n _proto.onOnline = function onOnline() {\n this.listeners.forEach(function (listener) {\n listener();\n });\n };\n\n _proto.isOnline = function isOnline() {\n if (typeof this.online === 'boolean') {\n return this.online;\n }\n\n if (typeof navigator === 'undefined' || typeof navigator.onLine === 'undefined') {\n return true;\n }\n\n return navigator.onLine;\n };\n\n return OnlineManager;\n}(Subscribable);\nexport var onlineManager = new OnlineManager();","import { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { sleep } from './utils';\n\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1000 * Math.pow(2, failureCount), 30000);\n}\n\nexport function isCancelable(value) {\n return typeof (value == null ? void 0 : value.cancel) === 'function';\n}\nexport var CancelledError = function CancelledError(options) {\n this.revert = options == null ? void 0 : options.revert;\n this.silent = options == null ? void 0 : options.silent;\n};\nexport function isCancelledError(value) {\n return value instanceof CancelledError;\n} // CLASS\n\nexport var Retryer = function Retryer(config) {\n var _this = this;\n\n var cancelRetry = false;\n var cancelFn;\n var continueFn;\n var promiseResolve;\n var promiseReject;\n this.abort = config.abort;\n\n this.cancel = function (cancelOptions) {\n return cancelFn == null ? void 0 : cancelFn(cancelOptions);\n };\n\n this.cancelRetry = function () {\n cancelRetry = true;\n };\n\n this.continueRetry = function () {\n cancelRetry = false;\n };\n\n this.continue = function () {\n return continueFn == null ? void 0 : continueFn();\n };\n\n this.failureCount = 0;\n this.isPaused = false;\n this.isResolved = false;\n this.isTransportCancelable = false;\n this.promise = new Promise(function (outerResolve, outerReject) {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n\n var resolve = function resolve(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onSuccess == null ? void 0 : config.onSuccess(value);\n continueFn == null ? void 0 : continueFn();\n promiseResolve(value);\n }\n };\n\n var reject = function reject(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onError == null ? void 0 : config.onError(value);\n continueFn == null ? void 0 : continueFn();\n promiseReject(value);\n }\n };\n\n var pause = function pause() {\n return new Promise(function (continueResolve) {\n continueFn = continueResolve;\n _this.isPaused = true;\n config.onPause == null ? void 0 : config.onPause();\n }).then(function () {\n continueFn = undefined;\n _this.isPaused = false;\n config.onContinue == null ? void 0 : config.onContinue();\n });\n }; // Create loop function\n\n\n var run = function run() {\n // Do nothing if already resolved\n if (_this.isResolved) {\n return;\n }\n\n var promiseOrValue; // Execute query\n\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n } // Create callback to cancel this fetch\n\n\n cancelFn = function cancelFn(cancelOptions) {\n if (!_this.isResolved) {\n reject(new CancelledError(cancelOptions));\n _this.abort == null ? void 0 : _this.abort(); // Cancel transport if supported\n\n if (isCancelable(promiseOrValue)) {\n try {\n promiseOrValue.cancel();\n } catch (_unused) {}\n }\n }\n }; // Check if the transport layer support cancellation\n\n\n _this.isTransportCancelable = isCancelable(promiseOrValue);\n Promise.resolve(promiseOrValue).then(resolve).catch(function (error) {\n var _config$retry, _config$retryDelay;\n\n // Stop if the fetch is already resolved\n if (_this.isResolved) {\n return;\n } // Do we need to retry the request?\n\n\n var retry = (_config$retry = config.retry) != null ? _config$retry : 3;\n var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;\n var delay = typeof retryDelay === 'function' ? retryDelay(_this.failureCount, error) : retryDelay;\n var shouldRetry = retry === true || typeof retry === 'number' && _this.failureCount < retry || typeof retry === 'function' && retry(_this.failureCount, error);\n\n if (cancelRetry || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error);\n return;\n }\n\n _this.failureCount++; // Notify on fail\n\n config.onFail == null ? void 0 : config.onFail(_this.failureCount, error); // Delay\n\n sleep(delay) // Pause if the document is not visible or when the device is offline\n .then(function () {\n if (!focusManager.isFocused() || !onlineManager.isOnline()) {\n return pause();\n }\n }).then(function () {\n if (cancelRetry) {\n reject(error);\n } else {\n run();\n }\n });\n });\n }; // Start loop\n\n\n run();\n};","import { scheduleMicrotask } from './utils'; // TYPES\n\n// CLASS\nexport var NotifyManager = /*#__PURE__*/function () {\n function NotifyManager() {\n this.queue = [];\n this.transactions = 0;\n\n this.notifyFn = function (callback) {\n callback();\n };\n\n this.batchNotifyFn = function (callback) {\n callback();\n };\n }\n\n var _proto = NotifyManager.prototype;\n\n _proto.batch = function batch(callback) {\n var result;\n this.transactions++;\n\n try {\n result = callback();\n } finally {\n this.transactions--;\n\n if (!this.transactions) {\n this.flush();\n }\n }\n\n return result;\n };\n\n _proto.schedule = function schedule(callback) {\n var _this = this;\n\n if (this.transactions) {\n this.queue.push(callback);\n } else {\n scheduleMicrotask(function () {\n _this.notifyFn(callback);\n });\n }\n }\n /**\n * All calls to the wrapped function will be batched.\n */\n ;\n\n _proto.batchCalls = function batchCalls(callback) {\n var _this2 = this;\n\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this2.schedule(function () {\n callback.apply(void 0, args);\n });\n };\n };\n\n _proto.flush = function flush() {\n var _this3 = this;\n\n var queue = this.queue;\n this.queue = [];\n\n if (queue.length) {\n scheduleMicrotask(function () {\n _this3.batchNotifyFn(function () {\n queue.forEach(function (callback) {\n _this3.notifyFn(callback);\n });\n });\n });\n }\n }\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n ;\n\n _proto.setNotifyFunction = function setNotifyFunction(fn) {\n this.notifyFn = fn;\n }\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n ;\n\n _proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn) {\n this.batchNotifyFn = fn;\n };\n\n return NotifyManager;\n}(); // SINGLETON\n\nexport var notifyManager = new NotifyManager();","// TYPES\n// FUNCTIONS\nvar logger = console;\nexport function getLogger() {\n return logger;\n}\nexport function setLogger(newLogger) {\n logger = newLogger;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getAbortController, functionalUpdate, isValidTimeout, noop, replaceEqualDeep, timeUntilStale, ensureQueryKeyArray } from './utils';\nimport { notifyManager } from './notifyManager';\nimport { getLogger } from './logger';\nimport { Retryer, isCancelledError } from './retryer'; // TYPES\n\n// CLASS\nexport var Query = /*#__PURE__*/function () {\n function Query(config) {\n this.abortSignalConsumed = false;\n this.hadObservers = false;\n this.defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.initialState = config.state || this.getDefaultState(this.options);\n this.state = this.initialState;\n this.meta = config.meta;\n this.scheduleGc();\n }\n\n var _proto = Query.prototype;\n\n _proto.setOptions = function setOptions(options) {\n var _this$options$cacheTi;\n\n this.options = _extends({}, this.defaultOptions, options);\n this.meta = options == null ? void 0 : options.meta; // Default to 5 minutes if not cache time is set\n\n this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 5 * 60 * 1000);\n };\n\n _proto.setDefaultOptions = function setDefaultOptions(options) {\n this.defaultOptions = options;\n };\n\n _proto.scheduleGc = function scheduleGc() {\n var _this = this;\n\n this.clearGcTimeout();\n\n if (isValidTimeout(this.cacheTime)) {\n this.gcTimeout = setTimeout(function () {\n _this.optionalRemove();\n }, this.cacheTime);\n }\n };\n\n _proto.clearGcTimeout = function clearGcTimeout() {\n if (this.gcTimeout) {\n clearTimeout(this.gcTimeout);\n this.gcTimeout = undefined;\n }\n };\n\n _proto.optionalRemove = function optionalRemove() {\n if (!this.observers.length) {\n if (this.state.isFetching) {\n if (this.hadObservers) {\n this.scheduleGc();\n }\n } else {\n this.cache.remove(this);\n }\n }\n };\n\n _proto.setData = function setData(updater, options) {\n var _this$options$isDataE, _this$options;\n\n var prevData = this.state.data; // Get the new data\n\n var data = functionalUpdate(updater, prevData); // Use prev data if an isDataEqual function is defined and returns `true`\n\n if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) {\n data = prevData;\n } else if (this.options.structuralSharing !== false) {\n // Structurally share data between prev and new data if needed\n data = replaceEqualDeep(prevData, data);\n } // Set data and mark it as cached\n\n\n this.dispatch({\n data: data,\n type: 'success',\n dataUpdatedAt: options == null ? void 0 : options.updatedAt\n });\n return data;\n };\n\n _proto.setState = function setState(state, setStateOptions) {\n this.dispatch({\n type: 'setState',\n state: state,\n setStateOptions: setStateOptions\n });\n };\n\n _proto.cancel = function cancel(options) {\n var _this$retryer;\n\n var promise = this.promise;\n (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n };\n\n _proto.destroy = function destroy() {\n this.clearGcTimeout();\n this.cancel({\n silent: true\n });\n };\n\n _proto.reset = function reset() {\n this.destroy();\n this.setState(this.initialState);\n };\n\n _proto.isActive = function isActive() {\n return this.observers.some(function (observer) {\n return observer.options.enabled !== false;\n });\n };\n\n _proto.isFetching = function isFetching() {\n return this.state.isFetching;\n };\n\n _proto.isStale = function isStale() {\n return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function (observer) {\n return observer.getCurrentResult().isStale;\n });\n };\n\n _proto.isStaleByTime = function isStaleByTime(staleTime) {\n if (staleTime === void 0) {\n staleTime = 0;\n }\n\n return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n };\n\n _proto.onFocus = function onFocus() {\n var _this$retryer2;\n\n var observer = this.observers.find(function (x) {\n return x.shouldFetchOnWindowFocus();\n });\n\n if (observer) {\n observer.refetch();\n } // Continue fetch if currently paused\n\n\n (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();\n };\n\n _proto.onOnline = function onOnline() {\n var _this$retryer3;\n\n var observer = this.observers.find(function (x) {\n return x.shouldFetchOnReconnect();\n });\n\n if (observer) {\n observer.refetch();\n } // Continue fetch if currently paused\n\n\n (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();\n };\n\n _proto.addObserver = function addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer);\n this.hadObservers = true; // Stop the query from being garbage collected\n\n this.clearGcTimeout();\n this.cache.notify({\n type: 'observerAdded',\n query: this,\n observer: observer\n });\n }\n };\n\n _proto.removeObserver = function removeObserver(observer) {\n if (this.observers.indexOf(observer) !== -1) {\n this.observers = this.observers.filter(function (x) {\n return x !== observer;\n });\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.retryer) {\n if (this.retryer.isTransportCancelable || this.abortSignalConsumed) {\n this.retryer.cancel({\n revert: true\n });\n } else {\n this.retryer.cancelRetry();\n }\n }\n\n if (this.cacheTime) {\n this.scheduleGc();\n } else {\n this.cache.remove(this);\n }\n }\n\n this.cache.notify({\n type: 'observerRemoved',\n query: this,\n observer: observer\n });\n }\n };\n\n _proto.getObserversCount = function getObserversCount() {\n return this.observers.length;\n };\n\n _proto.invalidate = function invalidate() {\n if (!this.state.isInvalidated) {\n this.dispatch({\n type: 'invalidate'\n });\n }\n };\n\n _proto.fetch = function fetch(options, fetchOptions) {\n var _this2 = this,\n _this$options$behavio,\n _context$fetchOptions,\n _abortController$abor;\n\n if (this.state.isFetching) {\n if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) {\n // Silently cancel current fetch if the user wants to cancel refetches\n this.cancel({\n silent: true\n });\n } else if (this.promise) {\n var _this$retryer4;\n\n // make sure that retries that were potentially cancelled due to unmounts can continue\n (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching\n\n return this.promise;\n }\n } // Update config if passed, otherwise the config from the last execution is used\n\n\n if (options) {\n this.setOptions(options);\n } // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n\n\n if (!this.options.queryFn) {\n var observer = this.observers.find(function (x) {\n return x.options.queryFn;\n });\n\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n\n var queryKey = ensureQueryKeyArray(this.queryKey);\n var abortController = getAbortController(); // Create query function context\n\n var queryFnContext = {\n queryKey: queryKey,\n pageParam: undefined,\n meta: this.meta\n };\n Object.defineProperty(queryFnContext, 'signal', {\n enumerable: true,\n get: function get() {\n if (abortController) {\n _this2.abortSignalConsumed = true;\n return abortController.signal;\n }\n\n return undefined;\n }\n }); // Create fetch function\n\n var fetchFn = function fetchFn() {\n if (!_this2.options.queryFn) {\n return Promise.reject('Missing queryFn');\n }\n\n _this2.abortSignalConsumed = false;\n return _this2.options.queryFn(queryFnContext);\n }; // Trigger behavior hook\n\n\n var context = {\n fetchOptions: fetchOptions,\n options: this.options,\n queryKey: queryKey,\n state: this.state,\n fetchFn: fetchFn,\n meta: this.meta\n };\n\n if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) {\n var _this$options$behavio2;\n\n (_this$options$behavio2 = this.options.behavior) == null ? void 0 : _this$options$behavio2.onFetch(context);\n } // Store state in case the current fetch needs to be reverted\n\n\n this.revertState = this.state; // Set to fetching state if not already in it\n\n if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {\n var _context$fetchOptions2;\n\n this.dispatch({\n type: 'fetch',\n meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta\n });\n } // Try to fetch the data\n\n\n this.retryer = new Retryer({\n fn: context.fetchFn,\n abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController),\n onSuccess: function onSuccess(data) {\n _this2.setData(data); // Notify cache callback\n\n\n _this2.cache.config.onSuccess == null ? void 0 : _this2.cache.config.onSuccess(data, _this2); // Remove query after fetching if cache time is 0\n\n if (_this2.cacheTime === 0) {\n _this2.optionalRemove();\n }\n },\n onError: function onError(error) {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n _this2.dispatch({\n type: 'error',\n error: error\n });\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n _this2.cache.config.onError == null ? void 0 : _this2.cache.config.onError(error, _this2); // Log error\n\n getLogger().error(error);\n } // Remove query after fetching if cache time is 0\n\n\n if (_this2.cacheTime === 0) {\n _this2.optionalRemove();\n }\n },\n onFail: function onFail() {\n _this2.dispatch({\n type: 'failed'\n });\n },\n onPause: function onPause() {\n _this2.dispatch({\n type: 'pause'\n });\n },\n onContinue: function onContinue() {\n _this2.dispatch({\n type: 'continue'\n });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay\n });\n this.promise = this.retryer.promise;\n return this.promise;\n };\n\n _proto.dispatch = function dispatch(action) {\n var _this3 = this;\n\n this.state = this.reducer(this.state, action);\n notifyManager.batch(function () {\n _this3.observers.forEach(function (observer) {\n observer.onQueryUpdate(action);\n });\n\n _this3.cache.notify({\n query: _this3,\n type: 'queryUpdated',\n action: action\n });\n });\n };\n\n _proto.getDefaultState = function getDefaultState(options) {\n var data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;\n var hasInitialData = typeof options.initialData !== 'undefined';\n var initialDataUpdatedAt = hasInitialData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n var hasData = typeof data !== 'undefined';\n return {\n data: data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchMeta: null,\n isFetching: false,\n isInvalidated: false,\n isPaused: false,\n status: hasData ? 'success' : 'idle'\n };\n };\n\n _proto.reducer = function reducer(state, action) {\n var _action$meta, _action$dataUpdatedAt;\n\n switch (action.type) {\n case 'failed':\n return _extends({}, state, {\n fetchFailureCount: state.fetchFailureCount + 1\n });\n\n case 'pause':\n return _extends({}, state, {\n isPaused: true\n });\n\n case 'continue':\n return _extends({}, state, {\n isPaused: false\n });\n\n case 'fetch':\n return _extends({}, state, {\n fetchFailureCount: 0,\n fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,\n isFetching: true,\n isPaused: false\n }, !state.dataUpdatedAt && {\n error: null,\n status: 'loading'\n });\n\n case 'success':\n return _extends({}, state, {\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),\n error: null,\n fetchFailureCount: 0,\n isFetching: false,\n isInvalidated: false,\n isPaused: false,\n status: 'success'\n });\n\n case 'error':\n var error = action.error;\n\n if (isCancelledError(error) && error.revert && this.revertState) {\n return _extends({}, this.revertState);\n }\n\n return _extends({}, state, {\n error: error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n isFetching: false,\n isPaused: false,\n status: 'error'\n });\n\n case 'invalidate':\n return _extends({}, state, {\n isInvalidated: true\n });\n\n case 'setState':\n return _extends({}, state, action.state);\n\n default:\n return state;\n }\n };\n\n return Query;\n}();","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { hashQueryKeyByOptions, matchQuery, parseFilterArgs } from './utils';\nimport { Query } from './query';\nimport { notifyManager } from './notifyManager';\nimport { Subscribable } from './subscribable';\n// CLASS\nexport var QueryCache = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(QueryCache, _Subscribable);\n\n function QueryCache(config) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.config = config || {};\n _this.queries = [];\n _this.queriesMap = {};\n return _this;\n }\n\n var _proto = QueryCache.prototype;\n\n _proto.build = function build(client, options, state) {\n var _options$queryHash;\n\n var queryKey = options.queryKey;\n var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options);\n var query = this.get(queryHash);\n\n if (!query) {\n query = new Query({\n cache: this,\n queryKey: queryKey,\n queryHash: queryHash,\n options: client.defaultQueryOptions(options),\n state: state,\n defaultOptions: client.getQueryDefaults(queryKey),\n meta: options.meta\n });\n this.add(query);\n }\n\n return query;\n };\n\n _proto.add = function add(query) {\n if (!this.queriesMap[query.queryHash]) {\n this.queriesMap[query.queryHash] = query;\n this.queries.push(query);\n this.notify({\n type: 'queryAdded',\n query: query\n });\n }\n };\n\n _proto.remove = function remove(query) {\n var queryInMap = this.queriesMap[query.queryHash];\n\n if (queryInMap) {\n query.destroy();\n this.queries = this.queries.filter(function (x) {\n return x !== query;\n });\n\n if (queryInMap === query) {\n delete this.queriesMap[query.queryHash];\n }\n\n this.notify({\n type: 'queryRemoved',\n query: query\n });\n }\n };\n\n _proto.clear = function clear() {\n var _this2 = this;\n\n notifyManager.batch(function () {\n _this2.queries.forEach(function (query) {\n _this2.remove(query);\n });\n });\n };\n\n _proto.get = function get(queryHash) {\n return this.queriesMap[queryHash];\n };\n\n _proto.getAll = function getAll() {\n return this.queries;\n };\n\n _proto.find = function find(arg1, arg2) {\n var _parseFilterArgs = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs[0];\n\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.queries.find(function (query) {\n return matchQuery(filters, query);\n });\n };\n\n _proto.findAll = function findAll(arg1, arg2) {\n var _parseFilterArgs2 = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs2[0];\n\n return Object.keys(filters).length > 0 ? this.queries.filter(function (query) {\n return matchQuery(filters, query);\n }) : this.queries;\n };\n\n _proto.notify = function notify(event) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(event);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n var _this4 = this;\n\n notifyManager.batch(function () {\n _this4.queries.forEach(function (query) {\n query.onFocus();\n });\n });\n };\n\n _proto.onOnline = function onOnline() {\n var _this5 = this;\n\n notifyManager.batch(function () {\n _this5.queries.forEach(function (query) {\n query.onOnline();\n });\n });\n };\n\n return QueryCache;\n}(Subscribable);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getLogger } from './logger';\nimport { notifyManager } from './notifyManager';\nimport { Retryer } from './retryer';\nimport { noop } from './utils'; // TYPES\n\n// CLASS\nexport var Mutation = /*#__PURE__*/function () {\n function Mutation(config) {\n this.options = _extends({}, config.defaultOptions, config.options);\n this.mutationId = config.mutationId;\n this.mutationCache = config.mutationCache;\n this.observers = [];\n this.state = config.state || getDefaultState();\n this.meta = config.meta;\n }\n\n var _proto = Mutation.prototype;\n\n _proto.setState = function setState(state) {\n this.dispatch({\n type: 'setState',\n state: state\n });\n };\n\n _proto.addObserver = function addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer);\n }\n };\n\n _proto.removeObserver = function removeObserver(observer) {\n this.observers = this.observers.filter(function (x) {\n return x !== observer;\n });\n };\n\n _proto.cancel = function cancel() {\n if (this.retryer) {\n this.retryer.cancel();\n return this.retryer.promise.then(noop).catch(noop);\n }\n\n return Promise.resolve();\n };\n\n _proto.continue = function _continue() {\n if (this.retryer) {\n this.retryer.continue();\n return this.retryer.promise;\n }\n\n return this.execute();\n };\n\n _proto.execute = function execute() {\n var _this = this;\n\n var data;\n var restored = this.state.status === 'loading';\n var promise = Promise.resolve();\n\n if (!restored) {\n this.dispatch({\n type: 'loading',\n variables: this.options.variables\n });\n promise = promise.then(function () {\n // Notify cache callback\n _this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this);\n }).then(function () {\n return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables);\n }).then(function (context) {\n if (context !== _this.state.context) {\n _this.dispatch({\n type: 'loading',\n context: context,\n variables: _this.state.variables\n });\n }\n });\n }\n\n return promise.then(function () {\n return _this.executeMutation();\n }).then(function (result) {\n data = result; // Notify cache callback\n\n _this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this);\n }).then(function () {\n return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'success',\n data: data\n });\n\n return data;\n }).catch(function (error) {\n // Notify cache callback\n _this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); // Log error\n\n getLogger().error(error);\n return Promise.resolve().then(function () {\n return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(undefined, error, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'error',\n error: error\n });\n\n throw error;\n });\n });\n };\n\n _proto.executeMutation = function executeMutation() {\n var _this2 = this,\n _this$options$retry;\n\n this.retryer = new Retryer({\n fn: function fn() {\n if (!_this2.options.mutationFn) {\n return Promise.reject('No mutationFn found');\n }\n\n return _this2.options.mutationFn(_this2.state.variables);\n },\n onFail: function onFail() {\n _this2.dispatch({\n type: 'failed'\n });\n },\n onPause: function onPause() {\n _this2.dispatch({\n type: 'pause'\n });\n },\n onContinue: function onContinue() {\n _this2.dispatch({\n type: 'continue'\n });\n },\n retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,\n retryDelay: this.options.retryDelay\n });\n return this.retryer.promise;\n };\n\n _proto.dispatch = function dispatch(action) {\n var _this3 = this;\n\n this.state = reducer(this.state, action);\n notifyManager.batch(function () {\n _this3.observers.forEach(function (observer) {\n observer.onMutationUpdate(action);\n });\n\n _this3.mutationCache.notify(_this3);\n });\n };\n\n return Mutation;\n}();\nexport function getDefaultState() {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isPaused: false,\n status: 'idle',\n variables: undefined\n };\n}\n\nfunction reducer(state, action) {\n switch (action.type) {\n case 'failed':\n return _extends({}, state, {\n failureCount: state.failureCount + 1\n });\n\n case 'pause':\n return _extends({}, state, {\n isPaused: true\n });\n\n case 'continue':\n return _extends({}, state, {\n isPaused: false\n });\n\n case 'loading':\n return _extends({}, state, {\n context: action.context,\n data: undefined,\n error: null,\n isPaused: false,\n status: 'loading',\n variables: action.variables\n });\n\n case 'success':\n return _extends({}, state, {\n data: action.data,\n error: null,\n status: 'success',\n isPaused: false\n });\n\n case 'error':\n return _extends({}, state, {\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n isPaused: false,\n status: 'error'\n });\n\n case 'setState':\n return _extends({}, state, action.state);\n\n default:\n return state;\n }\n}","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { notifyManager } from './notifyManager';\nimport { Mutation } from './mutation';\nimport { matchMutation, noop } from './utils';\nimport { Subscribable } from './subscribable'; // TYPES\n\n// CLASS\nexport var MutationCache = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(MutationCache, _Subscribable);\n\n function MutationCache(config) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.config = config || {};\n _this.mutations = [];\n _this.mutationId = 0;\n return _this;\n }\n\n var _proto = MutationCache.prototype;\n\n _proto.build = function build(client, options, state) {\n var mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.mutationId,\n options: client.defaultMutationOptions(options),\n state: state,\n defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined,\n meta: options.meta\n });\n this.add(mutation);\n return mutation;\n };\n\n _proto.add = function add(mutation) {\n this.mutations.push(mutation);\n this.notify(mutation);\n };\n\n _proto.remove = function remove(mutation) {\n this.mutations = this.mutations.filter(function (x) {\n return x !== mutation;\n });\n mutation.cancel();\n this.notify(mutation);\n };\n\n _proto.clear = function clear() {\n var _this2 = this;\n\n notifyManager.batch(function () {\n _this2.mutations.forEach(function (mutation) {\n _this2.remove(mutation);\n });\n });\n };\n\n _proto.getAll = function getAll() {\n return this.mutations;\n };\n\n _proto.find = function find(filters) {\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.mutations.find(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.findAll = function findAll(filters) {\n return this.mutations.filter(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.notify = function notify(mutation) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(mutation);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n this.resumePausedMutations();\n };\n\n _proto.onOnline = function onOnline() {\n this.resumePausedMutations();\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n var pausedMutations = this.mutations.filter(function (x) {\n return x.state.isPaused;\n });\n return notifyManager.batch(function () {\n return pausedMutations.reduce(function (promise, mutation) {\n return promise.then(function () {\n return mutation.continue().catch(noop);\n });\n }, Promise.resolve());\n });\n };\n\n return MutationCache;\n}(Subscribable);","import { isCancelable } from './retryer';\nimport { getAbortController } from './utils';\nexport function infiniteQueryBehavior() {\n return {\n onFetch: function onFetch(context) {\n context.fetchFn = function () {\n var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;\n\n var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;\n var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;\n var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;\n var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';\n var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';\n var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];\n var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];\n var abortController = getAbortController();\n var abortSignal = abortController == null ? void 0 : abortController.signal;\n var newPageParams = oldPageParams;\n var cancelled = false; // Get query function\n\n var queryFn = context.options.queryFn || function () {\n return Promise.reject('Missing queryFn');\n };\n\n var buildNewPages = function buildNewPages(pages, param, page, previous) {\n newPageParams = previous ? [param].concat(newPageParams) : [].concat(newPageParams, [param]);\n return previous ? [page].concat(pages) : [].concat(pages, [page]);\n }; // Create function to fetch a page\n\n\n var fetchPage = function fetchPage(pages, manual, param, previous) {\n if (cancelled) {\n return Promise.reject('Cancelled');\n }\n\n if (typeof param === 'undefined' && !manual && pages.length) {\n return Promise.resolve(pages);\n }\n\n var queryFnContext = {\n queryKey: context.queryKey,\n signal: abortSignal,\n pageParam: param,\n meta: context.meta\n };\n var queryFnResult = queryFn(queryFnContext);\n var promise = Promise.resolve(queryFnResult).then(function (page) {\n return buildNewPages(pages, param, page, previous);\n });\n\n if (isCancelable(queryFnResult)) {\n var promiseAsAny = promise;\n promiseAsAny.cancel = queryFnResult.cancel;\n }\n\n return promise;\n };\n\n var promise; // Fetch first page?\n\n if (!oldPages.length) {\n promise = fetchPage([]);\n } // Fetch next page?\n else if (isFetchingNextPage) {\n var manual = typeof pageParam !== 'undefined';\n var param = manual ? pageParam : getNextPageParam(context.options, oldPages);\n promise = fetchPage(oldPages, manual, param);\n } // Fetch previous page?\n else if (isFetchingPreviousPage) {\n var _manual = typeof pageParam !== 'undefined';\n\n var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages);\n\n promise = fetchPage(oldPages, _manual, _param, true);\n } // Refetch pages\n else {\n (function () {\n newPageParams = [];\n var manual = typeof context.options.getNextPageParam === 'undefined';\n var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page\n\n promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages\n\n var _loop = function _loop(i) {\n promise = promise.then(function (pages) {\n var shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;\n\n if (shouldFetchNextPage) {\n var _param2 = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);\n\n return fetchPage(pages, manual, _param2);\n }\n\n return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));\n });\n };\n\n for (var i = 1; i < oldPages.length; i++) {\n _loop(i);\n }\n })();\n }\n\n var finalPromise = promise.then(function (pages) {\n return {\n pages: pages,\n pageParams: newPageParams\n };\n });\n var finalPromiseAsAny = finalPromise;\n\n finalPromiseAsAny.cancel = function () {\n cancelled = true;\n abortController == null ? void 0 : abortController.abort();\n\n if (isCancelable(promise)) {\n promise.cancel();\n }\n };\n\n return finalPromise;\n };\n }\n };\n}\nexport function getNextPageParam(options, pages) {\n return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);\n}\nexport function getPreviousPageParam(options, pages) {\n return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);\n}\n/**\n * Checks if there is a next page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasNextPage(options, pages) {\n if (options.getNextPageParam && Array.isArray(pages)) {\n var nextPageParam = getNextPageParam(options, pages);\n return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;\n }\n}\n/**\n * Checks if there is a previous page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasPreviousPage(options, pages) {\n if (options.getPreviousPageParam && Array.isArray(pages)) {\n var previousPageParam = getPreviousPageParam(options, pages);\n return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { hashQueryKey, noop, parseFilterArgs, parseQueryArgs, partialMatchKey, hashQueryKeyByOptions } from './utils';\nimport { QueryCache } from './queryCache';\nimport { MutationCache } from './mutationCache';\nimport { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { notifyManager } from './notifyManager';\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior';\n// CLASS\nexport var QueryClient = /*#__PURE__*/function () {\n function QueryClient(config) {\n if (config === void 0) {\n config = {};\n }\n\n this.queryCache = config.queryCache || new QueryCache();\n this.mutationCache = config.mutationCache || new MutationCache();\n this.defaultOptions = config.defaultOptions || {};\n this.queryDefaults = [];\n this.mutationDefaults = [];\n }\n\n var _proto = QueryClient.prototype;\n\n _proto.mount = function mount() {\n var _this = this;\n\n this.unsubscribeFocus = focusManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onFocus();\n\n _this.queryCache.onFocus();\n }\n });\n this.unsubscribeOnline = onlineManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onOnline();\n\n _this.queryCache.onOnline();\n }\n });\n };\n\n _proto.unmount = function unmount() {\n var _this$unsubscribeFocu, _this$unsubscribeOnli;\n\n (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);\n (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);\n };\n\n _proto.isFetching = function isFetching(arg1, arg2) {\n var _parseFilterArgs = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs[0];\n\n filters.fetching = true;\n return this.queryCache.findAll(filters).length;\n };\n\n _proto.isMutating = function isMutating(filters) {\n return this.mutationCache.findAll(_extends({}, filters, {\n fetching: true\n })).length;\n };\n\n _proto.getQueryData = function getQueryData(queryKey, filters) {\n var _this$queryCache$find;\n\n return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;\n };\n\n _proto.getQueriesData = function getQueriesData(queryKeyOrFilters) {\n return this.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref) {\n var queryKey = _ref.queryKey,\n state = _ref.state;\n var data = state.data;\n return [queryKey, data];\n });\n };\n\n _proto.setQueryData = function setQueryData(queryKey, updater, options) {\n var parsedOptions = parseQueryArgs(queryKey);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions);\n return this.queryCache.build(this, defaultedOptions).setData(updater, options);\n };\n\n _proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) {\n var _this2 = this;\n\n return notifyManager.batch(function () {\n return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref2) {\n var queryKey = _ref2.queryKey;\n return [queryKey, _this2.setQueryData(queryKey, updater, options)];\n });\n });\n };\n\n _proto.getQueryState = function getQueryState(queryKey, filters) {\n var _this$queryCache$find2;\n\n return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;\n };\n\n _proto.removeQueries = function removeQueries(arg1, arg2) {\n var _parseFilterArgs2 = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs2[0];\n\n var queryCache = this.queryCache;\n notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n queryCache.remove(query);\n });\n });\n };\n\n _proto.resetQueries = function resetQueries(arg1, arg2, arg3) {\n var _this3 = this;\n\n var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs3[0],\n options = _parseFilterArgs3[1];\n\n var queryCache = this.queryCache;\n\n var refetchFilters = _extends({}, filters, {\n active: true\n });\n\n return notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n query.reset();\n });\n return _this3.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) {\n var _this4 = this;\n\n var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs4[0],\n _parseFilterArgs4$ = _parseFilterArgs4[1],\n cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$;\n\n if (typeof cancelOptions.revert === 'undefined') {\n cancelOptions.revert = true;\n }\n\n var promises = notifyManager.batch(function () {\n return _this4.queryCache.findAll(filters).map(function (query) {\n return query.cancel(cancelOptions);\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) {\n var _ref3,\n _filters$refetchActiv,\n _filters$refetchInact,\n _this5 = this;\n\n var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs5[0],\n options = _parseFilterArgs5[1];\n\n var refetchFilters = _extends({}, filters, {\n // if filters.refetchActive is not provided and filters.active is explicitly false,\n // e.g. invalidateQueries({ active: false }), we don't want to refetch active queries\n active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true,\n inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false\n });\n\n return notifyManager.batch(function () {\n _this5.queryCache.findAll(filters).forEach(function (query) {\n query.invalidate();\n });\n\n return _this5.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) {\n var _this6 = this;\n\n var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs6[0],\n options = _parseFilterArgs6[1];\n\n var promises = notifyManager.batch(function () {\n return _this6.queryCache.findAll(filters).map(function (query) {\n return query.fetch(undefined, _extends({}, options, {\n meta: {\n refetchPage: filters == null ? void 0 : filters.refetchPage\n }\n }));\n });\n });\n var promise = Promise.all(promises).then(noop);\n\n if (!(options == null ? void 0 : options.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652\n\n if (typeof defaultedOptions.retry === 'undefined') {\n defaultedOptions.retry = false;\n }\n\n var query = this.queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n };\n\n _proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) {\n return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n parsedOptions.behavior = infiniteQueryBehavior();\n return this.fetchQuery(parsedOptions);\n };\n\n _proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) {\n return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.cancelMutations = function cancelMutations() {\n var _this7 = this;\n\n var promises = notifyManager.batch(function () {\n return _this7.mutationCache.getAll().map(function (mutation) {\n return mutation.cancel();\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n return this.getMutationCache().resumePausedMutations();\n };\n\n _proto.executeMutation = function executeMutation(options) {\n return this.mutationCache.build(this, options).execute();\n };\n\n _proto.getQueryCache = function getQueryCache() {\n return this.queryCache;\n };\n\n _proto.getMutationCache = function getMutationCache() {\n return this.mutationCache;\n };\n\n _proto.getDefaultOptions = function getDefaultOptions() {\n return this.defaultOptions;\n };\n\n _proto.setDefaultOptions = function setDefaultOptions(options) {\n this.defaultOptions = options;\n };\n\n _proto.setQueryDefaults = function setQueryDefaults(queryKey, options) {\n var result = this.queryDefaults.find(function (x) {\n return hashQueryKey(queryKey) === hashQueryKey(x.queryKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.queryDefaults.push({\n queryKey: queryKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getQueryDefaults = function getQueryDefaults(queryKey) {\n var _this$queryDefaults$f;\n\n return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function (x) {\n return partialMatchKey(queryKey, x.queryKey);\n })) == null ? void 0 : _this$queryDefaults$f.defaultOptions : undefined;\n };\n\n _proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) {\n var result = this.mutationDefaults.find(function (x) {\n return hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.mutationDefaults.push({\n mutationKey: mutationKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getMutationDefaults = function getMutationDefaults(mutationKey) {\n var _this$mutationDefault;\n\n return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function (x) {\n return partialMatchKey(mutationKey, x.mutationKey);\n })) == null ? void 0 : _this$mutationDefault.defaultOptions : undefined;\n };\n\n _proto.defaultQueryOptions = function defaultQueryOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n var defaultedOptions = _extends({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, {\n _defaulted: true\n });\n\n if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n }\n\n return defaultedOptions;\n };\n\n _proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) {\n return this.defaultQueryOptions(options);\n };\n\n _proto.defaultMutationOptions = function defaultMutationOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n return _extends({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, {\n _defaulted: true\n });\n };\n\n _proto.clear = function clear() {\n this.queryCache.clear();\n this.mutationCache.clear();\n };\n\n return QueryClient;\n}();","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { isServer, isValidTimeout, noop, replaceEqualDeep, shallowEqualObjects, timeUntilStale } from './utils';\nimport { notifyManager } from './notifyManager';\nimport { focusManager } from './focusManager';\nimport { Subscribable } from './subscribable';\nimport { getLogger } from './logger';\nimport { isCancelledError } from './retryer';\nexport var QueryObserver = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(QueryObserver, _Subscribable);\n\n function QueryObserver(client, options) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.client = client;\n _this.options = options;\n _this.trackedProps = [];\n _this.selectError = null;\n\n _this.bindMethods();\n\n _this.setOptions(options);\n\n return _this;\n }\n\n var _proto = QueryObserver.prototype;\n\n _proto.bindMethods = function bindMethods() {\n this.remove = this.remove.bind(this);\n this.refetch = this.refetch.bind(this);\n };\n\n _proto.onSubscribe = function onSubscribe() {\n if (this.listeners.length === 1) {\n this.currentQuery.addObserver(this);\n\n if (shouldFetchOnMount(this.currentQuery, this.options)) {\n this.executeFetch();\n }\n\n this.updateTimers();\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.listeners.length) {\n this.destroy();\n }\n };\n\n _proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() {\n return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect);\n };\n\n _proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() {\n return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus);\n };\n\n _proto.destroy = function destroy() {\n this.listeners = [];\n this.clearTimers();\n this.currentQuery.removeObserver(this);\n };\n\n _proto.setOptions = function setOptions(options, notifyOptions) {\n var prevOptions = this.options;\n var prevQuery = this.currentQuery;\n this.options = this.client.defaultQueryObserverOptions(options);\n\n if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') {\n throw new Error('Expected enabled to be a boolean');\n } // Keep previous query key if the user does not supply one\n\n\n if (!this.options.queryKey) {\n this.options.queryKey = prevOptions.queryKey;\n }\n\n this.updateQuery();\n var mounted = this.hasListeners(); // Fetch if there are subscribers\n\n if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) {\n this.executeFetch();\n } // Update result\n\n\n this.updateResult(notifyOptions); // Update stale interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.updateStaleTimeout();\n }\n\n var nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) {\n this.updateRefetchInterval(nextRefetchInterval);\n }\n };\n\n _proto.getOptimisticResult = function getOptimisticResult(options) {\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return this.createResult(query, defaultedOptions);\n };\n\n _proto.getCurrentResult = function getCurrentResult() {\n return this.currentResult;\n };\n\n _proto.trackResult = function trackResult(result, defaultedOptions) {\n var _this2 = this;\n\n var trackedResult = {};\n\n var trackProp = function trackProp(key) {\n if (!_this2.trackedProps.includes(key)) {\n _this2.trackedProps.push(key);\n }\n };\n\n Object.keys(result).forEach(function (key) {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: function get() {\n trackProp(key);\n return result[key];\n }\n });\n });\n\n if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) {\n trackProp('error');\n }\n\n return trackedResult;\n };\n\n _proto.getNextResult = function getNextResult(options) {\n var _this3 = this;\n\n return new Promise(function (resolve, reject) {\n var unsubscribe = _this3.subscribe(function (result) {\n if (!result.isFetching) {\n unsubscribe();\n\n if (result.isError && (options == null ? void 0 : options.throwOnError)) {\n reject(result.error);\n } else {\n resolve(result);\n }\n }\n });\n });\n };\n\n _proto.getCurrentQuery = function getCurrentQuery() {\n return this.currentQuery;\n };\n\n _proto.remove = function remove() {\n this.client.getQueryCache().remove(this.currentQuery);\n };\n\n _proto.refetch = function refetch(options) {\n return this.fetch(_extends({}, options, {\n meta: {\n refetchPage: options == null ? void 0 : options.refetchPage\n }\n }));\n };\n\n _proto.fetchOptimistic = function fetchOptimistic(options) {\n var _this4 = this;\n\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return query.fetch().then(function () {\n return _this4.createResult(query, defaultedOptions);\n });\n };\n\n _proto.fetch = function fetch(fetchOptions) {\n var _this5 = this;\n\n return this.executeFetch(fetchOptions).then(function () {\n _this5.updateResult();\n\n return _this5.currentResult;\n });\n };\n\n _proto.executeFetch = function executeFetch(fetchOptions) {\n // Make sure we reference the latest query as the current one might have been removed\n this.updateQuery(); // Fetch\n\n var promise = this.currentQuery.fetch(this.options, fetchOptions);\n\n if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.updateStaleTimeout = function updateStaleTimeout() {\n var _this6 = this;\n\n this.clearStaleTimeout();\n\n if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n\n var time = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n\n var timeout = time + 1;\n this.staleTimeoutId = setTimeout(function () {\n if (!_this6.currentResult.isStale) {\n _this6.updateResult();\n }\n }, timeout);\n };\n\n _proto.computeRefetchInterval = function computeRefetchInterval() {\n var _this$options$refetch;\n\n return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;\n };\n\n _proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) {\n var _this7 = this;\n\n this.clearRefetchInterval();\n this.currentRefetchInterval = nextInterval;\n\n if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) {\n return;\n }\n\n this.refetchIntervalId = setInterval(function () {\n if (_this7.options.refetchIntervalInBackground || focusManager.isFocused()) {\n _this7.executeFetch();\n }\n }, this.currentRefetchInterval);\n };\n\n _proto.updateTimers = function updateTimers() {\n this.updateStaleTimeout();\n this.updateRefetchInterval(this.computeRefetchInterval());\n };\n\n _proto.clearTimers = function clearTimers() {\n this.clearStaleTimeout();\n this.clearRefetchInterval();\n };\n\n _proto.clearStaleTimeout = function clearStaleTimeout() {\n if (this.staleTimeoutId) {\n clearTimeout(this.staleTimeoutId);\n this.staleTimeoutId = undefined;\n }\n };\n\n _proto.clearRefetchInterval = function clearRefetchInterval() {\n if (this.refetchIntervalId) {\n clearInterval(this.refetchIntervalId);\n this.refetchIntervalId = undefined;\n }\n };\n\n _proto.createResult = function createResult(query, options) {\n var prevQuery = this.currentQuery;\n var prevOptions = this.options;\n var prevResult = this.currentResult;\n var prevResultState = this.currentResultState;\n var prevResultOptions = this.currentResultOptions;\n var queryChange = query !== prevQuery;\n var queryInitialState = queryChange ? query.state : this.currentQueryInitialState;\n var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult;\n var state = query.state;\n var dataUpdatedAt = state.dataUpdatedAt,\n error = state.error,\n errorUpdatedAt = state.errorUpdatedAt,\n isFetching = state.isFetching,\n status = state.status;\n var isPreviousData = false;\n var isPlaceholderData = false;\n var data; // Optimistically set result in fetching state if needed\n\n if (options.optimisticResults) {\n var mounted = this.hasListeners();\n var fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\n if (fetchOnMount || fetchOptionally) {\n isFetching = true;\n\n if (!dataUpdatedAt) {\n status = 'loading';\n }\n }\n } // Keep previous data if needed\n\n\n if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== 'error') {\n data = prevQueryResult.data;\n dataUpdatedAt = prevQueryResult.dataUpdatedAt;\n status = prevQueryResult.status;\n isPreviousData = true;\n } // Select data if needed\n else if (options.select && typeof state.data !== 'undefined') {\n // Memoize select result\n if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) {\n data = this.selectResult;\n } else {\n try {\n this.selectFn = options.select;\n data = options.select(state.data);\n\n if (options.structuralSharing !== false) {\n data = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, data);\n }\n\n this.selectResult = data;\n this.selectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n this.selectError = selectError;\n }\n }\n } // Use query data\n else {\n data = state.data;\n } // Show placeholder data if needed\n\n\n if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && (status === 'loading' || status === 'idle')) {\n var placeholderData; // Memoize placeholder data\n\n if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData;\n\n if (options.select && typeof placeholderData !== 'undefined') {\n try {\n placeholderData = options.select(placeholderData);\n\n if (options.structuralSharing !== false) {\n placeholderData = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, placeholderData);\n }\n\n this.selectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n this.selectError = selectError;\n }\n }\n }\n\n if (typeof placeholderData !== 'undefined') {\n status = 'success';\n data = placeholderData;\n isPlaceholderData = true;\n }\n }\n\n if (this.selectError) {\n error = this.selectError;\n data = this.selectResult;\n errorUpdatedAt = Date.now();\n status = 'error';\n }\n\n var result = {\n status: status,\n isLoading: status === 'loading',\n isSuccess: status === 'success',\n isError: status === 'error',\n isIdle: status === 'idle',\n data: data,\n dataUpdatedAt: dataUpdatedAt,\n error: error,\n errorUpdatedAt: errorUpdatedAt,\n failureCount: state.fetchFailureCount,\n errorUpdateCount: state.errorUpdateCount,\n isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,\n isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching: isFetching,\n isRefetching: isFetching && status !== 'loading',\n isLoadingError: status === 'error' && state.dataUpdatedAt === 0,\n isPlaceholderData: isPlaceholderData,\n isPreviousData: isPreviousData,\n isRefetchError: status === 'error' && state.dataUpdatedAt !== 0,\n isStale: isStale(query, options),\n refetch: this.refetch,\n remove: this.remove\n };\n return result;\n };\n\n _proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) {\n if (!prevResult) {\n return true;\n }\n\n var _this$options = this.options,\n notifyOnChangeProps = _this$options.notifyOnChangeProps,\n notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions;\n\n if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) {\n return true;\n }\n\n if (notifyOnChangeProps === 'tracked' && !this.trackedProps.length) {\n return true;\n }\n\n var includedProps = notifyOnChangeProps === 'tracked' ? this.trackedProps : notifyOnChangeProps;\n return Object.keys(result).some(function (key) {\n var typedKey = key;\n var changed = result[typedKey] !== prevResult[typedKey];\n var isIncluded = includedProps == null ? void 0 : includedProps.some(function (x) {\n return x === key;\n });\n var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function (x) {\n return x === key;\n });\n return changed && !isExcluded && (!includedProps || isIncluded);\n });\n };\n\n _proto.updateResult = function updateResult(notifyOptions) {\n var prevResult = this.currentResult;\n this.currentResult = this.createResult(this.currentQuery, this.options);\n this.currentResultState = this.currentQuery.state;\n this.currentResultOptions = this.options; // Only notify if something has changed\n\n if (shallowEqualObjects(this.currentResult, prevResult)) {\n return;\n } // Determine which callbacks to trigger\n\n\n var defaultNotifyOptions = {\n cache: true\n };\n\n if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) {\n defaultNotifyOptions.listeners = true;\n }\n\n this.notify(_extends({}, defaultNotifyOptions, notifyOptions));\n };\n\n _proto.updateQuery = function updateQuery() {\n var query = this.client.getQueryCache().build(this.client, this.options);\n\n if (query === this.currentQuery) {\n return;\n }\n\n var prevQuery = this.currentQuery;\n this.currentQuery = query;\n this.currentQueryInitialState = query.state;\n this.previousQueryResult = this.currentResult;\n\n if (this.hasListeners()) {\n prevQuery == null ? void 0 : prevQuery.removeObserver(this);\n query.addObserver(this);\n }\n };\n\n _proto.onQueryUpdate = function onQueryUpdate(action) {\n var notifyOptions = {};\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = true;\n } else if (action.type === 'error' && !isCancelledError(action.error)) {\n notifyOptions.onError = true;\n }\n\n this.updateResult(notifyOptions);\n\n if (this.hasListeners()) {\n this.updateTimers();\n }\n };\n\n _proto.notify = function notify(notifyOptions) {\n var _this8 = this;\n\n notifyManager.batch(function () {\n // First trigger the configuration callbacks\n if (notifyOptions.onSuccess) {\n _this8.options.onSuccess == null ? void 0 : _this8.options.onSuccess(_this8.currentResult.data);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(_this8.currentResult.data, null);\n } else if (notifyOptions.onError) {\n _this8.options.onError == null ? void 0 : _this8.options.onError(_this8.currentResult.error);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(undefined, _this8.currentResult.error);\n } // Then trigger the listeners\n\n\n if (notifyOptions.listeners) {\n _this8.listeners.forEach(function (listener) {\n listener(_this8.currentResult);\n });\n } // Then the cache listeners\n\n\n if (notifyOptions.cache) {\n _this8.client.getQueryCache().notify({\n query: _this8.currentQuery,\n type: 'observerResultsUpdated'\n });\n }\n });\n };\n\n return QueryObserver;\n}(Subscribable);\n\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false);\n}\n\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\n\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n var value = typeof field === 'function' ? field(query) : field;\n return value === 'always' || value !== false && isStale(query, options);\n }\n\n return false;\n}\n\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error') && isStale(query, options);\n}\n\nfunction isStale(query, options) {\n return query.isStaleByTime(options.staleTime);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { getDefaultState } from './mutation';\nimport { notifyManager } from './notifyManager';\nimport { Subscribable } from './subscribable';\n// CLASS\nexport var MutationObserver = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(MutationObserver, _Subscribable);\n\n function MutationObserver(client, options) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.client = client;\n\n _this.setOptions(options);\n\n _this.bindMethods();\n\n _this.updateResult();\n\n return _this;\n }\n\n var _proto = MutationObserver.prototype;\n\n _proto.bindMethods = function bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n };\n\n _proto.setOptions = function setOptions(options) {\n this.options = this.client.defaultMutationOptions(options);\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.listeners.length) {\n var _this$currentMutation;\n\n (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.removeObserver(this);\n }\n };\n\n _proto.onMutationUpdate = function onMutationUpdate(action) {\n this.updateResult(); // Determine which callbacks to trigger\n\n var notifyOptions = {\n listeners: true\n };\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = true;\n } else if (action.type === 'error') {\n notifyOptions.onError = true;\n }\n\n this.notify(notifyOptions);\n };\n\n _proto.getCurrentResult = function getCurrentResult() {\n return this.currentResult;\n };\n\n _proto.reset = function reset() {\n this.currentMutation = undefined;\n this.updateResult();\n this.notify({\n listeners: true\n });\n };\n\n _proto.mutate = function mutate(variables, options) {\n this.mutateOptions = options;\n\n if (this.currentMutation) {\n this.currentMutation.removeObserver(this);\n }\n\n this.currentMutation = this.client.getMutationCache().build(this.client, _extends({}, this.options, {\n variables: typeof variables !== 'undefined' ? variables : this.options.variables\n }));\n this.currentMutation.addObserver(this);\n return this.currentMutation.execute();\n };\n\n _proto.updateResult = function updateResult() {\n var state = this.currentMutation ? this.currentMutation.state : getDefaultState();\n\n var result = _extends({}, state, {\n isLoading: state.status === 'loading',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset\n });\n\n this.currentResult = result;\n };\n\n _proto.notify = function notify(options) {\n var _this2 = this;\n\n notifyManager.batch(function () {\n // First trigger the mutate callbacks\n if (_this2.mutateOptions) {\n if (options.onSuccess) {\n _this2.mutateOptions.onSuccess == null ? void 0 : _this2.mutateOptions.onSuccess(_this2.currentResult.data, _this2.currentResult.variables, _this2.currentResult.context);\n _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(_this2.currentResult.data, null, _this2.currentResult.variables, _this2.currentResult.context);\n } else if (options.onError) {\n _this2.mutateOptions.onError == null ? void 0 : _this2.mutateOptions.onError(_this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context);\n _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(undefined, _this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context);\n }\n } // Then trigger the listeners\n\n\n if (options.listeners) {\n _this2.listeners.forEach(function (listener) {\n listener(_this2.currentResult);\n });\n }\n });\n };\n\n return MutationObserver;\n}(Subscribable);","import ReactDOM from 'react-dom';\nexport var unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates;","import { notifyManager } from '../core';\nimport { unstable_batchedUpdates } from './reactBatchedUpdates';\nnotifyManager.setBatchNotifyFunction(unstable_batchedUpdates);","export var logger = console;","import { setLogger } from '../core';\nimport { logger } from './logger';\nsetLogger(logger);","import React from 'react';\nvar defaultContext = /*#__PURE__*/React.createContext(undefined);\nvar QueryClientSharingContext = /*#__PURE__*/React.createContext(false); // if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\n\nfunction getQueryClientContext(contextSharing) {\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext;\n }\n\n return window.ReactQueryClientContext;\n }\n\n return defaultContext;\n}\n\nexport var useQueryClient = function useQueryClient() {\n var queryClient = React.useContext(getQueryClientContext(React.useContext(QueryClientSharingContext)));\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one');\n }\n\n return queryClient;\n};\nexport var QueryClientProvider = function QueryClientProvider(_ref) {\n var client = _ref.client,\n _ref$contextSharing = _ref.contextSharing,\n contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing,\n children = _ref.children;\n React.useEffect(function () {\n client.mount();\n return function () {\n client.unmount();\n };\n }, [client]);\n var Context = getQueryClientContext(contextSharing);\n return /*#__PURE__*/React.createElement(QueryClientSharingContext.Provider, {\n value: contextSharing\n }, /*#__PURE__*/React.createElement(Context.Provider, {\n value: client\n }, children));\n};","import React from 'react'; // CONTEXT\n\nfunction createValue() {\n var _isReset = false;\n return {\n clearReset: function clearReset() {\n _isReset = false;\n },\n reset: function reset() {\n _isReset = true;\n },\n isReset: function isReset() {\n return _isReset;\n }\n };\n}\n\nvar QueryErrorResetBoundaryContext = /*#__PURE__*/React.createContext(createValue()); // HOOK\n\nexport var useQueryErrorResetBoundary = function useQueryErrorResetBoundary() {\n return React.useContext(QueryErrorResetBoundaryContext);\n}; // COMPONENT\n\nexport var QueryErrorResetBoundary = function QueryErrorResetBoundary(_ref) {\n var children = _ref.children;\n var value = React.useMemo(function () {\n return createValue();\n }, []);\n return /*#__PURE__*/React.createElement(QueryErrorResetBoundaryContext.Provider, {\n value: value\n }, typeof children === 'function' ? children(value) : children);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { notifyManager } from '../core/notifyManager';\nimport { noop, parseMutationArgs } from '../core/utils';\nimport { MutationObserver } from '../core/mutationObserver';\nimport { useQueryClient } from './QueryClientProvider';\nimport { shouldThrowError } from './utils'; // HOOK\n\nexport function useMutation(arg1, arg2, arg3) {\n var mountedRef = React.useRef(false);\n\n var _React$useState = React.useState(0),\n forceUpdate = _React$useState[1];\n\n var options = parseMutationArgs(arg1, arg2, arg3);\n var queryClient = useQueryClient();\n var obsRef = React.useRef();\n\n if (!obsRef.current) {\n obsRef.current = new MutationObserver(queryClient, options);\n } else {\n obsRef.current.setOptions(options);\n }\n\n var currentResult = obsRef.current.getCurrentResult();\n React.useEffect(function () {\n mountedRef.current = true;\n var unsubscribe = obsRef.current.subscribe(notifyManager.batchCalls(function () {\n if (mountedRef.current) {\n forceUpdate(function (x) {\n return x + 1;\n });\n }\n }));\n return function () {\n mountedRef.current = false;\n unsubscribe();\n };\n }, []);\n var mutate = React.useCallback(function (variables, mutateOptions) {\n obsRef.current.mutate(variables, mutateOptions).catch(noop);\n }, []);\n\n if (currentResult.error && shouldThrowError(undefined, obsRef.current.options.useErrorBoundary, [currentResult.error])) {\n throw currentResult.error;\n }\n\n return _extends({}, currentResult, {\n mutate: mutate,\n mutateAsync: currentResult.mutate\n });\n}","export function shouldThrowError(suspense, _useErrorBoundary, params) {\n // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n if (typeof _useErrorBoundary === 'function') {\n return _useErrorBoundary.apply(void 0, params);\n } // Allow useErrorBoundary to override suspense's throwing behavior\n\n\n if (typeof _useErrorBoundary === 'boolean') return _useErrorBoundary; // If suspense is enabled default to throwing errors\n\n return !!suspense;\n}","import React from 'react';\nimport { notifyManager } from '../core/notifyManager';\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary';\nimport { useQueryClient } from './QueryClientProvider';\nimport { shouldThrowError } from './utils';\nexport function useBaseQuery(options, Observer) {\n var mountedRef = React.useRef(false);\n\n var _React$useState = React.useState(0),\n forceUpdate = _React$useState[1];\n\n var queryClient = useQueryClient();\n var errorResetBoundary = useQueryErrorResetBoundary();\n var defaultedOptions = queryClient.defaultQueryObserverOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options\n\n defaultedOptions.optimisticResults = true; // Include callbacks in batch renders\n\n if (defaultedOptions.onError) {\n defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError);\n }\n\n if (defaultedOptions.onSuccess) {\n defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess);\n }\n\n if (defaultedOptions.onSettled) {\n defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled);\n }\n\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000;\n } // Set cache time to 1 if the option has been set to 0\n // when using suspense to prevent infinite loop of fetches\n\n\n if (defaultedOptions.cacheTime === 0) {\n defaultedOptions.cacheTime = 1;\n }\n }\n\n if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n defaultedOptions.retryOnMount = false;\n }\n }\n\n var _React$useState2 = React.useState(function () {\n return new Observer(queryClient, defaultedOptions);\n }),\n observer = _React$useState2[0];\n\n var result = observer.getOptimisticResult(defaultedOptions);\n React.useEffect(function () {\n mountedRef.current = true;\n errorResetBoundary.clearReset();\n var unsubscribe = observer.subscribe(notifyManager.batchCalls(function () {\n if (mountedRef.current) {\n forceUpdate(function (x) {\n return x + 1;\n });\n }\n })); // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n\n observer.updateResult();\n return function () {\n mountedRef.current = false;\n unsubscribe();\n };\n }, [errorResetBoundary, observer]);\n React.useEffect(function () {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setOptions(defaultedOptions, {\n listeners: false\n });\n }, [defaultedOptions, observer]); // Handle suspense\n\n if (defaultedOptions.suspense && result.isLoading) {\n throw observer.fetchOptimistic(defaultedOptions).then(function (_ref) {\n var data = _ref.data;\n defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null);\n }).catch(function (error) {\n errorResetBoundary.clearReset();\n defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error);\n });\n } // Handle error boundary\n\n\n if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, [result.error, observer.getCurrentQuery()])) {\n throw result.error;\n } // Handle result property usage tracking\n\n\n if (defaultedOptions.notifyOnChangeProps === 'tracked') {\n result = observer.trackResult(result, defaultedOptions);\n }\n\n return result;\n}","import { QueryObserver } from '../core';\nimport { parseQueryArgs } from '../core/utils';\nimport { useBaseQuery } from './useBaseQuery'; // HOOK\n\nexport function useQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n return useBaseQuery(parsedOptions, QueryObserver);\n}","import axios, { AxiosRequestConfig } from \"axios\";\nimport { QueryClient } from \"react-query\";\n\nconst instance = axios.create();\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n suspense: true,\n refetchOnWindowFocus: false,\n cacheTime: Infinity,\n },\n },\n});\n\nasync function fetcher(url: string, config: AxiosRequestConfig = {}) {\n try {\n const response = await instance({\n url,\n withCredentials: true,\n ...config,\n });\n return response.data;\n } catch (error: any) {\n throw Error(error);\n }\n}\n\nexport { queryClient, fetcher, instance };","import { useMutation, useQuery, useQueryClient } from \"react-query\";\nimport { ImageTag, LibraryImage } from \"../types/types\";\nimport { fetcher } from \"@thelia/fetcher\";\n\nexport function useLibraryImage(options: {\n id?: number | null;\n limit?: number | null;\n offset?: number;\n title?: string | null;\n tagId?: number | null;\n}) {\n return useQuery(\n [\"LibraryImage\", options],\n () =>\n fetcher(`/open_api/library/image`, {\n method: \"GET\",\n params: {\n id: options.id || null,\n limit: options.limit || 5,\n offset: options.offset || 0,\n title: options.title || null,\n tagId: options.tagId || null,\n },\n }),\n {\n keepPreviousData: true,\n onSuccess: (data: LibraryImage[]) => {},\n }\n );\n}\n\nexport function useLibraryImageById(id: number | null) {\n return useQuery(\n [\"LibraryImage\", id],\n () =>\n fetcher(`/open_api/library/image`, {\n method: \"GET\",\n params: {\n id: id || null,\n },\n }),\n {\n enabled: !!id,\n }\n );\n}\n\nexport function useCreateImage() {\n const queryClient = useQueryClient();\n return useMutation<\n LibraryImage,\n {\n message: string;\n statusCode: number;\n statusText: string;\n },\n FormData\n >(\n (data) => {\n return fetcher(`/open_api/library/image`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"multipart/form-data\",\n },\n data,\n });\n },\n {\n onSuccess: (data) => {\n queryClient.setQueryData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return [...oldData, data];\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useDeleteImage() {\n const queryClient = useQueryClient();\n return useMutation(\n (id: LibraryImage[\"id\"]) => {\n return fetcher(`/open_api/library/image/${id}`, {\n method: \"DELETE\",\n });\n },\n {\n onSuccess: (_, id) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.filter((i) => i.id !== id);\n }\n\n return oldData;\n });\n },\n }\n );\n}\nexport function useUpdateImage() {\n const queryClient = useQueryClient();\n return useMutation(\n (id: LibraryImage[\"id\"]) => {\n return fetcher(`/open_api/library/image/${id}`, {\n method: \"POST\",\n });\n },\n {\n onSuccess: (data, id) => {\n queryClient.setQueryData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((i) => (i.id === id ? data : i));\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useGetTags() {\n return useQuery(\n [\"LibraryTag\"],\n () =>\n fetcher(`/open_api/library/tag`, {\n method: \"GET\",\n }),\n {\n keepPreviousData: true,\n onSuccess: (data: ImageTag[\"tag\"][]) => {},\n }\n );\n}\n\nexport function useDeleteTagAssociation() {\n const queryClient = useQueryClient();\n\n return useMutation(\n (id: ImageTag[\"tag\"][\"id\"]) => {\n return fetcher(`/open_api/library/image_tag/${id}`, {\n method: \"DELETE\",\n });\n },\n {\n onSuccess: (data, id) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((image) => {\n if (image.tags && image.tags.length) {\n return {\n ...image,\n tags: image.tags.filter(\n ({ imageTag }: { imageTag: ImageTag[\"imageTag\"] }) =>\n imageTag.id !== id\n ),\n };\n }\n return image;\n });\n }\n\n return oldData;\n });\n },\n }\n );\n}\n\nexport function useAssociateTag() {\n const queryClient = useQueryClient();\n\n return useMutation(\n (data: { imageId: number | null; tagId: number }) => {\n return fetcher(`/open_api/library/image_tag`, {\n method: \"POST\",\n data,\n });\n },\n {\n onSuccess: (data: any) => {\n queryClient.setQueriesData([\"LibraryImage\"], (oldData: any) => {\n if (oldData && Array.isArray(oldData)) {\n return oldData.map((image) => {\n if (image.id === data.imageTag.imageId) {\n return {\n ...image,\n tags: [...image.tags, data],\n };\n }\n\n return image;\n });\n }\n\n return oldData;\n });\n },\n }\n );\n}\n","import * as React from \"react\";\n\nconst SvgXmark = props => ;\n\nexport { SvgXmark as ReactComponent };","import * as React from \"react\";\n\nconst SvgTrash = props => ;\n\nexport { SvgTrash as ReactComponent };","import * as React from \"react\";\n\nconst SvgTagXmark = props => ;\n\nexport { SvgTagXmark as ReactComponent };","import {\n useAssociateTag,\n useDeleteImage,\n useDeleteTagAssociation,\n useGetTags,\n useLibraryImage,\n} from \"../utils/queries\";\nimport { ReactComponent as XMarkIcon } from \"./assets/xmark.svg\";\nimport { ReactComponent as TrashIcon } from \"./assets/trash.svg\";\nimport { ReactComponent as TagXMarkIcon } from \"./assets/tag-xmark.svg\";\nimport ReactModal from \"react-modal\";\nimport { ImageTag, LibraryImage as LibraryImageType } from \"../types/types\";\nimport { Suspense, useState } from \"react\";\nimport { IntlProvider, useIntl } from \"react-intl\";\nimport Input from \"../Input\";\nimport ErrorBoundary from \"../ErrorBoundary\";\nimport { locale, messages } from \"../utils/intl\";\nimport { QueryClientProvider } from \"react-query\";\nimport { queryClient } from \"@thelia/fetcher\";\nimport \"./Library.css\";\n\nconst TagsList = ({\n currentTags,\n onUpdate,\n}: {\n currentTags: ImageTag[];\n onUpdate: Function;\n}) => {\n const { data } = useGetTags();\n\n const tags =\n data?.filter(\n (tagFromServer) =>\n !currentTags.find(\n ({ tag }: { tag: ImageTag[\"tag\"] }) => tag.id === tagFromServer.id\n )\n ) || [];\n\n return (\n
    \n {tags?.length > 0 ? (\n tags.map((tag) => (\n {\n onUpdate(tag);\n }}\n className=\"TagList__Item\"\n >\n {tag.title}\n \n ))\n ) : (\n
  • \n No tags available.\n
  • \n )}\n
\n );\n};\n\nconst TagConfigurationModal = ({\n isOpen,\n setIsOpen,\n image,\n}: {\n isOpen: boolean;\n setIsOpen: Function;\n image: LibraryImageType;\n}) => {\n const [showTags, setShowTags] = useState(false);\n\n const intl = useIntl();\n\n const deleteTagAssociation = useDeleteTagAssociation();\n const associateTag = useAssociateTag();\n\n return (\n {\n setIsOpen(false);\n }}\n className=\"Modal-Tags\"\n overlayClassName=\"Overlay\"\n >\n
\n
\n {\n setIsOpen(false);\n }}\n className=\"Modal__Header__Close\"\n >\n \n \n\n
\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_IMAGE_TAG_CONFIG\" })}{\" \"}\n {image.title}\n
\n
\n\n
\n
\n \n
\n \n {image.tags.length\n ? image.tags.map(({ tag, imageTag }: ImageTag) => (\n
\n {tag.title}\n deleteTagAssociation.mutate(imageTag.id || 57)}\n >\n \n \n
\n ))\n : !associateTag.isLoading\n ? intl.formatMessage({ id: \"BlockImage__LIBRARY_IMAGE_SELECT_TAG\" })\n : null}\n\n {associateTag.isLoading && (\n
\n \n \n \n
\n )}\n
\n setShowTags(!showTags)}\n disabled={associateTag.isLoading || deleteTagAssociation.isLoading}\n >\n \n \n {showTags ? (\n \n \n
\n }\n >\n {\n associateTag.mutate({ imageId: image.id, tagId: selectedTag.id });\n setShowTags(false);\n }}\n />\n \n ) : null}\n
\n
\n \n \n \n );\n};\n\nconst TagFilterOptions = () => {\n const intl = useIntl();\n\n const { data: tags } = useGetTags();\n\n return (\n <>\n \n {tags?.map((tag) => (\n \n ))}\n \n );\n};\n\nconst TagFilter = ({ setTagId }: { setTagId: Function }) => {\n const intl = useIntl();\n\n return (\n
\n
\n \n setTagId(e.target.value)}\n >\n {intl.formatMessage({ id: \"LOADING\" })}}>\n \n \n \n
\n );\n};\n\nconst LibraryImage = ({\n image,\n onSelect,\n}: {\n image: LibraryImageType;\n onSelect: (value: LibraryImageType) => void;\n}) => {\n const [isTagModalOpen, setIsTagModalOpen] = useState(false);\n\n const intl = useIntl();\n\n const deleteMutation = useDeleteImage();\n\n return (\n <>\n
\n
\n {image.tags?.map(({ tag }: { tag: ImageTag[\"tag\"] }) => (\n \n {tag.title}\n \n ))}\n
\n \n {image.title}\n\n
\n {image.title}\n onSelect(image)}\n >\n {intl.formatMessage({ id: \"CHOOSE\" })}\n \n
\n setIsTagModalOpen(true)}\n >\n \n \n deleteMutation.mutate(image.id)}\n >\n \n \n
\n
\n
\n \n \n );\n};\n\nconst LibraryContent = ({\n limit = 20,\n onSelect,\n}: {\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n}) => {\n const [offset, setOffset] = useState(0);\n const [title, setTitle] = useState(\"\");\n const [tagId, setTagId] = useState();\n\n const {\n data: images = [],\n isFetching,\n isPreviousData,\n } = useLibraryImage({\n offset,\n limit,\n title,\n tagId,\n });\n\n const intl = useIntl();\n\n return (\n
\n
\n setTitle(e.target.value)}\n label={intl.formatMessage({ id: \"BlockImage__LIBRARY_MODAL_SEARCH\" })}\n icon={}\n iconAlignment=\"right\"\n />\n\n \n
\n
\n {isFetching ? (\n
\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_SEARCHING\" })}\n \n
\n ) : images.length > 0 ? (\n images?.map((image) => {\n return ;\n })\n ) : (\n
\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_NO_CONTENT\" })}\n
\n )}\n
\n\n
\n setOffset((old) => Math.max(old - limit, 0))}\n disabled={offset === 0}\n >\n \n \n
\n {offset / limit + 1}\n
\n {\n if (!isPreviousData && (images?.length || 0) >= limit) {\n setOffset((old) => old + limit);\n }\n }}\n disabled={isPreviousData || (images?.length || 0) < limit}\n >\n \n \n
\n
\n );\n};\n\nfunction Library({\n isOpen,\n setIsOpen,\n limit = 20,\n onSelect,\n}: {\n isOpen: boolean;\n setIsOpen: Function;\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n}) {\n const intl = useIntl();\n\n return (\n setIsOpen(false)}\n className=\"Modal-Library\"\n ariaHideApp={false}\n overlayClassName=\"Overlay\"\n >\n
\n
\n \n\n
\n {intl.formatMessage({ id: \"BlockImage__LIBRARY_MODAL_TITLE\" })}\n
\n
\n\n
\n \n {intl.formatMessage({ id: \"BlockImage__LIBRARY_LOADING\" })}\n \n
\n }\n >\n \n \n \n \n
\n \n \n );\n}\n\nexport default function WrappedComponent(props: {\n isOpen: boolean;\n setIsOpen: Function;\n limit?: number;\n onSelect: (image: LibraryImageType) => void;\n}) {\n return (\n \n \n \n \n \n );\n}\n","import {\n ChangeEvent,\n FocusEvent,\n forwardRef,\n InputHTMLAttributes,\n ReactNode,\n Ref,\n} from \"react\";\nimport InputWrapper from \"./InputWrapper\";\n\nconst InputIcon = ({\n icon,\n alignment = \"left\",\n}: {\n icon: ReactNode;\n alignment?: \"left\" | \"right\";\n}) => {\n return (\n \n {icon}\n \n );\n};\n\nconst Input = forwardRef(\n (\n {\n value,\n onChange,\n className = \"\",\n emphasize,\n placeholder,\n icon,\n iconAlignment = \"left\",\n type = \"text\",\n isValid,\n label,\n id,\n info,\n error,\n ...props\n }: {\n value: string;\n onChange: (event: ChangeEvent) => void;\n className?: string;\n emphasize?: boolean;\n placeholder?: string;\n icon?: ReactNode;\n iconAlignment?: \"left\" | \"right\";\n type?: \"text\" | \"password\" | \"email\";\n isValid?: boolean;\n label?: string;\n id: string;\n info?: ReactNode;\n error?: string;\n } & InputHTMLAttributes,\n ref: Ref\n ) => {\n return (\n \n
\n \n\n {icon && }\n\n {icon && isValid && iconAlignment === \"left\" && (\n }\n />\n )}\n
\n
\n );\n }\n);\n\nexport default Input;\n","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nexport default function getBoundingClientRect(element, includeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n var offsetHeight = element.offsetHeight;\n var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n\n if (offsetWidth > 0) {\n scaleX = round(rect.width) / offsetWidth || 1;\n }\n\n if (offsetHeight > 0) {\n scaleY = round(rect.height) / offsetHeight || 1;\n }\n }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","export const ROUND_ARROW =\n '';\n\nexport const BOX_CLASS = `__NAMESPACE_PREFIX__-box`;\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`;\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`;\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`;\nexport const SVG_ARROW_CLASS = `__NAMESPACE_PREFIX__-svg-arrow`;\n\nexport const TOUCH_OPTIONS = {passive: true, capture: true};\n\nexport const TIPPY_DEFAULT_APPEND_TO = () => document.body;\n","import {BasePlacement, Placement} from './types';\n\nexport function hasOwnProperty(\n obj: Record,\n key: string\n): boolean {\n return {}.hasOwnProperty.call(obj, key);\n}\n\nexport function getValueAtIndexOrReturn(\n value: T | [T | null, T | null],\n index: number,\n defaultValue: T | [T, T]\n): T {\n if (Array.isArray(value)) {\n const v = value[index];\n return v == null\n ? Array.isArray(defaultValue)\n ? defaultValue[index]\n : defaultValue\n : v;\n }\n\n return value;\n}\n\nexport function isType(value: any, type: string): boolean {\n const str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(`${type}]`) > -1;\n}\n\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value(...args) : value;\n}\n\nexport function debounce(\n fn: (arg: T) => void,\n ms: number\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n let timeout: any;\n\n return (arg): void => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(arg);\n }, ms);\n };\n}\n\nexport function removeProperties(obj: T, keys: string[]): Partial {\n const clone = {...obj};\n keys.forEach((key) => {\n delete (clone as any)[key];\n });\n return clone;\n}\n\nexport function splitBySpaces(value: string): string[] {\n return value.split(/\\s+/).filter(Boolean);\n}\n\nexport function normalizeToArray(value: T | T[]): T[] {\n return ([] as T[]).concat(value);\n}\n\nexport function pushIfUnique(arr: T[], value: T): void {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\n\nexport function appendPxIfNumber(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport function unique(arr: T[]): T[] {\n return arr.filter((item, index) => arr.indexOf(item) === index);\n}\n\nexport function getNumber(value: string | number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\nexport function getBasePlacement(placement: Placement): BasePlacement {\n return placement.split('-')[0] as BasePlacement;\n}\n\nexport function arrayFrom(value: ArrayLike): any[] {\n return [].slice.call(value);\n}\n\nexport function removeUndefinedProps(\n obj: Record\n): Partial> {\n return Object.keys(obj).reduce((acc, key) => {\n if (obj[key] !== undefined) {\n (acc as any)[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n","import {ReferenceElement, Targets} from './types';\nimport {PopperTreeData} from './types-internal';\nimport {arrayFrom, isType, normalizeToArray, getBasePlacement} from './utils';\n\nexport function div(): HTMLDivElement {\n return document.createElement('div');\n}\n\nexport function isElement(value: unknown): value is Element | DocumentFragment {\n return ['Element', 'Fragment'].some((type) => isType(value, type));\n}\n\nexport function isNodeList(value: unknown): value is NodeList {\n return isType(value, 'NodeList');\n}\n\nexport function isMouseEvent(value: unknown): value is MouseEvent {\n return isType(value, 'MouseEvent');\n}\n\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\n\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\n\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number\n): void {\n els.forEach((el) => {\n if (el) {\n el.style.transitionDuration = `${value}ms`;\n }\n });\n}\n\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden'\n): void {\n els.forEach((el) => {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n\nexport function getOwnerDocument(\n elementOrElements: Element | Element[]\n): Document {\n const [element] = normalizeToArray(elementOrElements);\n\n // Elements created via a