liftie 3.56.5 → 4.0.0

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.
Files changed (311) hide show
  1. package/Makefile +2 -2
  2. package/app.js +33 -25
  3. package/lib/checker.js +1 -1
  4. package/lib/cli/curl.js +8 -8
  5. package/lib/cli/dirs.js +8 -6
  6. package/lib/cli/fetch.js +9 -9
  7. package/lib/cli/for-each-resort.js +3 -4
  8. package/lib/cli/generate.js +10 -10
  9. package/lib/cli/noaa.js +7 -12
  10. package/lib/client/about/index.js +2 -6
  11. package/lib/client/boot/height.js +2 -6
  12. package/lib/client/boot/index.js +8 -11
  13. package/lib/client/boot/service-worker.js +1 -5
  14. package/lib/client/minimax/index.js +1 -3
  15. package/lib/client/resort/dom.js +2 -7
  16. package/lib/client/resort/index.js +7 -10
  17. package/lib/client/resort/lifts.js +4 -5
  18. package/lib/client/resort/snow.js +3 -4
  19. package/lib/client/resort/weather.js +3 -4
  20. package/lib/client/resort/webcams.js +5 -8
  21. package/lib/client/state/index.js +4 -7
  22. package/lib/client/stats/index.js +1 -5
  23. package/lib/client/tag/index.js +1 -3
  24. package/lib/embed/index.js +0 -2
  25. package/lib/lifts/index.js +12 -12
  26. package/lib/lifts/parse.js +5 -5
  27. package/lib/lifts/parser.js +6 -10
  28. package/lib/lifts/pipe.js +3 -3
  29. package/lib/lifts/request.js +1 -3
  30. package/lib/lifts/rest.js +2 -4
  31. package/lib/lifts/stats.js +2 -5
  32. package/lib/loader.js +9 -12
  33. package/lib/loaders.js +7 -8
  34. package/lib/opening.js +6 -5
  35. package/lib/plugins.js +3 -8
  36. package/lib/resorts/3cime/index.js +1 -1
  37. package/lib/resorts/3cime/resort.json +1 -1
  38. package/lib/resorts/49-degrees-north/index.js +1 -1
  39. package/lib/resorts/abasin/index.js +2 -2
  40. package/lib/resorts/alpe-lusia-san-pellegrino/index.js +1 -1
  41. package/lib/resorts/alpe-lusia-san-pellegrino/resort.json +1 -1
  42. package/lib/resorts/alpine/index.js +1 -1
  43. package/lib/resorts/alta/index.js +6 -7
  44. package/lib/resorts/alta-badia/index.js +1 -1
  45. package/lib/resorts/alta-badia/resort.json +1 -1
  46. package/lib/resorts/alyeska/index.js +1 -1
  47. package/lib/resorts/angel-fire/index.js +1 -1
  48. package/lib/resorts/arabba/index.js +1 -1
  49. package/lib/resorts/arabba/resort.json +1 -1
  50. package/lib/resorts/aspen-highlands/index.js +1 -1
  51. package/lib/resorts/aspen-mountain/index.js +1 -1
  52. package/lib/resorts/attitash/index.js +1 -1
  53. package/lib/resorts/beavercreek/index.js +1 -1
  54. package/lib/resorts/berkshire-east/index.js +1 -1
  55. package/lib/resorts/big-sky/index.js +1 -1
  56. package/lib/resorts/big-white/index.js +1 -1
  57. package/lib/resorts/big-white/resort.json +1 -1
  58. package/lib/resorts/blue-mountain-pa/index.js +1 -1
  59. package/lib/resorts/bluemountain/index.js +1 -1
  60. package/lib/resorts/bogusbasin/index.js +5 -4
  61. package/lib/resorts/bolton-valley/index.js +2 -3
  62. package/lib/resorts/boreal/index.js +1 -1
  63. package/lib/resorts/breck/index.js +1 -1
  64. package/lib/resorts/brettonwoods/index.js +7 -5
  65. package/lib/resorts/brianhead/index.js +1 -1
  66. package/lib/resorts/bridger-bowl/index.js +4 -3
  67. package/lib/resorts/brighton/index.js +1 -1
  68. package/lib/resorts/bromley-mountain/index.js +1 -1
  69. package/lib/resorts/burke-mountain/index.js +1 -1
  70. package/lib/resorts/buttermilk/index.js +1 -1
  71. package/lib/resorts/caberfae-peaks/index.js +1 -1
  72. package/lib/resorts/camelback/index.js +1 -1
  73. package/lib/resorts/campo-felice/index.js +1 -1
  74. package/lib/resorts/campo-felice/resort.json +1 -1
  75. package/lib/resorts/canada-olympic-park/index.js +1 -1
  76. package/lib/resorts/cannon/index.js +1 -1
  77. package/lib/resorts/cataloochee/index.js +1 -1
  78. package/lib/resorts/catedral/index.js +1 -1
  79. package/lib/resorts/cervino/index.js +2 -2
  80. package/lib/resorts/chamonix/index.js +2 -2
  81. package/lib/resorts/chamonix/resort.json +1 -1
  82. package/lib/resorts/chinapeak/index.js +1 -1
  83. package/lib/resorts/civetta/index.js +1 -1
  84. package/lib/resorts/civetta/resort.json +1 -1
  85. package/lib/resorts/claviere/index.js +1 -1
  86. package/lib/resorts/copper/index.js +1 -1
  87. package/lib/resorts/coronetpeak/index.js +1 -1
  88. package/lib/resorts/coronetpeak/resort.json +1 -1
  89. package/lib/resorts/cortina-d-ampezzo/index.js +1 -1
  90. package/lib/resorts/cortina-d-ampezzo/resort.json +1 -1
  91. package/lib/resorts/courchevel/index.js +1 -1
  92. package/lib/resorts/courchevel/resort.json +2 -1
  93. package/lib/resorts/cranmore-mountain/index.js +1 -1
  94. package/lib/resorts/cransmontana/index.js +2 -2
  95. package/lib/resorts/crested-butte/index.js +1 -1
  96. package/lib/resorts/crystal-mountain/index.js +1 -1
  97. package/lib/resorts/cypress-mountain/index.js +1 -1
  98. package/lib/resorts/deer-valley/index.js +1 -1
  99. package/lib/resorts/devils-head/index.js +1 -1
  100. package/lib/resorts/diamondpeak/index.js +1 -1
  101. package/lib/resorts/falls-creek/index.js +5 -3
  102. package/lib/resorts/falls-creek/resort.json +1 -1
  103. package/lib/resorts/flims-laax-falera/index.js +1 -1
  104. package/lib/resorts/flims-laax-falera/resort.json +1 -1
  105. package/lib/resorts/folgaria/index.js +1 -1
  106. package/lib/resorts/folgaria/resort.json +1 -1
  107. package/lib/resorts/folgarida-marilleva/index.js +2 -1
  108. package/lib/resorts/forni/index.js +1 -1
  109. package/lib/resorts/forni/resort.json +1 -1
  110. package/lib/resorts/gore-mountain/index.js +1 -1
  111. package/lib/resorts/grand-targhee/index.js +1 -1
  112. package/lib/resorts/grouse/index.js +1 -1
  113. package/lib/resorts/gunstock/index.js +1 -1
  114. package/lib/resorts/heavenly/index.js +1 -1
  115. package/lib/resorts/hochfuegen/index.js +2 -2
  116. package/lib/resorts/homewood/index.js +1 -1
  117. package/lib/resorts/hoodoo/index.js +1 -1
  118. package/lib/resorts/hunter/index.js +1 -1
  119. package/lib/resorts/ischgl-silvretta-arena/index.js +1 -1
  120. package/lib/resorts/jackson-hole/index.js +5 -3
  121. package/lib/resorts/jay-peak/index.js +1 -1
  122. package/lib/resorts/jiminypeak/index.js +1 -1
  123. package/lib/resorts/june-mountain/index.js +1 -1
  124. package/lib/resorts/keystone/index.js +1 -1
  125. package/lib/resorts/killington/index.js +1 -1
  126. package/lib/resorts/king-pine/index.js +5 -3
  127. package/lib/resorts/kirkwood/index.js +1 -1
  128. package/lib/resorts/kitzbuehel/index.js +1 -1
  129. package/lib/resorts/lamolina/index.js +1 -1
  130. package/lib/resorts/lamolina/resort.json +1 -1
  131. package/lib/resorts/laplagne/index.js +1 -1
  132. package/lib/resorts/laplagne/resort.json +2 -1
  133. package/lib/resorts/larosiere/index.js +1 -1
  134. package/lib/resorts/lavarone/index.js +1 -1
  135. package/lib/resorts/lavarone/resort.json +1 -1
  136. package/lib/resorts/lesarcs/index.js +1 -1
  137. package/lib/resorts/lesmenuires/index.js +1 -1
  138. package/lib/resorts/lesmenuires/resort.json +2 -1
  139. package/lib/resorts/loon/index.js +1 -1
  140. package/lib/resorts/loveland/index.js +2 -2
  141. package/lib/resorts/mad-river-glen/index.js +2 -2
  142. package/lib/resorts/madonna-di-campiglio/index.js +2 -1
  143. package/lib/resorts/mammoth-lakes/index.js +1 -1
  144. package/lib/resorts/manning-park/index.js +1 -1
  145. package/lib/resorts/manning-park/resort.json +1 -1
  146. package/lib/resorts/megeve/index.js +1 -1
  147. package/lib/resorts/megeve/resort.json +2 -1
  148. package/lib/resorts/meribel/index.js +1 -1
  149. package/lib/resorts/meribel/resort.json +2 -1
  150. package/lib/resorts/monarch/index.js +2 -2
  151. package/lib/resorts/monte-amiata/index.js +1 -1
  152. package/lib/resorts/monte-amiata/resort.json +1 -1
  153. package/lib/resorts/monte-bondone/index.js +1 -1
  154. package/lib/resorts/montegenevre/index.js +1 -1
  155. package/lib/resorts/monterosa/index.js +1 -1
  156. package/lib/resorts/morzine/index.js +1 -1
  157. package/lib/resorts/morzine/resort.json +6 -2
  158. package/lib/resorts/mount-sunapee/index.js +1 -1
  159. package/lib/resorts/mountsnow/index.js +1 -1
  160. package/lib/resorts/mt-buller/index.js +1 -1
  161. package/lib/resorts/mt-hotham/index.js +5 -3
  162. package/lib/resorts/mt-seymour/index.js +1 -1
  163. package/lib/resorts/mt-spokane/index.js +1 -1
  164. package/lib/resorts/mtbachelor/index.js +1 -1
  165. package/lib/resorts/mtbrighton/index.js +1 -1
  166. package/lib/resorts/mthigh/index.js +1 -1
  167. package/lib/resorts/mthood/index.js +1 -1
  168. package/lib/resorts/mtpeter/index.js +1 -1
  169. package/lib/resorts/mtpeter/resort.json +1 -1
  170. package/lib/resorts/mtrose/index.js +1 -1
  171. package/lib/resorts/niseko/index.js +1 -1
  172. package/lib/resorts/niseko/resort.json +1 -1
  173. package/lib/resorts/northstar/index.js +1 -1
  174. package/lib/resorts/okemo/index.js +1 -1
  175. package/lib/resorts/ovindoli/index.js +1 -1
  176. package/lib/resorts/ovindoli/resort.json +1 -1
  177. package/lib/resorts/owlshead/index.js +1 -1
  178. package/lib/resorts/paganella/index.js +1 -1
  179. package/lib/resorts/paganella/resort.json +1 -1
  180. package/lib/resorts/palisades/index.js +1 -1
  181. package/lib/resorts/parkcity/index.js +1 -1
  182. package/lib/resorts/pats-peak/index.js +4 -2
  183. package/lib/resorts/peio/index.js +2 -2
  184. package/lib/resorts/perisher/index.js +1 -1
  185. package/lib/resorts/perisher/resort.json +1 -1
  186. package/lib/resorts/piancavallo/index.js +1 -1
  187. package/lib/resorts/piancavallo/resort.json +1 -1
  188. package/lib/resorts/pico/index.js +1 -1
  189. package/lib/resorts/pinzolo/index.js +2 -1
  190. package/lib/resorts/plan-de-corones/index.js +1 -1
  191. package/lib/resorts/plan-de-corones/resort.json +1 -1
  192. package/lib/resorts/pleasant-mountain/index.js +1 -1
  193. package/lib/resorts/pontedilegno-tonale/index.js +1 -1
  194. package/lib/resorts/ragged-mountain/index.js +1 -1
  195. package/lib/resorts/ravascletto-zoncolan/index.js +1 -1
  196. package/lib/resorts/ravascletto-zoncolan/resort.json +1 -1
  197. package/lib/resorts/red-lodge-mountain/index.js +1 -1
  198. package/lib/resorts/red-mountain/index.js +2 -3
  199. package/lib/resorts/rio-pusteria-bressanone/index.js +1 -1
  200. package/lib/resorts/rio-pusteria-bressanone/resort.json +1 -1
  201. package/lib/resorts/roccaraso/index.js +1 -1
  202. package/lib/resorts/roccaraso/resort.json +1 -1
  203. package/lib/resorts/saddleback/index.js +1 -1
  204. package/lib/resorts/san-martino-di-castrozza-passo-rolle/index.js +1 -1
  205. package/lib/resorts/san-martino-di-castrozza-passo-rolle/resort.json +1 -1
  206. package/lib/resorts/sansicario/index.js +1 -1
  207. package/lib/resorts/sappada/index.js +1 -1
  208. package/lib/resorts/sappada/resort.json +1 -1
  209. package/lib/resorts/sasquatch-mountain/index.js +1 -1
  210. package/lib/resorts/sauris/index.js +1 -1
  211. package/lib/resorts/sauris/resort.json +1 -1
  212. package/lib/resorts/sauze/index.js +1 -1
  213. package/lib/resorts/schweitzer/index.js +1 -1
  214. package/lib/resorts/sella/index.js +1 -1
  215. package/lib/resorts/sella/resort.json +1 -1
  216. package/lib/resorts/serfaus-fiss-ladis/index.js +1 -1
  217. package/lib/resorts/sestriere/index.js +1 -1
  218. package/lib/resorts/sestriere/resort.json +1 -1
  219. package/lib/resorts/shawnee-mountain/index.js +4 -2
  220. package/lib/resorts/sierra/index.js +1 -1
  221. package/lib/resorts/silver-star/index.js +2 -2
  222. package/lib/resorts/skiwelt/index.js +1 -1
  223. package/lib/resorts/smuggs/index.js +1 -1
  224. package/lib/resorts/snow-valley/index.js +2 -2
  225. package/lib/resorts/snowbasin/index.js +1 -1
  226. package/lib/resorts/snowbird/index.js +2 -3
  227. package/lib/resorts/snowmass/index.js +1 -1
  228. package/lib/resorts/snowshoe/index.js +1 -1
  229. package/lib/resorts/soelden/index.js +1 -1
  230. package/lib/resorts/solitude/index.js +1 -1
  231. package/lib/resorts/st-anton-am-arlberg/index.js +1 -1
  232. package/lib/resorts/steamboat/index.js +1 -1
  233. package/lib/resorts/stevens/index.js +1 -1
  234. package/lib/resorts/stowe/index.js +1 -1
  235. package/lib/resorts/stratton/index.js +1 -1
  236. package/lib/resorts/sugarbowl/index.js +1 -1
  237. package/lib/resorts/sugarbush/index.js +1 -1
  238. package/lib/resorts/sugarloaf/index.js +1 -1
  239. package/lib/resorts/sun-peaks/index.js +1 -1
  240. package/lib/resorts/sun-peaks/resort.json +1 -1
  241. package/lib/resorts/sunday-river/index.js +1 -1
  242. package/lib/resorts/sunshine-village/index.js +6 -3
  243. package/lib/resorts/sunvalley/index.js +1 -1
  244. package/lib/resorts/tahoe-donner/index.js +1 -1
  245. package/lib/resorts/taos/index.js +1 -1
  246. package/lib/resorts/tarvisio/index.js +1 -1
  247. package/lib/resorts/tarvisio/resort.json +1 -1
  248. package/lib/resorts/telluride/index.js +1 -1
  249. package/lib/resorts/thredbo/index.js +1 -1
  250. package/lib/resorts/tignes/index.js +1 -1
  251. package/lib/resorts/tignes/resort.json +1 -1
  252. package/lib/resorts/timberline-lodge/index.js +1 -1
  253. package/lib/resorts/tremblant/index.js +1 -1
  254. package/lib/resorts/vail/index.js +1 -1
  255. package/lib/resorts/val-di-fassa/index.js +1 -1
  256. package/lib/resorts/val-di-fassa/resort.json +1 -1
  257. package/lib/resorts/val-di-fiemme/index.js +1 -1
  258. package/lib/resorts/val-di-fiemme/resort.json +1 -1
  259. package/lib/resorts/val-gardena/index.js +1 -1
  260. package/lib/resorts/val-gardena/resort.json +1 -1
  261. package/lib/resorts/valdisere/index.js +1 -1
  262. package/lib/resorts/valdisere/resort.json +1 -1
  263. package/lib/resorts/verbier/index.js +1 -1
  264. package/lib/resorts/waterville/index.js +1 -1
  265. package/lib/resorts/whistler-blackcomb/index.js +2 -2
  266. package/lib/resorts/whistler-blackcomb/resort.json +1 -1
  267. package/lib/resorts/whiteface/index.js +1 -1
  268. package/lib/resorts/whitefish/index.js +1 -1
  269. package/lib/resorts/wildcat/index.js +1 -1
  270. package/lib/resorts/windham/index.js +1 -1
  271. package/lib/resorts/winter-park/index.js +1 -1
  272. package/lib/resorts/winterplace/index.js +1 -1
  273. package/lib/routes/cache.js +4 -4
  274. package/lib/routes/canonical.js +1 -3
  275. package/lib/routes/data.js +10 -12
  276. package/lib/routes/database.js +6 -7
  277. package/lib/routes/headers.js +2 -2
  278. package/lib/routes/index.js +9 -11
  279. package/lib/routes/plan.js +2 -4
  280. package/lib/routes/service-worker.js +6 -7
  281. package/lib/routes/sorter.js +2 -4
  282. package/lib/routes/tags.js +2 -4
  283. package/lib/select.js +3 -5
  284. package/lib/tools/aspen.js +4 -4
  285. package/lib/tools/boyne.js +4 -4
  286. package/lib/tools/campiglio-dolomiti.js +1 -1
  287. package/lib/tools/coerce.js +4 -4
  288. package/lib/tools/dolomitisuperski.js +1 -1
  289. package/lib/tools/domutil.js +11 -18
  290. package/lib/tools/infosnow.js +6 -6
  291. package/lib/tools/intrawest.js +3 -3
  292. package/lib/tools/limiter.js +2 -4
  293. package/lib/tools/lumiplan.js +2 -2
  294. package/lib/tools/millis.js +4 -11
  295. package/lib/tools/powdr.js +4 -4
  296. package/lib/tools/prism.js +5 -5
  297. package/lib/tools/skiplan.js +1 -1
  298. package/lib/tools/turismofvg.js +2 -2
  299. package/lib/tools/vail.js +8 -10
  300. package/lib/tools/vialattea.js +1 -1
  301. package/lib/weather/icons.js +3 -8
  302. package/lib/weather/index.js +5 -6
  303. package/lib/weather/noaa.js +5 -3
  304. package/lib/weather/openweather.js +6 -7
  305. package/lib/webcams.js +6 -6
  306. package/package.json +3 -2
  307. package/public/scripts/liftie-embed.js +41 -0
  308. package/public/scripts/liftie-embed.js.map +7 -0
  309. package/public/scripts/liftie.js +1561 -0
  310. package/public/scripts/liftie.js.map +7 -0
  311. package/public/stylesheets/style.css +864 -0
