@@ -0,0 +1,1893 @@
1+(() => {
2+ // output/Data.Function/index.js
3+ var flip = function(f) {
4+ return function(b) {
5+ return function(a) {
6+ return f(a)(b);
7+ };
8+ };
9+ };
10+ var $$const = function(a) {
11+ return function(v) {
12+ return a;
13+ };
14+ };
15+
16+ // output/Data.Functor/foreign.js
17+ var arrayMap = function(f) {
18+ return function(arr) {
19+ var l = arr.length;
20+ var result = new Array(l);
21+ for (var i = 0; i < l; i++) {
22+ result[i] = f(arr[i]);
23+ }
24+ return result;
25+ };
26+ };
27+
28+ // output/Data.Unit/foreign.js
29+ var unit = void 0;
30+
31+ // output/Data.Functor/index.js
32+ var map = function(dict) {
33+ return dict.map;
34+ };
35+ var functorArray = {
36+ map: arrayMap
37+ };
38+
39+ // output/Control.Apply/index.js
40+ var apply = function(dict) {
41+ return dict.apply;
42+ };
43+
44+ // output/Control.Applicative/index.js
45+ var pure = function(dict) {
46+ return dict.pure;
47+ };
48+ var liftA1 = function(dictApplicative) {
49+ var apply2 = apply(dictApplicative.Apply0());
50+ var pure1 = pure(dictApplicative);
51+ return function(f) {
52+ return function(a) {
53+ return apply2(pure1(f))(a);
54+ };
55+ };
56+ };
57+
58+ // output/Data.Array/foreign.js
59+ var rangeImpl = function(start2, end) {
60+ var step2 = start2 > end ? -1 : 1;
61+ var result = new Array(step2 * (end - start2) + 1);
62+ var i = start2, n = 0;
63+ while (i !== end) {
64+ result[n++] = i;
65+ i += step2;
66+ }
67+ result[n] = i;
68+ return result;
69+ };
70+ var replicateFill = function(count, value12) {
71+ if (count < 1) {
72+ return [];
73+ }
74+ var result = new Array(count);
75+ return result.fill(value12);
76+ };
77+ var replicatePolyfill = function(count, value12) {
78+ var result = [];
79+ var n = 0;
80+ for (var i = 0; i < count; i++) {
81+ result[n++] = value12;
82+ }
83+ return result;
84+ };
85+ var replicateImpl = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;
86+
87+ // output/Data.Semigroup/foreign.js
88+ var concatArray = function(xs) {
89+ return function(ys) {
90+ if (xs.length === 0) return ys;
91+ if (ys.length === 0) return xs;
92+ return xs.concat(ys);
93+ };
94+ };
95+
96+ // output/Data.Semigroup/index.js
97+ var semigroupArray = {
98+ append: concatArray
99+ };
100+ var append = function(dict) {
101+ return dict.append;
102+ };
103+
104+ // output/Control.Bind/foreign.js
105+ var arrayBind = typeof Array.prototype.flatMap === "function" ? function(arr) {
106+ return function(f) {
107+ return arr.flatMap(f);
108+ };
109+ } : function(arr) {
110+ return function(f) {
111+ var result = [];
112+ var l = arr.length;
113+ for (var i = 0; i < l; i++) {
114+ var xs = f(arr[i]);
115+ var k = xs.length;
116+ for (var j = 0; j < k; j++) {
117+ result.push(xs[j]);
118+ }
119+ }
120+ return result;
121+ };
122+ };
123+
124+ // output/Control.Bind/index.js
125+ var bind = function(dict) {
126+ return dict.bind;
127+ };
128+ var bindFlipped = function(dictBind) {
129+ return flip(bind(dictBind));
130+ };
131+
132+ // output/Control.Monad/index.js
133+ var ap = function(dictMonad) {
134+ var bind3 = bind(dictMonad.Bind1());
135+ var pure3 = pure(dictMonad.Applicative0());
136+ return function(f) {
137+ return function(a) {
138+ return bind3(f)(function(f$prime) {
139+ return bind3(a)(function(a$prime) {
140+ return pure3(f$prime(a$prime));
141+ });
142+ });
143+ };
144+ };
145+ };
146+
147+ // output/Data.Bounded/foreign.js
148+ var topChar = String.fromCharCode(65535);
149+ var bottomChar = String.fromCharCode(0);
150+ var topNumber = Number.POSITIVE_INFINITY;
151+ var bottomNumber = Number.NEGATIVE_INFINITY;
152+
153+ // output/Data.Show/foreign.js
154+ var showIntImpl = function(n) {
155+ return n.toString();
156+ };
157+
158+ // output/Data.Show/index.js
159+ var showInt = {
160+ show: showIntImpl
161+ };
162+ var show = function(dict) {
163+ return dict.show;
164+ };
165+
166+ // output/Data.Maybe/index.js
167+ var Nothing = /* @__PURE__ */ function() {
168+ function Nothing2() {
169+ }
170+ ;
171+ Nothing2.value = new Nothing2();
172+ return Nothing2;
173+ }();
174+ var Just = /* @__PURE__ */ function() {
175+ function Just2(value0) {
176+ this.value0 = value0;
177+ }
178+ ;
179+ Just2.create = function(value0) {
180+ return new Just2(value0);
181+ };
182+ return Just2;
183+ }();
184+
185+ // output/Data.Monoid/index.js
186+ var monoidArray = {
187+ mempty: [],
188+ Semigroup0: function() {
189+ return semigroupArray;
190+ }
191+ };
192+ var mempty = function(dict) {
193+ return dict.mempty;
194+ };
195+
196+ // output/Effect/foreign.js
197+ var pureE = function(a) {
198+ return function() {
199+ return a;
200+ };
201+ };
202+ var bindE = function(a) {
203+ return function(f) {
204+ return function() {
205+ return f(a())();
206+ };
207+ };
208+ };
209+
210+ // output/Effect/index.js
211+ var $runtime_lazy = function(name14, moduleName, init) {
212+ var state2 = 0;
213+ var val;
214+ return function(lineNumber) {
215+ if (state2 === 2) return val;
216+ if (state2 === 1) throw new ReferenceError(name14 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
217+ state2 = 1;
218+ val = init();
219+ state2 = 2;
220+ return val;
221+ };
222+ };
223+ var monadEffect = {
224+ Applicative0: function() {
225+ return applicativeEffect;
226+ },
227+ Bind1: function() {
228+ return bindEffect;
229+ }
230+ };
231+ var bindEffect = {
232+ bind: bindE,
233+ Apply0: function() {
234+ return $lazy_applyEffect(0);
235+ }
236+ };
237+ var applicativeEffect = {
238+ pure: pureE,
239+ Apply0: function() {
240+ return $lazy_applyEffect(0);
241+ }
242+ };
243+ var $lazy_functorEffect = /* @__PURE__ */ $runtime_lazy("functorEffect", "Effect", function() {
244+ return {
245+ map: liftA1(applicativeEffect)
246+ };
247+ });
248+ var $lazy_applyEffect = /* @__PURE__ */ $runtime_lazy("applyEffect", "Effect", function() {
249+ return {
250+ apply: ap(monadEffect),
251+ Functor0: function() {
252+ return $lazy_functorEffect(0);
253+ }
254+ };
255+ });
256+ var functorEffect = /* @__PURE__ */ $lazy_functorEffect(20);
257+
258+ // output/Effect.Ref/foreign.js
259+ var _new = function(val) {
260+ return function() {
261+ return { value: val };
262+ };
263+ };
264+ var read = function(ref) {
265+ return function() {
266+ return ref.value;
267+ };
268+ };
269+ var write = function(val) {
270+ return function(ref) {
271+ return function() {
272+ ref.value = val;
273+ };
274+ };
275+ };
276+
277+ // output/Effect.Ref/index.js
278+ var $$new = _new;
279+
280+ // output/Control.Monad.ST.Internal/foreign.js
281+ var map_ = function(f) {
282+ return function(a) {
283+ return function() {
284+ return f(a());
285+ };
286+ };
287+ };
288+ var pure_ = function(a) {
289+ return function() {
290+ return a;
291+ };
292+ };
293+ var bind_ = function(a) {
294+ return function(f) {
295+ return function() {
296+ return f(a())();
297+ };
298+ };
299+ };
300+
301+ // output/Control.Monad.ST.Internal/index.js
302+ var $runtime_lazy2 = function(name14, moduleName, init) {
303+ var state2 = 0;
304+ var val;
305+ return function(lineNumber) {
306+ if (state2 === 2) return val;
307+ if (state2 === 1) throw new ReferenceError(name14 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
308+ state2 = 1;
309+ val = init();
310+ state2 = 2;
311+ return val;
312+ };
313+ };
314+ var functorST = {
315+ map: map_
316+ };
317+ var monadST = {
318+ Applicative0: function() {
319+ return applicativeST;
320+ },
321+ Bind1: function() {
322+ return bindST;
323+ }
324+ };
325+ var bindST = {
326+ bind: bind_,
327+ Apply0: function() {
328+ return $lazy_applyST(0);
329+ }
330+ };
331+ var applicativeST = {
332+ pure: pure_,
333+ Apply0: function() {
334+ return $lazy_applyST(0);
335+ }
336+ };
337+ var $lazy_applyST = /* @__PURE__ */ $runtime_lazy2("applyST", "Control.Monad.ST.Internal", function() {
338+ return {
339+ apply: ap(monadST),
340+ Functor0: function() {
341+ return functorST;
342+ }
343+ };
344+ });
345+
346+ // output/Data.Foldable/foreign.js
347+ var foldrArray = function(f) {
348+ return function(init) {
349+ return function(xs) {
350+ var acc = init;
351+ var len = xs.length;
352+ for (var i = len - 1; i >= 0; i--) {
353+ acc = f(xs[i])(acc);
354+ }
355+ return acc;
356+ };
357+ };
358+ };
359+ var foldlArray = function(f) {
360+ return function(init) {
361+ return function(xs) {
362+ var acc = init;
363+ var len = xs.length;
364+ for (var i = 0; i < len; i++) {
365+ acc = f(acc)(xs[i]);
366+ }
367+ return acc;
368+ };
369+ };
370+ };
371+
372+ // output/Data.Tuple/index.js
373+ var Tuple = /* @__PURE__ */ function() {
374+ function Tuple2(value0, value1) {
375+ this.value0 = value0;
376+ this.value1 = value1;
377+ }
378+ ;
379+ Tuple2.create = function(value0) {
380+ return function(value1) {
381+ return new Tuple2(value0, value1);
382+ };
383+ };
384+ return Tuple2;
385+ }();
386+
387+ // output/Unsafe.Coerce/foreign.js
388+ var unsafeCoerce2 = function(x) {
389+ return x;
390+ };
391+
392+ // output/Data.Foldable/index.js
393+ var foldr = function(dict) {
394+ return dict.foldr;
395+ };
396+ var foldMapDefaultR = function(dictFoldable) {
397+ var foldr2 = foldr(dictFoldable);
398+ return function(dictMonoid) {
399+ var append3 = append(dictMonoid.Semigroup0());
400+ var mempty3 = mempty(dictMonoid);
401+ return function(f) {
402+ return foldr2(function(x) {
403+ return function(acc) {
404+ return append3(f(x))(acc);
405+ };
406+ })(mempty3);
407+ };
408+ };
409+ };
410+ var foldableArray = {
411+ foldr: foldrArray,
412+ foldl: foldlArray,
413+ foldMap: function(dictMonoid) {
414+ return foldMapDefaultR(foldableArray)(dictMonoid);
415+ }
416+ };
417+ var foldMap = function(dict) {
418+ return dict.foldMap;
419+ };
420+
421+ // output/Data.Function.Uncurried/foreign.js
422+ var runFn2 = function(fn) {
423+ return function(a) {
424+ return function(b) {
425+ return fn(a, b);
426+ };
427+ };
428+ };
429+
430+ // output/Data.Array/index.js
431+ var foldMap1 = /* @__PURE__ */ foldMap(foldableArray);
432+ var range2 = /* @__PURE__ */ runFn2(rangeImpl);
433+ var foldMap2 = function(dictMonoid) {
434+ return foldMap1(dictMonoid);
435+ };
436+
437+ // output/Maquette/foreign.js
438+ var NAMESPACE_W3 = "http://www.w3.org/";
439+ var NAMESPACE_SVG = NAMESPACE_W3 + "2000/svg";
440+ var NAMESPACE_XLINK = NAMESPACE_W3 + "1999/xlink";
441+ var emptyArray = [];
442+ var extend2 = function(base, overrides) {
443+ var result = {};
444+ Object.keys(base).forEach(function(key) {
445+ result[key] = base[key];
446+ });
447+ if (overrides) {
448+ Object.keys(overrides).forEach(function(key) {
449+ result[key] = overrides[key];
450+ });
451+ }
452+ return result;
453+ };
454+ var same = function(vnode1, vnode2) {
455+ if (vnode1.vnodeSelector !== vnode2.vnodeSelector) {
456+ return false;
457+ }
458+ if (vnode1.properties && vnode2.properties) {
459+ if (vnode1.properties.key !== vnode2.properties.key) {
460+ return false;
461+ }
462+ return vnode1.properties.bind === vnode2.properties.bind;
463+ }
464+ return !vnode1.properties && !vnode2.properties;
465+ };
466+ var checkStyleValue = function(styleValue) {
467+ if (typeof styleValue !== "string") {
468+ throw new Error("Style values must be strings");
469+ }
470+ };
471+ var findIndexOfChild = function(children, sameAs, start2) {
472+ if (sameAs.vnodeSelector !== "") {
473+ for (var i = start2; i < children.length; i++) {
474+ if (same(children[i], sameAs)) {
475+ return i;
476+ }
477+ }
478+ }
479+ return -1;
480+ };
481+ var checkDistinguishable = function(childNodes, indexToCheck, parentVNode, operation) {
482+ var childNode = childNodes[indexToCheck];
483+ if (childNode.vnodeSelector === "") {
484+ return;
485+ }
486+ var properties = childNode.properties;
487+ var key = properties ? properties.key === void 0 ? properties.bind : properties.key : void 0;
488+ if (!key) {
489+ for (var i = 0; i < childNodes.length; i++) {
490+ if (i !== indexToCheck) {
491+ var node = childNodes[i];
492+ if (same(node, childNode)) {
493+ throw {
494+ error: new Error(parentVNode.vnodeSelector + " had a " + childNode.vnodeSelector + " child " + (operation === "added" ? operation : "removed") + ", but there is now more than one. You must add unique key properties to make them distinguishable."),
495+ parentNode: parentVNode,
496+ childNode
497+ };
498+ }
499+ }
500+ }
501+ }
502+ };
503+ var nodeAdded = function(vNode) {
504+ if (vNode.properties) {
505+ var enterAnimation = vNode.properties.enterAnimation;
506+ if (enterAnimation) {
507+ enterAnimation(vNode.domNode, vNode.properties);
508+ }
509+ }
510+ };
511+ var removedNodes = [];
512+ var requestedIdleCallback = false;
513+ var visitRemovedNode = function(node) {
514+ (node.children || []).forEach(visitRemovedNode);
515+ if (node.properties && node.properties.afterRemoved) {
516+ node.properties.afterRemoved.apply(node.properties.bind || node.properties, [
517+ node.domNode
518+ ]);
519+ }
520+ };
521+ var processPendingNodeRemovals = function() {
522+ requestedIdleCallback = false;
523+ removedNodes.forEach(visitRemovedNode);
524+ removedNodes.length = 0;
525+ };
526+ var scheduleNodeRemoval = function(vNode) {
527+ removedNodes.push(vNode);
528+ if (!requestedIdleCallback) {
529+ requestedIdleCallback = true;
530+ if (typeof window !== "undefined" && "requestIdleCallback" in window) {
531+ window.requestIdleCallback(processPendingNodeRemovals, { timeout: 16 });
532+ } else {
533+ setTimeout(processPendingNodeRemovals, 16);
534+ }
535+ }
536+ };
537+ var nodeToRemove = function(vNode) {
538+ var domNode = vNode.domNode;
539+ if (vNode.properties) {
540+ var exitAnimation = vNode.properties.exitAnimation;
541+ if (exitAnimation) {
542+ domNode.style.pointerEvents = "none";
543+ var removeDomNode = function() {
544+ if (domNode.parentNode) {
545+ domNode.parentNode.removeChild(domNode);
546+ scheduleNodeRemoval(vNode);
547+ }
548+ };
549+ exitAnimation(domNode, removeDomNode, vNode.properties);
550+ return;
551+ }
552+ }
553+ if (domNode.parentNode) {
554+ domNode.parentNode.removeChild(domNode);
555+ scheduleNodeRemoval(vNode);
556+ }
557+ };
558+ var vnodeOnlyProps = [
559+ "afterCreate",
560+ "afterUpdate",
561+ "afterRemoved",
562+ "enterAnimation",
563+ "exitAnimation",
564+ "updateAnimation"
565+ ];
566+ function filterVNodeOnlyProps(name14) {
567+ return !vnodeOnlyProps.includes(name14);
568+ }
569+ var setProperties = function(domNode, properties, projectionOptions) {
570+ if (!properties) {
571+ return;
572+ }
573+ var eventHandlerInterceptor = projectionOptions.eventHandlerInterceptor;
574+ var propNames = Object.keys(properties).filter(filterVNodeOnlyProps);
575+ var propCount = propNames.length;
576+ for (var i = 0; i < propCount; i++) {
577+ var propName = propNames[i];
578+ var propValue = properties[propName];
579+ if (propName === "className") {
580+ throw new Error('Property "className" is not supported, use "class".');
581+ } else if (propName === "class") {
582+ toggleClasses(domNode, propValue, true);
583+ } else if (propName === "classes") {
584+ var classNames = Object.keys(propValue);
585+ var classNameCount = classNames.length;
586+ for (var j = 0; j < classNameCount; j++) {
587+ var className = classNames[j];
588+ if (propValue[className]) {
589+ domNode.classList.add(className);
590+ }
591+ }
592+ } else if (propName === "styles") {
593+ var styleNames = Object.keys(propValue);
594+ var styleCount = styleNames.length;
595+ for (var j = 0; j < styleCount; j++) {
596+ var styleName = styleNames[j];
597+ var styleValue = propValue[styleName];
598+ if (styleValue) {
599+ checkStyleValue(styleValue);
600+ projectionOptions.styleApplyer(domNode, styleName, styleValue);
601+ }
602+ }
603+ } else if (propName === "on" && propValue) {
604+ for (var _i = 0, _a = Object.entries(properties.on); _i < _a.length; _i++) {
605+ var _b = _a[_i], key = _b[0], handler = _b[1];
606+ var listener = typeof handler === "function" ? handler : handler.listener;
607+ if (eventHandlerInterceptor) {
608+ listener = eventHandlerInterceptor(key, listener, domNode, properties);
609+ }
610+ if (listener) {
611+ domNode.addEventListener(key, listener, typeof handler === "function" ? void 0 : handler.options);
612+ }
613+ }
614+ } else if (propName !== "key" && propValue !== null && propValue !== void 0) {
615+ var type = typeof propValue;
616+ if (type === "function") {
617+ if (propName.lastIndexOf("on", 0) === 0) {
618+ if (eventHandlerInterceptor) {
619+ propValue = eventHandlerInterceptor(propName, propValue, domNode, properties);
620+ }
621+ }
622+ domNode[propName] = propValue;
623+ } else if (projectionOptions.namespace === NAMESPACE_SVG) {
624+ if (propName === "href") {
625+ domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue);
626+ } else {
627+ domNode.setAttribute(propName, propValue);
628+ }
629+ } else if (type === "string" && propName !== "value" && propName !== "innerHTML") {
630+ domNode.setAttribute(propName, propValue);
631+ } else {
632+ domNode[propName] = propValue;
633+ }
634+ }
635+ }
636+ };
637+ var addChildren = function(domNode, children, projectionOptions) {
638+ if (!children) {
639+ return;
640+ }
641+ for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
642+ var child = children_1[_i];
643+ createDom(child, domNode, void 0, projectionOptions);
644+ }
645+ };
646+ var initPropertiesAndChildren = function(domNode, vnode, projectionOptions) {
647+ addChildren(domNode, vnode.children, projectionOptions);
648+ if (vnode.text) {
649+ domNode.textContent = vnode.text;
650+ }
651+ setProperties(domNode, vnode.properties, projectionOptions);
652+ if (vnode.properties && vnode.properties.afterCreate) {
653+ vnode.properties.afterCreate.apply(vnode.properties.bind || vnode.properties, [
654+ domNode,
655+ projectionOptions,
656+ vnode.vnodeSelector,
657+ vnode.properties,
658+ vnode.children
659+ ]);
660+ }
661+ };
662+ var createDom = function(vnode, parentNode, insertBefore, projectionOptions) {
663+ var _a;
664+ var domNode;
665+ var start2 = 0;
666+ var vnodeSelector = vnode.vnodeSelector;
667+ var doc = parentNode.ownerDocument;
668+ if (vnodeSelector === "") {
669+ if (vnode.domNode) {
670+ vnode.domNode.nodeValue = vnode.text;
671+ } else {
672+ domNode = vnode.domNode = doc.createTextNode(vnode.text);
673+ if (insertBefore !== void 0) {
674+ parentNode.insertBefore(domNode, insertBefore);
675+ } else {
676+ parentNode.appendChild(domNode);
677+ }
678+ }
679+ } else {
680+ for (var i = 0; i <= vnodeSelector.length; ++i) {
681+ var c = vnodeSelector.charAt(i);
682+ if (i === vnodeSelector.length || c === "." || c === "#") {
683+ var type = vnodeSelector.charAt(start2 - 1);
684+ var found = vnodeSelector.slice(start2, i);
685+ if (type === ".") {
686+ domNode.classList.add(found);
687+ } else if (type === "#") {
688+ domNode.id = found;
689+ } else {
690+ if (found === "svg") {
691+ projectionOptions = extend2(projectionOptions, {
692+ namespace: NAMESPACE_SVG
693+ });
694+ }
695+ if (projectionOptions.namespace !== void 0) {
696+ domNode = vnode.domNode = doc.createElementNS(projectionOptions.namespace, found);
697+ } else {
698+ domNode = vnode.domNode = vnode.domNode || (((_a = vnode.properties) === null || _a === void 0 ? void 0 : _a.is) ? doc.createElement(found, { is: vnode.properties.is }) : doc.createElement(found));
699+ if (found === "input" && vnode.properties && vnode.properties.type !== void 0) {
700+ domNode.setAttribute("type", vnode.properties.type);
701+ }
702+ }
703+ if (insertBefore !== void 0) {
704+ parentNode.insertBefore(domNode, insertBefore);
705+ } else if (domNode.parentNode !== parentNode) {
706+ parentNode.appendChild(domNode);
707+ }
708+ }
709+ start2 = i + 1;
710+ }
711+ }
712+ initPropertiesAndChildren(domNode, vnode, projectionOptions);
713+ }
714+ };
715+ var updateDom;
716+ var toggleClasses = function(domNode, classes, on2) {
717+ if (!classes) {
718+ return;
719+ }
720+ classes.split(" ").forEach(function(classToToggle) {
721+ if (classToToggle) {
722+ domNode.classList.toggle(classToToggle, on2);
723+ }
724+ });
725+ };
726+ var updateProperties = function(domNode, previousProperties, properties, projectionOptions) {
727+ if (!properties) {
728+ return;
729+ }
730+ var propertiesUpdated = false;
731+ var propNames = Object.keys(properties).filter(filterVNodeOnlyProps);
732+ var propCount = propNames.length;
733+ for (var i = 0; i < propCount; i++) {
734+ var propName = propNames[i];
735+ var propValue = properties[propName];
736+ var previousValue = previousProperties[propName];
737+ if (propName === "class") {
738+ if (previousValue !== propValue) {
739+ toggleClasses(domNode, previousValue, false);
740+ toggleClasses(domNode, propValue, true);
741+ }
742+ } else if (propName === "classes") {
743+ var classList = domNode.classList;
744+ var classNames = Object.keys(propValue);
745+ var classNameCount = classNames.length;
746+ for (var j = 0; j < classNameCount; j++) {
747+ var className = classNames[j];
748+ var on2 = !!propValue[className];
749+ var previousOn = !!previousValue[className];
750+ if (on2 === previousOn) {
751+ continue;
752+ }
753+ propertiesUpdated = true;
754+ if (on2) {
755+ classList.add(className);
756+ } else {
757+ classList.remove(className);
758+ }
759+ }
760+ } else if (propName === "styles") {
761+ var styleNames = Object.keys(propValue);
762+ var styleCount = styleNames.length;
763+ for (var j = 0; j < styleCount; j++) {
764+ var styleName = styleNames[j];
765+ var newStyleValue = propValue[styleName];
766+ var oldStyleValue = previousValue[styleName];
767+ if (newStyleValue === oldStyleValue) {
768+ continue;
769+ }
770+ propertiesUpdated = true;
771+ if (newStyleValue) {
772+ checkStyleValue(newStyleValue);
773+ projectionOptions.styleApplyer(domNode, styleName, newStyleValue);
774+ } else {
775+ projectionOptions.styleApplyer(domNode, styleName, "");
776+ }
777+ }
778+ } else {
779+ if (!propValue && typeof previousValue === "string") {
780+ propValue = "";
781+ }
782+ if (propName === "value") {
783+ var domValue = domNode[propName];
784+ if (domValue !== propValue && // The 'value' in the DOM tree !== newValue
785+ propValue !== previousValue) {
786+ domNode[propName] = propValue;
787+ }
788+ if (propValue !== previousValue) {
789+ propertiesUpdated = true;
790+ }
791+ } else if (propValue !== previousValue) {
792+ var type = typeof propValue;
793+ if (type !== "function" || !projectionOptions.eventHandlerInterceptor) {
794+ if (projectionOptions.namespace === NAMESPACE_SVG) {
795+ if (propName === "href") {
796+ domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue);
797+ } else {
798+ domNode.setAttribute(propName, propValue);
799+ }
800+ } else if (type === "string" && propName !== "innerHTML") {
801+ if (propName === "role" && propValue === "") {
802+ domNode.removeAttribute(propName);
803+ } else {
804+ domNode.setAttribute(propName, propValue);
805+ }
806+ } else if (domNode[propName] !== propValue) {
807+ domNode[propName] = propValue;
808+ }
809+ propertiesUpdated = true;
810+ }
811+ }
812+ }
813+ }
814+ return propertiesUpdated;
815+ };
816+ var updateChildren = function(vnode, domNode, oldChildren, newChildren, projectionOptions) {
817+ if (oldChildren === newChildren) {
818+ return false;
819+ }
820+ oldChildren = oldChildren || emptyArray;
821+ newChildren = newChildren || emptyArray;
822+ var oldChildrenLength = oldChildren.length;
823+ var newChildrenLength = newChildren.length;
824+ var oldIndex = 0;
825+ var newIndex = 0;
826+ var i;
827+ var textUpdated = false;
828+ while (newIndex < newChildrenLength) {
829+ var oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : void 0;
830+ var newChild = newChildren[newIndex];
831+ if (oldChild !== void 0 && same(oldChild, newChild)) {
832+ textUpdated = updateDom(oldChild, newChild, projectionOptions, domNode, oldChildren) || textUpdated;
833+ oldIndex++;
834+ } else {
835+ var findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1);
836+ if (findOldIndex >= 0) {
837+ for (i = oldIndex; i < findOldIndex; i++) {
838+ nodeToRemove(oldChildren[i]);
839+ checkDistinguishable(oldChildren, i, vnode, "removed");
840+ }
841+ textUpdated = updateDom(oldChildren[findOldIndex], newChild, projectionOptions, domNode, oldChildren) || textUpdated;
842+ oldIndex = findOldIndex + 1;
843+ } else {
844+ createDom(newChild, domNode, oldIndex < oldChildrenLength ? oldChildren[oldIndex].domNode : void 0, projectionOptions);
845+ nodeAdded(newChild);
846+ checkDistinguishable(newChildren, newIndex, vnode, "added");
847+ }
848+ }
849+ newIndex++;
850+ }
851+ if (oldChildrenLength > oldIndex) {
852+ for (i = oldIndex; i < oldChildrenLength; i++) {
853+ nodeToRemove(oldChildren[i]);
854+ checkDistinguishable(oldChildren, i, vnode, "removed");
855+ }
856+ }
857+ return textUpdated;
858+ };
859+ updateDom = function(previous, vnode, projectionOptions, parentNode, oldChildren) {
860+ var domNode = previous.domNode;
861+ var textUpdated = false;
862+ if (previous === vnode) {
863+ return false;
864+ }
865+ var updated = false;
866+ if (vnode.vnodeSelector === "") {
867+ if (vnode.text !== previous.text) {
868+ var newTextNode = domNode.ownerDocument.createTextNode(vnode.text);
869+ try {
870+ parentNode.replaceChild(newTextNode, domNode);
871+ } catch (e) {
872+ parentNode.replaceChild(newTextNode, parentNode.childNodes[oldChildren.indexOf(previous)]);
873+ }
874+ vnode.domNode = newTextNode;
875+ textUpdated = true;
876+ return textUpdated;
877+ }
878+ vnode.domNode = domNode;
879+ } else {
880+ if (vnode.vnodeSelector.lastIndexOf("svg", 0) === 0) {
881+ projectionOptions = extend2(projectionOptions, {
882+ namespace: NAMESPACE_SVG
883+ });
884+ }
885+ if (previous.text !== vnode.text) {
886+ updated = true;
887+ if (vnode.text === void 0) {
888+ domNode.removeChild(domNode.firstChild);
889+ } else {
890+ domNode.textContent = vnode.text;
891+ }
892+ }
893+ vnode.domNode = domNode;
894+ updated = updateChildren(vnode, domNode, previous.children, vnode.children, projectionOptions) || updated;
895+ updated = updateProperties(domNode, previous.properties, vnode.properties, projectionOptions) || updated;
896+ if (vnode.properties && vnode.properties.afterUpdate) {
897+ vnode.properties.afterUpdate.apply(vnode.properties.bind || vnode.properties, [
898+ domNode,
899+ projectionOptions,
900+ vnode.vnodeSelector,
901+ vnode.properties,
902+ vnode.children
903+ ]);
904+ }
905+ }
906+ if (updated && vnode.properties && vnode.properties.updateAnimation) {
907+ vnode.properties.updateAnimation(domNode, vnode.properties, previous.properties);
908+ }
909+ return textUpdated;
910+ };
911+ var createProjection = function(vnode, projectionOptions) {
912+ return {
913+ getLastRender: function() {
914+ return vnode;
915+ },
916+ update: function(updatedVnode) {
917+ if (vnode.vnodeSelector !== updatedVnode.vnodeSelector) {
918+ throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");
919+ }
920+ var previousVNode = vnode;
921+ vnode = updatedVnode;
922+ updateDom(previousVNode, updatedVnode, projectionOptions, previousVNode.domNode.parentNode, [previousVNode]);
923+ },
924+ domNode: vnode.domNode
925+ };
926+ };
927+ var DEFAULT_PROJECTION_OPTIONS = {
928+ namespace: void 0,
929+ performanceLogger: function() {
930+ return void 0;
931+ },
932+ eventHandlerInterceptor: void 0,
933+ styleApplyer: function(domNode, styleName, value12) {
934+ if (styleName.charAt(0) === "-") {
935+ domNode.style.setProperty(styleName, value12);
936+ } else {
937+ domNode.style[styleName] = value12;
938+ }
939+ }
940+ };
941+ var applyDefaultProjectionOptions = function(projectorOptions) {
942+ return extend2(DEFAULT_PROJECTION_OPTIONS, projectorOptions);
943+ };
944+ var dom = {
945+ /**
946+ * Creates a real DOM tree from `vnode`. The [[Projection]] object returned will contain the resulting DOM Node in
947+ * its [[Projection.domNode|domNode]] property.
948+ * This is a low-level method. Users will typically use a [[Projector]] instead.
949+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
950+ * objects may only be rendered once.
951+ * @param projectionOptions - Options to be used to create and update the projection.
952+ * @returns The [[Projection]] which also contains the DOM Node that was created.
953+ */
954+ create: function(vnode, projectionOptions) {
955+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
956+ createDom(vnode, document.createElement("div"), void 0, projectionOptions);
957+ return createProjection(vnode, projectionOptions);
958+ },
959+ /**
960+ * Appends a new child node to the DOM which is generated from a [[VNode]].
961+ * This is a low-level method. Users will typically use a [[Projector]] instead.
962+ * @param parentNode - The parent node for the new child node.
963+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
964+ * objects may only be rendered once.
965+ * @param projectionOptions - Options to be used to create and update the [[Projection]].
966+ * @returns The [[Projection]] that was created.
967+ */
968+ append: function(parentNode, vnode, projectionOptions) {
969+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
970+ createDom(vnode, parentNode, void 0, projectionOptions);
971+ return createProjection(vnode, projectionOptions);
972+ },
973+ /**
974+ * Inserts a new DOM node which is generated from a [[VNode]].
975+ * This is a low-level method. Users wil typically use a [[Projector]] instead.
976+ * @param beforeNode - The node that the DOM Node is inserted before.
977+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function.
978+ * NOTE: [[VNode]] objects may only be rendered once.
979+ * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]].
980+ * @returns The [[Projection]] that was created.
981+ */
982+ insertBefore: function(beforeNode, vnode, projectionOptions) {
983+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
984+ createDom(vnode, beforeNode.parentNode, beforeNode, projectionOptions);
985+ return createProjection(vnode, projectionOptions);
986+ },
987+ /**
988+ * Merges a new DOM node which is generated from a [[VNode]] with an existing DOM Node.
989+ * This means that the virtual DOM and the real DOM will have one overlapping element.
990+ * Therefore the selector for the root [[VNode]] will be ignored, but its properties and children will be applied to the Element provided.
991+ * This is a low-level method. Users wil typically use a [[Projector]] instead.
992+ * @param element - The existing element to adopt as the root of the new virtual DOM. Existing attributes and child nodes are preserved.
993+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]] objects
994+ * may only be rendered once.
995+ * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]].
996+ * @returns The [[Projection]] that was created.
997+ */
998+ merge: function(element, vnode, projectionOptions) {
999+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1000+ vnode.domNode = element;
1001+ initPropertiesAndChildren(element, vnode, projectionOptions);
1002+ return createProjection(vnode, projectionOptions);
1003+ },
1004+ /**
1005+ * Replaces an existing DOM node with a node generated from a [[VNode]].
1006+ * This is a low-level method. Users will typically use a [[Projector]] instead.
1007+ * @param element - The node for the [[VNode]] to replace.
1008+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
1009+ * objects may only be rendered once.
1010+ * @param projectionOptions - Options to be used to create and update the [[Projection]].
1011+ * @returns The [[Projection]] that was created.
1012+ */
1013+ replace: function(element, vnode, projectionOptions) {
1014+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1015+ createDom(vnode, element.parentNode, element, projectionOptions);
1016+ element.parentNode.removeChild(element);
1017+ return createProjection(vnode, projectionOptions);
1018+ }
1019+ };
1020+ var toTextVNode = function(data) {
1021+ return {
1022+ vnodeSelector: "",
1023+ properties: void 0,
1024+ children: void 0,
1025+ text: data.toString(),
1026+ domNode: null
1027+ };
1028+ };
1029+ var appendChildren = function(parentSelector, insertions, main2) {
1030+ for (var i = 0, length_1 = insertions.length; i < length_1; i++) {
1031+ var item = insertions[i];
1032+ if (Array.isArray(item)) {
1033+ appendChildren(parentSelector, item, main2);
1034+ } else {
1035+ if (item !== null && item !== void 0 && item !== false) {
1036+ if (typeof item === "string") {
1037+ item = toTextVNode(item);
1038+ }
1039+ main2.push(item);
1040+ }
1041+ }
1042+ }
1043+ };
1044+ function h(selector, properties, children) {
1045+ if (Array.isArray(properties)) {
1046+ children = properties;
1047+ properties = void 0;
1048+ } else if (properties && (typeof properties === "string" || properties.vnodeSelector) || children && (typeof children === "string" || children.vnodeSelector)) {
1049+ throw new Error("h called with invalid arguments");
1050+ }
1051+ var text5;
1052+ var flattenedChildren;
1053+ if (children && children.length === 1 && typeof children[0] === "string") {
1054+ text5 = children[0];
1055+ } else if (children) {
1056+ flattenedChildren = [];
1057+ appendChildren(selector, children, flattenedChildren);
1058+ if (flattenedChildren.length === 0) {
1059+ flattenedChildren = void 0;
1060+ }
1061+ }
1062+ return {
1063+ vnodeSelector: selector,
1064+ properties,
1065+ children: flattenedChildren,
1066+ text: text5 === "" ? void 0 : text5,
1067+ domNode: null
1068+ };
1069+ }
1070+ var createParentNodePath = function(node, rootNode) {
1071+ var parentNodePath = [];
1072+ while (node && node !== rootNode) {
1073+ parentNodePath.push(node);
1074+ node = node.parentNode;
1075+ }
1076+ return parentNodePath;
1077+ };
1078+ var find2;
1079+ if (Array.prototype.find) {
1080+ find2 = function(items, predicate) {
1081+ return items.find(predicate);
1082+ };
1083+ } else {
1084+ find2 = function(items, predicate) {
1085+ return items.filter(predicate)[0];
1086+ };
1087+ }
1088+ var findVNodeByParentNodePath = function(vnode, parentNodePath) {
1089+ var result = vnode;
1090+ parentNodePath.forEach(function(node) {
1091+ result = result && result.children ? find2(result.children, function(child) {
1092+ return child.domNode === node;
1093+ }) : void 0;
1094+ });
1095+ return result;
1096+ };
1097+ var createEventHandlerInterceptor = function(projector, getProjection, performanceLogger) {
1098+ return function(propertyName, eventHandler, domNode, properties) {
1099+ return modifiedEventHandler;
1100+ };
1101+ function modifiedEventHandler(evt) {
1102+ var _a, _b;
1103+ performanceLogger("domEvent", evt);
1104+ var projection = getProjection();
1105+ var parentNodePath = createParentNodePath(evt.currentTarget, projection.domNode);
1106+ parentNodePath.reverse();
1107+ var matchingVNode = findVNodeByParentNodePath(projection.getLastRender(), parentNodePath);
1108+ projector.scheduleRender();
1109+ var result;
1110+ if (matchingVNode) {
1111+ var listener = (_b = (_a = matchingVNode.properties["on" + evt.type]) !== null && _a !== void 0 ? _a : matchingVNode.properties.on[evt.type].listener) !== null && _b !== void 0 ? _b : matchingVNode.properties.on[evt.type];
1112+ result = listener.apply(matchingVNode.properties.bind || this, arguments);
1113+ }
1114+ performanceLogger("domEventProcessed", evt);
1115+ return result;
1116+ }
1117+ };
1118+ var createProjector = function(projectorOptions) {
1119+ var projector;
1120+ var projectionOptions = applyDefaultProjectionOptions(projectorOptions);
1121+ var performanceLogger = projectionOptions.performanceLogger;
1122+ var renderCompleted = true;
1123+ var scheduled;
1124+ var stopped = false;
1125+ var projections = [];
1126+ var renderFunctions = [];
1127+ var addProjection = function(domFunction, node, renderFunction) {
1128+ var projection;
1129+ var getProjection = function() {
1130+ return projection;
1131+ };
1132+ projectionOptions.eventHandlerInterceptor = createEventHandlerInterceptor(projector, getProjection, performanceLogger);
1133+ projection = domFunction(node, renderFunction(), projectionOptions);
1134+ projections.push(projection);
1135+ renderFunctions.push(renderFunction);
1136+ };
1137+ var doRender = function() {
1138+ scheduled = void 0;
1139+ if (!renderCompleted) {
1140+ return;
1141+ }
1142+ renderCompleted = false;
1143+ performanceLogger("renderStart", void 0);
1144+ for (var i = 0; i < projections.length; i++) {
1145+ var updatedVnode = renderFunctions[i]();
1146+ performanceLogger("rendered", void 0);
1147+ projections[i].update(updatedVnode);
1148+ performanceLogger("patched", void 0);
1149+ }
1150+ performanceLogger("renderDone", void 0);
1151+ renderCompleted = true;
1152+ };
1153+ projector = {
1154+ renderNow: doRender,
1155+ scheduleRender: function() {
1156+ if (!scheduled && !stopped) {
1157+ scheduled = requestAnimationFrame(doRender);
1158+ }
1159+ },
1160+ stop: function() {
1161+ if (scheduled) {
1162+ cancelAnimationFrame(scheduled);
1163+ scheduled = void 0;
1164+ }
1165+ stopped = true;
1166+ },
1167+ resume: function() {
1168+ stopped = false;
1169+ renderCompleted = true;
1170+ projector.scheduleRender();
1171+ },
1172+ append: function(parentNode, renderFunction) {
1173+ addProjection(dom.append, parentNode, renderFunction);
1174+ },
1175+ insertBefore: function(beforeNode, renderFunction) {
1176+ addProjection(dom.insertBefore, beforeNode, renderFunction);
1177+ },
1178+ merge: function(domNode, renderFunction) {
1179+ addProjection(dom.merge, domNode, renderFunction);
1180+ },
1181+ replace: function(domNode, renderFunction) {
1182+ addProjection(dom.replace, domNode, renderFunction);
1183+ },
1184+ detach: function(renderFunction) {
1185+ for (var i = 0; i < renderFunctions.length; i++) {
1186+ if (renderFunctions[i] === renderFunction) {
1187+ renderFunctions.splice(i, 1);
1188+ return projections.splice(i, 1)[0];
1189+ }
1190+ }
1191+ throw new Error("renderFunction was not found");
1192+ }
1193+ };
1194+ return projector;
1195+ };
1196+ function _h(selector) {
1197+ return function(properties) {
1198+ return function(children) {
1199+ return h(selector, properties, children);
1200+ };
1201+ };
1202+ }
1203+ function replace(projector) {
1204+ return function(el) {
1205+ return function(render) {
1206+ return function() {
1207+ projector.replace(el, render);
1208+ };
1209+ };
1210+ };
1211+ }
1212+
1213+ // output/Maquette/index.js
1214+ var string = unsafeCoerce2;
1215+ var h2 = _h;
1216+
1217+ // output/Foreign.Object/foreign.js
1218+ function _copyST(m) {
1219+ return function() {
1220+ var r = {};
1221+ for (var k in m) {
1222+ if (hasOwnProperty.call(m, k)) {
1223+ r[k] = m[k];
1224+ }
1225+ }
1226+ return r;
1227+ };
1228+ }
1229+ var empty2 = {};
1230+ function runST(f) {
1231+ return f();
1232+ }
1233+ function _foldM(bind3) {
1234+ return function(f) {
1235+ return function(mz) {
1236+ return function(m) {
1237+ var acc = mz;
1238+ function g(k2) {
1239+ return function(z) {
1240+ return f(z)(k2)(m[k2]);
1241+ };
1242+ }
1243+ for (var k in m) {
1244+ if (hasOwnProperty.call(m, k)) {
1245+ acc = bind3(acc)(g(k));
1246+ }
1247+ }
1248+ return acc;
1249+ };
1250+ };
1251+ };
1252+ }
1253+ function toArrayWithKey(f) {
1254+ return function(m) {
1255+ var r = [];
1256+ for (var k in m) {
1257+ if (hasOwnProperty.call(m, k)) {
1258+ r.push(f(k)(m[k]));
1259+ }
1260+ }
1261+ return r;
1262+ };
1263+ }
1264+ var keys = Object.keys || toArrayWithKey(function(k) {
1265+ return function() {
1266+ return k;
1267+ };
1268+ });
1269+
1270+ // output/Foreign.Object.ST/foreign.js
1271+ var newImpl = function() {
1272+ return {};
1273+ };
1274+ function poke2(k) {
1275+ return function(v) {
1276+ return function(m) {
1277+ return function() {
1278+ m[k] = v;
1279+ return m;
1280+ };
1281+ };
1282+ };
1283+ }
1284+
1285+ // output/Foreign.Object/index.js
1286+ var bindFlipped2 = /* @__PURE__ */ bindFlipped(bindST);
1287+ var thawST = _copyST;
1288+ var singleton2 = function(k) {
1289+ return function(v) {
1290+ return runST(bindFlipped2(poke2(k)(v))(newImpl));
1291+ };
1292+ };
1293+ var mutate = function(f) {
1294+ return function(m) {
1295+ return runST(function __do() {
1296+ var s = thawST(m)();
1297+ f(s)();
1298+ return s;
1299+ });
1300+ };
1301+ };
1302+ var foldM = function(dictMonad) {
1303+ var bind1 = bind(dictMonad.Bind1());
1304+ var pure1 = pure(dictMonad.Applicative0());
1305+ return function(f) {
1306+ return function(z) {
1307+ return _foldM(bind1)(f)(pure1(z));
1308+ };
1309+ };
1310+ };
1311+ var foldM1 = /* @__PURE__ */ foldM(monadST);
1312+ var union = function(m) {
1313+ return mutate(function(s) {
1314+ return foldM1(function(s$prime) {
1315+ return function(k) {
1316+ return function(v) {
1317+ return poke2(k)(v)(s$prime);
1318+ };
1319+ };
1320+ })(s)(m);
1321+ });
1322+ };
1323+
1324+ // output/Plum.View/index.js
1325+ var show2 = /* @__PURE__ */ show(showInt);
1326+ var append1 = /* @__PURE__ */ append(semigroupArray);
1327+ var mempty2 = /* @__PURE__ */ mempty(monoidArray);
1328+ var map2 = /* @__PURE__ */ map(functorArray);
1329+ var Px = /* @__PURE__ */ function() {
1330+ function Px2(value0) {
1331+ this.value0 = value0;
1332+ }
1333+ ;
1334+ Px2.create = function(value0) {
1335+ return new Px2(value0);
1336+ };
1337+ return Px2;
1338+ }();
1339+ var Fill = /* @__PURE__ */ function() {
1340+ function Fill2() {
1341+ }
1342+ ;
1343+ Fill2.value = new Fill2();
1344+ return Fill2;
1345+ }();
1346+ var Fit = /* @__PURE__ */ function() {
1347+ function Fit2() {
1348+ }
1349+ ;
1350+ Fit2.value = new Fit2();
1351+ return Fit2;
1352+ }();
1353+ var X = /* @__PURE__ */ function() {
1354+ function X2() {
1355+ }
1356+ ;
1357+ X2.value = new X2();
1358+ return X2;
1359+ }();
1360+ var Y = /* @__PURE__ */ function() {
1361+ function Y2() {
1362+ }
1363+ ;
1364+ Y2.value = new Y2();
1365+ return Y2;
1366+ }();
1367+ var Grid = /* @__PURE__ */ function() {
1368+ function Grid2() {
1369+ }
1370+ ;
1371+ Grid2.value = new Grid2();
1372+ return Grid2;
1373+ }();
1374+ var Flexbox = /* @__PURE__ */ function() {
1375+ function Flexbox2(value0) {
1376+ this.value0 = value0;
1377+ }
1378+ ;
1379+ Flexbox2.create = function(value0) {
1380+ return new Flexbox2(value0);
1381+ };
1382+ return Flexbox2;
1383+ }();
1384+ var Generic = /* @__PURE__ */ function() {
1385+ function Generic2() {
1386+ }
1387+ ;
1388+ Generic2.value = new Generic2();
1389+ return Generic2;
1390+ }();
1391+ var Span = /* @__PURE__ */ function() {
1392+ function Span2() {
1393+ }
1394+ ;
1395+ Span2.value = new Span2();
1396+ return Span2;
1397+ }();
1398+ var Start = /* @__PURE__ */ function() {
1399+ function Start2() {
1400+ }
1401+ ;
1402+ Start2.value = new Start2();
1403+ return Start2;
1404+ }();
1405+ var Center = /* @__PURE__ */ function() {
1406+ function Center2() {
1407+ }
1408+ ;
1409+ Center2.value = new Center2();
1410+ return Center2;
1411+ }();
1412+ var End = /* @__PURE__ */ function() {
1413+ function End2() {
1414+ }
1415+ ;
1416+ End2.value = new End2();
1417+ return End2;
1418+ }();
1419+ var Spacing = /* @__PURE__ */ function() {
1420+ function Spacing2(value0, value1) {
1421+ this.value0 = value0;
1422+ this.value1 = value1;
1423+ }
1424+ ;
1425+ Spacing2.create = function(value0) {
1426+ return function(value1) {
1427+ return new Spacing2(value0, value1);
1428+ };
1429+ };
1430+ return Spacing2;
1431+ }();
1432+ var Explain = /* @__PURE__ */ function() {
1433+ function Explain2() {
1434+ }
1435+ ;
1436+ Explain2.value = new Explain2();
1437+ return Explain2;
1438+ }();
1439+ var Align = /* @__PURE__ */ function() {
1440+ function Align2(value0, value1) {
1441+ this.value0 = value0;
1442+ this.value1 = value1;
1443+ }
1444+ ;
1445+ Align2.create = function(value0) {
1446+ return function(value1) {
1447+ return new Align2(value0, value1);
1448+ };
1449+ };
1450+ return Align2;
1451+ }();
1452+ var Width = /* @__PURE__ */ function() {
1453+ function Width2(value0) {
1454+ this.value0 = value0;
1455+ }
1456+ ;
1457+ Width2.create = function(value0) {
1458+ return new Width2(value0);
1459+ };
1460+ return Width2;
1461+ }();
1462+ var Height = /* @__PURE__ */ function() {
1463+ function Height2(value0) {
1464+ this.value0 = value0;
1465+ }
1466+ ;
1467+ Height2.create = function(value0) {
1468+ return new Height2(value0);
1469+ };
1470+ return Height2;
1471+ }();
1472+ var Wrapped = /* @__PURE__ */ function() {
1473+ function Wrapped2() {
1474+ }
1475+ ;
1476+ Wrapped2.value = new Wrapped2();
1477+ return Wrapped2;
1478+ }();
1479+ var Column = /* @__PURE__ */ function() {
1480+ function Column2(value0) {
1481+ this.value0 = value0;
1482+ }
1483+ ;
1484+ Column2.create = function(value0) {
1485+ return new Column2(value0);
1486+ };
1487+ return Column2;
1488+ }();
1489+ var Row = /* @__PURE__ */ function() {
1490+ function Row2(value0) {
1491+ this.value0 = value0;
1492+ }
1493+ ;
1494+ Row2.create = function(value0) {
1495+ return new Row2(value0);
1496+ };
1497+ return Row2;
1498+ }();
1499+ var Stack = /* @__PURE__ */ function() {
1500+ function Stack2(value0) {
1501+ this.value0 = value0;
1502+ }
1503+ ;
1504+ Stack2.create = function(value0) {
1505+ return new Stack2(value0);
1506+ };
1507+ return Stack2;
1508+ }();
1509+ var Wrapper = /* @__PURE__ */ function() {
1510+ function Wrapper2(value0) {
1511+ this.value0 = value0;
1512+ }
1513+ ;
1514+ Wrapper2.create = function(value0) {
1515+ return new Wrapper2(value0);
1516+ };
1517+ return Wrapper2;
1518+ }();
1519+ var Text = /* @__PURE__ */ function() {
1520+ function Text2(value0) {
1521+ this.value0 = value0;
1522+ }
1523+ ;
1524+ Text2.create = function(value0) {
1525+ return new Text2(value0);
1526+ };
1527+ return Text2;
1528+ }();
1529+ var semigroupSkin = {
1530+ append: function(v) {
1531+ return function(v1) {
1532+ return union(v)(v1);
1533+ };
1534+ }
1535+ };
1536+ var append2 = /* @__PURE__ */ append(semigroupSkin);
1537+ var semigroupMutation = {
1538+ append: function(v) {
1539+ return function(v1) {
1540+ return {
1541+ extraSkin: append2(v.extraSkin)(v1.extraSkin)
1542+ };
1543+ };
1544+ }
1545+ };
1546+ var monoidSkin = {
1547+ mempty: empty2,
1548+ Semigroup0: function() {
1549+ return semigroupSkin;
1550+ }
1551+ };
1552+ var mempty1 = /* @__PURE__ */ mempty(monoidSkin);
1553+ var foldMap3 = /* @__PURE__ */ foldMap2(monoidSkin);
1554+ var monoidMutation = {
1555+ mempty: {
1556+ extraSkin: mempty1
1557+ },
1558+ Semigroup0: function() {
1559+ return semigroupMutation;
1560+ }
1561+ };
1562+ var mempty22 = /* @__PURE__ */ mempty(monoidMutation);
1563+ var view = function(nerves) {
1564+ return function(meat) {
1565+ return function(bones) {
1566+ return {
1567+ nerves,
1568+ meat,
1569+ bones
1570+ };
1571+ };
1572+ };
1573+ };
1574+ var sk = function(key) {
1575+ return function(val) {
1576+ return singleton2(key)(val);
1577+ };
1578+ };
1579+ var length2 = function(v) {
1580+ if (v instanceof Px) {
1581+ return show2(v.value0) + "px";
1582+ }
1583+ ;
1584+ if (v instanceof Fit) {
1585+ return "fit-content";
1586+ }
1587+ ;
1588+ if (v instanceof Fill) {
1589+ return "100%";
1590+ }
1591+ ;
1592+ throw new Error("Failed pattern match at Plum.View (line 99, column 10 - line 102, column 17): " + [v.constructor.name]);
1593+ };
1594+ var skin = function(ctx) {
1595+ return function(v) {
1596+ if (v instanceof Spacing) {
1597+ return sk("gap")(show2(v.value0) + ("px " + (show2(v.value1) + "px")));
1598+ }
1599+ ;
1600+ if (v instanceof Explain) {
1601+ return sk("border")("dashed magenta");
1602+ }
1603+ ;
1604+ if (v instanceof Align) {
1605+ if (ctx instanceof Generic) {
1606+ return mempty1;
1607+ }
1608+ ;
1609+ if (ctx instanceof Span) {
1610+ return mempty1;
1611+ }
1612+ ;
1613+ if (ctx instanceof Grid) {
1614+ return sk(function() {
1615+ if (v.value0 instanceof X) {
1616+ return "justify-items";
1617+ }
1618+ ;
1619+ if (v.value0 instanceof Y) {
1620+ return "align-items";
1621+ }
1622+ ;
1623+ throw new Error("Failed pattern match at Plum.View (line 70, column 9 - line 72, column 29): " + [v.value0.constructor.name]);
1624+ }())(function() {
1625+ if (v.value1 instanceof Start) {
1626+ return "start";
1627+ }
1628+ ;
1629+ if (v.value1 instanceof Center) {
1630+ return "center";
1631+ }
1632+ ;
1633+ if (v.value1 instanceof End) {
1634+ return "end";
1635+ }
1636+ ;
1637+ throw new Error("Failed pattern match at Plum.View (line 74, column 9 - line 77, column 23): " + [v.value1.constructor.name]);
1638+ }());
1639+ }
1640+ ;
1641+ if (ctx instanceof Flexbox) {
1642+ return sk(function() {
1643+ var v1 = new Tuple(ctx.value0, v.value0);
1644+ if (v1.value0 instanceof X && v1.value1 instanceof X) {
1645+ return "justify-content";
1646+ }
1647+ ;
1648+ if (v1.value0 instanceof X && v1.value1 instanceof Y) {
1649+ return "align-items";
1650+ }
1651+ ;
1652+ if (v1.value0 instanceof Y && v1.value1 instanceof X) {
1653+ return "align-items";
1654+ }
1655+ ;
1656+ if (v1.value0 instanceof Y && v1.value1 instanceof Y) {
1657+ return "justify-content";
1658+ }
1659+ ;
1660+ throw new Error("Failed pattern match at Plum.View (line 81, column 9 - line 85, column 38): " + [v1.constructor.name]);
1661+ }())(function() {
1662+ if (v.value1 instanceof Start) {
1663+ return "flex-start";
1664+ }
1665+ ;
1666+ if (v.value1 instanceof Center) {
1667+ return "center";
1668+ }
1669+ ;
1670+ if (v.value1 instanceof End) {
1671+ return "flex-end";
1672+ }
1673+ ;
1674+ throw new Error("Failed pattern match at Plum.View (line 87, column 9 - line 90, column 28): " + [v.value1.constructor.name]);
1675+ }());
1676+ }
1677+ ;
1678+ throw new Error("Failed pattern match at Plum.View (line 66, column 26 - line 91, column 8): " + [ctx.constructor.name]);
1679+ }
1680+ ;
1681+ if (v instanceof Width) {
1682+ return sk("width")(length2(v.value0));
1683+ }
1684+ ;
1685+ if (v instanceof Height) {
1686+ return sk("height")(length2(v.value0));
1687+ }
1688+ ;
1689+ if (v instanceof Wrapped) {
1690+ if (ctx instanceof Flexbox) {
1691+ return sk("flex-wrap")("wrap");
1692+ }
1693+ ;
1694+ return mempty1;
1695+ }
1696+ ;
1697+ throw new Error("Failed pattern match at Plum.View (line 63, column 12 - line 96, column 16): " + [v.constructor.name]);
1698+ };
1699+ };
1700+ var h3 = function(el) {
1701+ return function(v) {
1702+ return function(children) {
1703+ return h2(el)({
1704+ styles: v
1705+ })(children);
1706+ };
1707+ };
1708+ };
1709+ var growSkin = function(fire) {
1710+ return function(v) {
1711+ return function(v1) {
1712+ var widthFill = [new Width(Fill.value), new Height(Fill.value)];
1713+ var alignCenter = [new Align(X.value, Center.value), new Align(Y.value, Center.value)];
1714+ var skn = function(ctx) {
1715+ return append2(foldMap3(skin(ctx))(append1(v1.meat)(append1(function() {
1716+ if (ctx instanceof Span) {
1717+ return mempty2;
1718+ }
1719+ ;
1720+ if (ctx instanceof Grid) {
1721+ return widthFill;
1722+ }
1723+ ;
1724+ if (ctx instanceof Flexbox) {
1725+ return widthFill;
1726+ }
1727+ ;
1728+ if (ctx instanceof Generic) {
1729+ return widthFill;
1730+ }
1731+ ;
1732+ throw new Error("Failed pattern match at Plum.View (line 128, column 16 - line 132, column 35): " + [ctx.constructor.name]);
1733+ }())(function() {
1734+ if (ctx instanceof Grid) {
1735+ return alignCenter;
1736+ }
1737+ ;
1738+ if (ctx instanceof Flexbox) {
1739+ return alignCenter;
1740+ }
1741+ ;
1742+ if (ctx instanceof Span) {
1743+ return mempty2;
1744+ }
1745+ ;
1746+ if (ctx instanceof Generic) {
1747+ return alignCenter;
1748+ }
1749+ ;
1750+ throw new Error("Failed pattern match at Plum.View (line 133, column 16 - line 137, column 37): " + [ctx.constructor.name]);
1751+ }()))))(v.extraSkin);
1752+ };
1753+ if (v1.bones instanceof Text) {
1754+ return h3("span")(skn(Span.value))([string(v1.bones.value0)]);
1755+ }
1756+ ;
1757+ if (v1.bones instanceof Wrapper) {
1758+ return h3("div")(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value0)]);
1759+ }
1760+ ;
1761+ if (v1.bones instanceof Stack) {
1762+ return h3("div")(append2(skn(Grid.value))(sk("display")("grid")))(map2(growSkin(fire)({
1763+ extraSkin: append2(sk("grid-row")("1"))(sk("grid-column")("1"))
1764+ }))(v1.bones.value0));
1765+ }
1766+ ;
1767+ if (v1.bones instanceof Row) {
1768+ return h3("div")(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
1769+ }
1770+ ;
1771+ if (v1.bones instanceof Column) {
1772+ return h3("div")(append2(skn(new Flexbox(Y.value)))(append2(sk("display")("flex"))(sk("flex-direction")("column"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
1773+ }
1774+ ;
1775+ throw new Error("Failed pattern match at Plum.View (line 140, column 5 - line 148, column 46): " + [v1.bones.constructor.name]);
1776+ };
1777+ };
1778+ };
1779+ var grow = function(fire) {
1780+ return function(v) {
1781+ return growSkin(fire)(mempty22)(v);
1782+ };
1783+ };
1784+
1785+ // output/Web.DOM.NonElementParentNode/foreign.js
1786+ function _getElementById(id) {
1787+ return function(node) {
1788+ return function() {
1789+ return node.getElementById(id);
1790+ };
1791+ };
1792+ }
1793+
1794+ // output/Data.Nullable/foreign.js
1795+ function nullable(a, r, f) {
1796+ return a == null ? r : f(a);
1797+ }
1798+
1799+ // output/Data.Nullable/index.js
1800+ var toMaybe = function(n) {
1801+ return nullable(n, Nothing.value, Just.create);
1802+ };
1803+
1804+ // output/Web.DOM.NonElementParentNode/index.js
1805+ var map3 = /* @__PURE__ */ map(functorEffect);
1806+ var getElementById = function(eid) {
1807+ var $2 = map3(toMaybe);
1808+ var $3 = _getElementById(eid);
1809+ return function($4) {
1810+ return $2($3($4));
1811+ };
1812+ };
1813+
1814+ // output/Web.HTML/foreign.js
1815+ var windowImpl = function() {
1816+ return window;
1817+ };
1818+
1819+ // output/Web.HTML.HTMLDocument/index.js
1820+ var toNonElementParentNode = unsafeCoerce2;
1821+
1822+ // output/Web.HTML.Window/foreign.js
1823+ function document2(window2) {
1824+ return function() {
1825+ return window2.document;
1826+ };
1827+ }
1828+
1829+ // output/Plum/index.js
1830+ var bind2 = /* @__PURE__ */ bind(bindEffect);
1831+ var outerStyle = "html,body{height:100%;padding:0;margin:0;}";
1832+ var run3 = function(id) {
1833+ return function(plum2) {
1834+ return function __do() {
1835+ var modelRef = bind2(plum2.init)($$new)();
1836+ var v = bind2(bind2(windowImpl)(document2))(function() {
1837+ var $6 = getElementById(id);
1838+ return function($7) {
1839+ return $6(toNonElementParentNode($7));
1840+ };
1841+ }())();
1842+ if (v instanceof Just) {
1843+ var projector = createProjector();
1844+ return replace(projector)(v.value0)(function __do2() {
1845+ var model = read(modelRef)();
1846+ var el = grow(function(msg) {
1847+ return function __do3() {
1848+ var m = read(modelRef)();
1849+ var m_ = plum2.update(msg)(m)();
1850+ return write(m_)(modelRef)();
1851+ };
1852+ })(plum2.view(model));
1853+ return h2("div")({
1854+ styles: {
1855+ height: "100%",
1856+ width: "100%"
1857+ }
1858+ })([el, h2("style")({})([string(outerStyle)])]);
1859+ })();
1860+ }
1861+ ;
1862+ if (v instanceof Nothing) {
1863+ return unit;
1864+ }
1865+ ;
1866+ throw new Error("Failed pattern match at Plum (line 25, column 92 - line 39, column 25): " + [v.constructor.name]);
1867+ };
1868+ };
1869+ };
1870+
1871+ // output/Main/index.js
1872+ var pure2 = /* @__PURE__ */ pure(applicativeEffect);
1873+ var map4 = /* @__PURE__ */ map(functorArray);
1874+ var plum = {
1875+ init: /* @__PURE__ */ pure2({
1876+ text: "Test"
1877+ }),
1878+ view: function(model) {
1879+ return view([])([Wrapped.value])(new Column(map4($$const(view([])([])(new Text("hello"))))(range2(1)(100))));
1880+ },
1881+ update: function(msg) {
1882+ return function(model) {
1883+ return pure2({
1884+ text: "Button pressed"
1885+ });
1886+ };
1887+ }
1888+ };
1889+ var main = /* @__PURE__ */ run3("plum")(plum);
1890+
1891+ // <stdin>
1892+ main();
1893+})();