@dcl/builder-site 7.21.3-19896835659.commit-bb1d19a → 7.21.4-20072676604.commit-b664d05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Back-Bt1TpmNC.js → Back-BynbDivp.js} +1 -1
- package/assets/{CollectionProvider.container-CdZDU931.js → CollectionProvider.container-D5CQnDMg.js} +1 -1
- package/assets/{CollectionStatus.container-D7SF6GBG.js → CollectionStatus.container-3ohPocER.js} +1 -1
- package/assets/{ConfirmDelete-BvCbqgkr.js → ConfirmDelete-CsS30BV6.js} +1 -1
- package/assets/{FileSaver.min-DkBGT7wg.js → FileSaver.min-Cl06a4Ib.js} +1 -1
- package/assets/{ItemProvider.container-BE8u0Rvw.js → ItemProvider.container-BxbHp3WI.js} +2 -2
- package/assets/{JumpIn.container-BA-hVJA8.js → JumpIn.container-DhDkycMJ.js} +1 -1
- package/assets/{LandAction-ClUpTbS0.js → LandAction-CWVaofVp.js} +1 -1
- package/assets/{LandProviderPage-Cle8Kso_.js → LandProviderPage-B0v3GZAN.js} +1 -1
- package/assets/{LoggedInDetailPage.container-DWMoMSsT.js → LoggedInDetailPage.container-DUhCPcHZ.js} +1 -1
- package/assets/{Navigation-BvYpwaZ8.css → Navigation-CUxcYWhj.css} +1 -1
- package/assets/{Navigation.container-9A40G-C8.js → Navigation.container-C4IkoSf-.js} +1 -1
- package/assets/{NotFound-BGRBV5Uq.js → NotFound-R4_SVQiM.js} +1 -1
- package/assets/{OptionsDropdown-CG8mCbxa.js → OptionsDropdown-us8wM9oB.js} +1 -1
- package/assets/{RentalPeriod-Em0xOmR0.js → RentalPeriod-l_RdW6cQ.js} +1 -1
- package/assets/{SDKTag--yigH3bT.js → SDKTag-WMhhtuJt.js} +1 -1
- package/assets/{SceneStats.container-CFQr-vWl.js → SceneStats.container-BN07N_DZ.js} +1 -1
- package/assets/{SignInRequired-B_3SXeXM.js → SignInRequired-DXu9Lnyi.js} +1 -1
- package/assets/{ThirdPartyKindBadge-BClaXwJI.js → ThirdPartyKindBadge-CPEJ7Im7.js} +1 -1
- package/assets/{dataReader-BLycT3A3.js → dataReader-BlvJSk7R.js} +1 -1
- package/assets/{date-BuuPIXis.js → date-I9Y85L5f.js} +1 -1
- package/assets/{fortmatic-DJEz0rp3.js → fortmatic-BJv3hUDW.js} +1 -1
- package/assets/{hooks-aEto244t.js → hooks-C1vW-Ivc.js} +1 -1
- package/assets/{index-mFsPtgxU.js → index-1lu3gBYu.js} +1 -1
- package/assets/{index-Bhseic3g.js → index-5NiuEoVx.js} +1 -1
- package/assets/{index-BknYlUwd.js → index-B7jP8Q5m.js} +1 -1
- package/assets/{index-Gh2V6S8q.js → index-BI7GgFb3.js} +1 -1
- package/assets/{index-rfdKGuam.js → index-BKTVBhGI.js} +1 -1
- package/assets/{index-CdewbTl9.js → index-B_dHaAQu.js} +1 -1
- package/assets/{index-CbjNJ2Kx.js → index-Bood3Bce.js} +1 -1
- package/assets/{index-Db5vWMok.js → index-BsFEl8gX.js} +1 -1
- package/assets/{index-DvQq0rNn.js → index-Bz0irhNB.js} +1 -1
- package/assets/{index-SoLXlPaG.css → index-Bzqz0HYS.css} +1 -1
- package/assets/{index-BHRIVcTs.js → index-C-GaOyrZ.js} +19 -19
- package/assets/{index-CGrCbrif.js → index-C8DyPldC.js} +1 -1
- package/assets/{index-N5H4XX_z.js → index-CBpHG7sZ.js} +1 -1
- package/assets/{index-BICUfUCl.js → index-CC94Lk6s.js} +1 -1
- package/assets/{index-CG8pSyWD.js → index-CCO2Avyx.js} +1 -1
- package/assets/{index-JkZS13Xr.js → index-CEsteZAp.js} +1 -1
- package/assets/index-CIYEP7v0.js +1 -0
- package/assets/{index-BD8iJDzG.js → index-CIvKBBya.js} +1 -1
- package/assets/{index-8iYCGnTs.js → index-CKLp6Hup.js} +1 -1
- package/assets/{index-DAAeQbXS.js → index-CNu1qaGD.js} +1 -1
- package/assets/{index-Br6hHsA1.js → index-CZcDUkD1.js} +1 -1
- package/assets/{index-CWPKklZI.js → index-Cc3x4kR0.js} +2 -2
- package/assets/{index-BQ0GFn_M.js → index-CdT1sm1s.js} +1 -1
- package/assets/{index-DYzSJInl.js → index-CqIAQxaM.js} +1 -1
- package/assets/{index-DMJQXYRd.js → index-CqPbErBR.js} +1 -1
- package/assets/{index-w9zwRdjL.js → index-CybcQcb-.js} +1 -1
- package/assets/{index-CZ8dfrU0.js → index-D5bIxLyr.js} +1 -1
- package/assets/{index-BosWvral.css → index-DI7btb-_.css} +7 -7
- package/assets/{index-CdmO0FNu.js → index-DLGfvbda.js} +1 -1
- package/assets/{index-ZjF3iZ0v.js → index-DPjPckBP.js} +1 -1
- package/assets/{index-CTAssOyf.css → index-DTWySej6.css} +1 -1
- package/assets/{index-Dpo0OSlf.css → index-DVdpc8LT.css} +1 -1
- package/assets/{index-DAx-r4m3.js → index-DXd3vmFE.js} +1 -1
- package/assets/{index-Cl_Vz47v.css → index-DXq5OdPF.css} +1 -1
- package/assets/{index-OtuvcX8Z.js → index-DZq8hgA_.js} +1 -1
- package/assets/{index-DOh8-nXu.js → index-Db6lCEoL.js} +1 -1
- package/assets/{index-koBO0cpK.js → index-Dbin4CZe.js} +1 -1
- package/assets/{index-Pi8zH23Q.js → index-DfhGmNm2.js} +1 -1
- package/assets/{index-LLu-0F-B.js → index-DkBcVZtV.js} +1 -1
- package/assets/{index-CLw4Lv2v.css → index-Dl7zdDXY.css} +1 -1
- package/assets/{index-D39rSukq.js → index-Do_FW82o.js} +1 -1
- package/assets/{index-ik5xvgjC.js → index-Dq3gvxnZ.js} +1 -1
- package/assets/{index-CJppakqi.js → index-DqtM4iLS.js} +1 -1
- package/assets/{index-DhWMukFk.js → index-Dut6SE52.js} +1 -1
- package/assets/{index-3fCnTMv0.css → index-KGFkJaYl.css} +1 -1
- package/assets/{index-D2M0UdRW.js → index-e1KSIcYB.js} +1 -1
- package/assets/index-jZdf8jWG.js +1 -0
- package/assets/{index-DGucDtQe.js → index-kxfDLB2J.js} +1 -1
- package/assets/{index-DlLGErhb.js → index-vv4Yct9z.js} +1 -1
- package/assets/{index.es-B5hd-vsJ.js → index.es-BJ4-Svcd.js} +4 -4
- package/assets/{selectors-RKMIkjNm.js → selectors-BobHRkyd.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-Co_sF4mN.js +0 -1
- package/assets/index-UXTmA8HS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c0 as g,cm as D,c1 as C,cn as S,M as f}from"./index-BHRIVcTs.js";import{g as T,f as j,b as s,a as o,c as k,d,l as y}from"./index-LLu-0F-B.js";function p(t,e){var r,a,n,i,l,c,h,v;g(1,arguments);var b=T(),u=D((r=(a=(n=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(l=e.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:b.weekStartsOn)!==null&&a!==void 0?a:(h=b.locale)===null||h===void 0||(v=h.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=C(t),w=m.getUTCDay(),$=(w<u?7:0)+w-u;return m.setUTCDate(m.getUTCDate()-$),m.setUTCHours(0,0,0,0),m}function x(t,e){return g(1,arguments),j(t,Date.now(),e)}var N={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},z=function(e,r,a){var n,i=N[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"en "+n:"hace "+n:n},O={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},V={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},X={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E={date:s({formats:O,defaultWidth:"full"}),time:s({formats:V,defaultWidth:"full"}),dateTime:s({formats:X,defaultWidth:"full"})},F={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},L={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},H=function(e,r,a,n){return r.getUTCHours()!==1?L[e]:F[e]},R={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},_={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Y={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},q={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},A={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},U={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Q=function(e,r){var a=Number(e);return a+"º"},I={ordinalNumber:Q,era:o({values:R,defaultWidth:"wide"}),quarter:o({values:_,defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:o({values:Y,defaultWidth:"wide"}),day:o({values:q,defaultWidth:"wide"}),dayPeriod:o({values:A,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})},B=/^(\d+)(º)?/i,G=/\d+/i,J={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},K={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Z={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ee={any:[/1/i,/2/i,/3/i,/4/i]},ae={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},te={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},re={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},ne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},ie={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},oe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},de={ordinalNumber:k({matchPattern:B,parsePattern:G,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:J,defaultMatchWidth:"wide",parsePatterns:K,defaultParseWidth:"any"}),quarter:d({matchPatterns:Z,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:te,defaultParseWidth:"any"}),day:d({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ne,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:ie,defaultMatchWidth:"any",parsePatterns:oe,defaultParseWidth:"any"})},P={code:"es",formatDistance:z,formatLong:E,formatRelative:H,localize:I,match:de,options:{weekStartsOn:1,firstWeekContainsDate:1}},se={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},me=function(e,r,a){var n,i=se[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",String(r)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?n+"内":n+"前":n},ue={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},le={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},ce={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},he={date:s({formats:ue,defaultWidth:"full"}),time:s({formats:le,defaultWidth:"full"}),dateTime:s({formats:ce,defaultWidth:"full"})};function ve(t,e,r){g(2,arguments);var a=p(t,r),n=p(e,r);return a.getTime()===n.getTime()}function W(t,e,r){var a="eeee p";return ve(t,e,r)?a:t.getTime()>e.getTime()?"'下个'"+a:"'上个'"+a}var fe={lastWeek:W,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:W,other:"PP p"},ge=function(e,r,a,n){var i=fe[e];return typeof i=="function"?i(r,a,n):i},be={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},we={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},ye={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},pe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Pe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},We={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Me=function(e,r){var a=Number(e);switch(r==null?void 0:r.unit){case"date":return a.toString()+"日";case"hour":return a.toString()+"时";case"minute":return a.toString()+"分";case"second":return a.toString()+"秒";default:return"第 "+a.toString()}},ke={ordinalNumber:Me,era:o({values:be,defaultWidth:"wide"}),quarter:o({values:we,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:o({values:ye,defaultWidth:"wide"}),day:o({values:pe,defaultWidth:"wide"}),dayPeriod:o({values:Pe,defaultWidth:"wide",formattingValues:We,defaultFormattingWidth:"wide"})},$e=/^(第\s*)?\d+(日|时|分|秒)?/i,De=/\d+/i,Ce={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Se={any:[/^(前)/i,/^(公元)/i]},Te={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},je={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},xe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ne={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},ze={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Oe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ve={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Xe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ee={ordinalNumber:k({matchPattern:$e,parsePattern:De,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:Ce,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),quarter:d({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Ne,defaultParseWidth:"any"}),day:d({matchPatterns:ze,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:Ve,defaultMatchWidth:"any",parsePatterns:Xe,defaultParseWidth:"any"})},M={code:"zh-CN",formatDistance:me,formatLong:he,formatRelative:ge,localize:ke,match:Ee,options:{weekStartsOn:1,firstWeekContainsDate:4}};const Fe={en:y,"en-EN":y,es:P,"es-ES":P,zh:M,"zh-CN":M};function _e(t,e={}){return x(t,Le(e))}function Ye(t){return t>3600?f("time.hours",{amount:Number((t/3600).toFixed(1)).toLocaleString()}):t>60?f("time.minutes",{amount:Math.round(t/60)}):f("time.seconds",{amount:Math.round(t)})}function Le(t){const e=Fe[S().locale];return e?{...t,locale:e}:{...t}}export{_e as a,Ye as f,p as s};
|
|
1
|
+
import{c0 as g,cm as D,c1 as C,cn as S,M as f}from"./index-C-GaOyrZ.js";import{g as T,f as j,b as s,a as o,c as k,d,l as y}from"./index-DkBcVZtV.js";function p(t,e){var r,a,n,i,l,c,h,v;g(1,arguments);var b=T(),u=D((r=(a=(n=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(l=e.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:b.weekStartsOn)!==null&&a!==void 0?a:(h=b.locale)===null||h===void 0||(v=h.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=C(t),w=m.getUTCDay(),$=(w<u?7:0)+w-u;return m.setUTCDate(m.getUTCDate()-$),m.setUTCHours(0,0,0,0),m}function x(t,e){return g(1,arguments),j(t,Date.now(),e)}var N={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},z=function(e,r,a){var n,i=N[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"en "+n:"hace "+n:n},O={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},V={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},X={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E={date:s({formats:O,defaultWidth:"full"}),time:s({formats:V,defaultWidth:"full"}),dateTime:s({formats:X,defaultWidth:"full"})},F={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},L={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},H=function(e,r,a,n){return r.getUTCHours()!==1?L[e]:F[e]},R={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},_={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Y={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},q={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},A={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},U={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Q=function(e,r){var a=Number(e);return a+"º"},I={ordinalNumber:Q,era:o({values:R,defaultWidth:"wide"}),quarter:o({values:_,defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:o({values:Y,defaultWidth:"wide"}),day:o({values:q,defaultWidth:"wide"}),dayPeriod:o({values:A,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})},B=/^(\d+)(º)?/i,G=/\d+/i,J={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},K={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Z={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ee={any:[/1/i,/2/i,/3/i,/4/i]},ae={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},te={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},re={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},ne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},ie={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},oe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},de={ordinalNumber:k({matchPattern:B,parsePattern:G,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:J,defaultMatchWidth:"wide",parsePatterns:K,defaultParseWidth:"any"}),quarter:d({matchPatterns:Z,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:te,defaultParseWidth:"any"}),day:d({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ne,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:ie,defaultMatchWidth:"any",parsePatterns:oe,defaultParseWidth:"any"})},P={code:"es",formatDistance:z,formatLong:E,formatRelative:H,localize:I,match:de,options:{weekStartsOn:1,firstWeekContainsDate:1}},se={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},me=function(e,r,a){var n,i=se[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",String(r)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?n+"内":n+"前":n},ue={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},le={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},ce={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},he={date:s({formats:ue,defaultWidth:"full"}),time:s({formats:le,defaultWidth:"full"}),dateTime:s({formats:ce,defaultWidth:"full"})};function ve(t,e,r){g(2,arguments);var a=p(t,r),n=p(e,r);return a.getTime()===n.getTime()}function W(t,e,r){var a="eeee p";return ve(t,e,r)?a:t.getTime()>e.getTime()?"'下个'"+a:"'上个'"+a}var fe={lastWeek:W,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:W,other:"PP p"},ge=function(e,r,a,n){var i=fe[e];return typeof i=="function"?i(r,a,n):i},be={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},we={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},ye={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},pe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Pe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},We={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Me=function(e,r){var a=Number(e);switch(r==null?void 0:r.unit){case"date":return a.toString()+"日";case"hour":return a.toString()+"时";case"minute":return a.toString()+"分";case"second":return a.toString()+"秒";default:return"第 "+a.toString()}},ke={ordinalNumber:Me,era:o({values:be,defaultWidth:"wide"}),quarter:o({values:we,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:o({values:ye,defaultWidth:"wide"}),day:o({values:pe,defaultWidth:"wide"}),dayPeriod:o({values:Pe,defaultWidth:"wide",formattingValues:We,defaultFormattingWidth:"wide"})},$e=/^(第\s*)?\d+(日|时|分|秒)?/i,De=/\d+/i,Ce={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Se={any:[/^(前)/i,/^(公元)/i]},Te={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},je={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},xe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ne={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},ze={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Oe={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ve={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Xe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ee={ordinalNumber:k({matchPattern:$e,parsePattern:De,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:Ce,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),quarter:d({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Ne,defaultParseWidth:"any"}),day:d({matchPatterns:ze,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:Ve,defaultMatchWidth:"any",parsePatterns:Xe,defaultParseWidth:"any"})},M={code:"zh-CN",formatDistance:me,formatLong:he,formatRelative:ge,localize:ke,match:Ee,options:{weekStartsOn:1,firstWeekContainsDate:4}};const Fe={en:y,"en-EN":y,es:P,"es-ES":P,zh:M,"zh-CN":M};function _e(t,e={}){return x(t,Le(e))}function Ye(t){return t>3600?f("time.hours",{amount:Number((t/3600).toFixed(1)).toLocaleString()}):t>60?f("time.minutes",{amount:Math.round(t/60)}):f("time.seconds",{amount:Math.round(t)})}function Le(t){const e=Fe[S().locale];return e?{...t,locale:e}:{...t}}export{_e as a,Ye as f,p as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{q as J}from"./index-BHRIVcTs.js";var Z=function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)}([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if(function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0}()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"postMessage",value:function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}}()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P}();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=function(){return this||typeof self=="object"&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},V(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},V(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),q=l.call(i,"finallyLoc");if(j&&q){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=function(q,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return Q()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var N=B(H,E);if(N){if(N===f)continue;return N}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(q,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}}(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function V(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function q(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,N=H.value;return N&&typeof N=="object"&&l.call(N,"__await")?Promise.resolve(N.__await).then(function(L){q("next",L,k,S)},function(L){q("throw",L,k,S)}):Promise.resolve(N).then(function(L){H.value=L,k(H)},function(L){return q("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function B(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,B(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:Q}}function Q(){return{value:r,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
|
|
1
|
+
import{q as J}from"./index-C-GaOyrZ.js";var Z=function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)}([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if(function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0}()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"postMessage",value:function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}}()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P}();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=function(){return this||typeof self=="object"&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},V(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},V(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),q=l.call(i,"finallyLoc");if(j&&q){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=function(q,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return Q()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var N=B(H,E);if(N){if(N===f)continue;return N}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(q,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}}(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function V(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function q(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,N=H.value;return N&&typeof N=="object"&&l.call(N,"__await")?Promise.resolve(N.__await).then(function(L){q("next",L,k,S)},function(L){q("throw",L,k,S)}):Promise.resolve(N).then(function(L){H.value=L,k(H)},function(L){return q("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function B(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,B(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:Q}}function Q(){return{value:r,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
|
|
2
2
|
.fortmatic-iframe {
|
|
3
3
|
display: none;
|
|
4
4
|
position: fixed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b1 as r,J as o,be as s,bf as n,bg as c,bh as m,bi as u,bj as l,bk as d,bl as h,bm as i,b3 as I,bn as F}from"./index-
|
|
1
|
+
import{b1 as r,J as o,be as s,bf as n,bg as c,bh as m,bi as u,bj as l,bk as d,bl as h,bm as i,b3 as I,bn as F}from"./index-C-GaOyrZ.js";const C=()=>{const e=r();return o.useMemo(()=>n(e.search),[e.search])},P=()=>{const e=r();return o.useMemo(()=>c(e.search),[e.search])},b=()=>{const e=r();return o.useMemo(()=>m(e.search),[e.search])},S=()=>{const e=r();return o.useMemo(()=>u(e.pathname),[e.pathname])},U=()=>{const e=r();return o.useMemo(()=>l(e.pathname),[e.pathname])},G=()=>{const e=r();return o.useMemo(()=>d(e.pathname),[e.pathname])},M=()=>{const e=r();return o.useMemo(()=>h(e.pathname),[e.pathname])},j=()=>{const e=r();return o.useMemo(()=>s(e.pathname),[e.pathname])},N=()=>{const e=r();return o.useMemo(()=>i(e.pathname),[e.pathname])},w=e=>{const t=r();return o.useMemo(()=>I(t.search,e),[t.search,e])},y=(e,t)=>{const a=r();return o.useMemo(()=>F(a.search,e,t),[a.search,e,t])};export{S as a,j as b,U as c,N as d,M as e,w as f,P as g,b as h,C as i,G as j,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e,ga as Ge,gb as Re,a7 as Z,dM as Ue,S as s,T as F,fl as Ie,a4 as Q,f7 as We,M as o,fV as Oe,e$ as te,gc as He,cO as Fe,a2 as M,eD as ze,gd as qe,g3 as Ve,bq as ke,g5 as Ye,g6 as Ze,eO as Ne,ge as Qe,J as l,R as $,gf as Je,gg as Ke,eY as B,dN as fe,ez as Xe,gh as et,bp as ye,Q as be,fm as ve,ey as we,eB as ue,gi as tt,gj as ge,gk as st,gl as nt,gm as at,gn as it,go as ot,fp as lt,gp as rt,gq as Se,eE as ct,gr as dt,gs as mt,gt as he,P as _t,cM as ut,cN as gt,aa as ht,ab as w,eZ as pe,eJ as Ce,fB as pt,ej as Ct,gu as xt,gv as jt,gw as It,eM as kt,gx as Nt,gy as ft,gz as yt,gA as bt,gB as vt,g0 as wt}from"./index-BHRIVcTs.js";import{e as St,f as Pt}from"./hooks-aEto244t.js";import{g as Dt}from"./selector-CtnQnmhq.js";import{L as Et}from"./LoggedInDetailPage.container-DWMoMSsT.js";import{C as Mt}from"./CollectionProvider.container-CdZDU931.js";import{N as Tt}from"./NotFound-BGRBV5Uq.js";import{B as Bt}from"./Back-Bt1TpmNC.js";import{C as $t,T as Lt}from"./ThirdPartyKindBadge-BClaXwJI.js";import{C as se}from"./ConfirmDelete-BvCbqgkr.js";import"./Navigation.container-9A40G-C8.js";import"./selectors-RKMIkjNm.js";import"./SignInRequired-B_3SXeXM.js";const At=t=>e.jsx("img",{"data-testid":Ge,src:Re[t.network],alt:t.network,className:t.className}),Gt="_image_142g7_1",Rt="_main_142g7_2",Ut="_network_142g7_13",q={image:Gt,main:Rt,network:Ut},Wt=t=>{const{collection:n,collectionId:r,className:i,shape:m}=t;return e.jsxs("div",{className:Z(q.main,i),children:[n!=null&&n.itemCount?e.jsx(Ue,{collectionId:r,className:q.image}):e.jsx(s.Blockie,{className:q.image,seed:r,size:8,scale:8,shape:m??"circle"}),n!=null&&n.linkedContractNetwork?e.jsx(At,{network:n==null?void 0:n.linkedContractNetwork,className:q.network}):null]})},Ot=(t,n)=>({collection:Ie(t,n.collectionId)}),Ht=F(Ot)(Wt),Ft="_ellipsis_4huv2_1",xe={ellipsis:Ft},zt=t=>{const{collection:n}=t,r=Q(),i=()=>{n.isPublished&&n.forumLink&&S(n.forumLink,"_blank")},m=()=>{const{items:_,onOpenModal:d}=t;d("SeeInWorldModal",{itemIds:_.map(f=>f.id)})},a=()=>{const{collection:_,items:d}=t;r.push(Oe(_,d),{fromParam:te.TP_COLLECTIONS})},j=()=>{const{collection:_,onDelete:d}=t;d(_)},C=()=>{const{collection:_,onOpenModal:d}=t;_.isPublished||d("EditCollectionURNModal",{collection:_})},b=()=>{const{collection:_,onOpenModal:d}=t;d("CreateAndEditMultipleItemsModal",{collectionId:_.id,type:He.EDIT})},S=(_,d="")=>{const f=window.open(_,d);f&&f.focus()},I=!We(n)&&!n.isPublished;return e.jsx(s.Dropdown,{className:xe.dropdown,trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{className:xe.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:m}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:a}),e.jsx(s.Popup,{content:o("collection_context_menu.delete_published_collection"),position:"right center",disabled:I,trigger:I?e.jsx(se,{name:n.name,onDelete:j,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})}):e.jsx(s.Dropdown.Item,{text:o("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(s.Popup,{content:o("collection_context_menu.change_published_urn"),position:"right center",disabled:!n.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.edit_urn"),onClick:C,disabled:n.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.edit_in_bulk"),onClick:b}),e.jsx(s.Popup,{content:o("collection_context_menu.unpublished"),position:"right center",disabled:n.isPublished||!!n.forumLink,trigger:e.jsx(s.Dropdown.Item,{disabled:!n.isPublished||!n.forumLink,text:o("collection_context_menu.forum_post"),onClick:i}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},qt=t=>({name:Fe(t)||""}),Vt=t=>({onOpenModal:(n,r)=>t(M(n,r)),onDelete:n=>t(ze(n))}),Yt=F(qt,Vt)(zt),Zt=(t,n)=>{const{collection:r,items:i}=n;return{itemCurations:Ve(t,r.id),isLoadingItemCurations:ke(Ze(t),Ye),isLinkedWearablesPaymentsEnabled:Ne(t),itemsStatus:Qe(t,i.map(m=>m.id))}},Qt=t=>({onNewClick:(n,r,i)=>t(M("PublishWizardCollectionModal",{collectionId:n,itemsWithChanges:r,itemsToPublish:i})),onPushChangesClick:(n,r)=>t(M("PushChangesModal",{collectionId:n,itemsWithChanges:r})),onClick:(n,r,i)=>t(M("PublishThirdPartyCollectionModal",{collectionId:n,itemIds:r,action:i}))}),Jt=F(Zt,Qt)(qe),Kt="_itemImage_1y9df_1",Xt="_itemStatus_1y9df_10",es="_grid_1y9df_14",ts="_row_1y9df_25",ss="_column_1y9df_30",ns="_statusColumn_1y9df_34",as="_synced_1y9df_39",is="_unsynced_1y9df_43",os="_avatarColumn_1y9df_47",ls="_nameWrapper_1y9df_52",rs="_name_1y9df_52",cs="_itemActions_1y9df_65",ds="_action_1y9df_72",x={itemImage:Kt,itemStatus:Xt,grid:es,row:ts,column:ss,statusColumn:ns,synced:as,unsynced:is,avatarColumn:os,nameWrapper:ls,name:rs,itemActions:cs,action:ds};function ms({item:t,status:n,selected:r,onSelect:i,onOpenModal:m,onDelete:a}){const j=Q(),C=l.useCallback((h,D)=>{i(t,D.checked)},[t,i]),b=l.useCallback(()=>{m("SeeInWorldModal",{itemIds:[t.id]})},[t,m]),S=l.useCallback(()=>{t.isPublished||m("EditItemURNModal",{item:t})},[t,m]),I=l.useCallback(()=>{j.push($.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:te.TP_COLLECTIONS})},[t,j]),_=l.useCallback(()=>{a(t)},[a,t]),d=l.useMemo(()=>{if(!t.urn)return"";try{const h=Je(t.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[t]),f=l.useMemo(()=>{switch(n){case B.UNDER_REVIEW:return e.jsx(s.Icon,{name:"clock outline"});case B.SYNCED:return e.jsx(s.Icon,{name:"check circle outline"});case B.UNSYNCED:return e.jsx(s.Icon,{name:"exclamation circle"});default:return null}},[n]),y=t.data;return e.jsx(s.Grid,{className:`CollectionItem ${x.grid}`,columns:"equal",children:e.jsxs(s.Grid.Row,{className:x.row,children:[e.jsxs(s.Grid.Column,{className:`${x.column} ${x.avatarColumn}`,width:5,children:[e.jsx(s.Checkbox,{checked:r,disabled:t.isPublished,onClick:C}),e.jsx(fe,{className:x.itemImage,item:t,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:x.nameWrapper,children:e.jsxs("div",{className:x.name,title:t.name,children:[e.jsx(Xe,{className:x.itemStatus,item:t}),t.name]})})]}),e.jsx(s.Grid.Column,{className:x.column,children:y.category?e.jsx("div",{children:o(`wearable.category.${y.category}`)}):null}),e.jsx(s.Grid.Column,{className:x.column,children:e.jsx("div",{children:o(`body_shapes.${et(t)}`)})}),e.jsx(s.Grid.Column,{className:x.column,children:e.jsx("div",{children:d})}),e.jsxs(s.Grid.Column,{width:3,className:`${x.column} ${x.statusColumn} ${x[n]}`,children:[f,e.jsx("div",{children:o(`third_party_collection_detail_page.synced_statuses.${n}`)})]}),e.jsx(s.Grid.Column,{width:1,className:x.column,children:e.jsx("div",{className:x.itemActions,children:e.jsx(s.Dropdown,{trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:x.action,onClick:ye(),children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_item.see_details"),as:be,to:$.itemDetail(t.id)}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:b}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:I}),e.jsx(s.Popup,{content:o("collection_item.cannot_edit_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_item.edit_urn"),onClick:S,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!t.isPublished&&e.jsx(se,{name:t.name,onDelete:_,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})})]})})})})]})})}const _s=(t,n)=>({status:ve(t)[n.item.id]}),us=t=>({onDelete:n=>t(we(n)),onOpenModal:(n,r)=>t(M(n,r))}),gs=F(_s,us)(ms),hs="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ps="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",Cs="_status_rgxu1_1",xs="_pending_migration_rgxu1_14",js="_synced_rgxu1_19",Is="_unpublished_rgxu1_24",ks="_unsynced_rgxu1_25",Ns="_pending_mapping_rgxu1_30",fs="_under_review_rgxu1_31",ys="_icon_rgxu1_10",V={status:Cs,pending_migration:xs,synced:js,unpublished:Is,unsynced:ks,pending_mapping:Ns,under_review:fs,icon:ys},bs=t=>{const{status:n,item:r}=t,i=!r.mappings&&ue(r.urn),m=!r.isMappingComplete&&ue(r.urn),a=l.useMemo(()=>{if(i)return e.jsx("img",{src:hs,className:V.icon});if(m)return e.jsx(s.Icon,{name:"warning circle"});switch(n){case B.UNDER_REVIEW:return e.jsx("img",{src:ps,className:V.icon});case B.SYNCED:return e.jsx(s.Icon,{name:"check circle"});case B.UNSYNCED:case B.UNPUBLISHED:return e.jsx(s.Icon,{name:"cloud upload"})}},[n,i,m]),j=l.useMemo(()=>i?o("item_status.pending_mapping"):m?o("item_status.pending_migration"):o(`item_status.${n}`),[n,i,m]),C=l.useMemo(()=>i?"pending_mapping":m?"pending_migration":n,[n,i,m]);return e.jsxs("div",{className:Z(V[C],V.status),children:[a," ",j]})},vs="_itemImage_1rili_1",ws="_itemStatus_1rili_10",Ss="_grid_1rili_14",Ps="_loading_1rili_21",Ds="_row_1rili_26",Es="_column_1rili_31",Ms="_avatarColumn_1rili_35",Ts="_nameWrapper_1rili_40",Bs="_name_1rili_40",$s="_itemActions_1rili_53",Ls="_action_1rili_60",As="_overlay_1rili_65",N={itemImage:vs,itemStatus:ws,grid:Ss,loading:Ps,row:Ds,column:Es,avatarColumn:Ms,nameWrapper:Ts,name:Bs,itemActions:$s,action:Ls,overlay:As};function Gs({item:t,status:n,selected:r,loading:i,collection:m,onSaveItem:a,onSelect:j,onOpenModal:C,onDelete:b}){const S=Q(),I=l.useMemo(()=>tt(t),[t]),_=l.useMemo(()=>m.linkedContractAddress&&m.linkedContractNetwork?{address:m.linkedContractAddress,network:m.linkedContractNetwork}:null,[m]),[d,f]=l.useState(I),y=l.useMemo(()=>{if(d&&_){const v=ge(d,_);return st(v)?void 0:"Invalid mapping"}},[d,_]);l.useEffect(()=>{!_||y||(!I&&d||I&&d&&!nt(I,d))&&h(d,_)},[I,y,d,_]);const h=l.useCallback(at((v,T)=>{const A=ge(v,T);a({...t,mappings:A})},1e3),[a]),D=l.useCallback((v,T)=>{i||j(t,T.checked)},[t,i,j]),P=l.useCallback(()=>{C("SeeInWorldModal",{itemIds:[t.id]})},[t,C]),L=l.useCallback(()=>{t.isPublished||C("EditItemURNModal",{item:t})},[t,C]),R=l.useCallback(()=>{S.push($.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:te.TP_COLLECTIONS})},[t,S]),c=l.useCallback(()=>{b(t)},[b,t]);return e.jsxs(s.Grid,{className:Z(N.grid,i&&N.loading),columns:"equal",children:[i&&e.jsx("div",{className:N.overlay,children:e.jsx(s.Loader,{size:"large",active:!0})}),e.jsxs(s.Grid.Row,{className:N.row,children:[e.jsxs(s.Grid.Column,{className:`${N.column} ${N.avatarColumn}`,width:4,children:[e.jsx(s.Checkbox,{checked:r,disabled:t.isPublished||i,onClick:D}),e.jsx(fe,{className:N.itemImage,item:t,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:N.nameWrapper,children:e.jsx("div",{className:N.name,title:t.name,children:t.name})})]}),e.jsx(s.Grid.Column,{children:_&&e.jsx(it,{disabled:i,mapping:d,error:y,onChange:f,isCompact:!0})}),e.jsx(s.Grid.Column,{width:3,className:Z(N.column,N.statusColumn),children:e.jsx(bs,{status:n,item:t})}),e.jsx(s.Grid.Column,{width:1,className:N.column,children:e.jsx("div",{className:N.itemActions,children:e.jsx(s.Dropdown,{trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:N.action,disabled:i,onClick:ye(),children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_item.see_details"),as:be,to:$.itemDetail(t.id)}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:P}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:R}),e.jsx(s.Popup,{content:o("collection_item.cannot_edit_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_item.edit_urn"),onClick:L,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!t.isPublished&&e.jsx(se,{name:t.name,onDelete:c,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})})]})})})})]})]})}const Rs=(t,n)=>{const r=ve(t);return{loading:!!ot(t)[n.item.id],status:r[n.item.id]}},Us=t=>({onDelete:n=>t(we(n)),onSaveItem:n=>t(lt(n,{},{onlySaveItem:!0})),onOpenModal:(n,r)=>t(M(n,r))}),Ws=F(Rs,Us)(Gs),G=50,Os="_itemCheckbox_2k9qa_1",Hs="_gridHeader_2k9qa_5",Fs="_itemColumn_2k9qa_15",ee={itemCheckbox:Os,gridHeader:Hs,itemColumn:Fs},zs=({areAllSelected:t,onSelectedAllClick:n})=>e.jsx(s.Grid,{columns:"equal",className:ee.gridHeader,children:e.jsxs(s.Grid.Row,{children:[e.jsxs(s.Grid.Column,{width:5,className:ee.itemColumn,children:[e.jsx(s.Checkbox,{className:ee.itemCheckbox,checked:t,onClick:n})," ",o("global.item")]}),e.jsx(s.Grid.Column,{children:o("global.category")}),e.jsx(s.Grid.Column,{children:o("global.body_shape")}),e.jsx(s.Grid.Column,{children:"URN ID"}),e.jsxs(s.Grid.Column,{width:3,children:[" ",o("collection_row.status")," "]}),e.jsx(s.Grid.Column,{width:1})]})}),qs="_gridHeader_4acv6_1",Vs="_itemColumn_4acv6_11",Ys="_itemCheckbox_4acv6_16",Zs="_linkedToColumn_4acv6_20",Y={gridHeader:qs,itemColumn:Vs,itemCheckbox:Ys,linkedToColumn:Zs},Qs=({areAllSelected:t,onSelectedAllClick:n})=>e.jsx(s.Grid,{columns:"equal",className:Y.gridHeader,children:e.jsxs(s.Grid.Row,{children:[e.jsxs(s.Grid.Column,{width:4,className:Y.itemColumn,children:[e.jsx(s.Checkbox,{className:Y.itemCheckbox,checked:t,onClick:n})," ",o("global.item")]}),e.jsxs(s.Grid.Column,{className:Y.linkedToColumn,children:[e.jsx("span",{children:o("third_party_collection_detail_page.linked_to")}),e.jsx(rt,{})]}),e.jsxs(s.Grid.Column,{width:3,children:[" ",o("collection_row.status")," "]}),e.jsx(s.Grid.Column,{width:1})]})}),Js="_main_16i8r_3",Ks="_slots_16i8r_11",Xs="_empty_16i8r_28",en="_searchContainer_16i8r_32",tn="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",nn="_selectionInfo_16i8r_53",an="_header_16i8r_63",on="_content_16i8r_74",ln="_title_16i8r_83",rn="_editCollectionName_16i8r_96",cn="_name_16i8r_101",dn="_nameAndType_16i8r_105",mn="_nameWrapper_16i8r_115",_n="_size_16i8r_139",un="_actions_16i8r_143",gn="_body_16i8r_151",hn="_info_16i8r_162",pn="_infoHeader_16i8r_170",Cn="_infoContent_16i8r_178",xn="_slotsIcon_16i8r_195",jn="_copyButton_16i8r_207",In="_sparkles_16i8r_232",kn="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",yn="_linkedWearableBadge_16i8r_283",bn="_typeBadge_16i8r_288",vn="_programmaticBadge_16i8r_292",wn="_standardBadge_16i8r_296",Sn="_loader_16i8r_302",u={main:Js,slots:Ks,empty:Xs,searchContainer:en,searchInfo:tn,syncedStatusList:sn,selectionInfo:nn,header:an,content:on,title:ln,editCollectionName:rn,name:cn,nameAndType:dn,nameWrapper:mn,size:_n,actions:un,body:gn,info:hn,infoHeader:pn,infoContent:Cn,slotsIcon:xn,copyButton:jn,sparkles:In,start:kn,migrationBanner:Nn,type:fn,linkedWearableBadge:yn,typeBadge:bn,programmaticBadge:vn,standardBadge:wn,loader:Sn},je=({children:t,title:n,info:r})=>e.jsxs("div",{className:u.info,children:[e.jsxs("div",{className:u.infoHeader,children:[n," ",r&&e.jsx(s.InfoTooltip,{content:r})]}),e.jsx("div",{className:u.infoContent,children:t})]});function Pn({currentPage:t,lastLocation:n,wallet:r,thirdParty:i,items:m,collection:a,totalItems:j,isLoading:C,isThirdPartyV2Enabled:b,isLinkedWearablesPaymentsEnabled:S,onFetchAvailableSlots:I,onFetchThirdParty:_,onNewItem:d,onEditName:f,isLoadingAvailableSlots:y}){const[h,D]=l.useState({}),[P,L]=l.useState(t),[R,c]=l.useState(!1),[v,T]=l.useState(!1),[A,ne]=l.useState("ALL"),U=Q(),ae=n===$.collections();l.useEffect(()=>{i&&i.availableSlots===void 0&&!y&&I(i.id)},[i,y,I]),l.useEffect(()=>{!C&&!i&&(a!=null&&a.urn)&&_(Se(a.urn))},[a==null?void 0:a.urn,C,i]),l.useEffect(()=>{if(t!==P&&L(t),v){const g=m.reduce((p,k)=>(p[k.id]=!0,p),{});D(g),c(!1)}},[P,v,m,i,t]);const Pe=l.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),De=l.useCallback(()=>{a&&f(a)},[a,f]),Ee=l.useCallback(()=>{ae?U.goBack():U.push($.collections(ct.THIRD_PARTY))},[U,ae]),Me=l.useCallback((g,p)=>{L(+p.activePage),U.push($.thirdPartyCollectionDetail(a.id,{page:+p.activePage}))},[a,U]),J=l.useCallback((g,p)=>{D({...h,[g.id]:p}),T(!1),c(!1)},[h]),W=l.useCallback(g=>g.every(p=>h[p.id]),[h]),ie=l.useCallback((g,p)=>{const k={...h},O=!W(g);for(const H of g)k[H.id]=O;D(k),c(!0),T(v&&!!p.checked)},[h,v,W]),oe=l.useCallback(()=>{D({})},[]),le=l.useMemo(()=>a&&i&&r&&dt(r.address,i),[a,i,r]),Te=l.useCallback(g=>{if(T(!0),a){const p=Math.ceil(j/G);g(a.id,{page:mt(p),limit:G,overridePaginationData:!1})}},[j]),re=l.useCallback((g,{value:p})=>{ne(p)},[ne]),Be=[{value:"ALL",text:o("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:o("item_status.synced")},{value:"UNSYNCED",text:o("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:o("item_status.pending_migration")},{value:"MAPPING_PENDING",text:o("item_status.pending_mapping")}]],$e=l.useMemo(()=>{switch(A){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:he.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:he.MISSING_MAPPING};default:return{}}},[A]),Le=l.useCallback((g,p,k,O,H)=>{const ce=p.filter(E=>h[E.id]),de=ce.length,me=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),z=j,K=Math.ceil(z/G),_e=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:u.header,children:[e.jsx(Bt,{absolute:!0,onClick:Ee}),e.jsxs("div",{className:u.content,children:[e.jsxs("div",{className:u.title,children:[e.jsx(Ht,{collectionId:a.id}),e.jsxs("div",{className:u.nameAndType,children:[e.jsxs("div",{className:u.nameWrapper,children:[e.jsx(s.Header,{size:"large",className:u.name,onClick:De,children:a.name}),!a.isPublished&&e.jsx(_t,{name:"edit",className:u.editCollectionName})]}),e.jsxs("div",{className:u.type,children:[e.jsx($t,{isThirdParty:!0}),e.jsx(Lt,{isProgrammatic:g.isProgrammatic})]})]})]}),e.jsxs("div",{className:u.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(je,{title:o("third_party_collection_detail_page.smart_contract_address_short"),info:o("third_party_collection_detail_page.smart_contract_address_long"),children:[ut(a.linkedContractAddress)," ",e.jsx(gt,{className:u.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(s.Icon,{name:"copy outline"})})]}),!S&&e.jsxs(je,{title:o("third_party_collection_detail_page.slots_short"),info:o("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:u.slotsIcon}),y?e.jsx(s.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[g.availableSlots??0," / ",g.maxItems]})]}),e.jsxs(s.Button,{inverted:!0,onClick:Pe,children:[e.jsx(s.Icon,{name:"plus"}),o("third_party_collection_detail_page.new_items")]}),g.availableSlots!==void 0?e.jsx(Jt,{collection:a,items:ce,slots:g.availableSlots}):null,e.jsx(Yt,{collection:a,items:k})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:u.migrationBanner,children:[e.jsx(s.Icon,{name:"sync"})," ",o("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:u.body,children:O?e.jsx("div",{className:u.loader,children:e.jsx(s.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:u.searchContainer,children:[k.length>0&&e.jsx("div",{className:u.searchInfo,children:o("third_party_collection_detail_page.search_info",{page:(P-1)*G+1,pageTotal:Math.min(z,P*G),total:z})}),e.jsx(s.Dropdown,{className:u.syncedStatusList,direction:"left",value:A,options:Be,onChange:re})]}),k.length?e.jsxs(e.Fragment,{children:[de>0?e.jsxs("div",{className:u.selectionInfo,children:[o("third_party_collection_detail_page.selection",{count:de})," ",e.jsx("span",{className:"link",onClick:oe,children:o("third_party_collection_detail_page.clear_selection")}),". ",R&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(H),children:o("third_party_collection_detail_page.select_all",{total:z})}):null," "]}):null,e.jsxs("div",{children:[b&&me?e.jsx(Qs,{areAllSelected:W(k),onSelectedAllClick:(E,X)=>ie(k,X)}):e.jsx(zs,{areAllSelected:W(k),onSelectedAllClick:(E,X)=>ie(k,X)}),k.map(E=>b&&me?e.jsx(Ws,{collection:a,item:E,selected:!!h[E.id],onSelect:J},E.id):e.jsx(gs,{collection:a,item:E,selected:!!h[E.id],onSelect:J},E.id)),K>1?e.jsx(s.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:P,onPageChange:Me}):null]})]}):e.jsxs("div",{className:u.empty,children:[e.jsx("div",{className:_e?u.start:u.sparkles}),_e?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:o("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:o("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:o("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:o("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,S,b,j,P,J,W,re,oe,A]),Ae=le&&a;return e.jsx(Mt,{id:a==null?void 0:a.id,itemsPage:P,itemsPageSize:G,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:g,isLoadingCollectionItems:p,items:k,paginatedItems:O,onFetchCollectionItemsPages:H})=>e.jsx(Et,{className:u.main,hasNavigation:!le&&!C&&!g,isLoading:C||g,children:Ae&&i?Le(i,k,O,p,H):e.jsx(Tt,{})})})}const Dn=()=>{const t=ht(),n=St()||"",r=Pt(),i=w(c=>Ie(c,n)),m=l.useMemo(()=>i?pe(i):!1,[i]),a=w(c=>{var v;return((v=Ce(c,n))==null?void 0:v.total)||null}),j=w(c=>i?pt(c,i.id):[]),C=w(c=>i&&Ce(c,i.id)||null),b=w(Ct),S=w(xt),I=w(Ne),_=w(c=>i&&pe(i)?jt(c,i):null),d=w(c=>It(c)),f=w(c=>ke(kt(c),wt)||Nt(c)||!!(m&&i&&ft(c,Se(i.urn)))),y=w(c=>yt(c)),h=w(c=>Dt(c)),D=l.useCallback(c=>t(M("CreateItemsModal",{collectionId:c})),[t]),P=l.useCallback(c=>t(M("EditCollectionNameModal",{collection:c})),[t]),L=l.useCallback(c=>t(bt(c)),[t]),R=l.useCallback(c=>t(vt(c)),[t]);return e.jsx(Pn,{items:j,totalItems:a,currentPage:r,paginatedData:C,wallet:b,collection:i,isThirdPartyV2Enabled:S,isLinkedWearablesPaymentsEnabled:I,thirdParty:_,authorizations:d,isLoading:f,isLoadingAvailableSlots:y,lastLocation:h,onNewItem:D,onEditName:P,onFetchAvailableSlots:L,onFetchThirdParty:R})},Hn=Dn;export{Hn as default};
|
|
1
|
+
import{N as e,ga as Ge,gb as Re,a7 as Z,dM as Ue,S as s,T as F,fl as Ie,a4 as Q,f7 as We,M as o,fV as Oe,e$ as te,gc as He,cO as Fe,a2 as M,eD as ze,gd as qe,g3 as Ve,bq as ke,g5 as Ye,g6 as Ze,eO as Ne,ge as Qe,J as l,R as $,gf as Je,gg as Ke,eY as B,dN as fe,ez as Xe,gh as et,bp as ye,Q as be,fm as ve,ey as we,eB as ue,gi as tt,gj as ge,gk as st,gl as nt,gm as at,gn as it,go as ot,fp as lt,gp as rt,gq as Se,eE as ct,gr as dt,gs as mt,gt as he,P as _t,cM as ut,cN as gt,aa as ht,ab as w,eZ as pe,eJ as Ce,fB as pt,ej as Ct,gu as xt,gv as jt,gw as It,eM as kt,gx as Nt,gy as ft,gz as yt,gA as bt,gB as vt,g0 as wt}from"./index-C-GaOyrZ.js";import{e as St,f as Pt}from"./hooks-C1vW-Ivc.js";import{g as Dt}from"./selector-CtnQnmhq.js";import{L as Et}from"./LoggedInDetailPage.container-DUhCPcHZ.js";import{C as Mt}from"./CollectionProvider.container-D5CQnDMg.js";import{N as Tt}from"./NotFound-R4_SVQiM.js";import{B as Bt}from"./Back-BynbDivp.js";import{C as $t,T as Lt}from"./ThirdPartyKindBadge-CPEJ7Im7.js";import{C as se}from"./ConfirmDelete-CsS30BV6.js";import"./Navigation.container-C4IkoSf-.js";import"./selectors-BobHRkyd.js";import"./SignInRequired-DXu9Lnyi.js";const At=t=>e.jsx("img",{"data-testid":Ge,src:Re[t.network],alt:t.network,className:t.className}),Gt="_image_142g7_1",Rt="_main_142g7_2",Ut="_network_142g7_13",q={image:Gt,main:Rt,network:Ut},Wt=t=>{const{collection:n,collectionId:r,className:i,shape:m}=t;return e.jsxs("div",{className:Z(q.main,i),children:[n!=null&&n.itemCount?e.jsx(Ue,{collectionId:r,className:q.image}):e.jsx(s.Blockie,{className:q.image,seed:r,size:8,scale:8,shape:m??"circle"}),n!=null&&n.linkedContractNetwork?e.jsx(At,{network:n==null?void 0:n.linkedContractNetwork,className:q.network}):null]})},Ot=(t,n)=>({collection:Ie(t,n.collectionId)}),Ht=F(Ot)(Wt),Ft="_ellipsis_4huv2_1",xe={ellipsis:Ft},zt=t=>{const{collection:n}=t,r=Q(),i=()=>{n.isPublished&&n.forumLink&&S(n.forumLink,"_blank")},m=()=>{const{items:_,onOpenModal:d}=t;d("SeeInWorldModal",{itemIds:_.map(f=>f.id)})},a=()=>{const{collection:_,items:d}=t;r.push(Oe(_,d),{fromParam:te.TP_COLLECTIONS})},j=()=>{const{collection:_,onDelete:d}=t;d(_)},C=()=>{const{collection:_,onOpenModal:d}=t;_.isPublished||d("EditCollectionURNModal",{collection:_})},b=()=>{const{collection:_,onOpenModal:d}=t;d("CreateAndEditMultipleItemsModal",{collectionId:_.id,type:He.EDIT})},S=(_,d="")=>{const f=window.open(_,d);f&&f.focus()},I=!We(n)&&!n.isPublished;return e.jsx(s.Dropdown,{className:xe.dropdown,trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{className:xe.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:m}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:a}),e.jsx(s.Popup,{content:o("collection_context_menu.delete_published_collection"),position:"right center",disabled:I,trigger:I?e.jsx(se,{name:n.name,onDelete:j,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})}):e.jsx(s.Dropdown.Item,{text:o("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(s.Popup,{content:o("collection_context_menu.change_published_urn"),position:"right center",disabled:!n.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.edit_urn"),onClick:C,disabled:n.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.edit_in_bulk"),onClick:b}),e.jsx(s.Popup,{content:o("collection_context_menu.unpublished"),position:"right center",disabled:n.isPublished||!!n.forumLink,trigger:e.jsx(s.Dropdown.Item,{disabled:!n.isPublished||!n.forumLink,text:o("collection_context_menu.forum_post"),onClick:i}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},qt=t=>({name:Fe(t)||""}),Vt=t=>({onOpenModal:(n,r)=>t(M(n,r)),onDelete:n=>t(ze(n))}),Yt=F(qt,Vt)(zt),Zt=(t,n)=>{const{collection:r,items:i}=n;return{itemCurations:Ve(t,r.id),isLoadingItemCurations:ke(Ze(t),Ye),isLinkedWearablesPaymentsEnabled:Ne(t),itemsStatus:Qe(t,i.map(m=>m.id))}},Qt=t=>({onNewClick:(n,r,i)=>t(M("PublishWizardCollectionModal",{collectionId:n,itemsWithChanges:r,itemsToPublish:i})),onPushChangesClick:(n,r)=>t(M("PushChangesModal",{collectionId:n,itemsWithChanges:r})),onClick:(n,r,i)=>t(M("PublishThirdPartyCollectionModal",{collectionId:n,itemIds:r,action:i}))}),Jt=F(Zt,Qt)(qe),Kt="_itemImage_1y9df_1",Xt="_itemStatus_1y9df_10",es="_grid_1y9df_14",ts="_row_1y9df_25",ss="_column_1y9df_30",ns="_statusColumn_1y9df_34",as="_synced_1y9df_39",is="_unsynced_1y9df_43",os="_avatarColumn_1y9df_47",ls="_nameWrapper_1y9df_52",rs="_name_1y9df_52",cs="_itemActions_1y9df_65",ds="_action_1y9df_72",x={itemImage:Kt,itemStatus:Xt,grid:es,row:ts,column:ss,statusColumn:ns,synced:as,unsynced:is,avatarColumn:os,nameWrapper:ls,name:rs,itemActions:cs,action:ds};function ms({item:t,status:n,selected:r,onSelect:i,onOpenModal:m,onDelete:a}){const j=Q(),C=l.useCallback((h,D)=>{i(t,D.checked)},[t,i]),b=l.useCallback(()=>{m("SeeInWorldModal",{itemIds:[t.id]})},[t,m]),S=l.useCallback(()=>{t.isPublished||m("EditItemURNModal",{item:t})},[t,m]),I=l.useCallback(()=>{j.push($.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:te.TP_COLLECTIONS})},[t,j]),_=l.useCallback(()=>{a(t)},[a,t]),d=l.useMemo(()=>{if(!t.urn)return"";try{const h=Je(t.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[t]),f=l.useMemo(()=>{switch(n){case B.UNDER_REVIEW:return e.jsx(s.Icon,{name:"clock outline"});case B.SYNCED:return e.jsx(s.Icon,{name:"check circle outline"});case B.UNSYNCED:return e.jsx(s.Icon,{name:"exclamation circle"});default:return null}},[n]),y=t.data;return e.jsx(s.Grid,{className:`CollectionItem ${x.grid}`,columns:"equal",children:e.jsxs(s.Grid.Row,{className:x.row,children:[e.jsxs(s.Grid.Column,{className:`${x.column} ${x.avatarColumn}`,width:5,children:[e.jsx(s.Checkbox,{checked:r,disabled:t.isPublished,onClick:C}),e.jsx(fe,{className:x.itemImage,item:t,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:x.nameWrapper,children:e.jsxs("div",{className:x.name,title:t.name,children:[e.jsx(Xe,{className:x.itemStatus,item:t}),t.name]})})]}),e.jsx(s.Grid.Column,{className:x.column,children:y.category?e.jsx("div",{children:o(`wearable.category.${y.category}`)}):null}),e.jsx(s.Grid.Column,{className:x.column,children:e.jsx("div",{children:o(`body_shapes.${et(t)}`)})}),e.jsx(s.Grid.Column,{className:x.column,children:e.jsx("div",{children:d})}),e.jsxs(s.Grid.Column,{width:3,className:`${x.column} ${x.statusColumn} ${x[n]}`,children:[f,e.jsx("div",{children:o(`third_party_collection_detail_page.synced_statuses.${n}`)})]}),e.jsx(s.Grid.Column,{width:1,className:x.column,children:e.jsx("div",{className:x.itemActions,children:e.jsx(s.Dropdown,{trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:x.action,onClick:ye(),children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_item.see_details"),as:be,to:$.itemDetail(t.id)}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:b}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:I}),e.jsx(s.Popup,{content:o("collection_item.cannot_edit_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_item.edit_urn"),onClick:S,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!t.isPublished&&e.jsx(se,{name:t.name,onDelete:_,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})})]})})})})]})})}const _s=(t,n)=>({status:ve(t)[n.item.id]}),us=t=>({onDelete:n=>t(we(n)),onOpenModal:(n,r)=>t(M(n,r))}),gs=F(_s,us)(ms),hs="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ps="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",Cs="_status_rgxu1_1",xs="_pending_migration_rgxu1_14",js="_synced_rgxu1_19",Is="_unpublished_rgxu1_24",ks="_unsynced_rgxu1_25",Ns="_pending_mapping_rgxu1_30",fs="_under_review_rgxu1_31",ys="_icon_rgxu1_10",V={status:Cs,pending_migration:xs,synced:js,unpublished:Is,unsynced:ks,pending_mapping:Ns,under_review:fs,icon:ys},bs=t=>{const{status:n,item:r}=t,i=!r.mappings&&ue(r.urn),m=!r.isMappingComplete&&ue(r.urn),a=l.useMemo(()=>{if(i)return e.jsx("img",{src:hs,className:V.icon});if(m)return e.jsx(s.Icon,{name:"warning circle"});switch(n){case B.UNDER_REVIEW:return e.jsx("img",{src:ps,className:V.icon});case B.SYNCED:return e.jsx(s.Icon,{name:"check circle"});case B.UNSYNCED:case B.UNPUBLISHED:return e.jsx(s.Icon,{name:"cloud upload"})}},[n,i,m]),j=l.useMemo(()=>i?o("item_status.pending_mapping"):m?o("item_status.pending_migration"):o(`item_status.${n}`),[n,i,m]),C=l.useMemo(()=>i?"pending_mapping":m?"pending_migration":n,[n,i,m]);return e.jsxs("div",{className:Z(V[C],V.status),children:[a," ",j]})},vs="_itemImage_1rili_1",ws="_itemStatus_1rili_10",Ss="_grid_1rili_14",Ps="_loading_1rili_21",Ds="_row_1rili_26",Es="_column_1rili_31",Ms="_avatarColumn_1rili_35",Ts="_nameWrapper_1rili_40",Bs="_name_1rili_40",$s="_itemActions_1rili_53",Ls="_action_1rili_60",As="_overlay_1rili_65",N={itemImage:vs,itemStatus:ws,grid:Ss,loading:Ps,row:Ds,column:Es,avatarColumn:Ms,nameWrapper:Ts,name:Bs,itemActions:$s,action:Ls,overlay:As};function Gs({item:t,status:n,selected:r,loading:i,collection:m,onSaveItem:a,onSelect:j,onOpenModal:C,onDelete:b}){const S=Q(),I=l.useMemo(()=>tt(t),[t]),_=l.useMemo(()=>m.linkedContractAddress&&m.linkedContractNetwork?{address:m.linkedContractAddress,network:m.linkedContractNetwork}:null,[m]),[d,f]=l.useState(I),y=l.useMemo(()=>{if(d&&_){const v=ge(d,_);return st(v)?void 0:"Invalid mapping"}},[d,_]);l.useEffect(()=>{!_||y||(!I&&d||I&&d&&!nt(I,d))&&h(d,_)},[I,y,d,_]);const h=l.useCallback(at((v,T)=>{const A=ge(v,T);a({...t,mappings:A})},1e3),[a]),D=l.useCallback((v,T)=>{i||j(t,T.checked)},[t,i,j]),P=l.useCallback(()=>{C("SeeInWorldModal",{itemIds:[t.id]})},[t,C]),L=l.useCallback(()=>{t.isPublished||C("EditItemURNModal",{item:t})},[t,C]),R=l.useCallback(()=>{S.push($.itemEditor({itemId:t.id,collectionId:t.collectionId}),{fromParam:te.TP_COLLECTIONS})},[t,S]),c=l.useCallback(()=>{b(t)},[b,t]);return e.jsxs(s.Grid,{className:Z(N.grid,i&&N.loading),columns:"equal",children:[i&&e.jsx("div",{className:N.overlay,children:e.jsx(s.Loader,{size:"large",active:!0})}),e.jsxs(s.Grid.Row,{className:N.row,children:[e.jsxs(s.Grid.Column,{className:`${N.column} ${N.avatarColumn}`,width:4,children:[e.jsx(s.Checkbox,{checked:r,disabled:t.isPublished||i,onClick:D}),e.jsx(fe,{className:N.itemImage,item:t,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:N.nameWrapper,children:e.jsx("div",{className:N.name,title:t.name,children:t.name})})]}),e.jsx(s.Grid.Column,{children:_&&e.jsx(it,{disabled:i,mapping:d,error:y,onChange:f,isCompact:!0})}),e.jsx(s.Grid.Column,{width:3,className:Z(N.column,N.statusColumn),children:e.jsx(bs,{status:n,item:t})}),e.jsx(s.Grid.Column,{width:1,className:N.column,children:e.jsx("div",{className:N.itemActions,children:e.jsx(s.Dropdown,{trigger:e.jsx(s.Button,{basic:!0,children:e.jsx(s.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:N.action,disabled:i,onClick:ye(),children:e.jsxs(s.Dropdown.Menu,{children:[e.jsx(s.Dropdown.Item,{text:o("collection_item.see_details"),as:be,to:$.itemDetail(t.id)}),e.jsx(s.Dropdown.Item,{text:o("collection_context_menu.see_in_decentraland"),onClick:P}),e.jsx(s.Dropdown.Item,{text:o("global.open_in_editor"),onClick:R}),e.jsx(s.Popup,{content:o("collection_item.cannot_edit_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(s.Dropdown.Item,{text:o("collection_item.edit_urn"),onClick:L,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!t.isPublished&&e.jsx(se,{name:t.name,onDelete:c,trigger:e.jsx(s.Dropdown.Item,{text:o("global.delete")})})]})})})})]})]})}const Rs=(t,n)=>{const r=ve(t);return{loading:!!ot(t)[n.item.id],status:r[n.item.id]}},Us=t=>({onDelete:n=>t(we(n)),onSaveItem:n=>t(lt(n,{},{onlySaveItem:!0})),onOpenModal:(n,r)=>t(M(n,r))}),Ws=F(Rs,Us)(Gs),G=50,Os="_itemCheckbox_2k9qa_1",Hs="_gridHeader_2k9qa_5",Fs="_itemColumn_2k9qa_15",ee={itemCheckbox:Os,gridHeader:Hs,itemColumn:Fs},zs=({areAllSelected:t,onSelectedAllClick:n})=>e.jsx(s.Grid,{columns:"equal",className:ee.gridHeader,children:e.jsxs(s.Grid.Row,{children:[e.jsxs(s.Grid.Column,{width:5,className:ee.itemColumn,children:[e.jsx(s.Checkbox,{className:ee.itemCheckbox,checked:t,onClick:n})," ",o("global.item")]}),e.jsx(s.Grid.Column,{children:o("global.category")}),e.jsx(s.Grid.Column,{children:o("global.body_shape")}),e.jsx(s.Grid.Column,{children:"URN ID"}),e.jsxs(s.Grid.Column,{width:3,children:[" ",o("collection_row.status")," "]}),e.jsx(s.Grid.Column,{width:1})]})}),qs="_gridHeader_4acv6_1",Vs="_itemColumn_4acv6_11",Ys="_itemCheckbox_4acv6_16",Zs="_linkedToColumn_4acv6_20",Y={gridHeader:qs,itemColumn:Vs,itemCheckbox:Ys,linkedToColumn:Zs},Qs=({areAllSelected:t,onSelectedAllClick:n})=>e.jsx(s.Grid,{columns:"equal",className:Y.gridHeader,children:e.jsxs(s.Grid.Row,{children:[e.jsxs(s.Grid.Column,{width:4,className:Y.itemColumn,children:[e.jsx(s.Checkbox,{className:Y.itemCheckbox,checked:t,onClick:n})," ",o("global.item")]}),e.jsxs(s.Grid.Column,{className:Y.linkedToColumn,children:[e.jsx("span",{children:o("third_party_collection_detail_page.linked_to")}),e.jsx(rt,{})]}),e.jsxs(s.Grid.Column,{width:3,children:[" ",o("collection_row.status")," "]}),e.jsx(s.Grid.Column,{width:1})]})}),Js="_main_16i8r_3",Ks="_slots_16i8r_11",Xs="_empty_16i8r_28",en="_searchContainer_16i8r_32",tn="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",nn="_selectionInfo_16i8r_53",an="_header_16i8r_63",on="_content_16i8r_74",ln="_title_16i8r_83",rn="_editCollectionName_16i8r_96",cn="_name_16i8r_101",dn="_nameAndType_16i8r_105",mn="_nameWrapper_16i8r_115",_n="_size_16i8r_139",un="_actions_16i8r_143",gn="_body_16i8r_151",hn="_info_16i8r_162",pn="_infoHeader_16i8r_170",Cn="_infoContent_16i8r_178",xn="_slotsIcon_16i8r_195",jn="_copyButton_16i8r_207",In="_sparkles_16i8r_232",kn="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",yn="_linkedWearableBadge_16i8r_283",bn="_typeBadge_16i8r_288",vn="_programmaticBadge_16i8r_292",wn="_standardBadge_16i8r_296",Sn="_loader_16i8r_302",u={main:Js,slots:Ks,empty:Xs,searchContainer:en,searchInfo:tn,syncedStatusList:sn,selectionInfo:nn,header:an,content:on,title:ln,editCollectionName:rn,name:cn,nameAndType:dn,nameWrapper:mn,size:_n,actions:un,body:gn,info:hn,infoHeader:pn,infoContent:Cn,slotsIcon:xn,copyButton:jn,sparkles:In,start:kn,migrationBanner:Nn,type:fn,linkedWearableBadge:yn,typeBadge:bn,programmaticBadge:vn,standardBadge:wn,loader:Sn},je=({children:t,title:n,info:r})=>e.jsxs("div",{className:u.info,children:[e.jsxs("div",{className:u.infoHeader,children:[n," ",r&&e.jsx(s.InfoTooltip,{content:r})]}),e.jsx("div",{className:u.infoContent,children:t})]});function Pn({currentPage:t,lastLocation:n,wallet:r,thirdParty:i,items:m,collection:a,totalItems:j,isLoading:C,isThirdPartyV2Enabled:b,isLinkedWearablesPaymentsEnabled:S,onFetchAvailableSlots:I,onFetchThirdParty:_,onNewItem:d,onEditName:f,isLoadingAvailableSlots:y}){const[h,D]=l.useState({}),[P,L]=l.useState(t),[R,c]=l.useState(!1),[v,T]=l.useState(!1),[A,ne]=l.useState("ALL"),U=Q(),ae=n===$.collections();l.useEffect(()=>{i&&i.availableSlots===void 0&&!y&&I(i.id)},[i,y,I]),l.useEffect(()=>{!C&&!i&&(a!=null&&a.urn)&&_(Se(a.urn))},[a==null?void 0:a.urn,C,i]),l.useEffect(()=>{if(t!==P&&L(t),v){const g=m.reduce((p,k)=>(p[k.id]=!0,p),{});D(g),c(!1)}},[P,v,m,i,t]);const Pe=l.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),De=l.useCallback(()=>{a&&f(a)},[a,f]),Ee=l.useCallback(()=>{ae?U.goBack():U.push($.collections(ct.THIRD_PARTY))},[U,ae]),Me=l.useCallback((g,p)=>{L(+p.activePage),U.push($.thirdPartyCollectionDetail(a.id,{page:+p.activePage}))},[a,U]),J=l.useCallback((g,p)=>{D({...h,[g.id]:p}),T(!1),c(!1)},[h]),W=l.useCallback(g=>g.every(p=>h[p.id]),[h]),ie=l.useCallback((g,p)=>{const k={...h},O=!W(g);for(const H of g)k[H.id]=O;D(k),c(!0),T(v&&!!p.checked)},[h,v,W]),oe=l.useCallback(()=>{D({})},[]),le=l.useMemo(()=>a&&i&&r&&dt(r.address,i),[a,i,r]),Te=l.useCallback(g=>{if(T(!0),a){const p=Math.ceil(j/G);g(a.id,{page:mt(p),limit:G,overridePaginationData:!1})}},[j]),re=l.useCallback((g,{value:p})=>{ne(p)},[ne]),Be=[{value:"ALL",text:o("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:o("item_status.synced")},{value:"UNSYNCED",text:o("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:o("item_status.pending_migration")},{value:"MAPPING_PENDING",text:o("item_status.pending_mapping")}]],$e=l.useMemo(()=>{switch(A){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:he.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:he.MISSING_MAPPING};default:return{}}},[A]),Le=l.useCallback((g,p,k,O,H)=>{const ce=p.filter(E=>h[E.id]),de=ce.length,me=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),z=j,K=Math.ceil(z/G),_e=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:u.header,children:[e.jsx(Bt,{absolute:!0,onClick:Ee}),e.jsxs("div",{className:u.content,children:[e.jsxs("div",{className:u.title,children:[e.jsx(Ht,{collectionId:a.id}),e.jsxs("div",{className:u.nameAndType,children:[e.jsxs("div",{className:u.nameWrapper,children:[e.jsx(s.Header,{size:"large",className:u.name,onClick:De,children:a.name}),!a.isPublished&&e.jsx(_t,{name:"edit",className:u.editCollectionName})]}),e.jsxs("div",{className:u.type,children:[e.jsx($t,{isThirdParty:!0}),e.jsx(Lt,{isProgrammatic:g.isProgrammatic})]})]})]}),e.jsxs("div",{className:u.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(je,{title:o("third_party_collection_detail_page.smart_contract_address_short"),info:o("third_party_collection_detail_page.smart_contract_address_long"),children:[ut(a.linkedContractAddress)," ",e.jsx(gt,{className:u.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(s.Icon,{name:"copy outline"})})]}),!S&&e.jsxs(je,{title:o("third_party_collection_detail_page.slots_short"),info:o("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:u.slotsIcon}),y?e.jsx(s.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[g.availableSlots??0," / ",g.maxItems]})]}),e.jsxs(s.Button,{inverted:!0,onClick:Pe,children:[e.jsx(s.Icon,{name:"plus"}),o("third_party_collection_detail_page.new_items")]}),g.availableSlots!==void 0?e.jsx(Jt,{collection:a,items:ce,slots:g.availableSlots}):null,e.jsx(Yt,{collection:a,items:k})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:u.migrationBanner,children:[e.jsx(s.Icon,{name:"sync"})," ",o("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:u.body,children:O?e.jsx("div",{className:u.loader,children:e.jsx(s.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:u.searchContainer,children:[k.length>0&&e.jsx("div",{className:u.searchInfo,children:o("third_party_collection_detail_page.search_info",{page:(P-1)*G+1,pageTotal:Math.min(z,P*G),total:z})}),e.jsx(s.Dropdown,{className:u.syncedStatusList,direction:"left",value:A,options:Be,onChange:re})]}),k.length?e.jsxs(e.Fragment,{children:[de>0?e.jsxs("div",{className:u.selectionInfo,children:[o("third_party_collection_detail_page.selection",{count:de})," ",e.jsx("span",{className:"link",onClick:oe,children:o("third_party_collection_detail_page.clear_selection")}),". ",R&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(H),children:o("third_party_collection_detail_page.select_all",{total:z})}):null," "]}):null,e.jsxs("div",{children:[b&&me?e.jsx(Qs,{areAllSelected:W(k),onSelectedAllClick:(E,X)=>ie(k,X)}):e.jsx(zs,{areAllSelected:W(k),onSelectedAllClick:(E,X)=>ie(k,X)}),k.map(E=>b&&me?e.jsx(Ws,{collection:a,item:E,selected:!!h[E.id],onSelect:J},E.id):e.jsx(gs,{collection:a,item:E,selected:!!h[E.id],onSelect:J},E.id)),K>1?e.jsx(s.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:P,onPageChange:Me}):null]})]}):e.jsxs("div",{className:u.empty,children:[e.jsx("div",{className:_e?u.start:u.sparkles}),_e?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:o("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:o("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:o("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:o("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,S,b,j,P,J,W,re,oe,A]),Ae=le&&a;return e.jsx(Mt,{id:a==null?void 0:a.id,itemsPage:P,itemsPageSize:G,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:g,isLoadingCollectionItems:p,items:k,paginatedItems:O,onFetchCollectionItemsPages:H})=>e.jsx(Et,{className:u.main,hasNavigation:!le&&!C&&!g,isLoading:C||g,children:Ae&&i?Le(i,k,O,p,H):e.jsx(Tt,{})})})}const Dn=()=>{const t=ht(),n=St()||"",r=Pt(),i=w(c=>Ie(c,n)),m=l.useMemo(()=>i?pe(i):!1,[i]),a=w(c=>{var v;return((v=Ce(c,n))==null?void 0:v.total)||null}),j=w(c=>i?pt(c,i.id):[]),C=w(c=>i&&Ce(c,i.id)||null),b=w(Ct),S=w(xt),I=w(Ne),_=w(c=>i&&pe(i)?jt(c,i):null),d=w(c=>It(c)),f=w(c=>ke(kt(c),wt)||Nt(c)||!!(m&&i&&ft(c,Se(i.urn)))),y=w(c=>yt(c)),h=w(c=>Dt(c)),D=l.useCallback(c=>t(M("CreateItemsModal",{collectionId:c})),[t]),P=l.useCallback(c=>t(M("EditCollectionNameModal",{collection:c})),[t]),L=l.useCallback(c=>t(bt(c)),[t]),R=l.useCallback(c=>t(vt(c)),[t]);return e.jsx(Pn,{items:j,totalItems:a,currentPage:r,paginatedData:C,wallet:b,collection:i,isThirdPartyV2Enabled:S,isLinkedWearablesPaymentsEnabled:I,thirdParty:_,authorizations:d,isLoading:f,isLoadingAvailableSlots:y,lastLocation:h,onNewItem:D,onEditName:P,onFetchAvailableSlots:L,onFetchThirdParty:R})},Hn=Dn;export{Hn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as Wr,$ as qr,B as Kr,m as Vr,q as Xr,J as Ye}from"./index-CJppakqi.js";import{g as st,R as lt,T as dt,k as vt,E as ht,a as yt,V as pt,s as mt,I as bt,b as gt,c as _t,N as wt,f as It,d as Et,v as St,_ as Ot,e as jt,h as Nt,O as At,y as Bt,A as kt,i as xt,W as Dt,p as Rt,U as Ct,L as Lt,u as Mt,x as Tt}from"./index-CJppakqi.js";import"./index-BHRIVcTs.js";var se={},Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Xr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Vr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecencyCheckEventEmit,At as RecencyCheckEventOnReceived,Bt as RecoveryMethodType,kt as SDKError,xt as SDKErrorCode,Dt as SDKWarning,Rt as SDKWarningCode,Ct as UpdateEmailEventEmit,Lt as UpdateEmailEventOnReceived,Mt as Wallets,Tt as isPromiEvent};
|
|
1
|
+
import{K as Wr,$ as qr,B as Kr,m as Vr,q as Xr,J as Ye}from"./index-DqtM4iLS.js";import{g as st,R as lt,T as dt,k as vt,E as ht,a as yt,V as pt,s as mt,I as bt,b as gt,c as _t,N as wt,f as It,d as Et,v as St,_ as Ot,e as jt,h as Nt,O as At,y as Bt,A as kt,i as xt,W as Dt,p as Rt,U as Ct,L as Lt,u as Mt,x as Tt}from"./index-DqtM4iLS.js";import"./index-C-GaOyrZ.js";var se={},Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Xr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Vr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecencyCheckEventEmit,At as RecencyCheckEventOnReceived,Bt as RecoveryMethodType,kt as SDKError,xt as SDKErrorCode,Dt as SDKWarning,Rt as SDKWarningCode,Ct as UpdateEmailEventEmit,Lt as UpdateEmailEventOnReceived,Mt as Wallets,Tt as isPromiEvent};
|