@@ -0,0 +1,1561 @@
1
+ (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+
28
+ // node_modules/.pnpm/transform-property@0.0.1/node_modules/transform-property/index.js
29
+ var require_transform_property = __commonJS({
30
+ "node_modules/.pnpm/transform-property@0.0.1/node_modules/transform-property/index.js"(exports, module) {
31
+ var styles = [
32
+ "webkitTransform",
33
+ "MozTransform",
34
+ "msTransform",
35
+ "OTransform",
36
+ "transform"
37
+ ];
38
+ var el = document.createElement("p");
39
+ var style;
40
+ for (i = 0; i < styles.length; i++) {
41
+ style = styles[i];
42
+ if (null != el.style[style]) {
43
+ module.exports = style;
44
+ break;
45
+ }
46
+ }
47
+ var i;
48
+ }
49
+ });
50
+
51
+ // node_modules/.pnpm/has-translate3d@0.0.3/node_modules/has-translate3d/index.js
52
+ var require_has_translate3d = __commonJS({
53
+ "node_modules/.pnpm/has-translate3d@0.0.3/node_modules/has-translate3d/index.js"(exports, module) {
54
+ var prop = require_transform_property();
55
+ if (!prop || !window.getComputedStyle) {
56
+ module.exports = false;
57
+ } else {
58
+ map = {
59
+ webkitTransform: "-webkit-transform",
60
+ OTransform: "-o-transform",
61
+ msTransform: "-ms-transform",
62
+ MozTransform: "-moz-transform",
63
+ transform: "transform"
64
+ };
65
+ el = document.createElement("div");
66
+ el.style[prop] = "translate3d(1px,1px,1px)";
67
+ document.body.insertBefore(el, null);
68
+ val = getComputedStyle(el).getPropertyValue(map[prop]);
69
+ document.body.removeChild(el);
70
+ module.exports = null != val && val.length && "none" != val;
71
+ }
72
+ var map;
73
+ var el;
74
+ var val;
75
+ }
76
+ });
77
+
78
+ // node_modules/.pnpm/component-emitter@1.3.1/node_modules/component-emitter/index.js
79
+ var require_component_emitter = __commonJS({
80
+ "node_modules/.pnpm/component-emitter@1.3.1/node_modules/component-emitter/index.js"(exports, module) {
81
+ if (typeof module !== "undefined") {
82
+ module.exports = Emitter;
83
+ }
84
+ function Emitter(obj) {
85
+ if (obj) return mixin(obj);
86
+ }
87
+ function mixin(obj) {
88
+ for (var key in Emitter.prototype) {
89
+ obj[key] = Emitter.prototype[key];
90
+ }
91
+ return obj;
92
+ }
93
+ Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn) {
94
+ this._callbacks = this._callbacks || {};
95
+ (this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn);
96
+ return this;
97
+ };
98
+ Emitter.prototype.once = function(event, fn) {
99
+ function on() {
100
+ this.off(event, on);
101
+ fn.apply(this, arguments);
102
+ }
103
+ on.fn = fn;
104
+ this.on(event, on);
105
+ return this;
106
+ };
107
+ Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn) {
108
+ this._callbacks = this._callbacks || {};
109
+ if (0 == arguments.length) {
110
+ this._callbacks = {};
111
+ return this;
112
+ }
113
+ var callbacks = this._callbacks["$" + event];
114
+ if (!callbacks) return this;
115
+ if (1 == arguments.length) {
116
+ delete this._callbacks["$" + event];
117
+ return this;
118
+ }
119
+ var cb;
120
+ for (var i = 0; i < callbacks.length; i++) {
121
+ cb = callbacks[i];
122
+ if (cb === fn || cb.fn === fn) {
123
+ callbacks.splice(i, 1);
124
+ break;
125
+ }
126
+ }
127
+ if (callbacks.length === 0) {
128
+ delete this._callbacks["$" + event];
129
+ }
130
+ return this;
131
+ };
132
+ Emitter.prototype.emit = function(event) {
133
+ this._callbacks = this._callbacks || {};
134
+ var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event];
135
+ for (var i = 1; i < arguments.length; i++) {
136
+ args[i - 1] = arguments[i];
137
+ }
138
+ if (callbacks) {
139
+ callbacks = callbacks.slice(0);
140
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
141
+ callbacks[i].apply(this, args);
142
+ }
143
+ }
144
+ return this;
145
+ };
146
+ Emitter.prototype.listeners = function(event) {
147
+ this._callbacks = this._callbacks || {};
148
+ return this._callbacks["$" + event] || [];
149
+ };
150
+ Emitter.prototype.hasListeners = function(event) {
151
+ return !!this.listeners(event).length;
152
+ };
153
+ }
154
+ });
155
+
156
+ // node_modules/.pnpm/@pirxpilot+events@1.0.1/node_modules/@pirxpilot/events/index.js
157
+ var require_events = __commonJS({
158
+ "node_modules/.pnpm/@pirxpilot+events@1.0.1/node_modules/@pirxpilot/events/index.js"(exports, module) {
159
+ module.exports = events;
160
+ function events(el, obj) {
161
+ var handlers = {};
162
+ function bind(name, handler, opts) {
163
+ if (!handler) {
164
+ handler = name;
165
+ }
166
+ if (typeof handler === "string") {
167
+ handler = obj[handler].bind(obj);
168
+ }
169
+ el.addEventListener(name, handler, opts);
170
+ handlers[name] = {
171
+ handler,
172
+ opts
173
+ };
174
+ }
175
+ function do_unbind(name) {
176
+ var h = handlers[name];
177
+ if (!h) {
178
+ return;
179
+ }
180
+ el.removeEventListener(name, h.handler, h.opts);
181
+ delete handlers[name];
182
+ }
183
+ function unbind(name) {
184
+ if (!name) {
185
+ return unbindAll();
186
+ }
187
+ do_unbind(name);
188
+ }
189
+ function unbindAll() {
190
+ Object.keys(handlers).forEach(do_unbind);
191
+ }
192
+ return {
193
+ bind,
194
+ unbind
195
+ };
196
+ }
197
+ }
198
+ });
199
+
200
+ // node_modules/.pnpm/@pirxpilot+swipe@2.0.2/node_modules/@pirxpilot/swipe/index.js
201
+ var require_swipe = __commonJS({
202
+ "node_modules/.pnpm/@pirxpilot+swipe@2.0.2/node_modules/@pirxpilot/swipe/index.js"(exports, module) {
203
+ var has3d = require_has_translate3d();
204
+ var Emitter = require_component_emitter();
205
+ var events = require_events();
206
+ var min = Math.min;
207
+ var max = Math.max;
208
+ module.exports = Swipe;
209
+ function Swipe(el) {
210
+ if (!(this instanceof Swipe)) return new Swipe(el);
211
+ if (!el) throw new TypeError("Swipe() requires an element");
212
+ this.child = el.children[0];
213
+ this.touchAction("none");
214
+ this.currentEl = this.children().visible[0];
215
+ this.currentVisible = 0;
216
+ this.current = 0;
217
+ this.el = el;
218
+ this.refresh();
219
+ this.interval(5e3);
220
+ this.duration(300);
221
+ this.fastThreshold(200);
222
+ this.threshold(0.5);
223
+ this.show(0, 0, { silent: true });
224
+ this.bind();
225
+ }
226
+ Emitter(Swipe.prototype);
227
+ Swipe.prototype.threshold = function(n) {
228
+ this._threshold = n;
229
+ };
230
+ Swipe.prototype.fastThreshold = function(ms) {
231
+ this._fastThreshold = ms;
232
+ };
233
+ Swipe.prototype.refresh = function() {
234
+ var children = this.children();
235
+ var visible2 = children.visible.length;
236
+ var prev = this.visible || visible2;
237
+ var i = indexOf(children.visible, this.currentEl);
238
+ if (visible2 < prev && i <= this.currentVisible && i >= 0) {
239
+ this.currentVisible -= this.currentVisible - i;
240
+ } else if (visible2 > prev && i > this.currentVisible) {
241
+ this.currentVisible += i - this.currentVisible;
242
+ }
243
+ this.visible = visible2;
244
+ this.childWidth = this.el.getBoundingClientRect().width;
245
+ this.width = Math.ceil(this.childWidth * visible2);
246
+ this.child.style.width = this.width + "px";
247
+ this.child.style.height = this.height + "px";
248
+ this.show(this.currentVisible, 0, { silent: true });
249
+ };
250
+ Swipe.prototype.bind = function() {
251
+ this.events = events(this.child, this);
252
+ this.docEvents = events(document, this);
253
+ if ("PointerEvent" in window) {
254
+ this.events.bind("pointerdown", "ontouchstart");
255
+ this.events.bind("pointermove", "ontouchmove");
256
+ this.events.bind("pointerup", "ontouchend");
257
+ this.events.bind("pointercancel", "ontouchend");
258
+ } else {
259
+ this.events.bind("mousedown", "ontouchstart");
260
+ this.events.bind("mousemove", "ontouchmove");
261
+ this.docEvents.bind("mouseup", "ontouchend");
262
+ this.events.bind("touchstart", "ontouchstart");
263
+ this.events.bind("touchmove", "ontouchmove");
264
+ this.docEvents.bind("touchend", "ontouchend");
265
+ }
266
+ };
267
+ Swipe.prototype.unbind = function() {
268
+ this.events.unbind();
269
+ this.docEvents.unbind();
270
+ };
271
+ Swipe.prototype.ontouchstart = function(e) {
272
+ this.transitionDuration(0);
273
+ this.dx = 0;
274
+ this.updown = null;
275
+ if ("PointerEvent" in window) {
276
+ e.target.setPointerCapture(e.pointerId);
277
+ }
278
+ var touch = this.getTouch(e);
279
+ this.down = {
280
+ x: touch.pageX,
281
+ y: touch.pageY,
282
+ at: /* @__PURE__ */ new Date()
283
+ };
284
+ };
285
+ Swipe.prototype.ontouchmove = function(e) {
286
+ if (!this.down || this.updown) return;
287
+ var touch = this.getTouch(e);
288
+ if (!touch) return;
289
+ var down = this.down;
290
+ var x = touch.pageX;
291
+ var w = this.childWidth;
292
+ var i = this.currentVisible;
293
+ this.dx = x - down.x;
294
+ if (null == this.updown) {
295
+ var y = touch.pageY;
296
+ var dy = y - down.y;
297
+ var slope = dy / this.dx;
298
+ if (slope > 1 || slope < -1) {
299
+ this.updown = true;
300
+ return;
301
+ } else {
302
+ this.updown = false;
303
+ }
304
+ }
305
+ e.preventDefault();
306
+ var dir = this.dx < 0 ? 1 : 0;
307
+ if (this.isFirst() && 0 === dir) this.dx /= 2;
308
+ if (this.isLast() && 1 === dir) this.dx /= 2;
309
+ this.translate(i * w + -this.dx);
310
+ };
311
+ Swipe.prototype.ontouchend = function(e) {
312
+ e.stopPropagation();
313
+ if (!this.down) return;
314
+ if ("PointerEvent" in window) {
315
+ e.target.releasePointerCapture(e.pointerId);
316
+ }
317
+ var dx = this.dx;
318
+ var w = this.childWidth;
319
+ var ms = /* @__PURE__ */ new Date() - this.down.at;
320
+ var threshold = ms < this._fastThreshold ? w / 10 : w * this._threshold;
321
+ var dir = dx < 0 ? 1 : 0;
322
+ var half = Math.abs(dx) >= threshold;
323
+ this.down = null;
324
+ if (this.isFirst() && 1 == dir && half) return this.next();
325
+ if (this.isFirst()) return this.prev();
326
+ if (this.isLast() && 1 == dir) return this.next();
327
+ if (1 === dir && half) return this.next();
328
+ if (0 === dir && half) return this.prev();
329
+ this.show(this.currentVisible);
330
+ };
331
+ Swipe.prototype.duration = function(ms) {
332
+ this._duration = ms;
333
+ return this;
334
+ };
335
+ Swipe.prototype.interval = function(ms) {
336
+ this._interval = ms;
337
+ return this;
338
+ };
339
+ Swipe.prototype.play = function() {
340
+ if (this.timer) return;
341
+ this.timer = setInterval(this.cycle.bind(this), this._interval);
342
+ return this;
343
+ };
344
+ Swipe.prototype.stop = function() {
345
+ clearInterval(this.timer);
346
+ this.timer = null;
347
+ return this;
348
+ };
349
+ Swipe.prototype.cycle = function() {
350
+ if (this.isLast()) {
351
+ this.currentVisible = -1;
352
+ this.next();
353
+ } else {
354
+ this.next();
355
+ }
356
+ };
357
+ Swipe.prototype.isFirst = function() {
358
+ return this.currentVisible === 0;
359
+ };
360
+ Swipe.prototype.isLast = function() {
361
+ return this.currentVisible == this.visible - 1;
362
+ };
363
+ Swipe.prototype.prev = function() {
364
+ this.show(this.currentVisible - 1);
365
+ return this;
366
+ };
367
+ Swipe.prototype.next = function() {
368
+ this.show(this.currentVisible + 1);
369
+ return this;
370
+ };
371
+ Swipe.prototype.show = function(i, ms, options) {
372
+ options = options || {};
373
+ if (null == ms) ms = this._duration;
374
+ var self = this;
375
+ var children = this.children();
376
+ i = max(0, min(i, children.visible.length - 1));
377
+ this.currentVisible = i;
378
+ this.currentEl = children.visible[i];
379
+ this.current = indexOf(children.all, this.currentEl);
380
+ this.transitionDuration(ms);
381
+ this.translate(this.childWidth * i);
382
+ if (!options.silent) {
383
+ this.emit("showing", this.current, this.currentEl);
384
+ if (!ms) return this;
385
+ this.child.addEventListener("transitionend", function shown() {
386
+ if (self.current == i) self.emit("show", self.current, self.currentEl);
387
+ self.child.removeEventListener("transitionend", shown);
388
+ });
389
+ }
390
+ return this;
391
+ };
392
+ Swipe.prototype.children = function() {
393
+ var els = this.child.children;
394
+ var ret = {
395
+ all: els,
396
+ visible: [],
397
+ hidden: []
398
+ };
399
+ for (var i = 0; i < els.length; i++) {
400
+ var el = els[i];
401
+ if (visible(el)) {
402
+ ret.visible.push(el);
403
+ } else {
404
+ ret.hidden.push(el);
405
+ }
406
+ }
407
+ return ret;
408
+ };
409
+ Swipe.prototype.transitionDuration = function(ms) {
410
+ var s = this.child.style;
411
+ s.transition = ms + "ms transform";
412
+ };
413
+ Swipe.prototype.translate = function(x) {
414
+ var s = this.child.style;
415
+ x = -x;
416
+ if (has3d) {
417
+ s.transform = "translate3d(" + x + "px, 0, 0)";
418
+ } else {
419
+ s.transform = "translateX(" + x + "px)";
420
+ }
421
+ };
422
+ Swipe.prototype.touchAction = function(value) {
423
+ var s = this.child.style;
424
+ s.touchAction = value;
425
+ };
426
+ Swipe.prototype.getTouch = function(e) {
427
+ var touch = e;
428
+ if (e.changedTouches && e.changedTouches.length > 0) {
429
+ touch = e.changedTouches[0];
430
+ }
431
+ return touch;
432
+ };
433
+ function indexOf(els, el) {
434
+ for (var i = 0; i < els.length; i++) {
435
+ if (els[i] == el) return i;
436
+ }
437
+ return -1;
438
+ }
439
+ function visible(el) {
440
+ return getComputedStyle(el).display != "none";
441
+ }
442
+ }
443
+ });
444
+
445
+ // node_modules/.pnpm/el-component@1.0.1/node_modules/el-component/index.js
446
+ var require_el_component = __commonJS({
447
+ "node_modules/.pnpm/el-component@1.0.1/node_modules/el-component/index.js"(exports, module) {
448
+ var voids = [
449
+ "area",
450
+ "base",
451
+ "br",
452
+ "col",
453
+ "embed",
454
+ "hr",
455
+ "img",
456
+ "input",
457
+ "keygen",
458
+ "link",
459
+ "menuitem",
460
+ "meta",
461
+ "param",
462
+ "source",
463
+ "track",
464
+ "wbr"
465
+ ].reduce(function(o, v) {
466
+ o[v] = true;
467
+ return o;
468
+ }, /* @__PURE__ */ Object.create(null));
469
+ function htmlTag(tag2, content, attrStr) {
470
+ var text = [
471
+ "<",
472
+ tag2,
473
+ attrStr ? " " + attrStr : "",
474
+ ">"
475
+ ];
476
+ if (!voids[tag2]) {
477
+ text = text.concat([
478
+ content || "",
479
+ "</",
480
+ tag2,
481
+ ">"
482
+ ]);
483
+ }
484
+ return text;
485
+ }
486
+ function xmlTag(tag2, content, attrStr) {
487
+ var text = [
488
+ "<",
489
+ tag2,
490
+ attrStr ? " " + attrStr : ""
491
+ ];
492
+ if (!content || !content.length) {
493
+ text.push("/>");
494
+ } else {
495
+ text = text.concat([
496
+ ">",
497
+ content,
498
+ "</",
499
+ tag2,
500
+ ">"
501
+ ]);
502
+ }
503
+ return text;
504
+ }
505
+ function toStr(tagFn, tag2, content, attrs) {
506
+ var attrStr, classes, ids;
507
+ if (typeof content !== "string") {
508
+ attrs = content;
509
+ content = "";
510
+ }
511
+ tag2 = tag2 || "";
512
+ attrs = attrs || {};
513
+ classes = tag2.split(".");
514
+ tag2 = classes.shift() || "div";
515
+ if (classes.length) {
516
+ classes = classes.join(" ");
517
+ if (attrs["class"]) {
518
+ attrs["class"] += " " + classes;
519
+ } else {
520
+ attrs["class"] = classes;
521
+ }
522
+ }
523
+ ids = tag2.split("#");
524
+ if (ids.length > 1) {
525
+ tag2 = ids[0] || "div";
526
+ attrs.id = ids[1];
527
+ }
528
+ attrStr = Object.keys(attrs).map(function(attr) {
529
+ return attr + '="' + attrs[attr] + '"';
530
+ }).join(" ");
531
+ return tagFn(tag2, content, attrStr).join("");
532
+ }
533
+ module.exports = toStr.bind(null, htmlTag);
534
+ module.exports.xml = toStr.bind(null, xmlTag);
535
+ }
536
+ });
537
+
538
+ // node_modules/.pnpm/tiny-pager@1.0.0/node_modules/tiny-pager/index.js
539
+ var require_tiny_pager = __commonJS({
540
+ "node_modules/.pnpm/tiny-pager@1.0.0/node_modules/tiny-pager/index.js"(exports, module) {
541
+ var Emitter = require_component_emitter();
542
+ var el = require_el_component();
543
+ module.exports = Pager;
544
+ function Pager(el2) {
545
+ if (!(this instanceof Pager)) {
546
+ return new Pager(el2);
547
+ }
548
+ this._total = 0;
549
+ this._current = 0;
550
+ this.el = el2;
551
+ el2.addEventListener("click", this.onclick.bind(this));
552
+ }
553
+ Emitter(Pager.prototype);
554
+ Pager.prototype.total = function total(t) {
555
+ this._total = t;
556
+ return this;
557
+ };
558
+ Pager.prototype.onclick = function onclick(e) {
559
+ var page, target = e.target || e.srcElement;
560
+ page = Array.prototype.indexOf.call(this.el.children, target);
561
+ if (page < 0) {
562
+ return;
563
+ }
564
+ e.preventDefault();
565
+ e.stopPropagation();
566
+ this.select(page);
567
+ };
568
+ Pager.prototype.select = function select(page, opts) {
569
+ var silent = opts && opts.silent;
570
+ if (page === this._current) {
571
+ return;
572
+ }
573
+ Array.prototype.forEach.call(this.el.children, function(a, i) {
574
+ a.className = i == page ? "active" : "inactive";
575
+ });
576
+ this._current = page;
577
+ if (!silent) {
578
+ this.emit("show", this._current);
579
+ }
580
+ return this;
581
+ };
582
+ Pager.prototype.render = function render6() {
583
+ var i, html = [];
584
+ for (i = 0; i < this._total; i++) {
585
+ html.push(i !== this._current ? "a.inactive" : "a.active");
586
+ }
587
+ this.el.innerHTML = html.map(function(item) {
588
+ return el(item);
589
+ }).join("");
590
+ return this;
591
+ };
592
+ }
593
+ });
594
+
595
+ // node_modules/.pnpm/yields-keycode@1.1.0/node_modules/yields-keycode/index.js
596
+ var require_yields_keycode = __commonJS({
597
+ "node_modules/.pnpm/yields-keycode@1.1.0/node_modules/yields-keycode/index.js"(exports, module) {
598
+ var map = {
599
+ backspace: 8,
600
+ command: 91,
601
+ tab: 9,
602
+ clear: 12,
603
+ enter: 13,
604
+ shift: 16,
605
+ ctrl: 17,
606
+ alt: 18,
607
+ capslock: 20,
608
+ escape: 27,
609
+ esc: 27,
610
+ space: 32,
611
+ pageup: 33,
612
+ pagedown: 34,
613
+ end: 35,
614
+ home: 36,
615
+ left: 37,
616
+ up: 38,
617
+ right: 39,
618
+ down: 40,
619
+ del: 46,
620
+ comma: 188,
621
+ f1: 112,
622
+ f2: 113,
623
+ f3: 114,
624
+ f4: 115,
625
+ f5: 116,
626
+ f6: 117,
627
+ f7: 118,
628
+ f8: 119,
629
+ f9: 120,
630
+ f10: 121,
631
+ f11: 122,
632
+ f12: 123,
633
+ ",": 188,
634
+ ".": 190,
635
+ "/": 191,
636
+ "`": 192,
637
+ "-": 189,
638
+ "=": 187,
639
+ ";": 186,
640
+ "[": 219,
641
+ "\\": 220,
642
+ "]": 221,
643
+ "'": 222
644
+ };
645
+ module.exports = function(name) {
646
+ return map[name.toLowerCase()] || name.toUpperCase().charCodeAt(0);
647
+ };
648
+ }
649
+ });
650
+
651
+ // node_modules/.pnpm/yields-k-sequence@0.1.0/node_modules/yields-k-sequence/index.js
652
+ var require_yields_k_sequence = __commonJS({
653
+ "node_modules/.pnpm/yields-k-sequence@0.1.0/node_modules/yields-k-sequence/index.js"(exports, module) {
654
+ var keycode = require_yields_keycode();
655
+ module.exports = sequence;
656
+ function sequence(keys, ms, fn) {
657
+ var codes = keys.split(/ +/).map(keycode), clen = codes.length, seq = [], i = 0, prev;
658
+ if (2 == arguments.length) {
659
+ fn = ms;
660
+ ms = 500;
661
+ }
662
+ return function(e) {
663
+ var code = codes[i++];
664
+ if (42 != code && code != e.which) return reset();
665
+ if (prev && /* @__PURE__ */ new Date() - prev > ms) return reset();
666
+ var len = seq.push(e.which);
667
+ prev = /* @__PURE__ */ new Date();
668
+ if (len != clen) return;
669
+ reset();
670
+ fn(e);
671
+ };
672
+ function reset() {
673
+ prev = null;
674
+ seq = [];
675
+ i = 0;
676
+ }
677
+ }
678
+ }
679
+ });
680
+
681
+ // node_modules/.pnpm/component-os@0.0.1/node_modules/component-os/index.js
682
+ var require_component_os = __commonJS({
683
+ "node_modules/.pnpm/component-os@0.0.1/node_modules/component-os/index.js"(exports, module) {
684
+ module.exports = os();
685
+ function os() {
686
+ var ua = navigator.userAgent;
687
+ if (/mac/i.test(ua)) return "mac";
688
+ if (/win/i.test(ua)) return "windows";
689
+ if (/linux/i.test(ua)) return "linux";
690
+ }
691
+ }
692
+ });
693
+
694
+ // node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/proto.js
695
+ var require_proto = __commonJS({
696
+ "node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/proto.js"(exports) {
697
+ var sequence = require_yields_k_sequence();
698
+ var keycode = require_yields_keycode();
699
+ var os = require_component_os();
700
+ var modifiers = {
701
+ 224: "command",
702
+ 91: "command",
703
+ 93: "command",
704
+ 16: "shift",
705
+ 17: "ctrl",
706
+ 18: "alt"
707
+ };
708
+ exports["super"] = "mac" == os ? "command" : "ctrl";
709
+ exports.handle = function(e, fn) {
710
+ var ignore = this.ignore;
711
+ var event = e.type;
712
+ var code = e.which;
713
+ if (fn) return this.bind(e, fn);
714
+ var mod = modifiers[code];
715
+ if ("keydown" == event && mod) {
716
+ this["super"] = exports["super"] == mod;
717
+ this[mod] = true;
718
+ this.modifiers = true;
719
+ this.active++;
720
+ return;
721
+ }
722
+ if (ignore && ignore(e)) return;
723
+ var all = this.listeners;
724
+ for (var i = 0; i < all.length; ++i) {
725
+ var invoke = true;
726
+ var obj = all[i];
727
+ var seq = obj.seq;
728
+ var mods = obj.mods;
729
+ fn = seq || obj.fn;
730
+ if (!seq && code != obj.code) continue;
731
+ if (event != obj.event) continue;
732
+ if (this.active != obj.mods.length) continue;
733
+ for (var j = 0; j < mods.length; ++j) {
734
+ if (!this[mods[j]]) {
735
+ invoke = null;
736
+ break;
737
+ }
738
+ }
739
+ if (invoke) {
740
+ fn(e);
741
+ }
742
+ }
743
+ };
744
+ exports.destroy = function() {
745
+ this.el.removeEventListener("keydown", this._handle);
746
+ this.el.removeEventListener("keyup", this._handle);
747
+ this.el.removeEventListener("keyup", this._clear);
748
+ this.el.removeEventListener("focus", this._clear);
749
+ this.listeners = [];
750
+ };
751
+ exports.unbind = function(keys, fn) {
752
+ var fns = this.listeners;
753
+ var len = fns.length;
754
+ var all;
755
+ if (0 === arguments.length) {
756
+ this.listeners = [];
757
+ return this;
758
+ }
759
+ all = parseKeys(keys);
760
+ for (var i = 0; i < all.length; ++i) {
761
+ for (var j = 0, obj; j < len; ++j) {
762
+ obj = fns[j];
763
+ if (!obj) continue;
764
+ if (fn && obj.fn != fn) continue;
765
+ if (obj.key != all[i].key) continue;
766
+ if (!matches(obj, all[i])) continue;
767
+ fns.splice(j--, 1);
768
+ }
769
+ }
770
+ return this;
771
+ };
772
+ exports.bind = function(event, keys, fn) {
773
+ var fns = this.listeners;
774
+ var len;
775
+ var all;
776
+ if (2 == arguments.length) {
777
+ fn = keys;
778
+ keys = event;
779
+ event = "keydown";
780
+ }
781
+ all = parseKeys(keys);
782
+ len = all.length;
783
+ for (var i = 0; i < len; ++i) {
784
+ var obj = all[i];
785
+ obj.seq = obj.seq && sequence(obj.key, fn);
786
+ obj.event = event;
787
+ obj.fn = fn;
788
+ fns.push(obj);
789
+ }
790
+ return this;
791
+ };
792
+ exports.up = function(keys, fn) {
793
+ return this.bind("keyup", keys, fn);
794
+ };
795
+ exports.down = function(keys, fn) {
796
+ return this.bind("keydown", keys, fn);
797
+ };
798
+ exports.clear = function(e) {
799
+ var code = e.keyCode || e.which;
800
+ if (!(code in modifiers)) return;
801
+ this.active--;
802
+ this[modifiers[code]] = null;
803
+ this.modifiers = this.command || this.shift || this.ctrl || this.alt;
804
+ };
805
+ exports.reset = function() {
806
+ this.active = 0;
807
+ this.modifiers = this.command = this.shift = this.ctrl = this.alt = null;
808
+ };
809
+ exports.ignore = function(e) {
810
+ var el = e.target || e.srcElement;
811
+ var name = el.tagName.toLowerCase();
812
+ return "textarea" == name || "select" == name || "input" == name;
813
+ };
814
+ function parseKeys(keys) {
815
+ keys = keys.replace("super", exports["super"]);
816
+ var all = "," != keys ? keys.split(/ *, */) : [","];
817
+ var ret = [];
818
+ for (var i = 0; i < all.length; ++i) {
819
+ if ("" === all[i]) continue;
820
+ var mods = all[i].split(/ *\+ */);
821
+ var key = mods.pop() || ",";
822
+ ret.push({
823
+ seq: !!(~key.indexOf(" ") || ~key.indexOf("*")),
824
+ code: keycode(key),
825
+ mods,
826
+ key
827
+ });
828
+ }
829
+ return ret;
830
+ }
831
+ function matches(a, b) {
832
+ return 0 === b.mods.length || eql(a, b);
833
+ }
834
+ function eql(a, b) {
835
+ a = a.mods.sort().toString();
836
+ b = b.mods.sort().toString();
837
+ return a == b;
838
+ }
839
+ }
840
+ });
841
+
842
+ // node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/index.js
843
+ var require_lib = __commonJS({
844
+ "node_modules/.pnpm/@pirxpilot+k@1.0.1/node_modules/@pirxpilot/k/lib/index.js"(exports, module) {
845
+ var proto = require_proto();
846
+ module.exports = function(el) {
847
+ function k2(e, fn) {
848
+ k2.handle(e, fn);
849
+ }
850
+ k2._handle = proto.handle.bind(k2);
851
+ k2._clear = proto.clear.bind(k2);
852
+ k2._reset = proto.reset.bind(k2);
853
+ el.addEventListener("keydown", k2._handle, false);
854
+ el.addEventListener("keyup", k2._handle, false);
855
+ el.addEventListener("keyup", k2._clear, false);
856
+ el.addEventListener("focus", k2._reset, false);
857
+ for (var p in proto) k2[p] = proto[p];
858
+ k2.listeners = [];
859
+ k2.active = 0;
860
+ k2.el = el;
861
+ return k2;
862
+ };
863
+ }
864
+ });
865
+
866
+ // node_modules/.pnpm/debounce@2.2.0/node_modules/debounce/index.js
867
+ var require_debounce = __commonJS({
868
+ "node_modules/.pnpm/debounce@2.2.0/node_modules/debounce/index.js"(exports, module) {
869
+ function debounce2(function_, wait = 100, options = {}) {
870
+ if (typeof function_ !== "function") {
871
+ throw new TypeError(`Expected the first parameter to be a function, got \`${typeof function_}\`.`);
872
+ }
873
+ if (wait < 0) {
874
+ throw new RangeError("`wait` must not be negative.");
875
+ }
876
+ const { immediate } = typeof options === "boolean" ? { immediate: options } : options;
877
+ let storedContext;
878
+ let storedArguments;
879
+ let timeoutId;
880
+ let timestamp;
881
+ let result;
882
+ function run() {
883
+ const callContext = storedContext;
884
+ const callArguments = storedArguments;
885
+ storedContext = void 0;
886
+ storedArguments = void 0;
887
+ result = function_.apply(callContext, callArguments);
888
+ return result;
889
+ }
890
+ function later() {
891
+ const last = Date.now() - timestamp;
892
+ if (last < wait && last >= 0) {
893
+ timeoutId = setTimeout(later, wait - last);
894
+ } else {
895
+ timeoutId = void 0;
896
+ if (!immediate) {
897
+ result = run();
898
+ }
899
+ }
900
+ }
901
+ const debounced = function(...arguments_) {
902
+ if (storedContext && this !== storedContext && Object.getPrototypeOf(this) === Object.getPrototypeOf(storedContext)) {
903
+ throw new Error("Debounced method called with different contexts of the same prototype.");
904
+ }
905
+ storedContext = this;
906
+ storedArguments = arguments_;
907
+ timestamp = Date.now();
908
+ const callNow = immediate && !timeoutId;
909
+ if (!timeoutId) {
910
+ timeoutId = setTimeout(later, wait);
911
+ }
912
+ if (callNow) {
913
+ result = run();
914
+ }
915
+ return result;
916
+ };
917
+ Object.defineProperty(debounced, "isPending", {
918
+ get() {
919
+ return timeoutId !== void 0;
920
+ }
921
+ });
922
+ debounced.clear = () => {
923
+ if (!timeoutId) {
924
+ return;
925
+ }
926
+ clearTimeout(timeoutId);
927
+ timeoutId = void 0;
928
+ };
929
+ debounced.flush = () => {
930
+ if (!timeoutId) {
931
+ return;
932
+ }
933
+ debounced.trigger();
934
+ };
935
+ debounced.trigger = () => {
936
+ result = run();
937
+ debounced.clear();
938
+ };
939
+ return debounced;
940
+ }
941
+ module.exports.debounce = debounce2;
942
+ module.exports = debounce2;
943
+ }
944
+ });
945
+
946
+ // node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
947
+ function assign(target) {
948
+ for (var i = 1; i < arguments.length; i++) {
949
+ var source = arguments[i];
950
+ for (var key in source) {
951
+ target[key] = source[key];
952
+ }
953
+ }
954
+ return target;
955
+ }
956
+ var defaultConverter = {
957
+ read: function(value) {
958
+ if (value[0] === '"') {
959
+ value = value.slice(1, -1);
960
+ }
961
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
962
+ },
963
+ write: function(value) {
964
+ return encodeURIComponent(value).replace(
965
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
966
+ decodeURIComponent
967
+ );
968
+ }
969
+ };
970
+ function init(converter, defaultAttributes) {
971
+ function set(name, value, attributes) {
972
+ if (typeof document === "undefined") {
973
+ return;
974
+ }
975
+ attributes = assign({}, defaultAttributes, attributes);
976
+ if (typeof attributes.expires === "number") {
977
+ attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
978
+ }
979
+ if (attributes.expires) {
980
+ attributes.expires = attributes.expires.toUTCString();
981
+ }
982
+ name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
983
+ var stringifiedAttributes = "";
984
+ for (var attributeName in attributes) {
985
+ if (!attributes[attributeName]) {
986
+ continue;
987
+ }
988
+ stringifiedAttributes += "; " + attributeName;
989
+ if (attributes[attributeName] === true) {
990
+ continue;
991
+ }
992
+ stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
993
+ }
994
+ return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
995
+ }
996
+ function get(name) {
997
+ if (typeof document === "undefined" || arguments.length && !name) {
998
+ return;
999
+ }
1000
+ var cookies = document.cookie ? document.cookie.split("; ") : [];
1001
+ var jar = {};
1002
+ for (var i = 0; i < cookies.length; i++) {
1003
+ var parts = cookies[i].split("=");
1004
+ var value = parts.slice(1).join("=");
1005
+ try {
1006
+ var found = decodeURIComponent(parts[0]);
1007
+ jar[found] = converter.read(value, found);
1008
+ if (name === found) {
1009
+ break;
1010
+ }
1011
+ } catch (e) {
1012
+ }
1013
+ }
1014
+ return name ? jar[name] : jar;
1015
+ }
1016
+ return Object.create(
1017
+ {
1018
+ set,
1019
+ get,
1020
+ remove: function(name, attributes) {
1021
+ set(
1022
+ name,
1023
+ "",
1024
+ assign({}, attributes, {
1025
+ expires: -1
1026
+ })
1027
+ );
1028
+ },
1029
+ withAttributes: function(attributes) {
1030
+ return init(this.converter, assign({}, this.attributes, attributes));
1031
+ },
1032
+ withConverter: function(converter2) {
1033
+ return init(assign({}, this.converter, converter2), this.attributes);
1034
+ }
1035
+ },
1036
+ {
1037
+ attributes: { value: Object.freeze(defaultAttributes) },
1038
+ converter: { value: Object.freeze(converter) }
1039
+ }
1040
+ );
1041
+ }
1042
+ var api = init(defaultConverter, { path: "/" });
1043
+
1044
+ // lib/client/about/index.js
1045
+ function about() {
1046
+ const s = document.querySelector(".hidden .about");
1047
+ if (!s) {
1048
+ return;
1049
+ }
1050
+ if (!check()) {
1051
+ return;
1052
+ }
1053
+ const section = s.parentNode;
1054
+ const trigger = s.querySelector("a.close");
1055
+ trigger.addEventListener("click", (e) => {
1056
+ close();
1057
+ e.preventDefault();
1058
+ });
1059
+ open();
1060
+ function check() {
1061
+ return window.parent === window && typeof api.get("resorts-open") === "undefined";
1062
+ }
1063
+ function close() {
1064
+ section.classList.add("hidden");
1065
+ }
1066
+ function open() {
1067
+ section.classList.remove("hidden");
1068
+ }
1069
+ }
1070
+
1071
+ // lib/client/minimax/index.js
1072
+ function minimax(node, selector) {
1073
+ const my = {
1074
+ trigger: node.querySelector(selector),
1075
+ state: "open",
1076
+ // by default trigger 'open' state
1077
+ fn() {
1078
+ }
1079
+ };
1080
+ const self = {
1081
+ state: state2,
1082
+ on
1083
+ };
1084
+ function onclick(e) {
1085
+ e.preventDefault();
1086
+ const state3 = node.classList.toggle(my.state);
1087
+ my.fn.call(null, state3);
1088
+ }
1089
+ function state2(s) {
1090
+ my.state = s;
1091
+ return self;
1092
+ }
1093
+ function on(fn) {
1094
+ my.fn = fn;
1095
+ return self;
1096
+ }
1097
+ if (my.trigger) {
1098
+ my.trigger.addEventListener("click", onclick);
1099
+ }
1100
+ return self;
1101
+ }
1102
+
1103
+ // lib/client/resort/dom.js
1104
+ function removeAllChildren(node) {
1105
+ while (node.hasChildNodes()) {
1106
+ node.removeChild(node.lastChild);
1107
+ }
1108
+ }
1109
+ function next({ nextElementSibling, nextSibling }) {
1110
+ return nextElementSibling || nextSibling;
1111
+ }
1112
+
1113
+ // lib/client/resort/lifts.js
1114
+ render.section = 0;
1115
+ render.type = "lifts";
1116
+ var states = ["open", "hold", "scheduled", "closed"];
1117
+ function renderStatus(node, status) {
1118
+ removeAllChildren(node);
1119
+ if (status) {
1120
+ node.innerHTML = Object.keys(status).map((name) => {
1121
+ const klass = `status ls-${status[name]}`;
1122
+ return `<li class="lift"><span class="name">${name}</span><span class="${klass}"></span></li>`;
1123
+ }).join("");
1124
+ }
1125
+ }
1126
+ function renderStats(node, stats2) {
1127
+ states.forEach((s) => node.querySelector(`.ls-${s}`).innerHTML = stats2 ? stats2[s] : 0);
1128
+ }
1129
+ function renderColorBar(node, percentage) {
1130
+ states.forEach((state2) => {
1131
+ const width = `width:${percentage ? percentage[state2] : 25}%;`;
1132
+ node.querySelector(`.${state2}`).setAttribute("style", width);
1133
+ });
1134
+ }
1135
+ function render(node, { status, stats: stats2 }) {
1136
+ renderStatus(node.querySelector(".lifts"), status);
1137
+ renderStats(node.querySelector(".summary"), stats2);
1138
+ renderColorBar(node.querySelector(".summary-color-bar"), stats2.percentage);
1139
+ }
1140
+
1141
+ // lib/client/resort/snow.js
1142
+ var day = 24 * 60 * 60 * 1e3;
1143
+ render2.section = 1;
1144
+ render2.type = "snow";
1145
+ function renderField(div, field, snow) {
1146
+ const el = div.querySelector(`.${field}`);
1147
+ const value = snow[field];
1148
+ el.querySelector(".value").innerHTML = value || "";
1149
+ el.classList.toggle("hidden", !value);
1150
+ }
1151
+ function render2(div, snow) {
1152
+ if (Date.now() - snow.timestamp > day) {
1153
+ return false;
1154
+ }
1155
+ renderField(div, "snowfall", snow);
1156
+ renderField(div, "depth", snow);
1157
+ renderField(div, "condition", snow);
1158
+ div.querySelector(".notice").innerHTML = snow.notice || "";
1159
+ return true;
1160
+ }
1161
+
1162
+ // lib/client/resort/weather.js
1163
+ var day2 = 24 * 60 * 60 * 1e3;
1164
+ render3.section = 1;
1165
+ render3.type = "weather";
1166
+ function renderIcon(li, icon) {
1167
+ if (Array.isArray(icon)) {
1168
+ icon.forEach((cl, i) => li.item(i).setAttribute("class", cl));
1169
+ }
1170
+ }
1171
+ function renderNotice(el, notice) {
1172
+ if (!notice) {
1173
+ return el.classList.add("hidden");
1174
+ }
1175
+ el.classList.remove("hidden");
1176
+ el = el.querySelector("a");
1177
+ el.setAttribute("href", notice.href);
1178
+ el.setAttribute("title", `Go to ${notice.site}`);
1179
+ el = el.querySelector("img");
1180
+ el.setAttribute("src", notice.img);
1181
+ el.setAttribute("style", `width:${notice.width}px;`);
1182
+ el.setAttribute("alt", notice.site);
1183
+ }
1184
+ function render3(div, weather) {
1185
+ if (Date.now() - weather.timestamp > day2) {
1186
+ return false;
1187
+ }
1188
+ renderIcon(div.querySelectorAll(".weather-icon > ul > li"), weather.icon);
1189
+ div.querySelector(".temperature").innerHTML = `${weather.temperature.max}&deg;F`;
1190
+ const snowforecast = div.querySelector(".snowforecast");
1191
+ snowforecast.classList.toggle("hidden", !weather.snow);
1192
+ if (weather.snow) {
1193
+ snowforecast.innerHTML = `${weather.snow}"`;
1194
+ }
1195
+ div.querySelector(".conditions").innerHTML = weather.conditions;
1196
+ div.querySelector(".text").innerHTML = weather.text;
1197
+ renderNotice(div.querySelector(".notice"), weather.notice);
1198
+ return true;
1199
+ }
1200
+
1201
+ // lib/client/resort/webcams.js
1202
+ var import_swipe = __toESM(require_swipe(), 1);
1203
+ var import_tiny_pager = __toESM(require_tiny_pager(), 1);
1204
+ render4.section = 1;
1205
+ render4.type = "webcams";
1206
+ var DELAY = 15 * 60 * 1e3;
1207
+ function swiper(el) {
1208
+ const ui = {
1209
+ swipe: (0, import_swipe.default)(el.swipe),
1210
+ pager: (0, import_tiny_pager.default)(el.pager)
1211
+ };
1212
+ function refresh(count) {
1213
+ ui.swipe.refresh();
1214
+ ui.pager.total(count).render();
1215
+ el.pager.classList.toggle("hidden", count < 2);
1216
+ }
1217
+ function current() {
1218
+ return ui.swipe.currentVisible;
1219
+ }
1220
+ ui.pager.on("show", (n) => {
1221
+ ui.swipe.show(n, null, {
1222
+ silent: true
1223
+ });
1224
+ });
1225
+ ui.swipe.on("show", (n) => {
1226
+ ui.pager.select(n, {
1227
+ silent: true
1228
+ });
1229
+ });
1230
+ return {
1231
+ refresh,
1232
+ current
1233
+ };
1234
+ }
1235
+ function render4(div, webcams) {
1236
+ let cams;
1237
+ let timer;
1238
+ let ui;
1239
+ function refresh() {
1240
+ cams.forEach((it) => {
1241
+ const imgs = it.node.querySelectorAll("img");
1242
+ const fn = swap.bind(null, imgs, it);
1243
+ for (let i = 0; i < imgs.length; i++) {
1244
+ imgs[i].onload = fn;
1245
+ }
1246
+ imgs[it.inactive].setAttribute("src", imgs[it.active].getAttribute("src"));
1247
+ });
1248
+ }
1249
+ function initCam(cam, { source, image, name, notice }) {
1250
+ cam.querySelector("a").setAttribute("href", source);
1251
+ cam.querySelector("img.active").setAttribute("src", image);
1252
+ cam.querySelector("img.inactive").setAttribute("src", "");
1253
+ cam.querySelector(".title").innerHTML = name;
1254
+ cam.querySelector(".notice").innerHTML = notice || "";
1255
+ cams.push({
1256
+ node: cam,
1257
+ active: 0,
1258
+ inactive: 1
1259
+ });
1260
+ }
1261
+ function init3() {
1262
+ if (timer) {
1263
+ clearInterval(timer);
1264
+ timer = void 0;
1265
+ }
1266
+ cams = [];
1267
+ const ul = div.querySelector("ul");
1268
+ const li = ul.querySelectorAll("li");
1269
+ webcams.forEach((webcam, i) => {
1270
+ let cam;
1271
+ if (i < li.length) {
1272
+ cam = li[i];
1273
+ } else {
1274
+ cam = ul.appendChild(li[0].cloneNode(true));
1275
+ }
1276
+ initCam(cam.querySelector(".webcam"), webcam);
1277
+ });
1278
+ for (let i = Math.max(1, webcams.length); i < li.length; i++) {
1279
+ ul.removeChild(li[i]);
1280
+ }
1281
+ if (!ui) {
1282
+ ui = swiper({
1283
+ swipe: div.querySelector(".swipe"),
1284
+ pager: div.querySelector(".pager")
1285
+ });
1286
+ }
1287
+ ui.refresh(webcams.length);
1288
+ if (!cams.length) {
1289
+ return false;
1290
+ }
1291
+ timer = setInterval(refresh, DELAY);
1292
+ return true;
1293
+ }
1294
+ function swap(imgs, it) {
1295
+ it.active = (it.active + 1) % 2;
1296
+ it.inactive = (it.inactive + 1) % 2;
1297
+ imgs[it.inactive].setAttribute("class", "inactive");
1298
+ imgs[it.active].setAttribute("class", "active");
1299
+ imgs[it.inactive].setAttribute("src", "");
1300
+ }
1301
+ init3();
1302
+ }
1303
+
1304
+ // lib/client/resort/index.js
1305
+ function renderOpening(node, opening) {
1306
+ if (opening) {
1307
+ opening = opening.split("-");
1308
+ if (new Date(opening[0], opening[1] - 1, opening[2]).getTime() <= Date.now()) {
1309
+ node.dataset.opening = "";
1310
+ node = node.querySelector(".opening-date");
1311
+ node.parentNode.removeChild(node);
1312
+ }
1313
+ }
1314
+ }
1315
+ var plugins = [render, render3, render4, render2];
1316
+ function renderPlugins(node, getData) {
1317
+ const sec = next(node);
1318
+ plugins.forEach((plugin) => {
1319
+ const data = getData(plugin.type);
1320
+ if (!data) {
1321
+ return;
1322
+ }
1323
+ const el = plugin.section ? sec.querySelector(`.${plugin.type}`) : node;
1324
+ if (!el) {
1325
+ return;
1326
+ }
1327
+ const show = plugin(el, data);
1328
+ if (typeof show === "boolean") {
1329
+ el.classList.toggle("visible", show);
1330
+ el.classList.toggle("hiddent", !show);
1331
+ }
1332
+ });
1333
+ }
1334
+ function render5(node, resort2) {
1335
+ const tsPrev = JSON.parse(node.dataset.timestamp);
1336
+ const tsCurr = resort2.timestamp;
1337
+ renderPlugins(node, (plugin) => {
1338
+ if (!resort2[plugin] || !tsCurr[plugin]) {
1339
+ return;
1340
+ }
1341
+ if (tsPrev[plugin] && tsCurr[plugin] <= tsPrev[plugin]) {
1342
+ return;
1343
+ }
1344
+ return resort2[plugin];
1345
+ });
1346
+ renderOpening(node, node.dataset.opening);
1347
+ node.dataset.timestamp = JSON.stringify(tsCurr);
1348
+ }
1349
+ var MAX = 12;
1350
+ function resort(node) {
1351
+ let updateCounter = MAX;
1352
+ function updateTimeToRefresh(counter) {
1353
+ const ttr = node.querySelector(".time-to-refresh");
1354
+ ttr.innerHTML = counter * 5;
1355
+ }
1356
+ function refresh(now) {
1357
+ const id = node.dataset.resort;
1358
+ if (!node.classList.contains("open")) {
1359
+ return;
1360
+ }
1361
+ if (now) {
1362
+ updateCounter = 0;
1363
+ } else {
1364
+ updateCounter -= 1;
1365
+ }
1366
+ if (updateCounter > 0) {
1367
+ updateTimeToRefresh(updateCounter);
1368
+ return;
1369
+ }
1370
+ updateCounter = MAX;
1371
+ updateTimeToRefresh(updateCounter);
1372
+ fetch(`/api/resort/${id}`).then((res) => res.json()).then((resort2) => render5(node, resort2));
1373
+ }
1374
+ function init3() {
1375
+ const ds = node.dataset;
1376
+ updateTimeToRefresh(MAX);
1377
+ renderPlugins(node, (plugin) => {
1378
+ const data = ds[plugin];
1379
+ return data && JSON.parse(data);
1380
+ });
1381
+ }
1382
+ return {
1383
+ init: init3,
1384
+ refresh,
1385
+ node
1386
+ };
1387
+ }
1388
+
1389
+ // lib/client/state/index.js
1390
+ var import_k = __toESM(require_lib(), 1);
1391
+ var k = (0, import_k.default)(window);
1392
+ function state(nodes, st, keys) {
1393
+ const cookieName = `resorts-${st}`;
1394
+ const self = {
1395
+ load,
1396
+ save,
1397
+ update,
1398
+ read
1399
+ };
1400
+ function find(id) {
1401
+ return nodes.find((n) => n.dataset.resort === id);
1402
+ }
1403
+ function read() {
1404
+ const text = api.get(cookieName);
1405
+ return (text == null ? void 0 : text.length) ? text.split(",") : [];
1406
+ }
1407
+ function write(arr) {
1408
+ api.set(cookieName, arr.join(","), {
1409
+ expires: 30,
1410
+ path: "/",
1411
+ secure: window.location.protocol === "https:",
1412
+ sameSite: "strict"
1413
+ });
1414
+ }
1415
+ function update() {
1416
+ const state2 = read().reduce((memo, id) => {
1417
+ memo[id] = true;
1418
+ return memo;
1419
+ }, {});
1420
+ nodes.forEach(({ dataset, classList }) => {
1421
+ const id = dataset.resort;
1422
+ state2[id] = classList.contains(st);
1423
+ });
1424
+ const selected = Object.keys(state2).filter((id) => state2[id]);
1425
+ write(selected);
1426
+ return selected;
1427
+ }
1428
+ function save() {
1429
+ const selected = nodes.filter((n) => n.classList.contains(st)).map((n) => n.dataset.resort);
1430
+ write(selected);
1431
+ return selected;
1432
+ }
1433
+ function load() {
1434
+ const selected = read();
1435
+ selected.forEach((id) => {
1436
+ const node = find(id);
1437
+ if (node) {
1438
+ node.classList.add(st);
1439
+ }
1440
+ });
1441
+ return selected;
1442
+ }
1443
+ function all(on) {
1444
+ nodes.forEach((n) => n.classList.toggle(st, on));
1445
+ update();
1446
+ }
1447
+ if (keys) {
1448
+ k(keys.on, all.bind(null, true));
1449
+ k(keys.off, all.bind(null, false));
1450
+ }
1451
+ return self;
1452
+ }
1453
+
1454
+ // lib/client/stats/index.js
1455
+ function stats() {
1456
+ const pie = document.querySelector(".stats .pie");
1457
+ if (!pie) {
1458
+ return;
1459
+ }
1460
+ const data = JSON.parse(pie.dataset.stats);
1461
+ let ac = 0;
1462
+ const { style } = pie;
1463
+ Object.entries(data.percentage).forEach(([key, value]) => style.setProperty(`--${key}`, `${ac += value}%`));
1464
+ }
1465
+
1466
+ // lib/client/tag/index.js
1467
+ function tag(node) {
1468
+ let count;
1469
+ function update(c) {
1470
+ if (!count) {
1471
+ return;
1472
+ }
1473
+ count.innerHTML = c;
1474
+ node.classList.toggle("hidden", c <= 0);
1475
+ }
1476
+ if (node) {
1477
+ count = node.querySelector(".count");
1478
+ }
1479
+ return {
1480
+ update
1481
+ };
1482
+ }
1483
+
1484
+ // lib/client/boot/height.js
1485
+ var import_debounce = __toESM(require_debounce(), 1);
1486
+ function notify() {
1487
+ const widget = document.querySelector(".widget");
1488
+ if (!widget) {
1489
+ return;
1490
+ }
1491
+ window.parent.postMessage(
1492
+ {
1493
+ height: widget.scrollHeight,
1494
+ resort: window.location.pathname.split("/").pop()
1495
+ },
1496
+ "*"
1497
+ );
1498
+ }
1499
+ function postHeight() {
1500
+ if (window === window.parent) {
1501
+ return;
1502
+ }
1503
+ notify();
1504
+ window.addEventListener("resize", (0, import_debounce.default)(notify, 300), true);
1505
+ }
1506
+
1507
+ // lib/client/boot/service-worker.js
1508
+ function registrationHandler({ scope, installing, waiting, active }) {
1509
+ console.log("SW", scope);
1510
+ if (installing) {
1511
+ console.log("installing", installing.state);
1512
+ }
1513
+ if (waiting) {
1514
+ console.log("waiting", waiting.state);
1515
+ }
1516
+ if (active) {
1517
+ console.log("active", active.state);
1518
+ }
1519
+ }
1520
+ function register(url = "/sw.js") {
1521
+ if (navigator.serviceWorker && document.documentElement.hasAttribute("data-service-worker")) {
1522
+ return navigator.serviceWorker.register(url).then(registrationHandler).catch((reason) => console.log("SW registration failed!", reason));
1523
+ }
1524
+ }
1525
+
1526
+ // lib/client/boot/index.js
1527
+ register();
1528
+ init2();
1529
+ function init2() {
1530
+ const rnodes = Array.from(document.querySelectorAll(".resort"));
1531
+ const opens = state(rnodes, "open", {
1532
+ on: "shift + o",
1533
+ off: "shift + x"
1534
+ });
1535
+ const starred = state(rnodes, "starred");
1536
+ const starredTag = tag(document.querySelector(".tags .starred"));
1537
+ const resorts = rnodes.map((r) => resort(r));
1538
+ resorts.forEach((r) => {
1539
+ minimax(r.node, ".minimax").state("open").on((open) => {
1540
+ if (open) {
1541
+ r.refresh(true);
1542
+ }
1543
+ opens.update();
1544
+ });
1545
+ minimax(r.node, ".star").state("starred").on(() => starredTag.update(starred.update().length));
1546
+ r.init();
1547
+ });
1548
+ window.setInterval(() => resorts.forEach((r) => r.refresh()), 5 * 1e3);
1549
+ about();
1550
+ opens.update();
1551
+ starredTag.update(starred.load().length);
1552
+ stats();
1553
+ postHeight();
1554
+ }
1555
+ })();
1556
+ /*! Bundled license information:
1557
+
1558
+ js-cookie/dist/js.cookie.mjs:
1559
+ (*! js-cookie v3.0.5 | MIT *)
1560
+ */
1561
+ //# sourceMappingURL=liftie.js.map