@@ -0,0 +1,2312 @@
2+ // output/Control.Semigroupoid/index.js
3+ var semigroupoidFn = {
4+ compose: function(f) {
13+ // output/Control.Category/index.js
14+ var identity = function(dict) {
15+ return dict.identity;
18+ identity: function(x) {
21+ Semigroupoid0: function() {
22+ return semigroupoidFn;
26+ // output/Data.Boolean/index.js
27+ var otherwise = true;
29+ // output/Data.Function/index.js
30+ var flip = function(f) {
37+ var $$const = function(a) {
43+ // output/Data.Functor/foreign.js
44+ var arrayMap = function(f) {
45+ return function(arr) {
47+ var result = new Array(l);
48+ for (var i = 0; i < l; i++) {
49+ result[i] = f(arr[i]);
55+ // output/Data.Unit/foreign.js
58+ // output/Data.Functor/index.js
59+ var map = function(dict) {
66+ // output/Control.Apply/index.js
67+ var apply = function(dict) {
71+ // output/Control.Applicative/index.js
72+ var pure = function(dict) {
75+ var liftA1 = function(dictApplicative) {
76+ var apply2 = apply(dictApplicative.Apply0());
77+ var pure1 = pure(dictApplicative);
80+ return apply2(pure1(f))(a);
85+ // output/Data.Array/foreign.js
86+ var rangeImpl = function(start2, end) {
87+ var step2 = start2 > end ? -1 : 1;
88+ var result = new Array(step2 * (end - start2) + 1);
89+ var i = start2, n = 0;
97+ var replicateFill = function(count, value12) {
101+ var result = new Array(count);
102+ return result.fill(value12);
104+ var replicatePolyfill = function(count, value12) {
107+ for (var i = 0; i < count; i++) {
108+ result[n++] = value12;
112+ var replicateImpl = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;
114+ // output/Data.Semigroup/foreign.js
115+ var concatArray = function(xs) {
116+ return function(ys) {
117+ if (xs.length === 0) return ys;
118+ if (ys.length === 0) return xs;
119+ return xs.concat(ys);
123+ // output/Data.Semigroup/index.js
124+ var semigroupArray = {
127+ var append = function(dict) {
131+ // output/Control.Bind/foreign.js
132+ var arrayBind = typeof Array.prototype.flatMap === "function" ? function(arr) {
133+ return function(f) {
134+ return arr.flatMap(f);
137+ return function(f) {
140+ for (var i = 0; i < l; i++) {
143+ for (var j = 0; j < k; j++) {
151+ // output/Control.Bind/index.js
152+ var bind = function(dict) {
155+ var bindFlipped = function(dictBind) {
156+ return flip(bind(dictBind));
159+ // output/Control.Monad/index.js
160+ var ap = function(dictMonad) {
161+ var bind3 = bind(dictMonad.Bind1());
162+ var pure3 = pure(dictMonad.Applicative0());
163+ return function(f) {
164+ return function(a) {
165+ return bind3(f)(function(f$prime) {
166+ return bind3(a)(function(a$prime) {
167+ return pure3(f$prime(a$prime));
174+ // output/Data.Bounded/foreign.js
175+ var topInt = 2147483647;
176+ var bottomInt = -2147483648;
177+ var topChar = String.fromCharCode(65535);
178+ var bottomChar = String.fromCharCode(0);
179+ var topNumber = Number.POSITIVE_INFINITY;
180+ var bottomNumber = Number.NEGATIVE_INFINITY;
182+ // output/Data.Ord/foreign.js
183+ var unsafeCompareImpl = function(lt) {
184+ return function(eq2) {
185+ return function(gt) {
186+ return function(x) {
187+ return function(y) {
188+ return x < y ? lt : x === y ? eq2 : gt;
194+ var ordIntImpl = unsafeCompareImpl;
196+ // output/Data.Eq/foreign.js
197+ var refEq = function(r1) {
198+ return function(r2) {
202+ var eqIntImpl = refEq;
204+ // output/Data.Eq/index.js
209+ // output/Data.Ordering/index.js
210+ var LT = /* @__PURE__ */ function() {
214+ LT2.value = new LT2();
217+ var GT = /* @__PURE__ */ function() {
221+ GT2.value = new GT2();
224+ var EQ = /* @__PURE__ */ function() {
228+ EQ2.value = new EQ2();
232+ // output/Data.Ord/index.js
233+ var ordInt = /* @__PURE__ */ function() {
235+ compare: ordIntImpl(LT.value)(EQ.value)(GT.value),
242+ // output/Data.Bounded/index.js
243+ var top = function(dict) {
253+ var bottom = function(dict) {
257+ // output/Data.Show/foreign.js
258+ var showIntImpl = function(n) {
259+ return n.toString();
261+ var showNumberImpl = function(n) {
262+ var str = n.toString();
263+ return isNaN(str + ".0") ? str : str + ".0";
266+ // output/Data.Show/index.js
268+ show: showNumberImpl
273+ var show = function(dict) {
277+ // output/Data.Maybe/index.js
278+ var identity2 = /* @__PURE__ */ identity(categoryFn);
279+ var Nothing = /* @__PURE__ */ function() {
280+ function Nothing2() {
283+ Nothing2.value = new Nothing2();
286+ var Just = /* @__PURE__ */ function() {
287+ function Just2(value0) {
288+ this.value0 = value0;
291+ Just2.create = function(value0) {
292+ return new Just2(value0);
296+ var maybe = function(v) {
297+ return function(v1) {
298+ return function(v2) {
299+ if (v2 instanceof Nothing) {
303+ if (v2 instanceof Just) {
304+ return v1(v2.value0);
307+ throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
311+ var fromMaybe = function(a) {
312+ return maybe(a)(identity2);
315+ // output/Data.Monoid/index.js
318+ Semigroup0: function() {
319+ return semigroupArray;
322+ var mempty = function(dict) {
326+ // output/Effect/foreign.js
327+ var pureE = function(a) {
332+ var bindE = function(a) {
333+ return function(f) {
340+ // output/Effect/index.js
341+ var $runtime_lazy = function(name14, moduleName, init) {
344+ return function(lineNumber) {
345+ if (state2 === 2) return val;
346+ if (state2 === 1) throw new ReferenceError(name14 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
354+ Applicative0: function() {
355+ return applicativeEffect;
363+ Apply0: function() {
364+ return $lazy_applyEffect(0);
367+ var applicativeEffect = {
369+ Apply0: function() {
370+ return $lazy_applyEffect(0);
373+ var $lazy_functorEffect = /* @__PURE__ */ $runtime_lazy("functorEffect", "Effect", function() {
375+ map: liftA1(applicativeEffect)
378+ var $lazy_applyEffect = /* @__PURE__ */ $runtime_lazy("applyEffect", "Effect", function() {
380+ apply: ap(monadEffect),
381+ Functor0: function() {
382+ return $lazy_functorEffect(0);
386+ var functorEffect = /* @__PURE__ */ $lazy_functorEffect(20);
388+ // output/Effect.Ref/foreign.js
389+ var _new = function(val) {
391+ return { value: val };
394+ var read = function(ref) {
399+ var write = function(val) {
400+ return function(ref) {
407+ // output/Effect.Ref/index.js
410+ // output/Control.Monad.ST.Internal/foreign.js
411+ var map_ = function(f) {
412+ return function(a) {
418+ var pure_ = function(a) {
423+ var bind_ = function(a) {
424+ return function(f) {
431+ // output/Control.Monad.ST.Internal/index.js
432+ var $runtime_lazy2 = function(name14, moduleName, init) {
435+ return function(lineNumber) {
436+ if (state2 === 2) return val;
437+ if (state2 === 1) throw new ReferenceError(name14 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
448+ Applicative0: function() {
449+ return applicativeST;
457+ Apply0: function() {
458+ return $lazy_applyST(0);
461+ var applicativeST = {
463+ Apply0: function() {
464+ return $lazy_applyST(0);
467+ var $lazy_applyST = /* @__PURE__ */ $runtime_lazy2("applyST", "Control.Monad.ST.Internal", function() {
470+ Functor0: function() {
476+ // output/Data.Foldable/foreign.js
477+ var foldrArray = function(f) {
478+ return function(init) {
479+ return function(xs) {
481+ var len = xs.length;
482+ for (var i = len - 1; i >= 0; i--) {
483+ acc = f(xs[i])(acc);
489+ var foldlArray = function(f) {
490+ return function(init) {
491+ return function(xs) {
493+ var len = xs.length;
494+ for (var i = 0; i < len; i++) {
495+ acc = f(acc)(xs[i]);
502+ // output/Data.Tuple/index.js
503+ var Tuple = /* @__PURE__ */ function() {
504+ function Tuple2(value0, value1) {
505+ this.value0 = value0;
506+ this.value1 = value1;
509+ Tuple2.create = function(value0) {
510+ return function(value1) {
511+ return new Tuple2(value0, value1);
517+ // output/Unsafe.Coerce/foreign.js
518+ var unsafeCoerce2 = function(x) {
522+ // output/Data.Foldable/index.js
523+ var foldr = function(dict) {
526+ var foldMapDefaultR = function(dictFoldable) {
527+ var foldr2 = foldr(dictFoldable);
528+ return function(dictMonoid) {
529+ var append3 = append(dictMonoid.Semigroup0());
530+ var mempty3 = mempty(dictMonoid);
531+ return function(f) {
532+ return foldr2(function(x) {
533+ return function(acc) {
534+ return append3(f(x))(acc);
540+ var foldableArray = {
543+ foldMap: function(dictMonoid) {
544+ return foldMapDefaultR(foldableArray)(dictMonoid);
547+ var foldMap = function(dict) {
548+ return dict.foldMap;
551+ // output/Data.Function.Uncurried/foreign.js
552+ var runFn2 = function(fn) {
553+ return function(a) {
554+ return function(b) {
560+ // output/Data.Array/index.js
561+ var foldMap1 = /* @__PURE__ */ foldMap(foldableArray);
562+ var range2 = /* @__PURE__ */ runFn2(rangeImpl);
563+ var foldMap2 = function(dictMonoid) {
564+ return foldMap1(dictMonoid);
567+ // output/Maquette/foreign.js
568+ var NAMESPACE_W3 = "http://www.w3.org/";
569+ var NAMESPACE_SVG = NAMESPACE_W3 + "2000/svg";
570+ var NAMESPACE_XLINK = NAMESPACE_W3 + "1999/xlink";
571+ var emptyArray = [];
572+ var extend2 = function(base, overrides) {
574+ Object.keys(base).forEach(function(key) {
575+ result[key] = base[key];
578+ Object.keys(overrides).forEach(function(key) {
579+ result[key] = overrides[key];
584+ var same = function(vnode1, vnode2) {
585+ if (vnode1.vnodeSelector !== vnode2.vnodeSelector) {
588+ if (vnode1.properties && vnode2.properties) {
589+ if (vnode1.properties.key !== vnode2.properties.key) {
592+ return vnode1.properties.bind === vnode2.properties.bind;
594+ return !vnode1.properties && !vnode2.properties;
596+ var checkStyleValue = function(styleValue) {
597+ if (typeof styleValue !== "string") {
598+ throw new Error("Style values must be strings");
601+ var findIndexOfChild = function(children, sameAs, start2) {
602+ if (sameAs.vnodeSelector !== "") {
603+ for (var i = start2; i < children.length; i++) {
604+ if (same(children[i], sameAs)) {
611+ var checkDistinguishable = function(childNodes, indexToCheck, parentVNode, operation) {
612+ var childNode = childNodes[indexToCheck];
613+ if (childNode.vnodeSelector === "") {
616+ var properties = childNode.properties;
617+ var key = properties ? properties.key === void 0 ? properties.bind : properties.key : void 0;
619+ for (var i = 0; i < childNodes.length; i++) {
620+ if (i !== indexToCheck) {
621+ var node = childNodes[i];
622+ if (same(node, childNode)) {
624+ 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."),
625+ parentNode: parentVNode,
633+ var nodeAdded = function(vNode) {
634+ if (vNode.properties) {
635+ var enterAnimation = vNode.properties.enterAnimation;
636+ if (enterAnimation) {
637+ enterAnimation(vNode.domNode, vNode.properties);
641+ var removedNodes = [];
642+ var requestedIdleCallback = false;
643+ var visitRemovedNode = function(node) {
644+ (node.children || []).forEach(visitRemovedNode);
645+ if (node.properties && node.properties.afterRemoved) {
646+ node.properties.afterRemoved.apply(node.properties.bind || node.properties, [
651+ var processPendingNodeRemovals = function() {
652+ requestedIdleCallback = false;
653+ removedNodes.forEach(visitRemovedNode);
654+ removedNodes.length = 0;
656+ var scheduleNodeRemoval = function(vNode) {
657+ removedNodes.push(vNode);
658+ if (!requestedIdleCallback) {
659+ requestedIdleCallback = true;
660+ if (typeof window !== "undefined" && "requestIdleCallback" in window) {
661+ window.requestIdleCallback(processPendingNodeRemovals, { timeout: 16 });
663+ setTimeout(processPendingNodeRemovals, 16);
667+ var nodeToRemove = function(vNode) {
668+ var domNode = vNode.domNode;
669+ if (vNode.properties) {
670+ var exitAnimation = vNode.properties.exitAnimation;
671+ if (exitAnimation) {
672+ domNode.style.pointerEvents = "none";
673+ var removeDomNode = function() {
674+ if (domNode.parentNode) {
675+ domNode.parentNode.removeChild(domNode);
676+ scheduleNodeRemoval(vNode);
679+ exitAnimation(domNode, removeDomNode, vNode.properties);
683+ if (domNode.parentNode) {
684+ domNode.parentNode.removeChild(domNode);
685+ scheduleNodeRemoval(vNode);
688+ var vnodeOnlyProps = [
696+ function filterVNodeOnlyProps(name14) {
697+ return !vnodeOnlyProps.includes(name14);
699+ var setProperties = function(domNode, properties, projectionOptions) {
703+ var eventHandlerInterceptor = projectionOptions.eventHandlerInterceptor;
704+ var propNames = Object.keys(properties).filter(filterVNodeOnlyProps);
705+ var propCount = propNames.length;
706+ for (var i = 0; i < propCount; i++) {
707+ var propName = propNames[i];
708+ var propValue = properties[propName];
709+ if (propName === "className") {
710+ throw new Error('Property "className" is not supported, use "class".');
711+ } else if (propName === "class") {
712+ toggleClasses(domNode, propValue, true);
713+ } else if (propName === "classes") {
714+ var classNames = Object.keys(propValue);
715+ var classNameCount = classNames.length;
716+ for (var j = 0; j < classNameCount; j++) {
717+ var className = classNames[j];
718+ if (propValue[className]) {
719+ domNode.classList.add(className);
722+ } else if (propName === "styles") {
723+ var styleNames = Object.keys(propValue);
724+ var styleCount = styleNames.length;
725+ for (var j = 0; j < styleCount; j++) {
726+ var styleName = styleNames[j];
727+ var styleValue = propValue[styleName];
729+ checkStyleValue(styleValue);
730+ projectionOptions.styleApplyer(domNode, styleName, styleValue);
733+ } else if (propName === "on" && propValue) {
734+ for (var _i = 0, _a = Object.entries(properties.on); _i < _a.length; _i++) {
735+ var _b = _a[_i], key = _b[0], handler = _b[1];
736+ var listener = typeof handler === "function" ? handler : handler.listener;
737+ if (eventHandlerInterceptor) {
738+ listener = eventHandlerInterceptor(key, listener, domNode, properties);
741+ domNode.addEventListener(key, listener, typeof handler === "function" ? void 0 : handler.options);
744+ } else if (propName !== "key" && propValue !== null && propValue !== void 0) {
745+ var type = typeof propValue;
746+ if (type === "function") {
747+ if (propName.lastIndexOf("on", 0) === 0) {
748+ if (eventHandlerInterceptor) {
749+ propValue = eventHandlerInterceptor(propName, propValue, domNode, properties);
752+ domNode[propName] = propValue;
753+ } else if (projectionOptions.namespace === NAMESPACE_SVG) {
754+ if (propName === "href") {
755+ domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue);
757+ domNode.setAttribute(propName, propValue);
759+ } else if (type === "string" && propName !== "value" && propName !== "innerHTML") {
760+ domNode.setAttribute(propName, propValue);
762+ domNode[propName] = propValue;
767+ var addChildren = function(domNode, children, projectionOptions) {
771+ for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
772+ var child = children_1[_i];
773+ createDom(child, domNode, void 0, projectionOptions);
776+ var initPropertiesAndChildren = function(domNode, vnode, projectionOptions) {
777+ addChildren(domNode, vnode.children, projectionOptions);
779+ domNode.textContent = vnode.text;
781+ setProperties(domNode, vnode.properties, projectionOptions);
782+ if (vnode.properties && vnode.properties.afterCreate) {
783+ vnode.properties.afterCreate.apply(vnode.properties.bind || vnode.properties, [
786+ vnode.vnodeSelector,
792+ var createDom = function(vnode, parentNode, insertBefore, projectionOptions) {
796+ var vnodeSelector = vnode.vnodeSelector;
797+ var doc = parentNode.ownerDocument;
798+ if (vnodeSelector === "") {
799+ if (vnode.domNode) {
800+ vnode.domNode.nodeValue = vnode.text;
802+ domNode = vnode.domNode = doc.createTextNode(vnode.text);
803+ if (insertBefore !== void 0) {
804+ parentNode.insertBefore(domNode, insertBefore);
806+ parentNode.appendChild(domNode);
810+ for (var i = 0; i <= vnodeSelector.length; ++i) {
811+ var c = vnodeSelector.charAt(i);
812+ if (i === vnodeSelector.length || c === "." || c === "#") {
813+ var type = vnodeSelector.charAt(start2 - 1);
814+ var found = vnodeSelector.slice(start2, i);
816+ domNode.classList.add(found);
817+ } else if (type === "#") {
820+ if (found === "svg") {
821+ projectionOptions = extend2(projectionOptions, {
822+ namespace: NAMESPACE_SVG
825+ if (projectionOptions.namespace !== void 0) {
826+ domNode = vnode.domNode = doc.createElementNS(projectionOptions.namespace, found);
828+ 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));
829+ if (found === "input" && vnode.properties && vnode.properties.type !== void 0) {
830+ domNode.setAttribute("type", vnode.properties.type);
833+ if (insertBefore !== void 0) {
834+ parentNode.insertBefore(domNode, insertBefore);
835+ } else if (domNode.parentNode !== parentNode) {
836+ parentNode.appendChild(domNode);
842+ initPropertiesAndChildren(domNode, vnode, projectionOptions);
846+ var toggleClasses = function(domNode, classes, on2) {
850+ classes.split(" ").forEach(function(classToToggle) {
851+ if (classToToggle) {
852+ domNode.classList.toggle(classToToggle, on2);
856+ var updateProperties = function(domNode, previousProperties, properties, projectionOptions) {
860+ var propertiesUpdated = false;
861+ var propNames = Object.keys(properties).filter(filterVNodeOnlyProps);
862+ var propCount = propNames.length;
863+ for (var i = 0; i < propCount; i++) {
864+ var propName = propNames[i];
865+ var propValue = properties[propName];
866+ var previousValue = previousProperties[propName];
867+ if (propName === "class") {
868+ if (previousValue !== propValue) {
869+ toggleClasses(domNode, previousValue, false);
870+ toggleClasses(domNode, propValue, true);
872+ } else if (propName === "classes") {
873+ var classList = domNode.classList;
874+ var classNames = Object.keys(propValue);
875+ var classNameCount = classNames.length;
876+ for (var j = 0; j < classNameCount; j++) {
877+ var className = classNames[j];
878+ var on2 = !!propValue[className];
879+ var previousOn = !!previousValue[className];
880+ if (on2 === previousOn) {
883+ propertiesUpdated = true;
885+ classList.add(className);
887+ classList.remove(className);
890+ } else if (propName === "styles") {
891+ var styleNames = Object.keys(propValue);
892+ var styleCount = styleNames.length;
893+ for (var j = 0; j < styleCount; j++) {
894+ var styleName = styleNames[j];
895+ var newStyleValue = propValue[styleName];
896+ var oldStyleValue = previousValue[styleName];
897+ if (newStyleValue === oldStyleValue) {
900+ propertiesUpdated = true;
901+ if (newStyleValue) {
902+ checkStyleValue(newStyleValue);
903+ projectionOptions.styleApplyer(domNode, styleName, newStyleValue);
905+ projectionOptions.styleApplyer(domNode, styleName, "");
909+ if (!propValue && typeof previousValue === "string") {
912+ if (propName === "value") {
913+ var domValue = domNode[propName];
914+ if (domValue !== propValue && // The 'value' in the DOM tree !== newValue
915+ propValue !== previousValue) {
916+ domNode[propName] = propValue;
918+ if (propValue !== previousValue) {
919+ propertiesUpdated = true;
921+ } else if (propValue !== previousValue) {
922+ var type = typeof propValue;
923+ if (type !== "function" || !projectionOptions.eventHandlerInterceptor) {
924+ if (projectionOptions.namespace === NAMESPACE_SVG) {
925+ if (propName === "href") {
926+ domNode.setAttributeNS(NAMESPACE_XLINK, propName, propValue);
928+ domNode.setAttribute(propName, propValue);
930+ } else if (type === "string" && propName !== "innerHTML") {
931+ if (propName === "role" && propValue === "") {
932+ domNode.removeAttribute(propName);
934+ domNode.setAttribute(propName, propValue);
936+ } else if (domNode[propName] !== propValue) {
937+ domNode[propName] = propValue;
939+ propertiesUpdated = true;
944+ return propertiesUpdated;
946+ var updateChildren = function(vnode, domNode, oldChildren, newChildren, projectionOptions) {
947+ if (oldChildren === newChildren) {
950+ oldChildren = oldChildren || emptyArray;
951+ newChildren = newChildren || emptyArray;
952+ var oldChildrenLength = oldChildren.length;
953+ var newChildrenLength = newChildren.length;
957+ var textUpdated = false;
958+ while (newIndex < newChildrenLength) {
959+ var oldChild = oldIndex < oldChildrenLength ? oldChildren[oldIndex] : void 0;
960+ var newChild = newChildren[newIndex];
961+ if (oldChild !== void 0 && same(oldChild, newChild)) {
962+ textUpdated = updateDom(oldChild, newChild, projectionOptions, domNode, oldChildren) || textUpdated;
965+ var findOldIndex = findIndexOfChild(oldChildren, newChild, oldIndex + 1);
966+ if (findOldIndex >= 0) {
967+ for (i = oldIndex; i < findOldIndex; i++) {
968+ nodeToRemove(oldChildren[i]);
969+ checkDistinguishable(oldChildren, i, vnode, "removed");
971+ textUpdated = updateDom(oldChildren[findOldIndex], newChild, projectionOptions, domNode, oldChildren) || textUpdated;
972+ oldIndex = findOldIndex + 1;
974+ createDom(newChild, domNode, oldIndex < oldChildrenLength ? oldChildren[oldIndex].domNode : void 0, projectionOptions);
975+ nodeAdded(newChild);
976+ checkDistinguishable(newChildren, newIndex, vnode, "added");
981+ if (oldChildrenLength > oldIndex) {
982+ for (i = oldIndex; i < oldChildrenLength; i++) {
983+ nodeToRemove(oldChildren[i]);
984+ checkDistinguishable(oldChildren, i, vnode, "removed");
989+ updateDom = function(previous, vnode, projectionOptions, parentNode, oldChildren) {
990+ var domNode = previous.domNode;
991+ var textUpdated = false;
992+ if (previous === vnode) {
995+ var updated = false;
996+ if (vnode.vnodeSelector === "") {
997+ if (vnode.text !== previous.text) {
998+ var newTextNode = domNode.ownerDocument.createTextNode(vnode.text);
1000+ parentNode.replaceChild(newTextNode, domNode);
1002+ parentNode.replaceChild(newTextNode, parentNode.childNodes[oldChildren.indexOf(previous)]);
1004+ vnode.domNode = newTextNode;
1005+ textUpdated = true;
1006+ return textUpdated;
1008+ vnode.domNode = domNode;
1010+ if (vnode.vnodeSelector.lastIndexOf("svg", 0) === 0) {
1011+ projectionOptions = extend2(projectionOptions, {
1012+ namespace: NAMESPACE_SVG
1015+ if (previous.text !== vnode.text) {
1017+ if (vnode.text === void 0) {
1018+ domNode.removeChild(domNode.firstChild);
1020+ domNode.textContent = vnode.text;
1023+ vnode.domNode = domNode;
1024+ updated = updateChildren(vnode, domNode, previous.children, vnode.children, projectionOptions) || updated;
1025+ updated = updateProperties(domNode, previous.properties, vnode.properties, projectionOptions) || updated;
1026+ if (vnode.properties && vnode.properties.afterUpdate) {
1027+ vnode.properties.afterUpdate.apply(vnode.properties.bind || vnode.properties, [
1030+ vnode.vnodeSelector,
1036+ if (updated && vnode.properties && vnode.properties.updateAnimation) {
1037+ vnode.properties.updateAnimation(domNode, vnode.properties, previous.properties);
1039+ return textUpdated;
1041+ var createProjection = function(vnode, projectionOptions) {
1043+ getLastRender: function() {
1046+ update: function(updatedVnode) {
1047+ if (vnode.vnodeSelector !== updatedVnode.vnodeSelector) {
1048+ 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)");
1050+ var previousVNode = vnode;
1051+ vnode = updatedVnode;
1052+ updateDom(previousVNode, updatedVnode, projectionOptions, previousVNode.domNode.parentNode, [previousVNode]);
1054+ domNode: vnode.domNode
1057+ var DEFAULT_PROJECTION_OPTIONS = {
1059+ performanceLogger: function() {
1062+ eventHandlerInterceptor: void 0,
1063+ styleApplyer: function(domNode, styleName, value12) {
1064+ if (styleName.charAt(0) === "-") {
1065+ domNode.style.setProperty(styleName, value12);
1067+ domNode.style[styleName] = value12;
1071+ var applyDefaultProjectionOptions = function(projectorOptions) {
1072+ return extend2(DEFAULT_PROJECTION_OPTIONS, projectorOptions);
1076+ * Creates a real DOM tree from `vnode`. The [[Projection]] object returned will contain the resulting DOM Node in
1077+ * its [[Projection.domNode|domNode]] property.
1078+ * This is a low-level method. Users will typically use a [[Projector]] instead.
1079+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
1080+ * objects may only be rendered once.
1081+ * @param projectionOptions - Options to be used to create and update the projection.
1082+ * @returns The [[Projection]] which also contains the DOM Node that was created.
1084+ create: function(vnode, projectionOptions) {
1085+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1086+ createDom(vnode, document.createElement("div"), void 0, projectionOptions);
1087+ return createProjection(vnode, projectionOptions);
1090+ * Appends a new child node to the DOM which is generated from a [[VNode]].
1091+ * This is a low-level method. Users will typically use a [[Projector]] instead.
1092+ * @param parentNode - The parent node for the new child node.
1093+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
1094+ * objects may only be rendered once.
1095+ * @param projectionOptions - Options to be used to create and update the [[Projection]].
1096+ * @returns The [[Projection]] that was created.
1098+ append: function(parentNode, vnode, projectionOptions) {
1099+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1100+ createDom(vnode, parentNode, void 0, projectionOptions);
1101+ return createProjection(vnode, projectionOptions);
1104+ * Inserts a new DOM node which is generated from a [[VNode]].
1105+ * This is a low-level method. Users wil typically use a [[Projector]] instead.
1106+ * @param beforeNode - The node that the DOM Node is inserted before.
1107+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function.
1108+ * NOTE: [[VNode]] objects may only be rendered once.
1109+ * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]].
1110+ * @returns The [[Projection]] that was created.
1112+ insertBefore: function(beforeNode, vnode, projectionOptions) {
1113+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1114+ createDom(vnode, beforeNode.parentNode, beforeNode, projectionOptions);
1115+ return createProjection(vnode, projectionOptions);
1118+ * Merges a new DOM node which is generated from a [[VNode]] with an existing DOM Node.
1119+ * This means that the virtual DOM and the real DOM will have one overlapping element.
1120+ * Therefore the selector for the root [[VNode]] will be ignored, but its properties and children will be applied to the Element provided.
1121+ * This is a low-level method. Users wil typically use a [[Projector]] instead.
1122+ * @param element - The existing element to adopt as the root of the new virtual DOM. Existing attributes and child nodes are preserved.
1123+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]] objects
1124+ * may only be rendered once.
1125+ * @param projectionOptions - Options to be used to create and update the projection, see [[createProjector]].
1126+ * @returns The [[Projection]] that was created.
1128+ merge: function(element, vnode, projectionOptions) {
1129+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1130+ vnode.domNode = element;
1131+ initPropertiesAndChildren(element, vnode, projectionOptions);
1132+ return createProjection(vnode, projectionOptions);
1135+ * Replaces an existing DOM node with a node generated from a [[VNode]].
1136+ * This is a low-level method. Users will typically use a [[Projector]] instead.
1137+ * @param element - The node for the [[VNode]] to replace.
1138+ * @param vnode - The root of the virtual DOM tree that was created using the [[h]] function. NOTE: [[VNode]]
1139+ * objects may only be rendered once.
1140+ * @param projectionOptions - Options to be used to create and update the [[Projection]].
1141+ * @returns The [[Projection]] that was created.
1143+ replace: function(element, vnode, projectionOptions) {
1144+ projectionOptions = applyDefaultProjectionOptions(projectionOptions);
1145+ createDom(vnode, element.parentNode, element, projectionOptions);
1146+ element.parentNode.removeChild(element);
1147+ return createProjection(vnode, projectionOptions);
1150+ var toTextVNode = function(data) {
1153+ properties: void 0,
1155+ text: data.toString(),
1159+ var appendChildren = function(parentSelector, insertions, main2) {
1160+ for (var i = 0, length_1 = insertions.length; i < length_1; i++) {
1161+ var item = insertions[i];
1162+ if (Array.isArray(item)) {
1163+ appendChildren(parentSelector, item, main2);
1165+ if (item !== null && item !== void 0 && item !== false) {
1166+ if (typeof item === "string") {
1167+ item = toTextVNode(item);
1174+ function h(selector, properties, children) {
1175+ if (Array.isArray(properties)) {
1176+ children = properties;
1177+ properties = void 0;
1178+ } else if (properties && (typeof properties === "string" || properties.vnodeSelector) || children && (typeof children === "string" || children.vnodeSelector)) {
1179+ throw new Error("h called with invalid arguments");
1182+ var flattenedChildren;
1183+ if (children && children.length === 1 && typeof children[0] === "string") {
1184+ text5 = children[0];
1185+ } else if (children) {
1186+ flattenedChildren = [];
1187+ appendChildren(selector, children, flattenedChildren);
1188+ if (flattenedChildren.length === 0) {
1189+ flattenedChildren = void 0;
1193+ vnodeSelector: selector,
1195+ children: flattenedChildren,
1196+ text: text5 === "" ? void 0 : text5,
1200+ var createParentNodePath = function(node, rootNode) {
1201+ var parentNodePath = [];
1202+ while (node && node !== rootNode) {
1203+ parentNodePath.push(node);
1204+ node = node.parentNode;
1206+ return parentNodePath;
1209+ if (Array.prototype.find) {
1210+ find2 = function(items, predicate) {
1211+ return items.find(predicate);
1214+ find2 = function(items, predicate) {
1215+ return items.filter(predicate)[0];
1218+ var findVNodeByParentNodePath = function(vnode, parentNodePath) {
1219+ var result = vnode;
1220+ parentNodePath.forEach(function(node) {
1221+ result = result && result.children ? find2(result.children, function(child) {
1222+ return child.domNode === node;
1227+ var createEventHandlerInterceptor = function(projector, getProjection, performanceLogger) {
1228+ return function(propertyName, eventHandler, domNode, properties) {
1229+ return modifiedEventHandler;
1231+ function modifiedEventHandler(evt) {
1233+ performanceLogger("domEvent", evt);
1234+ var projection = getProjection();
1235+ var parentNodePath = createParentNodePath(evt.currentTarget, projection.domNode);
1236+ parentNodePath.reverse();
1237+ var matchingVNode = findVNodeByParentNodePath(projection.getLastRender(), parentNodePath);
1238+ projector.scheduleRender();
1240+ if (matchingVNode) {
1241+ 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];
1242+ result = listener.apply(matchingVNode.properties.bind || this, arguments);
1244+ performanceLogger("domEventProcessed", evt);
1248+ var createProjector = function(projectorOptions) {
1250+ var projectionOptions = applyDefaultProjectionOptions(projectorOptions);
1251+ var performanceLogger = projectionOptions.performanceLogger;
1252+ var renderCompleted = true;
1254+ var stopped = false;
1255+ var projections = [];
1256+ var renderFunctions = [];
1257+ var addProjection = function(domFunction, node, renderFunction) {
1259+ var getProjection = function() {
1262+ projectionOptions.eventHandlerInterceptor = createEventHandlerInterceptor(projector, getProjection, performanceLogger);
1263+ projection = domFunction(node, renderFunction(), projectionOptions);
1264+ projections.push(projection);
1265+ renderFunctions.push(renderFunction);
1267+ var doRender = function() {
1268+ scheduled = void 0;
1269+ if (!renderCompleted) {
1272+ renderCompleted = false;
1273+ performanceLogger("renderStart", void 0);
1274+ for (var i = 0; i < projections.length; i++) {
1275+ var updatedVnode = renderFunctions[i]();
1276+ performanceLogger("rendered", void 0);
1277+ projections[i].update(updatedVnode);
1278+ performanceLogger("patched", void 0);
1280+ performanceLogger("renderDone", void 0);
1281+ renderCompleted = true;
1284+ renderNow: doRender,
1285+ scheduleRender: function() {
1286+ if (!scheduled && !stopped) {
1287+ scheduled = requestAnimationFrame(doRender);
1292+ cancelAnimationFrame(scheduled);
1293+ scheduled = void 0;
1297+ resume: function() {
1299+ renderCompleted = true;
1300+ projector.scheduleRender();
1302+ append: function(parentNode, renderFunction) {
1303+ addProjection(dom.append, parentNode, renderFunction);
1305+ insertBefore: function(beforeNode, renderFunction) {
1306+ addProjection(dom.insertBefore, beforeNode, renderFunction);
1308+ merge: function(domNode, renderFunction) {
1309+ addProjection(dom.merge, domNode, renderFunction);
1311+ replace: function(domNode, renderFunction) {
1312+ addProjection(dom.replace, domNode, renderFunction);
1314+ detach: function(renderFunction) {
1315+ for (var i = 0; i < renderFunctions.length; i++) {
1316+ if (renderFunctions[i] === renderFunction) {
1317+ renderFunctions.splice(i, 1);
1318+ return projections.splice(i, 1)[0];
1321+ throw new Error("renderFunction was not found");
1326+ function _h(selector) {
1327+ return function(properties) {
1328+ return function(children) {
1329+ return h(selector, properties, children);
1333+ function replace(projector) {
1334+ return function(el) {
1335+ return function(render3) {
1336+ return function() {
1337+ projector.replace(el, render3);
1343+ // output/Maquette/index.js
1344+ var string = unsafeCoerce2;
1347+ // output/Data.Int/foreign.js
1348+ var fromNumberImpl = function(just) {
1349+ return function(nothing) {
1350+ return function(n) {
1351+ return (n | 0) === n ? just(n) : nothing;
1355+ var toNumber = function(n) {
1359+ // output/Data.Number/foreign.js
1360+ var isFiniteImpl = isFinite;
1361+ var round = Math.round;
1363+ // output/Data.Int/index.js
1364+ var top2 = /* @__PURE__ */ top(boundedInt);
1365+ var bottom2 = /* @__PURE__ */ bottom(boundedInt);
1366+ var fromNumber = /* @__PURE__ */ function() {
1367+ return fromNumberImpl(Just.create)(Nothing.value);
1369+ var unsafeClamp = function(x) {
1370+ if (!isFiniteImpl(x)) {
1374+ if (x >= toNumber(top2)) {
1378+ if (x <= toNumber(bottom2)) {
1383+ return fromMaybe(0)(fromNumber(x));
1386+ throw new Error("Failed pattern match at Data.Int (line 72, column 1 - line 72, column 29): " + [x.constructor.name]);
1388+ var round2 = function($37) {
1389+ return unsafeClamp(round($37));
1392+ // output/Foreign.Object/foreign.js
1393+ function _copyST(m) {
1394+ return function() {
1397+ if (hasOwnProperty.call(m, k)) {
1405+ function runST(f) {
1408+ function _foldM(bind3) {
1409+ return function(f) {
1410+ return function(mz) {
1411+ return function(m) {
1414+ return function(z) {
1415+ return f(z)(k2)(m[k2]);
1419+ if (hasOwnProperty.call(m, k)) {
1420+ acc = bind3(acc)(g(k));
1428+ function toArrayWithKey(f) {
1429+ return function(m) {
1432+ if (hasOwnProperty.call(m, k)) {
1433+ r.push(f(k)(m[k]));
1439+ var keys = Object.keys || toArrayWithKey(function(k) {
1440+ return function() {
1445+ // output/Foreign.Object.ST/foreign.js
1446+ var newImpl = function() {
1449+ function poke2(k) {
1450+ return function(v) {
1451+ return function(m) {
1452+ return function() {
1460+ // output/Foreign.Object/index.js
1461+ var bindFlipped2 = /* @__PURE__ */ bindFlipped(bindST);
1462+ var thawST = _copyST;
1463+ var singleton2 = function(k) {
1464+ return function(v) {
1465+ return runST(bindFlipped2(poke2(k)(v))(newImpl));
1468+ var mutate = function(f) {
1469+ return function(m) {
1470+ return runST(function __do() {
1471+ var s = thawST(m)();
1477+ var foldM = function(dictMonad) {
1478+ var bind1 = bind(dictMonad.Bind1());
1479+ var pure1 = pure(dictMonad.Applicative0());
1480+ return function(f) {
1481+ return function(z) {
1482+ return _foldM(bind1)(f)(pure1(z));
1486+ var foldM1 = /* @__PURE__ */ foldM(monadST);
1487+ var union = function(m) {
1488+ return mutate(function(s) {
1489+ return foldM1(function(s$prime) {
1490+ return function(k) {
1491+ return function(v) {
1492+ return poke2(k)(v)(s$prime);
1499+ // output/Record.Unsafe.Union/foreign.js
1500+ function unsafeUnionFn(r1, r2) {
1502+ for (var k1 in r2) {
1503+ if ({}.hasOwnProperty.call(r2, k1)) {
1507+ for (var k2 in r1) {
1508+ if ({}.hasOwnProperty.call(r1, k2)) {
1515+ // output/Record.Unsafe.Union/index.js
1516+ var unsafeUnion = /* @__PURE__ */ runFn2(unsafeUnionFn);
1518+ // output/Plum.View/index.js
1519+ var show2 = /* @__PURE__ */ show(showInt);
1520+ var show1 = /* @__PURE__ */ show(showNumber);
1521+ var append1 = /* @__PURE__ */ append(semigroupArray);
1522+ var mempty2 = /* @__PURE__ */ mempty(monoidArray);
1523+ var map2 = /* @__PURE__ */ map(functorArray);
1524+ var Px = /* @__PURE__ */ function() {
1525+ function Px2(value0) {
1526+ this.value0 = value0;
1529+ Px2.create = function(value0) {
1530+ return new Px2(value0);
1534+ var Fill = /* @__PURE__ */ function() {
1538+ Fill2.value = new Fill2();
1541+ var Fit = /* @__PURE__ */ function() {
1545+ Fit2.value = new Fit2();
1548+ var Max2 = /* @__PURE__ */ function() {
1549+ function Max3(value0, value1) {
1550+ this.value0 = value0;
1551+ this.value1 = value1;
1554+ Max3.create = function(value0) {
1555+ return function(value1) {
1556+ return new Max3(value0, value1);
1561+ var Min2 = /* @__PURE__ */ function() {
1562+ function Min3(value0, value1) {
1563+ this.value0 = value0;
1564+ this.value1 = value1;
1567+ Min3.create = function(value0) {
1568+ return function(value1) {
1569+ return new Min3(value0, value1);
1574+ var X = /* @__PURE__ */ function() {
1578+ X2.value = new X2();
1581+ var Y = /* @__PURE__ */ function() {
1585+ Y2.value = new Y2();
1588+ var Grid = /* @__PURE__ */ function() {
1592+ Grid2.value = new Grid2();
1595+ var Flexbox = /* @__PURE__ */ function() {
1596+ function Flexbox2(value0) {
1597+ this.value0 = value0;
1600+ Flexbox2.create = function(value0) {
1601+ return new Flexbox2(value0);
1605+ var Generic = /* @__PURE__ */ function() {
1606+ function Generic2() {
1609+ Generic2.value = new Generic2();
1612+ var Span = /* @__PURE__ */ function() {
1616+ Span2.value = new Span2();
1619+ var Start = /* @__PURE__ */ function() {
1620+ function Start2() {
1623+ Start2.value = new Start2();
1626+ var Center = /* @__PURE__ */ function() {
1627+ function Center2() {
1630+ Center2.value = new Center2();
1633+ var End = /* @__PURE__ */ function() {
1637+ End2.value = new End2();
1640+ var Spacing = /* @__PURE__ */ function() {
1641+ function Spacing2(value0, value1) {
1642+ this.value0 = value0;
1643+ this.value1 = value1;
1646+ Spacing2.create = function(value0) {
1647+ return function(value1) {
1648+ return new Spacing2(value0, value1);
1653+ var Explain = /* @__PURE__ */ function() {
1654+ function Explain2() {
1657+ Explain2.value = new Explain2();
1660+ var Align = /* @__PURE__ */ function() {
1661+ function Align2(value0, value1) {
1662+ this.value0 = value0;
1663+ this.value1 = value1;
1666+ Align2.create = function(value0) {
1667+ return function(value1) {
1668+ return new Align2(value0, value1);
1673+ var Width = /* @__PURE__ */ function() {
1674+ function Width2(value0) {
1675+ this.value0 = value0;
1678+ Width2.create = function(value0) {
1679+ return new Width2(value0);
1683+ var Height = /* @__PURE__ */ function() {
1684+ function Height2(value0) {
1685+ this.value0 = value0;
1688+ Height2.create = function(value0) {
1689+ return new Height2(value0);
1693+ var Wrapped = /* @__PURE__ */ function() {
1694+ function Wrapped2() {
1697+ Wrapped2.value = new Wrapped2();
1700+ var BackgroundColor = /* @__PURE__ */ function() {
1701+ function BackgroundColor2(value0) {
1702+ this.value0 = value0;
1705+ BackgroundColor2.create = function(value0) {
1706+ return new BackgroundColor2(value0);
1708+ return BackgroundColor2;
1710+ var Padding = /* @__PURE__ */ function() {
1711+ function Padding2(value0) {
1712+ this.value0 = value0;
1715+ Padding2.create = function(value0) {
1716+ return new Padding2(value0);
1720+ var Spread = /* @__PURE__ */ function() {
1721+ function Spread2() {
1724+ Spread2.value = new Spread2();
1727+ var Opacity = /* @__PURE__ */ function() {
1728+ function Opacity2(value0) {
1729+ this.value0 = value0;
1732+ Opacity2.create = function(value0) {
1733+ return new Opacity2(value0);
1737+ var Pointer = /* @__PURE__ */ function() {
1738+ function Pointer2() {
1741+ Pointer2.value = new Pointer2();
1744+ var Move = /* @__PURE__ */ function() {
1745+ function Move2(value0) {
1746+ this.value0 = value0;
1749+ Move2.create = function(value0) {
1750+ return new Move2(value0);
1754+ var Clip = /* @__PURE__ */ function() {
1755+ function Clip2(value0) {
1756+ this.value0 = value0;
1759+ Clip2.create = function(value0) {
1760+ return new Clip2(value0);
1764+ var Column = /* @__PURE__ */ function() {
1765+ function Column2(value0) {
1766+ this.value0 = value0;
1769+ Column2.create = function(value0) {
1770+ return new Column2(value0);
1774+ var Row = /* @__PURE__ */ function() {
1775+ function Row2(value0) {
1776+ this.value0 = value0;
1779+ Row2.create = function(value0) {
1780+ return new Row2(value0);
1784+ var Stack = /* @__PURE__ */ function() {
1785+ function Stack2(value0) {
1786+ this.value0 = value0;
1789+ Stack2.create = function(value0) {
1790+ return new Stack2(value0);
1794+ var Wrapper = /* @__PURE__ */ function() {
1795+ function Wrapper2(value0) {
1796+ this.value0 = value0;
1799+ Wrapper2.create = function(value0) {
1800+ return new Wrapper2(value0);
1804+ var Text = /* @__PURE__ */ function() {
1805+ function Text2(value0) {
1806+ this.value0 = value0;
1809+ Text2.create = function(value0) {
1810+ return new Text2(value0);
1814+ var Link = /* @__PURE__ */ function() {
1815+ function Link2(value0, value1, value22) {
1816+ this.value0 = value0;
1817+ this.value1 = value1;
1818+ this.value2 = value22;
1821+ Link2.create = function(value0) {
1822+ return function(value1) {
1823+ return function(value22) {
1824+ return new Link2(value0, value1, value22);
1830+ var Download = /* @__PURE__ */ function() {
1831+ function Download2(value0, value1, value22) {
1832+ this.value0 = value0;
1833+ this.value1 = value1;
1834+ this.value2 = value22;
1837+ Download2.create = function(value0) {
1838+ return function(value1) {
1839+ return function(value22) {
1840+ return new Download2(value0, value1, value22);
1846+ var semigroupSkin = {
1847+ append: function(v) {
1848+ return function(v1) {
1849+ return union(v)(v1);
1853+ var append2 = /* @__PURE__ */ append(semigroupSkin);
1854+ var semigroupMutation = {
1855+ append: function(v) {
1856+ return function(v1) {
1858+ extraSkin: append2(v.extraSkin)(v1.extraSkin)
1863+ var renderableColor = {
1864+ render: function(v) {
1865+ return "rgba(" + (show2(v.r) + ("," + (show2(v.g) + ("," + (show2(v.b) + ("," + (show1(v.a) + ")")))))));
1870+ Semigroup0: function() {
1871+ return semigroupSkin;
1874+ var mempty1 = /* @__PURE__ */ mempty(monoidSkin);
1875+ var foldMap3 = /* @__PURE__ */ foldMap2(monoidSkin);
1876+ var monoidMutation = {
1880+ Semigroup0: function() {
1881+ return semigroupMutation;
1884+ var mempty22 = /* @__PURE__ */ mempty(monoidMutation);
1885+ var view = function(nerves) {
1886+ return function(meat) {
1887+ return function(bones) {
1896+ var sk = function(key) {
1897+ return function(val) {
1898+ return singleton2(key)(val);
1901+ var rgb = function(r) {
1902+ return function(g) {
1903+ return function(b) {
1905+ r: round2(r * 255),
1906+ g: round2(g * 255),
1907+ b: round2(b * 255),
1913+ var render = function(dict) {
1914+ return dict.render;
1916+ var render1 = /* @__PURE__ */ render(renderableColor);
1917+ var renderableLength = {
1918+ render: function(v) {
1919+ if (v instanceof Px) {
1920+ return show2(v.value0) + "px";
1923+ if (v instanceof Fit) {
1924+ return "fit-content";
1927+ if (v instanceof Fill) {
1931+ if (v instanceof Max2) {
1932+ return "max(" + (show2(v.value0) + ("px," + (render(renderableLength)(v.value1) + ")")));
1935+ if (v instanceof Min2) {
1936+ return "min(" + (show2(v.value0) + ("px," + (render(renderableLength)(v.value1) + ")")));
1939+ throw new Error("Failed pattern match at Plum.View (line 131, column 12 - line 136, column 62): " + [v.constructor.name]);
1942+ var render2 = /* @__PURE__ */ render(renderableLength);
1943+ var skin = function(ctx) {
1944+ return function(v) {
1945+ if (v instanceof Spacing) {
1946+ return sk("gap")(show2(v.value0) + ("px " + (show2(v.value1) + "px")));
1949+ if (v instanceof Explain) {
1950+ return sk("border")("dashed magenta");
1953+ if (v instanceof Align) {
1954+ if (ctx instanceof Generic) {
1958+ if (ctx instanceof Span) {
1962+ if (ctx instanceof Grid) {
1963+ return sk(function() {
1964+ if (v.value0 instanceof X) {
1965+ return "justify-items";
1968+ if (v.value0 instanceof Y) {
1969+ return "align-items";
1972+ throw new Error("Failed pattern match at Plum.View (line 88, column 9 - line 90, column 29): " + [v.value0.constructor.name]);
1974+ if (v.value1 instanceof Start) {
1978+ if (v.value1 instanceof Center) {
1982+ if (v.value1 instanceof End) {
1986+ throw new Error("Failed pattern match at Plum.View (line 92, column 9 - line 95, column 23): " + [v.value1.constructor.name]);
1990+ if (ctx instanceof Flexbox) {
1991+ return sk(function() {
1992+ var v1 = new Tuple(ctx.value0, v.value0);
1993+ if (v1.value0 instanceof X && v1.value1 instanceof X) {
1994+ return "justify-content";
1997+ if (v1.value0 instanceof X && v1.value1 instanceof Y) {
1998+ return "align-items";
2001+ if (v1.value0 instanceof Y && v1.value1 instanceof X) {
2002+ return "align-items";
2005+ if (v1.value0 instanceof Y && v1.value1 instanceof Y) {
2006+ return "justify-content";
2009+ throw new Error("Failed pattern match at Plum.View (line 99, column 9 - line 103, column 38): " + [v1.constructor.name]);
2011+ if (v.value1 instanceof Start) {
2012+ return "flex-start";
2015+ if (v.value1 instanceof Center) {
2019+ if (v.value1 instanceof End) {
2023+ throw new Error("Failed pattern match at Plum.View (line 105, column 9 - line 108, column 28): " + [v.value1.constructor.name]);
2027+ throw new Error("Failed pattern match at Plum.View (line 84, column 26 - line 109, column 8): " + [ctx.constructor.name]);
2030+ if (v instanceof Width) {
2031+ return sk("width")(render2(v.value0));
2034+ if (v instanceof Height) {
2035+ return sk("height")(render2(v.value0));
2038+ if (v instanceof Wrapped) {
2039+ if (ctx instanceof Flexbox) {
2040+ return sk("flex-wrap")("wrap");
2046+ if (v instanceof BackgroundColor) {
2047+ return sk("background-color")(render1(v.value0));
2050+ if (v instanceof Padding) {
2051+ return sk("padding")(show2(v.value0.top) + ("px " + (show2(v.value0.right) + ("px " + (show2(v.value0.bottom) + ("px " + (show2(v.value0.left) + "px")))))));
2054+ if (v instanceof Spread) {
2055+ if (ctx instanceof Flexbox) {
2056+ return sk("justify-content")("space-between");
2062+ if (v instanceof Opacity) {
2063+ return sk("opacity")(show1(v.value0));
2066+ if (v instanceof Pointer) {
2067+ return sk("cursor")("pointer");
2070+ if (v instanceof Move) {
2071+ return sk("transform")("translate(" + (show2(v.value0.x) + ("px, " + (show2(v.value0.y) + ")"))));
2074+ if (v instanceof Clip && v.value0 instanceof X) {
2075+ return sk("overflow-x")("hidden");
2078+ if (v instanceof Clip && v.value0 instanceof Y) {
2079+ return sk("overflow-y")("hidden");
2082+ throw new Error("Failed pattern match at Plum.View (line 81, column 12 - line 125, column 37): " + [v.constructor.name]);
2085+ var hWith = function(el) {
2086+ return function(props) {
2087+ return function(v) {
2088+ return function(children) {
2089+ return h2(el)(unsafeUnion(props)({
2096+ var h3 = function(el) {
2097+ return function(v) {
2098+ return function(children) {
2105+ var growSkin = function(fire) {
2106+ return function(v) {
2107+ return function(v1) {
2108+ var widthFill = [new Width(Fill.value), new Height(Fill.value)];
2109+ var alignCenter = [new Align(X.value, Center.value), new Align(Y.value, Center.value)];
2110+ var skn = function(ctx) {
2111+ return append2(foldMap3(skin(ctx))(append1(v1.meat)(append1(function() {
2112+ if (ctx instanceof Span) {
2116+ if (ctx instanceof Grid) {
2120+ if (ctx instanceof Flexbox) {
2124+ if (ctx instanceof Generic) {
2128+ throw new Error("Failed pattern match at Plum.View (line 181, column 16 - line 185, column 35): " + [ctx.constructor.name]);
2130+ if (ctx instanceof Grid) {
2131+ return alignCenter;
2134+ if (ctx instanceof Flexbox) {
2135+ return alignCenter;
2138+ if (ctx instanceof Span) {
2142+ if (ctx instanceof Generic) {
2143+ return alignCenter;
2146+ throw new Error("Failed pattern match at Plum.View (line 186, column 16 - line 190, column 37): " + [ctx.constructor.name]);
2147+ }()))))(v.extraSkin);
2149+ if (v1.bones instanceof Text) {
2150+ return h3("span")(skn(Span.value))([string(v1.bones.value0)]);
2153+ if (v1.bones instanceof Wrapper) {
2154+ return h3("div")(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value0)]);
2157+ if (v1.bones instanceof Stack) {
2158+ return h3("div")(append2(skn(Grid.value))(sk("display")("grid")))(map2(growSkin(fire)({
2159+ extraSkin: append2(sk("grid-row")("1"))(sk("grid-column")("1"))
2160+ }))(v1.bones.value0));
2163+ if (v1.bones instanceof Row) {
2164+ return h3("div")(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
2167+ if (v1.bones instanceof Column) {
2168+ return h3("div")(append2(skn(new Flexbox(Y.value)))(append2(sk("display")("flex"))(sk("flex-direction")("column"))))(map2(growSkin(fire)(mempty22))(v1.bones.value0));
2171+ if (v1.bones instanceof Link) {
2172+ return hWith("a")({
2173+ href: v1.bones.value0,
2174+ rel: "noopener noreferrer",
2175+ target: function() {
2176+ if (v1.bones.value1.newTab) {
2182+ })(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value2)]);
2185+ if (v1.bones instanceof Download) {
2186+ return hWith("a")({
2187+ href: v1.bones.value0,
2188+ download: fromMaybe("")(v1.bones.value1.filename)
2189+ })(append2(skn(new Flexbox(X.value)))(append2(sk("display")("flex"))(sk("flex-direction")("row"))))([growSkin(fire)(mempty22)(v1.bones.value2)]);
2192+ throw new Error("Failed pattern match at Plum.View (line 193, column 5 - line 215, column 39): " + [v1.bones.constructor.name]);
2196+ var grow = function(fire) {
2197+ return function(v) {
2198+ return growSkin(fire)(mempty22)(v);
2202+ // output/Web.DOM.NonElementParentNode/foreign.js
2203+ function _getElementById(id) {
2204+ return function(node) {
2205+ return function() {
2206+ return node.getElementById(id);
2211+ // output/Data.Nullable/foreign.js
2212+ function nullable(a, r, f) {
2213+ return a == null ? r : f(a);
2216+ // output/Data.Nullable/index.js
2217+ var toMaybe = function(n) {
2218+ return nullable(n, Nothing.value, Just.create);
2221+ // output/Web.DOM.NonElementParentNode/index.js
2222+ var map3 = /* @__PURE__ */ map(functorEffect);
2223+ var getElementById = function(eid) {
2224+ var $2 = map3(toMaybe);
2225+ var $3 = _getElementById(eid);
2226+ return function($4) {
2231+ // output/Web.HTML/foreign.js
2232+ var windowImpl = function() {
2236+ // output/Web.HTML.HTMLDocument/index.js
2237+ var toNonElementParentNode = unsafeCoerce2;
2239+ // output/Web.HTML.Window/foreign.js
2240+ function document2(window2) {
2241+ return function() {
2242+ return window2.document;
2246+ // output/Plum/index.js
2247+ var bind2 = /* @__PURE__ */ bind(bindEffect);
2248+ var outerStyle = "html,body{height:100%;padding:0;margin:0;}";
2249+ var run3 = function(id) {
2250+ return function(plum2) {
2251+ return function __do() {
2252+ var modelRef = bind2(plum2.init)($$new)();
2253+ var v = bind2(bind2(windowImpl)(document2))(function() {
2254+ var $6 = getElementById(id);
2255+ return function($7) {
2256+ return $6(toNonElementParentNode($7));
2259+ if (v instanceof Just) {
2260+ var projector = createProjector();
2261+ return replace(projector)(v.value0)(function __do2() {
2262+ var model = read(modelRef)();
2263+ var el = grow(function(msg) {
2264+ return function __do3() {
2265+ var m = read(modelRef)();
2266+ var m_ = plum2.update(msg)(m)();
2267+ return write(m_)(modelRef)();
2269+ })(plum2.view(model));
2275+ })([h2("style")({})([string(outerStyle)]), el]);
2279+ if (v instanceof Nothing) {
2283+ throw new Error("Failed pattern match at Plum (line 25, column 92 - line 39, column 25): " + [v.constructor.name]);
2288+ // output/Main/index.js
2289+ var pure2 = /* @__PURE__ */ pure(applicativeEffect);
2290+ var map4 = /* @__PURE__ */ map(functorArray);
2292+ init: /* @__PURE__ */ pure2({
2295+ view: function(model) {
2296+ return view([])([])(new Column([view([])([])(new Link("https://iko.soy", {
2298+ }, view([])([])(new Text("my website")))), view([])([])(new Row(map4($$const(view([])([new BackgroundColor(rgb(1)(0)(0))])(new Text("hello"))))(range2(1)(100))))]));
2300+ update: function(msg) {
2301+ return function(model) {
2303+ text: "Button pressed"
2308+ var main = /* @__PURE__ */ run3("plum")(plum);