diff --git a/dist/tiny-form-fields.esm.js b/dist/tiny-form-fields.esm.js index 839314b..f3f2444 100644 --- a/dist/tiny-form-fields.esm.js +++ b/dist/tiny-form-fields.esm.js @@ -77,7 +77,7 @@ function A9(fun, a, b, c, d, e, f, g, h, i) { return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i); } -console.warn('Compiled in DEBUG mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.'); + // EQUALITY @@ -113,7 +113,7 @@ function _Utils_eqHelp(x, y, depth, stack) return true; } - /**/ + /**_UNUSED/ if (x.$ === 'Set_elm_builtin') { x = $elm$core$Set$toList(x); @@ -126,7 +126,7 @@ function _Utils_eqHelp(x, y, depth, stack) } //*/ - /**_UNUSED/ + /**/ if (x.$ < 0) { x = $elm$core$Dict$toList(x); @@ -161,7 +161,7 @@ function _Utils_cmp(x, y, ord) return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; } - /**/ + /**_UNUSED/ if (x instanceof String) { var a = x.valueOf(); @@ -170,10 +170,10 @@ function _Utils_cmp(x, y, ord) } //*/ - /**_UNUSED/ + /**/ if (typeof x.$ === 'undefined') //*/ - /**/ + /**_UNUSED/ if (x.$[0] === '#') //*/ { @@ -203,17 +203,17 @@ var _Utils_compare = F2(function(x, y) // COMMON VALUES -var _Utils_Tuple0_UNUSED = 0; -var _Utils_Tuple0 = { $: '#0' }; +var _Utils_Tuple0 = 0; +var _Utils_Tuple0_UNUSED = { $: '#0' }; -function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; } -function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; } +function _Utils_Tuple2(a, b) { return { a: a, b: b }; } +function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } -function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; } -function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } +function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } +function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } -function _Utils_chr_UNUSED(c) { return c; } -function _Utils_chr(c) { return new String(c); } +function _Utils_chr(c) { return c; } +function _Utils_chr_UNUSED(c) { return new String(c); } // RECORDS @@ -264,11 +264,11 @@ function _Utils_ap(xs, ys) -var _List_Nil_UNUSED = { $: 0 }; -var _List_Nil = { $: '[]' }; +var _List_Nil = { $: 0 }; +var _List_Nil_UNUSED = { $: '[]' }; -function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; } -function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; } +function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } +function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } var _List_cons = F2(_List_Cons); @@ -499,12 +499,12 @@ var _JsArray_appendN = F3(function(n, dest, source) // LOG -var _Debug_log_UNUSED = F2(function(tag, value) +var _Debug_log = F2(function(tag, value) { return value; }); -var _Debug_log = F2(function(tag, value) +var _Debug_log_UNUSED = F2(function(tag, value) { console.log(tag + ': ' + _Debug_toString(value)); return value; @@ -530,12 +530,12 @@ function _Debug_todoCase(moduleName, region, value) // TO STRING -function _Debug_toString_UNUSED(value) +function _Debug_toString(value) { return ''; } -function _Debug_toString(value) +function _Debug_toString_UNUSED(value) { return _Debug_toAnsiString(false, value); } @@ -720,13 +720,13 @@ function _Debug_toHexDigit(n) // CRASH -function _Debug_crash_UNUSED(identifier) +function _Debug_crash(identifier) { throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); } -function _Debug_crash(identifier, fact1, fact2, fact3, fact4) +function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) { switch(identifier) { @@ -784,11 +784,11 @@ function _Debug_crash(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.start.line === region.end.line) + if (region.bl.aL === region.bN.aL) { - return 'on line ' + region.start.line; + return 'on line ' + region.bl.aL; } - return 'on lines ' + region.start.line + ' through ' + region.end.line; + return 'on lines ' + region.bl.aL + ' through ' + region.bN.aL; } @@ -1212,7 +1212,7 @@ function _Char_toLocaleLower(char) -/**/ +/**_UNUSED/ function _Json_errorToString(error) { return $elm$json$Json$Decode$errorToString(error); @@ -1616,11 +1616,11 @@ var _Json_encode = F2(function(indentLevel, value) return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; }); -function _Json_wrap(value) { return { $: 0, a: value }; } -function _Json_unwrap(value) { return value.a; } +function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } +function _Json_unwrap_UNUSED(value) { return value.a; } -function _Json_wrap_UNUSED(value) { return value; } -function _Json_unwrap_UNUSED(value) { return value; } +function _Json_wrap(value) { return value; } +function _Json_unwrap(value) { return value; } function _Json_emptyArray() { return []; } function _Json_emptyObject() { return {}; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.ds, + impl.dV, + impl.dS, function() { return function() {} } ); }); @@ -1872,7 +1872,7 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) { var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); - $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/); + $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); var managers = {}; var initPair = init(result.a); var model = initPair.a; @@ -2317,7 +2317,7 @@ function _Platform_setupIncomingPort(name, sendToApp) /* -function _Platform_export_UNUSED(exports) +function _Platform_export(exports) { scope['Elm'] ? _Platform_mergeExportsProd(scope['Elm'], exports) @@ -2342,7 +2342,7 @@ function _Platform_mergeExportsProd(obj, exports) /* -function _Platform_export(exports) +function _Platform_export_UNUSED(exports) { scope['Elm'] ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) @@ -2385,10 +2385,10 @@ var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args { // NOTE: this function needs _Platform_export available to work - /**_UNUSED/ + /**/ var node = args['node']; //*/ - /**/ + /**_UNUSED/ var node = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ @@ -2663,14 +2663,14 @@ function _VirtualDom_noInnerHtmlOrFormAction(key) function _VirtualDom_noJavaScriptUri(value) { return _VirtualDom_RE_js.test(value) - ? /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ : value; } function _VirtualDom_noJavaScriptOrHtmlUri(value) { return _VirtualDom_RE_js_html.test(value) - ? /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ : value; } @@ -2678,7 +2678,7 @@ function _VirtualDom_noJavaScriptOrHtmlJson(value) { return (typeof _Json_unwrap(value) === 'string' && _VirtualDom_RE_js_html.test(_Json_unwrap(value))) ? _Json_wrap( - /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ ) : value; } @@ -2727,9 +2727,9 @@ var _VirtualDom_mapEventTuple = F2(function(func, tuple) var _VirtualDom_mapEventRecord = F2(function(func, record) { return { - message: func(record.message), - stopPropagation: record.stopPropagation, - preventDefault: record.preventDefault + ai: func(record.ai), + bm: record.bm, + bh: record.bh } }); @@ -2997,11 +2997,11 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) // 3 = Custom var value = result.a; - var message = !tag ? value : tag < 3 ? value.a : value.message; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation; + var message = !tag ? value : tag < 3 ? value.a : value.ai; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.bm; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.bh) && event.preventDefault(), eventNode ); var tagger; @@ -3940,6503 +3940,990 @@ function _VirtualDom_dekey(keyedNode) -var _Bitwise_and = F2(function(a, b) -{ - return a & b; -}); - -var _Bitwise_or = F2(function(a, b) -{ - return a | b; -}); - -var _Bitwise_xor = F2(function(a, b) -{ - return a ^ b; -}); - -function _Bitwise_complement(a) -{ - return ~a; -}; - -var _Bitwise_shiftLeftBy = F2(function(offset, a) -{ - return a << offset; -}); - -var _Bitwise_shiftRightBy = F2(function(offset, a) -{ - return a >> offset; -}); - -var _Bitwise_shiftRightZfBy = F2(function(offset, a) -{ - return a >>> offset; -}); - - - - -// HELPERS - - -function _Debugger_unsafeCoerce(value) -{ - return value; -} - +// ELEMENT -// PROGRAMS +var _Debugger_element; -var _Debugger_element = F4(function(impl, flagDecoder, debugMetadata, args) +var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args) { return _Platform_initialize( flagDecoder, args, - A3($elm$browser$Debugger$Main$wrapInit, _Json_wrap(debugMetadata), _Debugger_popout(), impl.init), - $elm$browser$Debugger$Main$wrapUpdate(impl.update), - $elm$browser$Debugger$Main$wrapSubs(impl.subscriptions), - function(sendToApp, initialModel) - { - var view = impl.view; - var title = _VirtualDom_doc.title; + impl.ds, + impl.dV, + impl.dS, + function(sendToApp, initialModel) { + var view = impl.dW; + /**/ + var domNode = args['node']; + //*/ + /**_UNUSED/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); + //*/ var currNode = _VirtualDom_virtualize(domNode); - var currBlocker = $elm$browser$Debugger$Main$toBlockerType(initialModel); - var currPopout; - - var cornerNode = _VirtualDom_doc.createElement('div'); - domNode.parentNode.insertBefore(cornerNode, domNode.nextSibling); - var cornerCurr = _VirtualDom_virtualize(cornerNode); - - initialModel.popout.a = sendToApp; return _Browser_makeAnimator(initialModel, function(model) { - var nextNode = A2(_VirtualDom_map, $elm$browser$Debugger$Main$UserMsg, view($elm$browser$Debugger$Main$getUserModel(model))); + var nextNode = view(model); var patches = _VirtualDom_diff(currNode, nextNode); domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp); currNode = nextNode; - - // update blocker - - var nextBlocker = $elm$browser$Debugger$Main$toBlockerType(model); - _Debugger_updateBlocker(currBlocker, nextBlocker); - currBlocker = nextBlocker; - - // view corner - - var cornerNext = $elm$browser$Debugger$Main$cornerView(model); - var cornerPatches = _VirtualDom_diff(cornerCurr, cornerNext); - cornerNode = _VirtualDom_applyPatches(cornerNode, cornerCurr, cornerPatches, sendToApp); - cornerCurr = cornerNext; - - if (!model.popout.b) - { - currPopout = undefined; - return; - } - - // view popout - - _VirtualDom_doc = model.popout.b; // SWITCH TO POPOUT DOC - currPopout || (currPopout = _VirtualDom_virtualize(model.popout.b)); - var nextPopout = $elm$browser$Debugger$Main$popoutView(model); - var popoutPatches = _VirtualDom_diff(currPopout, nextPopout); - _VirtualDom_applyPatches(model.popout.b.body, currPopout, popoutPatches, sendToApp); - currPopout = nextPopout; - _VirtualDom_doc = document; // SWITCH BACK TO NORMAL DOC }); } ); }); -var _Debugger_document = F4(function(impl, flagDecoder, debugMetadata, args) + +// DOCUMENT + + +var _Debugger_document; + +var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args) { return _Platform_initialize( flagDecoder, args, - A3($elm$browser$Debugger$Main$wrapInit, _Json_wrap(debugMetadata), _Debugger_popout(), impl.init), - $elm$browser$Debugger$Main$wrapUpdate(impl.update), - $elm$browser$Debugger$Main$wrapSubs(impl.subscriptions), - function(sendToApp, initialModel) - { - var divertHrefToApp = impl.setup && impl.setup(function(x) { return sendToApp($elm$browser$Debugger$Main$UserMsg(x)); }); - var view = impl.view; + impl.ds, + impl.dV, + impl.dS, + function(sendToApp, initialModel) { + var divertHrefToApp = impl.bj && impl.bj(sendToApp) + var view = impl.dW; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); - var currBlocker = $elm$browser$Debugger$Main$toBlockerType(initialModel); - var currPopout; - - initialModel.popout.a = sendToApp; - return _Browser_makeAnimator(initialModel, function(model) { _VirtualDom_divertHrefToApp = divertHrefToApp; - var doc = view($elm$browser$Debugger$Main$getUserModel(model)); - var nextNode = _VirtualDom_node('body')(_List_Nil)( - _Utils_ap( - A2($elm$core$List$map, _VirtualDom_map($elm$browser$Debugger$Main$UserMsg), doc.body), - _List_Cons($elm$browser$Debugger$Main$cornerView(model), _List_Nil) - ) - ); + var doc = view(model); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.c7); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); - - // update blocker - - var nextBlocker = $elm$browser$Debugger$Main$toBlockerType(model); - _Debugger_updateBlocker(currBlocker, nextBlocker); - currBlocker = nextBlocker; - - // view popout - - if (!model.popout.b) { currPopout = undefined; return; } - - _VirtualDom_doc = model.popout.b; // SWITCH TO POPOUT DOC - currPopout || (currPopout = _VirtualDom_virtualize(model.popout.b)); - var nextPopout = $elm$browser$Debugger$Main$popoutView(model); - var popoutPatches = _VirtualDom_diff(currPopout, nextPopout); - _VirtualDom_applyPatches(model.popout.b.body, currPopout, popoutPatches, sendToApp); - currPopout = nextPopout; - _VirtualDom_doc = document; // SWITCH BACK TO NORMAL DOC + (title !== doc.cV) && (_VirtualDom_doc.title = title = doc.cV); }); } ); }); -function _Debugger_popout() -{ - return { - b: undefined, - a: undefined - }; -} -function _Debugger_isOpen(popout) -{ - return !!popout.b; -} +// ANIMATION -function _Debugger_open(popout) -{ - return _Scheduler_binding(function(callback) - { - _Debugger_openWindow(popout); - callback(_Scheduler_succeed(_Utils_Tuple0)); - }); -} -function _Debugger_openWindow(popout) +var _Browser_cancelAnimationFrame = + typeof cancelAnimationFrame !== 'undefined' + ? cancelAnimationFrame + : function(id) { clearTimeout(id); }; + +var _Browser_requestAnimationFrame = + typeof requestAnimationFrame !== 'undefined' + ? requestAnimationFrame + : function(callback) { return setTimeout(callback, 1000 / 60); }; + + +function _Browser_makeAnimator(model, draw) { - var w = $elm$browser$Debugger$Main$initialWindowWidth, - h = $elm$browser$Debugger$Main$initialWindowHeight, - x = screen.width - w, - y = screen.height - h; - - var debuggerWindow = window.open('', '', 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y); - var doc = debuggerWindow.document; - doc.title = 'Elm Debugger'; - - // handle arrow keys - doc.addEventListener('keydown', function(event) { - event.metaKey && event.which === 82 && window.location.reload(); - event.key === 'ArrowUp' && (popout.a($elm$browser$Debugger$Main$Up ), event.preventDefault()); - event.key === 'ArrowDown' && (popout.a($elm$browser$Debugger$Main$Down), event.preventDefault()); - }); + draw(model); - // handle window close - window.addEventListener('unload', close); - debuggerWindow.addEventListener('unload', function() { - popout.b = undefined; - popout.a($elm$browser$Debugger$Main$NoOp); - window.removeEventListener('unload', close); - }); + var state = 0; - function close() { - popout.b = undefined; - popout.a($elm$browser$Debugger$Main$NoOp); - debuggerWindow.close(); + function updateIfNeeded() + { + state = state === 1 + ? 0 + : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 ); } - // register new window - popout.b = doc; + return function(nextModel, isSync) + { + model = nextModel; + + isSync + ? ( draw(model), + state === 2 && (state = 1) + ) + : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded), + state = 2 + ); + }; } -// SCROLL +// APPLICATION -function _Debugger_scroll(popout) +function _Browser_application(impl) { - return _Scheduler_binding(function(callback) - { - if (popout.b) + var onUrlChange = impl.dJ; + var onUrlRequest = impl.dK; + var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; + + return _Browser_document({ + bj: function(sendToApp) { - var msgs = popout.b.getElementById('elm-debugger-sidebar'); - if (msgs && msgs.scrollTop !== 0) + key.a = sendToApp; + _Browser_window.addEventListener('popstate', key); + _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key); + + return F2(function(domNode, event) { - msgs.scrollTop = 0; - } - } - callback(_Scheduler_succeed(_Utils_Tuple0)); + if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download')) + { + event.preventDefault(); + var href = domNode.href; + var curr = _Browser_getUrl(); + var next = $elm$url$Url$fromString(href).a; + sendToApp(onUrlRequest( + (next + && curr.cC === next.cC + && curr.b1 === next.b1 + && curr.cw.a === next.cw.a + ) + ? $elm$browser$Browser$Internal(next) + : $elm$browser$Browser$External(href) + )); + } + }); + }, + ds: function(flags) + { + return A3(impl.ds, flags, _Browser_getUrl(), key); + }, + dW: impl.dW, + dV: impl.dV, + dS: impl.dS }); } +function _Browser_getUrl() +{ + return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1); +} -var _Debugger_scrollTo = F2(function(id, popout) +var _Browser_go = F2(function(key, n) { - return _Scheduler_binding(function(callback) - { - if (popout.b) - { - var msg = popout.b.getElementById(id); - if (msg) - { - msg.scrollIntoView(false); - } - } - callback(_Scheduler_succeed(_Utils_Tuple0)); - }); + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + n && history.go(n); + key(); + })); }); +var _Browser_pushUrl = F2(function(key, url) +{ + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + history.pushState({}, '', url); + key(); + })); +}); - -// UPLOAD - - -function _Debugger_upload(popout) +var _Browser_replaceUrl = F2(function(key, url) { - return _Scheduler_binding(function(callback) - { - var doc = popout.b || document; - var element = doc.createElement('input'); - element.setAttribute('type', 'file'); - element.setAttribute('accept', 'text/json'); - element.style.display = 'none'; - element.addEventListener('change', function(event) - { - var fileReader = new FileReader(); - fileReader.onload = function(e) - { - callback(_Scheduler_succeed(e.target.result)); - }; - fileReader.readAsText(event.target.files[0]); - doc.body.removeChild(element); - }); - doc.body.appendChild(element); - element.click(); - }); -} + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + history.replaceState({}, '', url); + key(); + })); +}); -// DOWNLOAD +// GLOBAL EVENTS + +var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} }; +var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode; +var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode; -var _Debugger_download = F2(function(historyLength, json) +var _Browser_on = F3(function(node, eventName, sendToSelf) { - return _Scheduler_binding(function(callback) + return _Scheduler_spawn(_Scheduler_binding(function(callback) { - var fileName = 'history-' + historyLength + '.txt'; - var jsonString = JSON.stringify(json); - var mime = 'text/plain;charset=utf-8'; - var done = _Scheduler_succeed(_Utils_Tuple0); - - // for IE10+ - if (navigator.msSaveBlob) - { - navigator.msSaveBlob(new Blob([jsonString], {type: mime}), fileName); - return callback(done); - } + function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } + node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true }); + return function() { node.removeEventListener(eventName, handler); }; + })); +}); - // for HTML5 - var element = document.createElement('a'); - element.setAttribute('href', 'data:' + mime + ',' + encodeURIComponent(jsonString)); - element.setAttribute('download', fileName); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - callback(done); - }); +var _Browser_decodeEvent = F2(function(decoder, event) +{ + var result = _Json_runHelp(decoder, event); + return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing; }); -// POPOUT CONTENT +// PAGE VISIBILITY -function _Debugger_messageToString(value) +function _Browser_visibilityInfo() { - if (typeof value === 'boolean') - { - return value ? 'True' : 'False'; - } + return (typeof _VirtualDom_doc.hidden !== 'undefined') + ? { dp: 'hidden', db: 'visibilitychange' } + : + (typeof _VirtualDom_doc.mozHidden !== 'undefined') + ? { dp: 'mozHidden', db: 'mozvisibilitychange' } + : + (typeof _VirtualDom_doc.msHidden !== 'undefined') + ? { dp: 'msHidden', db: 'msvisibilitychange' } + : + (typeof _VirtualDom_doc.webkitHidden !== 'undefined') + ? { dp: 'webkitHidden', db: 'webkitvisibilitychange' } + : { dp: 'hidden', db: 'visibilitychange' }; +} - if (typeof value === 'number') - { - return value + ''; - } - if (typeof value === 'string') - { - return '"' + _Debugger_addSlashes(value, false) + '"'; - } - if (value instanceof String) - { - return "'" + _Debugger_addSlashes(value, true) + "'"; - } +// ANIMATION FRAMES - if (typeof value !== 'object' || value === null || !('$' in value)) - { - return '…'; - } - if (typeof value.$ === 'number') +function _Browser_rAF() +{ + return _Scheduler_binding(function(callback) { - return '…'; - } + var id = _Browser_requestAnimationFrame(function() { + callback(_Scheduler_succeed(Date.now())); + }); - var code = value.$.charCodeAt(0); - if (code === 0x23 /* # */ || /* a */ 0x61 <= code && code <= 0x7A /* z */) - { - return '…'; - } + return function() { + _Browser_cancelAnimationFrame(id); + }; + }); +} - if (['Array_elm_builtin', 'Set_elm_builtin', 'RBNode_elm_builtin', 'RBEmpty_elm_builtin'].indexOf(value.$) >= 0) - { - return '…'; - } - var keys = Object.keys(value); - switch (keys.length) +function _Browser_now() +{ + return _Scheduler_binding(function(callback) { - case 1: - return value.$; - case 2: - return value.$ + ' ' + _Debugger_messageToString(value.a); - default: - return value.$ + ' … ' + _Debugger_messageToString(value[keys[keys.length - 1]]); - } + callback(_Scheduler_succeed(Date.now())); + }); } -function _Debugger_init(value) -{ - if (typeof value === 'boolean') - { - return A3($elm$browser$Debugger$Expando$Constructor, $elm$core$Maybe$Just(value ? 'True' : 'False'), true, _List_Nil); - } - if (typeof value === 'number') - { - return $elm$browser$Debugger$Expando$Primitive(value + ''); - } +// DOM STUFF - if (typeof value === 'string') - { - return $elm$browser$Debugger$Expando$S('"' + _Debugger_addSlashes(value, false) + '"'); - } - if (value instanceof String) +function _Browser_withNode(id, doStuff) +{ + return _Scheduler_binding(function(callback) { - return $elm$browser$Debugger$Expando$S("'" + _Debugger_addSlashes(value, true) + "'"); - } + _Browser_requestAnimationFrame(function() { + var node = document.getElementById(id); + callback(node + ? _Scheduler_succeed(doStuff(node)) + : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)) + ); + }); + }); +} - if (typeof value === 'object' && '$' in value) + +function _Browser_withWindow(doStuff) +{ + return _Scheduler_binding(function(callback) { - var tag = value.$; + _Browser_requestAnimationFrame(function() { + callback(_Scheduler_succeed(doStuff())); + }); + }); +} - if (tag === '::' || tag === '[]') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$ListSeq, true, - A2($elm$core$List$map, _Debugger_init, value) - ); - } - if (tag === 'Set_elm_builtin') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$SetSeq, true, - A3($elm$core$Set$foldr, _Debugger_initCons, _List_Nil, value) - ); - } +// FOCUS and BLUR - if (tag === 'RBNode_elm_builtin' || tag == 'RBEmpty_elm_builtin') - { - return A2($elm$browser$Debugger$Expando$Dictionary, true, - A3($elm$core$Dict$foldr, _Debugger_initKeyValueCons, _List_Nil, value) - ); - } - if (tag === 'Array_elm_builtin') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$ArraySeq, true, - A3($elm$core$Array$foldr, _Debugger_initCons, _List_Nil, value) - ); - } +var _Browser_call = F2(function(functionName, id) +{ + return _Browser_withNode(id, function(node) { + node[functionName](); + return _Utils_Tuple0; + }); +}); - if (typeof tag === 'number') - { - return $elm$browser$Debugger$Expando$Primitive(''); - } - var char = tag.charCodeAt(0); - if (char === 35 || 65 <= char && char <= 90) - { - var list = _List_Nil; - for (var i in value) - { - if (i === '$') continue; - list = _List_Cons(_Debugger_init(value[i]), list); - } - return A3($elm$browser$Debugger$Expando$Constructor, char === 35 ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(tag), true, $elm$core$List$reverse(list)); - } - return $elm$browser$Debugger$Expando$Primitive(''); - } +// WINDOW VIEWPORT - if (typeof value === 'object') - { - var dict = $elm$core$Dict$empty; - for (var i in value) - { - dict = A3($elm$core$Dict$insert, i, _Debugger_init(value[i]), dict); - } - return A2($elm$browser$Debugger$Expando$Record, true, dict); - } - return $elm$browser$Debugger$Expando$Primitive(''); +function _Browser_getViewport() +{ + return { + cL: _Browser_getScene(), + cZ: { + c0: _Browser_window.pageXOffset, + c1: _Browser_window.pageYOffset, + c$: _Browser_doc.documentElement.clientWidth, + b$: _Browser_doc.documentElement.clientHeight + } + }; } -var _Debugger_initCons = F2(function initConsHelp(value, list) +function _Browser_getScene() { - return _List_Cons(_Debugger_init(value), list); -}); + var body = _Browser_doc.body; + var elem = _Browser_doc.documentElement; + return { + c$: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + b$: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + }; +} -var _Debugger_initKeyValueCons = F3(function(key, value, list) +var _Browser_setViewport = F2(function(x, y) { - return _List_Cons( - _Utils_Tuple2(_Debugger_init(key), _Debugger_init(value)), - list - ); + return _Browser_withWindow(function() + { + _Browser_window.scroll(x, y); + return _Utils_Tuple0; + }); }); -function _Debugger_addSlashes(str, isChar) + + +// ELEMENT VIEWPORT + + +function _Browser_getViewportOf(id) { - var s = str - .replace(/\\/g, '\\\\') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - .replace(/\r/g, '\\r') - .replace(/\v/g, '\\v') - .replace(/\0/g, '\\0'); - if (isChar) - { - return s.replace(/\'/g, '\\\''); - } - else + return _Browser_withNode(id, function(node) { - return s.replace(/\"/g, '\\"'); - } + return { + cL: { + c$: node.scrollWidth, + b$: node.scrollHeight + }, + cZ: { + c0: node.scrollLeft, + c1: node.scrollTop, + c$: node.clientWidth, + b$: node.clientHeight + } + }; + }); } - -// BLOCK EVENTS +var _Browser_setViewportOf = F3(function(id, x, y) +{ + return _Browser_withNode(id, function(node) + { + node.scrollLeft = x; + node.scrollTop = y; + return _Utils_Tuple0; + }); +}); -function _Debugger_updateBlocker(oldBlocker, newBlocker) -{ - if (oldBlocker === newBlocker) return; - var oldEvents = _Debugger_blockerToEvents(oldBlocker); - var newEvents = _Debugger_blockerToEvents(newBlocker); +// ELEMENT - // remove old blockers - for (var i = 0; i < oldEvents.length; i++) - { - document.removeEventListener(oldEvents[i], _Debugger_blocker, true); - } - // add new blockers - for (var i = 0; i < newEvents.length; i++) +function _Browser_getElement(id) +{ + return _Browser_withNode(id, function(node) { - document.addEventListener(newEvents[i], _Debugger_blocker, true); - } + var rect = node.getBoundingClientRect(); + var x = _Browser_window.pageXOffset; + var y = _Browser_window.pageYOffset; + return { + cL: _Browser_getScene(), + cZ: { + c0: x, + c1: y, + c$: _Browser_doc.documentElement.clientWidth, + b$: _Browser_doc.documentElement.clientHeight + }, + di: { + c0: x + rect.left, + c1: y + rect.top, + c$: rect.width, + b$: rect.height + } + }; + }); } -function _Debugger_blocker(event) + +// LOAD and RELOAD + + +function _Browser_reload(skipCache) { - if (event.type === 'keydown' && event.metaKey && event.which === 82) + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) { - return; - } + _VirtualDom_doc.location.reload(skipCache); + })); +} - var isScroll = event.type === 'scroll' || event.type === 'wheel'; - for (var node = event.target; node; node = node.parentNode) +function _Browser_load(url) +{ + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) { - if (isScroll ? node.id === 'elm-debugger-details' : node.id === 'elm-debugger-overlay') + try { - return; + _Browser_window.location = url; } - } - - event.stopPropagation(); - event.preventDefault(); -} - -function _Debugger_blockerToEvents(blocker) -{ - return blocker === $elm$browser$Debugger$Overlay$BlockNone - ? [] - : blocker === $elm$browser$Debugger$Overlay$BlockMost - ? _Debugger_mostEvents - : _Debugger_allEvents; + catch(err) + { + // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. + // Other browsers reload the page, so let's be consistent about that. + _VirtualDom_doc.location.reload(false); + } + })); } -var _Debugger_mostEvents = [ - 'click', 'dblclick', 'mousemove', - 'mouseup', 'mousedown', 'mouseenter', 'mouseleave', - 'touchstart', 'touchend', 'touchcancel', 'touchmove', - 'pointerdown', 'pointerup', 'pointerover', 'pointerout', - 'pointerenter', 'pointerleave', 'pointermove', 'pointercancel', - 'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop', - 'keyup', 'keydown', 'keypress', - 'input', 'change', - 'focus', 'blur' -]; -var _Debugger_allEvents = _Debugger_mostEvents.concat('wheel', 'scroll'); +var _Bitwise_and = F2(function(a, b) +{ + return a & b; +}); +var _Bitwise_or = F2(function(a, b) +{ + return a | b; +}); +var _Bitwise_xor = F2(function(a, b) +{ + return a ^ b; +}); -// ELEMENT +function _Bitwise_complement(a) +{ + return ~a; +}; +var _Bitwise_shiftLeftBy = F2(function(offset, a) +{ + return a << offset; +}); -var _Debugger_element; +var _Bitwise_shiftRightBy = F2(function(offset, a) +{ + return a >> offset; +}); -var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args) +var _Bitwise_shiftRightZfBy = F2(function(offset, a) { - return _Platform_initialize( - flagDecoder, - args, - impl.init, - impl.update, - impl.subscriptions, - function(sendToApp, initialModel) { - var view = impl.view; - /**_UNUSED/ - var domNode = args['node']; - //*/ - /**/ - var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); - //*/ - var currNode = _VirtualDom_virtualize(domNode); - - return _Browser_makeAnimator(initialModel, function(model) - { - var nextNode = view(model); - var patches = _VirtualDom_diff(currNode, nextNode); - domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp); - currNode = nextNode; - }); - } - ); -}); - - - -// DOCUMENT - - -var _Debugger_document; - -var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args) -{ - return _Platform_initialize( - flagDecoder, - args, - impl.init, - impl.update, - impl.subscriptions, - function(sendToApp, initialModel) { - var divertHrefToApp = impl.setup && impl.setup(sendToApp) - var view = impl.view; - var title = _VirtualDom_doc.title; - var bodyNode = _VirtualDom_doc.body; - var currNode = _VirtualDom_virtualize(bodyNode); - return _Browser_makeAnimator(initialModel, function(model) - { - _VirtualDom_divertHrefToApp = divertHrefToApp; - var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body); - var patches = _VirtualDom_diff(currNode, nextNode); - bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); - currNode = nextNode; - _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); - }); - } - ); -}); - - - -// ANIMATION - - -var _Browser_cancelAnimationFrame = - typeof cancelAnimationFrame !== 'undefined' - ? cancelAnimationFrame - : function(id) { clearTimeout(id); }; - -var _Browser_requestAnimationFrame = - typeof requestAnimationFrame !== 'undefined' - ? requestAnimationFrame - : function(callback) { return setTimeout(callback, 1000 / 60); }; - - -function _Browser_makeAnimator(model, draw) -{ - draw(model); - - var state = 0; - - function updateIfNeeded() - { - state = state === 1 - ? 0 - : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 ); - } - - return function(nextModel, isSync) - { - model = nextModel; - - isSync - ? ( draw(model), - state === 2 && (state = 1) - ) - : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded), - state = 2 - ); - }; -} - - - -// APPLICATION - - -function _Browser_application(impl) -{ - var onUrlChange = impl.onUrlChange; - var onUrlRequest = impl.onUrlRequest; - var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; - - return _Browser_document({ - setup: function(sendToApp) - { - key.a = sendToApp; - _Browser_window.addEventListener('popstate', key); - _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key); - - return F2(function(domNode, event) - { - if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download')) - { - event.preventDefault(); - var href = domNode.href; - var curr = _Browser_getUrl(); - var next = $elm$url$Url$fromString(href).a; - sendToApp(onUrlRequest( - (next - && curr.protocol === next.protocol - && curr.host === next.host - && curr.port_.a === next.port_.a - ) - ? $elm$browser$Browser$Internal(next) - : $elm$browser$Browser$External(href) - )); - } - }); - }, - init: function(flags) - { - return A3(impl.init, flags, _Browser_getUrl(), key); - }, - view: impl.view, - update: impl.update, - subscriptions: impl.subscriptions - }); -} - -function _Browser_getUrl() -{ - return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1); -} - -var _Browser_go = F2(function(key, n) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - n && history.go(n); - key(); - })); -}); - -var _Browser_pushUrl = F2(function(key, url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - history.pushState({}, '', url); - key(); - })); -}); - -var _Browser_replaceUrl = F2(function(key, url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - history.replaceState({}, '', url); - key(); - })); -}); - - - -// GLOBAL EVENTS - - -var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} }; -var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode; -var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode; - -var _Browser_on = F3(function(node, eventName, sendToSelf) -{ - return _Scheduler_spawn(_Scheduler_binding(function(callback) - { - function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } - node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true }); - return function() { node.removeEventListener(eventName, handler); }; - })); -}); - -var _Browser_decodeEvent = F2(function(decoder, event) -{ - var result = _Json_runHelp(decoder, event); - return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing; -}); - - - -// PAGE VISIBILITY - - -function _Browser_visibilityInfo() -{ - return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { hidden: 'hidden', change: 'visibilitychange' } - : - (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { hidden: 'mozHidden', change: 'mozvisibilitychange' } - : - (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { hidden: 'msHidden', change: 'msvisibilitychange' } - : - (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' } - : { hidden: 'hidden', change: 'visibilitychange' }; -} - - - -// ANIMATION FRAMES - - -function _Browser_rAF() -{ - return _Scheduler_binding(function(callback) - { - var id = _Browser_requestAnimationFrame(function() { - callback(_Scheduler_succeed(Date.now())); - }); - - return function() { - _Browser_cancelAnimationFrame(id); - }; - }); -} - - -function _Browser_now() -{ - return _Scheduler_binding(function(callback) - { - callback(_Scheduler_succeed(Date.now())); - }); -} - - - -// DOM STUFF - - -function _Browser_withNode(id, doStuff) -{ - return _Scheduler_binding(function(callback) - { - _Browser_requestAnimationFrame(function() { - var node = document.getElementById(id); - callback(node - ? _Scheduler_succeed(doStuff(node)) - : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)) - ); - }); - }); -} - - -function _Browser_withWindow(doStuff) -{ - return _Scheduler_binding(function(callback) - { - _Browser_requestAnimationFrame(function() { - callback(_Scheduler_succeed(doStuff())); - }); - }); -} - - -// FOCUS and BLUR - - -var _Browser_call = F2(function(functionName, id) -{ - return _Browser_withNode(id, function(node) { - node[functionName](); - return _Utils_Tuple0; - }); -}); - - - -// WINDOW VIEWPORT - - -function _Browser_getViewport() -{ - return { - scene: _Browser_getScene(), - viewport: { - x: _Browser_window.pageXOffset, - y: _Browser_window.pageYOffset, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight - } - }; -} - -function _Browser_getScene() -{ - var body = _Browser_doc.body; - var elem = _Browser_doc.documentElement; - return { - width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) - }; -} - -var _Browser_setViewport = F2(function(x, y) -{ - return _Browser_withWindow(function() - { - _Browser_window.scroll(x, y); - return _Utils_Tuple0; - }); -}); - - - -// ELEMENT VIEWPORT - - -function _Browser_getViewportOf(id) -{ - return _Browser_withNode(id, function(node) - { - return { - scene: { - width: node.scrollWidth, - height: node.scrollHeight - }, - viewport: { - x: node.scrollLeft, - y: node.scrollTop, - width: node.clientWidth, - height: node.clientHeight - } - }; - }); -} - - -var _Browser_setViewportOf = F3(function(id, x, y) -{ - return _Browser_withNode(id, function(node) - { - node.scrollLeft = x; - node.scrollTop = y; - return _Utils_Tuple0; - }); -}); - - - -// ELEMENT - - -function _Browser_getElement(id) -{ - return _Browser_withNode(id, function(node) - { - var rect = node.getBoundingClientRect(); - var x = _Browser_window.pageXOffset; - var y = _Browser_window.pageYOffset; - return { - scene: _Browser_getScene(), - viewport: { - x: x, - y: y, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight - }, - element: { - x: x + rect.left, - y: y + rect.top, - width: rect.width, - height: rect.height - } - }; - }); -} - - - -// LOAD and RELOAD - - -function _Browser_reload(skipCache) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) - { - _VirtualDom_doc.location.reload(skipCache); - })); -} - -function _Browser_load(url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) - { - try - { - _Browser_window.location = url; - } - catch(err) - { - // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. - // Other browsers reload the page, so let's be consistent about that. - _VirtualDom_doc.location.reload(false); - } - })); -} -var $elm$core$Basics$EQ = {$: 'EQ'}; -var $elm$core$Basics$GT = {$: 'GT'}; -var $elm$core$Basics$LT = {$: 'LT'}; -var $elm$core$List$cons = _List_cons; -var $elm$core$Dict$foldr = F3( - function (func, acc, t) { - foldr: - while (true) { - if (t.$ === 'RBEmpty_elm_builtin') { - return acc; - } else { - var key = t.b; - var value = t.c; - var left = t.d; - var right = t.e; - var $temp$func = func, - $temp$acc = A3( - func, - key, - value, - A3($elm$core$Dict$foldr, func, acc, right)), - $temp$t = left; - func = $temp$func; - acc = $temp$acc; - t = $temp$t; - continue foldr; - } - } - }); -var $elm$core$Dict$toList = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, list) { - return A2( - $elm$core$List$cons, - _Utils_Tuple2(key, value), - list); - }), - _List_Nil, - dict); -}; -var $elm$core$Dict$keys = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, keyList) { - return A2($elm$core$List$cons, key, keyList); - }), - _List_Nil, - dict); -}; -var $elm$core$Set$toList = function (_v0) { - var dict = _v0.a; - return $elm$core$Dict$keys(dict); -}; -var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; -var $elm$core$Array$foldr = F3( - function (func, baseCase, _v0) { - var tree = _v0.c; - var tail = _v0.d; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); - } else { - var values = node.a; - return A3($elm$core$Elm$JsArray$foldr, func, acc, values); - } - }); - return A3( - $elm$core$Elm$JsArray$foldr, - helper, - A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail), - tree); - }); -var $elm$core$Array$toList = function (array) { - return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); -}; -var $elm$core$Result$Err = function (a) { - return {$: 'Err', a: a}; -}; -var $elm$json$Json$Decode$Failure = F2( - function (a, b) { - return {$: 'Failure', a: a, b: b}; - }); -var $elm$json$Json$Decode$Field = F2( - function (a, b) { - return {$: 'Field', a: a, b: b}; - }); -var $elm$json$Json$Decode$Index = F2( - function (a, b) { - return {$: 'Index', a: a, b: b}; - }); -var $elm$core$Result$Ok = function (a) { - return {$: 'Ok', a: a}; -}; -var $elm$json$Json$Decode$OneOf = function (a) { - return {$: 'OneOf', a: a}; -}; -var $elm$core$Basics$False = {$: 'False'}; -var $elm$core$Basics$add = _Basics_add; -var $elm$core$Maybe$Just = function (a) { - return {$: 'Just', a: a}; -}; -var $elm$core$Maybe$Nothing = {$: 'Nothing'}; -var $elm$core$String$all = _String_all; -var $elm$core$Basics$and = _Basics_and; -var $elm$core$Basics$append = _Utils_append; -var $elm$json$Json$Encode$encode = _Json_encode; -var $elm$core$String$fromInt = _String_fromNumber; -var $elm$core$String$join = F2( - function (sep, chunks) { - return A2( - _String_join, - sep, - _List_toArray(chunks)); - }); -var $elm$core$String$split = F2( - function (sep, string) { - return _List_fromArray( - A2(_String_split, sep, string)); - }); -var $elm$json$Json$Decode$indent = function (str) { - return A2( - $elm$core$String$join, - '\n ', - A2($elm$core$String$split, '\n', str)); -}; -var $elm$core$List$foldl = F3( - function (func, acc, list) { - foldl: - while (true) { - if (!list.b) { - return acc; - } else { - var x = list.a; - var xs = list.b; - var $temp$func = func, - $temp$acc = A2(func, x, acc), - $temp$list = xs; - func = $temp$func; - acc = $temp$acc; - list = $temp$list; - continue foldl; - } - } - }); -var $elm$core$List$length = function (xs) { - return A3( - $elm$core$List$foldl, - F2( - function (_v0, i) { - return i + 1; - }), - 0, - xs); -}; -var $elm$core$List$map2 = _List_map2; -var $elm$core$Basics$le = _Utils_le; -var $elm$core$Basics$sub = _Basics_sub; -var $elm$core$List$rangeHelp = F3( - function (lo, hi, list) { - rangeHelp: - while (true) { - if (_Utils_cmp(lo, hi) < 1) { - var $temp$lo = lo, - $temp$hi = hi - 1, - $temp$list = A2($elm$core$List$cons, hi, list); - lo = $temp$lo; - hi = $temp$hi; - list = $temp$list; - continue rangeHelp; - } else { - return list; - } - } - }); -var $elm$core$List$range = F2( - function (lo, hi) { - return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil); - }); -var $elm$core$List$indexedMap = F2( - function (f, xs) { - return A3( - $elm$core$List$map2, - f, - A2( - $elm$core$List$range, - 0, - $elm$core$List$length(xs) - 1), - xs); - }); -var $elm$core$Char$toCode = _Char_toCode; -var $elm$core$Char$isLower = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (97 <= code) && (code <= 122); -}; -var $elm$core$Char$isUpper = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (code <= 90) && (65 <= code); -}; -var $elm$core$Basics$or = _Basics_or; -var $elm$core$Char$isAlpha = function (_char) { - return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); -}; -var $elm$core$Char$isDigit = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (code <= 57) && (48 <= code); -}; -var $elm$core$Char$isAlphaNum = function (_char) { - return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); -}; -var $elm$core$List$reverse = function (list) { - return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); -}; -var $elm$core$String$uncons = _String_uncons; -var $elm$json$Json$Decode$errorOneOf = F2( - function (i, error) { - return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent( - $elm$json$Json$Decode$errorToString(error)))); - }); -var $elm$json$Json$Decode$errorToString = function (error) { - return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); -}; -var $elm$json$Json$Decode$errorToStringHelp = F2( - function (error, context) { - errorToStringHelp: - while (true) { - switch (error.$) { - case 'Field': - var f = error.a; - var err = error.b; - var isSimple = function () { - var _v1 = $elm$core$String$uncons(f); - if (_v1.$ === 'Nothing') { - return false; - } else { - var _v2 = _v1.a; - var _char = _v2.a; - var rest = _v2.b; - return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest); - } - }(); - var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']')); - var $temp$error = err, - $temp$context = A2($elm$core$List$cons, fieldName, context); - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - case 'Index': - var i = error.a; - var err = error.b; - var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); - var $temp$error = err, - $temp$context = A2($elm$core$List$cons, indexName, context); - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - case 'OneOf': - var errors = error.a; - if (!errors.b) { - return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { - if (!context.b) { - return '!'; - } else { - return ' at json' + A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)); - } - }(); - } else { - if (!errors.b.b) { - var err = errors.a; - var $temp$error = err, - $temp$context = context; - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - } else { - var starter = function () { - if (!context.b) { - return 'Json.Decode.oneOf'; - } else { - return 'The Json.Decode.oneOf at json' + A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)); - } - }(); - var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt( - $elm$core$List$length(errors)) + ' ways:')); - return A2( - $elm$core$String$join, - '\n\n', - A2( - $elm$core$List$cons, - introduction, - A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors))); - } - } - default: - var msg = error.a; - var json = error.b; - var introduction = function () { - if (!context.b) { - return 'Problem with the given value:\n\n'; - } else { - return 'Problem with the value at json' + (A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)) + ':\n\n '); - } - }(); - return introduction + ($elm$json$Json$Decode$indent( - A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg)); - } - } - }); -var $elm$core$Array$branchFactor = 32; -var $elm$core$Array$Array_elm_builtin = F4( - function (a, b, c, d) { - return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d}; - }); -var $elm$core$Elm$JsArray$empty = _JsArray_empty; -var $elm$core$Basics$ceiling = _Basics_ceiling; -var $elm$core$Basics$fdiv = _Basics_fdiv; -var $elm$core$Basics$logBase = F2( - function (base, number) { - return _Basics_log(number) / _Basics_log(base); - }); -var $elm$core$Basics$toFloat = _Basics_toFloat; -var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( - A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor)); -var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty); -var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; -var $elm$core$Array$Leaf = function (a) { - return {$: 'Leaf', a: a}; -}; -var $elm$core$Basics$apL = F2( - function (f, x) { - return f(x); - }); -var $elm$core$Basics$apR = F2( - function (x, f) { - return f(x); - }); -var $elm$core$Basics$eq = _Utils_equal; -var $elm$core$Basics$floor = _Basics_floor; -var $elm$core$Elm$JsArray$length = _JsArray_length; -var $elm$core$Basics$gt = _Utils_gt; -var $elm$core$Basics$max = F2( - function (x, y) { - return (_Utils_cmp(x, y) > 0) ? x : y; - }); -var $elm$core$Basics$mul = _Basics_mul; -var $elm$core$Array$SubTree = function (a) { - return {$: 'SubTree', a: a}; -}; -var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; -var $elm$core$Array$compressNodes = F2( - function (nodes, acc) { - compressNodes: - while (true) { - var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes); - var node = _v0.a; - var remainingNodes = _v0.b; - var newAcc = A2( - $elm$core$List$cons, - $elm$core$Array$SubTree(node), - acc); - if (!remainingNodes.b) { - return $elm$core$List$reverse(newAcc); - } else { - var $temp$nodes = remainingNodes, - $temp$acc = newAcc; - nodes = $temp$nodes; - acc = $temp$acc; - continue compressNodes; - } - } - }); -var $elm$core$Tuple$first = function (_v0) { - var x = _v0.a; - return x; -}; -var $elm$core$Array$treeFromBuilder = F2( - function (nodeList, nodeListSize) { - treeFromBuilder: - while (true) { - var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor); - if (newNodeSize === 1) { - return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a; - } else { - var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil), - $temp$nodeListSize = newNodeSize; - nodeList = $temp$nodeList; - nodeListSize = $temp$nodeListSize; - continue treeFromBuilder; - } - } - }); -var $elm$core$Array$builderToArray = F2( - function (reverseNodeList, builder) { - if (!builder.nodeListSize) { - return A4( - $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail), - $elm$core$Array$shiftStep, - $elm$core$Elm$JsArray$empty, - builder.tail); - } else { - var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor; - var depth = $elm$core$Basics$floor( - A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize); - return A4( - $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail) + treeLen, - A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), - tree, - builder.tail); - } - }); -var $elm$core$Basics$idiv = _Basics_idiv; -var $elm$core$Basics$lt = _Utils_lt; -var $elm$core$Array$initializeHelp = F5( - function (fn, fromIndex, len, nodeList, tail) { - initializeHelp: - while (true) { - if (fromIndex < 0) { - return A2( - $elm$core$Array$builderToArray, - false, - {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail}); - } else { - var leaf = $elm$core$Array$Leaf( - A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); - var $temp$fn = fn, - $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor, - $temp$len = len, - $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList), - $temp$tail = tail; - fn = $temp$fn; - fromIndex = $temp$fromIndex; - len = $temp$len; - nodeList = $temp$nodeList; - tail = $temp$tail; - continue initializeHelp; - } - } - }); -var $elm$core$Basics$remainderBy = _Basics_remainderBy; -var $elm$core$Array$initialize = F2( - function (len, fn) { - if (len <= 0) { - return $elm$core$Array$empty; - } else { - var tailLen = len % $elm$core$Array$branchFactor; - var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn); - var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor; - return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); - } - }); -var $elm$core$Basics$True = {$: 'True'}; -var $elm$core$Result$isOk = function (result) { - if (result.$ === 'Ok') { - return true; - } else { - return false; - } -}; -var $elm$json$Json$Decode$map = _Json_map1; -var $elm$json$Json$Decode$map2 = _Json_map2; -var $elm$json$Json$Decode$succeed = _Json_succeed; -var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { - switch (handler.$) { - case 'Normal': - return 0; - case 'MayStopPropagation': - return 1; - case 'MayPreventDefault': - return 2; - default: - return 3; - } -}; -var $elm$browser$Debugger$Expando$ArraySeq = {$: 'ArraySeq'}; -var $elm$browser$Debugger$Overlay$BlockMost = {$: 'BlockMost'}; -var $elm$browser$Debugger$Overlay$BlockNone = {$: 'BlockNone'}; -var $elm$browser$Debugger$Expando$Constructor = F3( - function (a, b, c) { - return {$: 'Constructor', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$Dictionary = F2( - function (a, b) { - return {$: 'Dictionary', a: a, b: b}; - }); -var $elm$browser$Debugger$Main$Down = {$: 'Down'}; -var $elm$browser$Debugger$Expando$ListSeq = {$: 'ListSeq'}; -var $elm$browser$Debugger$Main$NoOp = {$: 'NoOp'}; -var $elm$browser$Debugger$Expando$Primitive = function (a) { - return {$: 'Primitive', a: a}; -}; -var $elm$browser$Debugger$Expando$Record = F2( - function (a, b) { - return {$: 'Record', a: a, b: b}; - }); -var $elm$browser$Debugger$Expando$S = function (a) { - return {$: 'S', a: a}; -}; -var $elm$browser$Debugger$Expando$Sequence = F3( - function (a, b, c) { - return {$: 'Sequence', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$SetSeq = {$: 'SetSeq'}; -var $elm$browser$Debugger$Main$Up = {$: 'Up'}; -var $elm$browser$Debugger$Main$UserMsg = function (a) { - return {$: 'UserMsg', a: a}; -}; -var $elm$browser$Debugger$Main$Export = {$: 'Export'}; -var $elm$browser$Debugger$Main$Import = {$: 'Import'}; -var $elm$browser$Debugger$Main$Open = {$: 'Open'}; -var $elm$browser$Debugger$Main$OverlayMsg = function (a) { - return {$: 'OverlayMsg', a: a}; -}; -var $elm$browser$Debugger$Main$Resume = {$: 'Resume'}; -var $elm$browser$Debugger$Main$isPaused = function (state) { - if (state.$ === 'Running') { - return false; - } else { - return true; - } -}; -var $elm$browser$Debugger$History$size = function (history) { - return history.numMessages; -}; -var $elm$browser$Debugger$Overlay$Accept = function (a) { - return {$: 'Accept', a: a}; -}; -var $elm$browser$Debugger$Overlay$Choose = F2( - function (a, b) { - return {$: 'Choose', a: a, b: b}; - }); -var $elm$html$Html$div = _VirtualDom_node('div'); -var $elm$json$Json$Encode$string = _Json_wrap; -var $elm$html$Html$Attributes$stringProperty = F2( - function (key, string) { - return A2( - _VirtualDom_property, - key, - $elm$json$Json$Encode$string(string)); - }); -var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); -var $elm$virtual_dom$VirtualDom$Normal = function (a) { - return {$: 'Normal', a: a}; -}; -var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; -var $elm$html$Html$Events$on = F2( - function (event, decoder) { - return A2( - $elm$virtual_dom$VirtualDom$on, - event, - $elm$virtual_dom$VirtualDom$Normal(decoder)); - }); -var $elm$html$Html$Events$onClick = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'click', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$html$Html$span = _VirtualDom_node('span'); -var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style; -var $elm$html$Html$Attributes$style = $elm$virtual_dom$VirtualDom$style; -var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; -var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; -var $elm$html$Html$a = _VirtualDom_node('a'); -var $elm$browser$Debugger$Overlay$goodNews1 = '\nThe good news is that having values like this in your message type is not\nso great in the long run. You are better off using simpler data, like\n'; -var $elm$browser$Debugger$Overlay$goodNews2 = '\nfunction can pattern match on that data and call whatever functions, JSON\ndecoders, etc. you need. This makes the code much more explicit and easy to\nfollow for other readers (or you in a few months!)\n'; -var $elm$html$Html$Attributes$href = function (url) { - return A2( - $elm$html$Html$Attributes$stringProperty, - 'href', - _VirtualDom_noJavaScriptUri(url)); -}; -var $elm$core$List$foldrHelper = F4( - function (fn, acc, ctr, ls) { - if (!ls.b) { - return acc; - } else { - var a = ls.a; - var r1 = ls.b; - if (!r1.b) { - return A2(fn, a, acc); - } else { - var b = r1.a; - var r2 = r1.b; - if (!r2.b) { - return A2( - fn, - a, - A2(fn, b, acc)); - } else { - var c = r2.a; - var r3 = r2.b; - if (!r3.b) { - return A2( - fn, - a, - A2( - fn, - b, - A2(fn, c, acc))); - } else { - var d = r3.a; - var r4 = r3.b; - var res = (ctr > 500) ? A3( - $elm$core$List$foldl, - fn, - acc, - $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4); - return A2( - fn, - a, - A2( - fn, - b, - A2( - fn, - c, - A2(fn, d, res)))); - } - } - } - } - }); -var $elm$core$List$foldr = F3( - function (fn, acc, ls) { - return A4($elm$core$List$foldrHelper, fn, acc, 0, ls); - }); -var $elm$core$List$map = F2( - function (f, xs) { - return A3( - $elm$core$List$foldr, - F2( - function (x, acc) { - return A2( - $elm$core$List$cons, - f(x), - acc); - }), - _List_Nil, - xs); - }); -var $elm$html$Html$p = _VirtualDom_node('p'); -var $elm$html$Html$ul = _VirtualDom_node('ul'); -var $elm$html$Html$code = _VirtualDom_node('code'); -var $elm$browser$Debugger$Overlay$viewCode = function (name) { - return A2( - $elm$html$Html$code, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(name) - ])); -}; -var $elm$browser$Debugger$Overlay$addCommas = function (items) { - if (!items.b) { - return ''; - } else { - if (!items.b.b) { - var item = items.a; - return item; - } else { - if (!items.b.b.b) { - var item1 = items.a; - var _v1 = items.b; - var item2 = _v1.a; - return item1 + (' and ' + item2); - } else { - var lastItem = items.a; - var otherItems = items.b; - return A2( - $elm$core$String$join, - ', ', - _Utils_ap( - otherItems, - _List_fromArray( - [' and ' + lastItem]))); - } - } - } -}; -var $elm$html$Html$li = _VirtualDom_node('li'); -var $elm$browser$Debugger$Overlay$problemToString = function (problem) { - switch (problem.$) { - case 'Function': - return 'functions'; - case 'Decoder': - return 'JSON decoders'; - case 'Task': - return 'tasks'; - case 'Process': - return 'processes'; - case 'Socket': - return 'web sockets'; - case 'Request': - return 'HTTP requests'; - case 'Program': - return 'programs'; - default: - return 'virtual DOM values'; - } -}; -var $elm$browser$Debugger$Overlay$viewProblemType = function (_v0) { - var name = _v0.name; - var problems = _v0.problems; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name), - $elm$html$Html$text( - ' can contain ' + ($elm$browser$Debugger$Overlay$addCommas( - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$problemToString, problems)) + '.')) - ])); -}; -var $elm$browser$Debugger$Overlay$viewBadMetadata = function (_v0) { - var message = _v0.message; - var problems = _v0.problems; - return _List_fromArray( - [ - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('The '), - $elm$browser$Debugger$Overlay$viewCode(message), - $elm$html$Html$text(' type of your program cannot be reliably serialized for history files.') - ])), - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('Functions cannot be serialized, nor can values that contain functions. This is a problem in these places:') - ])), - A2( - $elm$html$Html$ul, - _List_Nil, - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$viewProblemType, problems)), - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text($elm$browser$Debugger$Overlay$goodNews1), - A2( - $elm$html$Html$a, - _List_fromArray( - [ - $elm$html$Html$Attributes$href('https://guide.elm-lang.org/types/custom_types.html') - ]), - _List_fromArray( - [ - $elm$html$Html$text('custom types') - ])), - $elm$html$Html$text(', in your messages. From there, your '), - $elm$browser$Debugger$Overlay$viewCode('update'), - $elm$html$Html$text($elm$browser$Debugger$Overlay$goodNews2) - ])) - ]); -}; -var $elm$virtual_dom$VirtualDom$map = _VirtualDom_map; -var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; -var $elm$browser$Debugger$Overlay$Cancel = {$: 'Cancel'}; -var $elm$browser$Debugger$Overlay$Proceed = {$: 'Proceed'}; -var $elm$html$Html$button = _VirtualDom_node('button'); -var $elm$browser$Debugger$Overlay$viewButtons = function (buttons) { - var btn = F2( - function (msg, string) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin-right', '20px'), - $elm$html$Html$Events$onClick(msg) - ]), - _List_fromArray( - [ - $elm$html$Html$text(string) - ])); - }); - var buttonNodes = function () { - if (buttons.$ === 'Accept') { - var proceed = buttons.a; - return _List_fromArray( - [ - A2(btn, $elm$browser$Debugger$Overlay$Proceed, proceed) - ]); - } else { - var cancel = buttons.a; - var proceed = buttons.b; - return _List_fromArray( - [ - A2(btn, $elm$browser$Debugger$Overlay$Cancel, cancel), - A2(btn, $elm$browser$Debugger$Overlay$Proceed, proceed) - ]); - } - }(); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'height', '60px'), - A2($elm$html$Html$Attributes$style, 'line-height', '60px'), - A2($elm$html$Html$Attributes$style, 'text-align', 'right'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - buttonNodes); -}; -var $elm$browser$Debugger$Overlay$viewMessage = F4( - function (config, title, details, buttons) { - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-overlay'), - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100vw'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'none'), - A2($elm$html$Html$Attributes$style, 'font-family', '\'Trebuchet MS\', \'Lucida Grande\', \'Bitstream Vera Sans\', \'Helvetica Neue\', sans-serif'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483647') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2($elm$html$Html$Attributes$style, 'width', '600px'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'padding-left', 'calc(50% - 300px)'), - A2($elm$html$Html$Attributes$style, 'padding-right', 'calc(50% - 300px)'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgba(200, 200, 200, 0.7)'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '36px'), - A2($elm$html$Html$Attributes$style, 'height', '80px'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)'), - A2($elm$html$Html$Attributes$style, 'padding-left', '22px'), - A2($elm$html$Html$Attributes$style, 'vertical-align', 'middle'), - A2($elm$html$Html$Attributes$style, 'line-height', '80px') - ]), - _List_fromArray( - [ - $elm$html$Html$text(title) - ])), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-details'), - A2($elm$html$Html$Attributes$style, 'padding', ' 8px 20px'), - A2($elm$html$Html$Attributes$style, 'overflow-y', 'auto'), - A2($elm$html$Html$Attributes$style, 'max-height', 'calc(100vh - 156px)'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(61, 61, 61)') - ]), - details), - A2( - $elm$html$Html$map, - config.wrap, - $elm$browser$Debugger$Overlay$viewButtons(buttons)) - ])) - ])); - }); -var $elm$virtual_dom$VirtualDom$attribute = F2( - function (key, value) { - return A2( - _VirtualDom_attribute, - _VirtualDom_noOnOrFormAction(key), - _VirtualDom_noJavaScriptOrHtmlUri(value)); - }); -var $elm$core$Basics$negate = function (n) { - return -n; -}; -var $elm$virtual_dom$VirtualDom$nodeNS = F2( - function (namespace, tag) { - return A2( - _VirtualDom_nodeNS, - namespace, - _VirtualDom_noScript(tag)); - }); -var $elm$core$String$fromFloat = _String_fromNumber; -var $elm$browser$Debugger$Overlay$viewShape = F4( - function (x, y, angle, coordinates) { - return A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'polygon', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'points', coordinates), - A2( - $elm$virtual_dom$VirtualDom$attribute, - 'transform', - 'translate(' + ($elm$core$String$fromFloat(x) + (' ' + ($elm$core$String$fromFloat(y) + (') rotate(' + ($elm$core$String$fromFloat(-angle) + ')')))))) - ]), - _List_Nil); - }); -var $elm$browser$Debugger$Overlay$elmLogo = A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'svg', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'viewBox', '-300 -300 600 600'), - A2($elm$virtual_dom$VirtualDom$attribute, 'xmlns', 'http://www.w3.org/2000/svg'), - A2($elm$virtual_dom$VirtualDom$attribute, 'fill', 'currentColor'), - A2($elm$virtual_dom$VirtualDom$attribute, 'width', '24px'), - A2($elm$virtual_dom$VirtualDom$attribute, 'height', '24px') - ]), - _List_fromArray( - [ - A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'g', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'transform', 'scale(1 -1)') - ]), - _List_fromArray( - [ - A4($elm$browser$Debugger$Overlay$viewShape, 0, -210, 0, '-280,-90 0,190 280,-90'), - A4($elm$browser$Debugger$Overlay$viewShape, -210, 0, 90, '-280,-90 0,190 280,-90'), - A4($elm$browser$Debugger$Overlay$viewShape, 207, 207, 45, '-198,-66 0,132 198,-66'), - A4($elm$browser$Debugger$Overlay$viewShape, 150, 0, 0, '-130,0 0,-130 130,0 0,130'), - A4($elm$browser$Debugger$Overlay$viewShape, -89, 239, 0, '-191,61 69,61 191,-61 -69,-61'), - A4($elm$browser$Debugger$Overlay$viewShape, 0, 106, 180, '-130,-44 0,86 130,-44'), - A4($elm$browser$Debugger$Overlay$viewShape, 256, -150, 270, '-130,-44 0,86 130,-44') - ])) - ])); -var $elm$core$String$length = _String_length; -var $elm$browser$Debugger$Overlay$viewMiniControls = F2( - function (config, numMsgs) { - var string = $elm$core$String$fromInt(numMsgs); - var width = $elm$core$String$fromInt( - 2 + $elm$core$String$length(string)); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'bottom', '2em'), - A2($elm$html$Html$Attributes$style, 'right', '2em'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(42px + ' + (width + 'ch)')), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'background-color', '#1293D8'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'font-family', 'monospace'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483647'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - $elm$html$Html$Events$onClick(config.open) - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$elmLogo, - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', 'calc(1ch + 6px)'), - A2($elm$html$Html$Attributes$style, 'padding-right', '1ch') - ]), - _List_fromArray( - [ - $elm$html$Html$text(string) - ])) - ])); - }); -var $elm$browser$Debugger$Overlay$explanationBad = '\nThe messages in this history do not match the messages handled by your\nprogram. I noticed changes in the following types:\n'; -var $elm$browser$Debugger$Overlay$explanationRisky = '\nThis history seems old. It will work with this program, but some\nmessages have been added since the history was created:\n'; -var $elm$core$List$intersperse = F2( - function (sep, xs) { - if (!xs.b) { - return _List_Nil; - } else { - var hd = xs.a; - var tl = xs.b; - var step = F2( - function (x, rest) { - return A2( - $elm$core$List$cons, - sep, - A2($elm$core$List$cons, x, rest)); - }); - var spersed = A3($elm$core$List$foldr, step, _List_Nil, tl); - return A2($elm$core$List$cons, hd, spersed); - } - }); -var $elm$browser$Debugger$Overlay$viewMention = F2( - function (tags, verbed) { - var _v0 = A2( - $elm$core$List$map, - $elm$browser$Debugger$Overlay$viewCode, - $elm$core$List$reverse(tags)); - if (!_v0.b) { - return $elm$html$Html$text(''); - } else { - if (!_v0.b.b) { - var tag = _v0.a; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(verbed), - tag, - $elm$html$Html$text('.') - ])); - } else { - if (!_v0.b.b.b) { - var tag2 = _v0.a; - var _v1 = _v0.b; - var tag1 = _v1.a; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(verbed), - tag1, - $elm$html$Html$text(' and '), - tag2, - $elm$html$Html$text('.') - ])); - } else { - var lastTag = _v0.a; - var otherTags = _v0.b; - return A2( - $elm$html$Html$li, - _List_Nil, - A2( - $elm$core$List$cons, - $elm$html$Html$text(verbed), - _Utils_ap( - A2( - $elm$core$List$intersperse, - $elm$html$Html$text(', '), - $elm$core$List$reverse(otherTags)), - _List_fromArray( - [ - $elm$html$Html$text(', and '), - lastTag, - $elm$html$Html$text('.') - ])))); - } - } - } - }); -var $elm$browser$Debugger$Overlay$viewChange = function (change) { - return A2( - $elm$html$Html$li, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin', '8px 0') - ]), - function () { - if (change.$ === 'AliasChange') { - var name = change.a; - return _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '1.5em') - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name) - ])) - ]); - } else { - var name = change.a; - var removed = change.b.removed; - var changed = change.b.changed; - var added = change.b.added; - var argsMatch = change.b.argsMatch; - return _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '1.5em') - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name) - ])), - A2( - $elm$html$Html$ul, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'list-style-type', 'disc'), - A2($elm$html$Html$Attributes$style, 'padding-left', '2em') - ]), - _List_fromArray( - [ - A2($elm$browser$Debugger$Overlay$viewMention, removed, 'Removed '), - A2($elm$browser$Debugger$Overlay$viewMention, changed, 'Changed '), - A2($elm$browser$Debugger$Overlay$viewMention, added, 'Added ') - ])), - argsMatch ? $elm$html$Html$text('') : $elm$html$Html$text('This may be due to the fact that the type variable names changed.') - ]); - } - }()); -}; -var $elm$browser$Debugger$Overlay$viewReport = F2( - function (isBad, report) { - switch (report.$) { - case 'CorruptHistory': - return _List_fromArray( - [ - $elm$html$Html$text('Looks like this history file is corrupt. I cannot understand it.') - ]); - case 'VersionChanged': - var old = report.a; - var _new = report.b; - return _List_fromArray( - [ - $elm$html$Html$text('This history was created with Elm ' + (old + (', but you are using Elm ' + (_new + ' right now.')))) - ]); - case 'MessageChanged': - var old = report.a; - var _new = report.b; - return _List_fromArray( - [ - $elm$html$Html$text('To import some other history, the overall message type must' + ' be the same. The old history has '), - $elm$browser$Debugger$Overlay$viewCode(old), - $elm$html$Html$text(' messages, but the new program works with '), - $elm$browser$Debugger$Overlay$viewCode(_new), - $elm$html$Html$text(' messages.') - ]); - default: - var changes = report.a; - return _List_fromArray( - [ - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text( - isBad ? $elm$browser$Debugger$Overlay$explanationBad : $elm$browser$Debugger$Overlay$explanationRisky) - ])), - A2( - $elm$html$Html$ul, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'list-style-type', 'none'), - A2($elm$html$Html$Attributes$style, 'padding-left', '20px') - ]), - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$viewChange, changes)) - ]); - } - }); -var $elm$browser$Debugger$Overlay$view = F5( - function (config, isPaused, isOpen, numMsgs, state) { - switch (state.$) { - case 'None': - return isOpen ? $elm$html$Html$text('') : (isPaused ? A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-overlay'), - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100vw'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgba(200, 200, 200, 0.7)'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'font-family', '\'Trebuchet MS\', \'Lucida Grande\', \'Bitstream Vera Sans\', \'Helvetica Neue\', sans-serif'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483646'), - $elm$html$Html$Events$onClick(config.resume) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '80px') - ]), - _List_fromArray( - [ - $elm$html$Html$text('Click to Resume') - ])), - A2($elm$browser$Debugger$Overlay$viewMiniControls, config, numMsgs) - ])) : A2($elm$browser$Debugger$Overlay$viewMiniControls, config, numMsgs)); - case 'BadMetadata': - var badMetadata_ = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Cannot use Import or Export', - $elm$browser$Debugger$Overlay$viewBadMetadata(badMetadata_), - $elm$browser$Debugger$Overlay$Accept('Ok')); - case 'BadImport': - var report = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Cannot Import History', - A2($elm$browser$Debugger$Overlay$viewReport, true, report), - $elm$browser$Debugger$Overlay$Accept('Ok')); - default: - var report = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Warning', - A2($elm$browser$Debugger$Overlay$viewReport, false, report), - A2($elm$browser$Debugger$Overlay$Choose, 'Cancel', 'Import Anyway')); - } - }); -var $elm$browser$Debugger$Main$cornerView = function (model) { - return A5( - $elm$browser$Debugger$Overlay$view, - {exportHistory: $elm$browser$Debugger$Main$Export, importHistory: $elm$browser$Debugger$Main$Import, open: $elm$browser$Debugger$Main$Open, resume: $elm$browser$Debugger$Main$Resume, wrap: $elm$browser$Debugger$Main$OverlayMsg}, - $elm$browser$Debugger$Main$isPaused(model.state), - _Debugger_isOpen(model.popout), - $elm$browser$Debugger$History$size(model.history), - model.overlay); -}; -var $elm$core$Dict$RBEmpty_elm_builtin = {$: 'RBEmpty_elm_builtin'}; -var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; -var $elm$core$Set$foldr = F3( - function (func, initialState, _v0) { - var dict = _v0.a; - return A3( - $elm$core$Dict$foldr, - F3( - function (key, _v1, state) { - return A2(func, key, state); - }), - initialState, - dict); - }); -var $elm$browser$Debugger$Main$getCurrentModel = function (state) { - if (state.$ === 'Running') { - var model = state.a; - return model; - } else { - var model = state.b; - return model; - } -}; -var $elm$browser$Debugger$Main$getUserModel = function (model) { - return $elm$browser$Debugger$Main$getCurrentModel(model.state); -}; -var $elm$browser$Debugger$Main$initialWindowHeight = 420; -var $elm$browser$Debugger$Main$initialWindowWidth = 900; -var $elm$core$Dict$Black = {$: 'Black'}; -var $elm$core$Dict$RBNode_elm_builtin = F5( - function (a, b, c, d, e) { - return {$: 'RBNode_elm_builtin', a: a, b: b, c: c, d: d, e: e}; - }); -var $elm$core$Dict$Red = {$: 'Red'}; -var $elm$core$Dict$balance = F5( - function (color, key, value, left, right) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Red')) { - var _v1 = right.a; - var rK = right.b; - var rV = right.c; - var rLeft = right.d; - var rRight = right.e; - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { - var _v3 = left.a; - var lK = left.b; - var lV = left.c; - var lLeft = left.d; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - key, - value, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - rK, - rV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, left, rLeft), - rRight); - } - } else { - if ((((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) && (left.d.$ === 'RBNode_elm_builtin')) && (left.d.a.$ === 'Red')) { - var _v5 = left.a; - var lK = left.b; - var lV = left.c; - var _v6 = left.d; - var _v7 = _v6.a; - var llK = _v6.b; - var llV = _v6.c; - var llLeft = _v6.d; - var llRight = _v6.e; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - lK, - lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, key, value, lRight, right)); - } else { - return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); - } - } - }); -var $elm$core$Basics$compare = _Utils_compare; -var $elm$core$Dict$insertHelp = F3( - function (key, value, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); - } else { - var nColor = dict.a; - var nKey = dict.b; - var nValue = dict.c; - var nLeft = dict.d; - var nRight = dict.e; - var _v1 = A2($elm$core$Basics$compare, key, nKey); - switch (_v1.$) { - case 'LT': - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - A3($elm$core$Dict$insertHelp, key, value, nLeft), - nRight); - case 'EQ': - return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); - default: - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - nLeft, - A3($elm$core$Dict$insertHelp, key, value, nRight)); - } - } - }); -var $elm$core$Dict$insert = F3( - function (key, value, dict) { - var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { - var _v1 = _v0.a; - var k = _v0.b; - var v = _v0.c; - var l = _v0.d; - var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); - } else { - var x = _v0; - return x; - } - }); -var $elm$browser$Debugger$Main$cachedHistory = function (model) { - var _v0 = model.state; - if (_v0.$ === 'Running') { - return model.history; - } else { - var history = _v0.e; - return history; - } -}; -var $elm$virtual_dom$VirtualDom$node = function (tag) { - return _VirtualDom_node( - _VirtualDom_noScript(tag)); -}; -var $elm$html$Html$node = $elm$virtual_dom$VirtualDom$node; -var $elm$browser$Debugger$Main$DragEnd = {$: 'DragEnd'}; -var $elm$browser$Debugger$Main$getDragStatus = function (layout) { - if (layout.$ === 'Horizontal') { - var status = layout.a; - return status; - } else { - var status = layout.a; - return status; - } -}; -var $elm$browser$Debugger$Main$Drag = function (a) { - return {$: 'Drag', a: a}; -}; -var $elm$browser$Debugger$Main$DragInfo = F5( - function (x, y, down, width, height) { - return {down: down, height: height, width: width, x: x, y: y}; - }); -var $elm$json$Json$Decode$field = _Json_decodeField; -var $elm$json$Json$Decode$at = F2( - function (fields, decoder) { - return A3($elm$core$List$foldr, $elm$json$Json$Decode$field, decoder, fields); - }); -var $elm$json$Json$Decode$float = _Json_decodeFloat; -var $elm$browser$Debugger$Main$decodeDimension = function (field) { - return A2( - $elm$json$Json$Decode$at, - _List_fromArray( - ['currentTarget', 'ownerDocument', 'defaultView', field]), - $elm$json$Json$Decode$float); -}; -var $elm$json$Json$Decode$int = _Json_decodeInt; -var $elm$json$Json$Decode$map5 = _Json_map5; -var $elm$browser$Debugger$Main$onMouseMove = A2( - $elm$html$Html$Events$on, - 'mousemove', - A2( - $elm$json$Json$Decode$map, - $elm$browser$Debugger$Main$Drag, - A6( - $elm$json$Json$Decode$map5, - $elm$browser$Debugger$Main$DragInfo, - A2($elm$json$Json$Decode$field, 'pageX', $elm$json$Json$Decode$float), - A2($elm$json$Json$Decode$field, 'pageY', $elm$json$Json$Decode$float), - A2( - $elm$json$Json$Decode$field, - 'buttons', - A2( - $elm$json$Json$Decode$map, - function (v) { - return v === 1; - }, - $elm$json$Json$Decode$int)), - $elm$browser$Debugger$Main$decodeDimension('innerWidth'), - $elm$browser$Debugger$Main$decodeDimension('innerHeight')))); -var $elm$html$Html$Events$onMouseUp = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'mouseup', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$browser$Debugger$Main$toDragListeners = function (layout) { - var _v0 = $elm$browser$Debugger$Main$getDragStatus(layout); - if (_v0.$ === 'Static') { - return _List_Nil; - } else { - return _List_fromArray( - [ - $elm$browser$Debugger$Main$onMouseMove, - $elm$html$Html$Events$onMouseUp($elm$browser$Debugger$Main$DragEnd) - ]); - } -}; -var $elm$browser$Debugger$Main$toFlexDirection = function (layout) { - if (layout.$ === 'Horizontal') { - return 'row'; - } else { - return 'column-reverse'; - } -}; -var $elm$browser$Debugger$Main$DragStart = {$: 'DragStart'}; -var $elm$html$Html$Events$onMouseDown = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'mousedown', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$browser$Debugger$Main$toPercent = function (fraction) { - return $elm$core$String$fromFloat(100 * fraction) + '%'; -}; -var $elm$browser$Debugger$Main$viewDragZone = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2( - $elm$html$Html$Attributes$style, - 'left', - $elm$browser$Debugger$Main$toPercent(x)), - A2($elm$html$Html$Attributes$style, 'margin-left', '-5px'), - A2($elm$html$Html$Attributes$style, 'width', '10px'), - A2($elm$html$Html$Attributes$style, 'height', '100%'), - A2($elm$html$Html$Attributes$style, 'cursor', 'col-resize'), - $elm$html$Html$Events$onMouseDown($elm$browser$Debugger$Main$DragStart) - ]), - _List_Nil); - } else { - var y = layout.c; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2( - $elm$html$Html$Attributes$style, - 'top', - $elm$browser$Debugger$Main$toPercent(y)), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'margin-top', '-5px'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '10px'), - A2($elm$html$Html$Attributes$style, 'cursor', 'row-resize'), - $elm$html$Html$Events$onMouseDown($elm$browser$Debugger$Main$DragStart) - ]), - _List_Nil); - } -}; -var $elm$browser$Debugger$Main$TweakExpandoModel = function (a) { - return {$: 'TweakExpandoModel', a: a}; -}; -var $elm$browser$Debugger$Main$TweakExpandoMsg = function (a) { - return {$: 'TweakExpandoMsg', a: a}; -}; -var $elm$browser$Debugger$Main$toExpandoPercents = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return _Utils_Tuple2( - $elm$browser$Debugger$Main$toPercent(1 - x), - '100%'); - } else { - var y = layout.c; - return _Utils_Tuple2( - '100%', - $elm$browser$Debugger$Main$toPercent(y)); - } -}; -var $elm$browser$Debugger$Main$toMouseBlocker = function (layout) { - var _v0 = $elm$browser$Debugger$Main$getDragStatus(layout); - if (_v0.$ === 'Static') { - return 'auto'; - } else { - return 'none'; - } -}; -var $elm$browser$Debugger$Expando$Field = F2( - function (a, b) { - return {$: 'Field', a: a, b: b}; - }); -var $elm$browser$Debugger$Expando$Index = F3( - function (a, b, c) { - return {$: 'Index', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$Key = {$: 'Key'}; -var $elm$browser$Debugger$Expando$None = {$: 'None'}; -var $elm$browser$Debugger$Expando$Toggle = {$: 'Toggle'}; -var $elm$browser$Debugger$Expando$Value = {$: 'Value'}; -var $elm$browser$Debugger$Expando$blue = A2($elm$html$Html$Attributes$style, 'color', 'rgb(28, 0, 207)'); -var $elm$core$Basics$composeL = F3( - function (g, f, x) { - return g( - f(x)); - }); -var $elm$browser$Debugger$Expando$leftPad = function (maybeKey) { - if (maybeKey.$ === 'Nothing') { - return _List_Nil; - } else { - return _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', '4ch') - ]); - } -}; -var $elm$browser$Debugger$Expando$makeArrow = function (arrow) { - return A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#777'), - A2($elm$html$Html$Attributes$style, 'padding-left', '2ch'), - A2($elm$html$Html$Attributes$style, 'width', '2ch'), - A2($elm$html$Html$Attributes$style, 'display', 'inline-block') - ]), - _List_fromArray( - [ - $elm$html$Html$text(arrow) - ])); -}; -var $elm$browser$Debugger$Expando$purple = A2($elm$html$Html$Attributes$style, 'color', 'rgb(136, 19, 145)'); -var $elm$browser$Debugger$Expando$lineStarter = F3( - function (maybeKey, maybeIsClosed, description) { - var arrow = function () { - if (maybeIsClosed.$ === 'Nothing') { - return $elm$browser$Debugger$Expando$makeArrow(''); - } else { - if (maybeIsClosed.a) { - return $elm$browser$Debugger$Expando$makeArrow('▸'); - } else { - return $elm$browser$Debugger$Expando$makeArrow('▾'); - } - } - }(); - if (maybeKey.$ === 'Nothing') { - return A2($elm$core$List$cons, arrow, description); - } else { - var key = maybeKey.a; - return A2( - $elm$core$List$cons, - arrow, - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(key) - ])), - A2( - $elm$core$List$cons, - $elm$html$Html$text(' = '), - description))); - } - }); -var $elm$browser$Debugger$Expando$red = A2($elm$html$Html$Attributes$style, 'color', 'rgb(196, 26, 22)'); -var $elm$core$Tuple$second = function (_v0) { - var y = _v0.b; - return y; -}; -var $elm$browser$Debugger$Expando$seqTypeToString = F2( - function (n, seqType) { - switch (seqType.$) { - case 'ListSeq': - return 'List(' + ($elm$core$String$fromInt(n) + ')'); - case 'SetSeq': - return 'Set(' + ($elm$core$String$fromInt(n) + ')'); - default: - return 'Array(' + ($elm$core$String$fromInt(n) + ')'); - } - }); -var $elm$core$String$slice = _String_slice; -var $elm$core$String$left = F2( - function (n, string) { - return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string); - }); -var $elm$core$String$right = F2( - function (n, string) { - return (n < 1) ? '' : A3( - $elm$core$String$slice, - -n, - $elm$core$String$length(string), - string); - }); -var $elm$browser$Debugger$Expando$elideMiddle = function (str) { - return ($elm$core$String$length(str) <= 18) ? str : (A2($elm$core$String$left, 8, str) + ('...' + A2($elm$core$String$right, 8, str))); -}; -var $elm$core$Dict$isEmpty = function (dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return true; - } else { - return false; - } -}; -var $elm$browser$Debugger$Expando$viewExtraTinyRecord = F3( - function (length, starter, entries) { - if (!entries.b) { - return _Utils_Tuple2( - length + 1, - _List_fromArray( - [ - $elm$html$Html$text('}') - ])); - } else { - var field = entries.a; - var rest = entries.b; - var nextLength = (length + $elm$core$String$length(field)) + 1; - if (nextLength > 18) { - return _Utils_Tuple2( - length + 2, - _List_fromArray( - [ - $elm$html$Html$text('…}') - ])); - } else { - var _v1 = A3($elm$browser$Debugger$Expando$viewExtraTinyRecord, nextLength, ',', rest); - var finalLength = _v1.a; - var otherHtmls = _v1.b; - return _Utils_Tuple2( - finalLength, - A2( - $elm$core$List$cons, - $elm$html$Html$text(starter), - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(field) - ])), - otherHtmls))); - } - } - }); -var $elm$browser$Debugger$Expando$viewTinyHelp = function (str) { - return _Utils_Tuple2( - $elm$core$String$length(str), - _List_fromArray( - [ - $elm$html$Html$text(str) - ])); -}; -var $elm$core$Maybe$withDefault = F2( - function (_default, maybe) { - if (maybe.$ === 'Just') { - var value = maybe.a; - return value; - } else { - return _default; - } - }); -var $elm$browser$Debugger$Expando$viewExtraTiny = function (value) { - if (value.$ === 'Record') { - var record = value.b; - return A3( - $elm$browser$Debugger$Expando$viewExtraTinyRecord, - 0, - '{', - $elm$core$Dict$keys(record)); - } else { - return $elm$browser$Debugger$Expando$viewTiny(value); - } -}; -var $elm$browser$Debugger$Expando$viewTiny = function (value) { - switch (value.$) { - case 'S': - var stringRep = value.a; - var str = $elm$browser$Debugger$Expando$elideMiddle(stringRep); - return _Utils_Tuple2( - $elm$core$String$length(str), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$red]), - _List_fromArray( - [ - $elm$html$Html$text(str) - ])) - ])); - case 'Primitive': - var stringRep = value.a; - return _Utils_Tuple2( - $elm$core$String$length(stringRep), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$blue]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ])); - case 'Sequence': - var seqType = value.a; - var valueList = value.c; - return $elm$browser$Debugger$Expando$viewTinyHelp( - A2( - $elm$browser$Debugger$Expando$seqTypeToString, - $elm$core$List$length(valueList), - seqType)); - case 'Dictionary': - var keyValuePairs = value.b; - return $elm$browser$Debugger$Expando$viewTinyHelp( - 'Dict(' + ($elm$core$String$fromInt( - $elm$core$List$length(keyValuePairs)) + ')')); - case 'Record': - var record = value.b; - return $elm$browser$Debugger$Expando$viewTinyRecord(record); - default: - if (!value.c.b) { - var maybeName = value.a; - return $elm$browser$Debugger$Expando$viewTinyHelp( - A2($elm$core$Maybe$withDefault, 'Unit', maybeName)); - } else { - var maybeName = value.a; - var valueList = value.c; - return $elm$browser$Debugger$Expando$viewTinyHelp( - function () { - if (maybeName.$ === 'Nothing') { - return 'Tuple(' + ($elm$core$String$fromInt( - $elm$core$List$length(valueList)) + ')'); - } else { - var name = maybeName.a; - return name + ' …'; - } - }()); - } - } -}; -var $elm$browser$Debugger$Expando$viewTinyRecord = function (record) { - return $elm$core$Dict$isEmpty(record) ? _Utils_Tuple2( - 2, - _List_fromArray( - [ - $elm$html$Html$text('{}') - ])) : A3( - $elm$browser$Debugger$Expando$viewTinyRecordHelp, - 0, - '{ ', - $elm$core$Dict$toList(record)); -}; -var $elm$browser$Debugger$Expando$viewTinyRecordHelp = F3( - function (length, starter, entries) { - if (!entries.b) { - return _Utils_Tuple2( - length + 2, - _List_fromArray( - [ - $elm$html$Html$text(' }') - ])); - } else { - var _v1 = entries.a; - var field = _v1.a; - var value = _v1.b; - var rest = entries.b; - var fieldLen = $elm$core$String$length(field); - var _v2 = $elm$browser$Debugger$Expando$viewExtraTiny(value); - var valueLen = _v2.a; - var valueHtmls = _v2.b; - var newLength = ((length + fieldLen) + valueLen) + 5; - if (newLength > 60) { - return _Utils_Tuple2( - length + 4, - _List_fromArray( - [ - $elm$html$Html$text(', … }') - ])); - } else { - var _v3 = A3($elm$browser$Debugger$Expando$viewTinyRecordHelp, newLength, ', ', rest); - var finalLength = _v3.a; - var otherHtmls = _v3.b; - return _Utils_Tuple2( - finalLength, - A2( - $elm$core$List$cons, - $elm$html$Html$text(starter), - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(field) - ])), - A2( - $elm$core$List$cons, - $elm$html$Html$text(' = '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, valueHtmls), - otherHtmls))))); - } - } - }); -var $elm$browser$Debugger$Expando$view = F2( - function (maybeKey, expando) { - switch (expando.$) { - case 'S': - var stringRep = expando.a; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Nothing, - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$red]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ]))); - case 'Primitive': - var stringRep = expando.a; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Nothing, - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$blue]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ]))); - case 'Sequence': - var seqType = expando.a; - var isClosed = expando.b; - var valueList = expando.c; - return A4($elm$browser$Debugger$Expando$viewSequence, maybeKey, seqType, isClosed, valueList); - case 'Dictionary': - var isClosed = expando.a; - var keyValuePairs = expando.b; - return A3($elm$browser$Debugger$Expando$viewDictionary, maybeKey, isClosed, keyValuePairs); - case 'Record': - var isClosed = expando.a; - var valueDict = expando.b; - return A3($elm$browser$Debugger$Expando$viewRecord, maybeKey, isClosed, valueDict); - default: - var maybeName = expando.a; - var isClosed = expando.b; - var valueList = expando.c; - return A4($elm$browser$Debugger$Expando$viewConstructor, maybeKey, maybeName, isClosed, valueList); - } - }); -var $elm$browser$Debugger$Expando$viewConstructor = F4( - function (maybeKey, maybeName, isClosed, valueList) { - var tinyArgs = A2( - $elm$core$List$map, - A2($elm$core$Basics$composeL, $elm$core$Tuple$second, $elm$browser$Debugger$Expando$viewExtraTiny), - valueList); - var description = function () { - var _v7 = _Utils_Tuple2(maybeName, tinyArgs); - if (_v7.a.$ === 'Nothing') { - if (!_v7.b.b) { - var _v8 = _v7.a; - return _List_fromArray( - [ - $elm$html$Html$text('()') - ]); - } else { - var _v9 = _v7.a; - var _v10 = _v7.b; - var x = _v10.a; - var xs = _v10.b; - return A2( - $elm$core$List$cons, - $elm$html$Html$text('( '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, x), - A3( - $elm$core$List$foldr, - F2( - function (args, rest) { - return A2( - $elm$core$List$cons, - $elm$html$Html$text(', '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, args), - rest)); - }), - _List_fromArray( - [ - $elm$html$Html$text(' )') - ]), - xs))); - } - } else { - if (!_v7.b.b) { - var name = _v7.a.a; - return _List_fromArray( - [ - $elm$html$Html$text(name) - ]); - } else { - var name = _v7.a.a; - var _v11 = _v7.b; - var x = _v11.a; - var xs = _v11.b; - return A2( - $elm$core$List$cons, - $elm$html$Html$text(name + ' '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, x), - A3( - $elm$core$List$foldr, - F2( - function (args, rest) { - return A2( - $elm$core$List$cons, - $elm$html$Html$text(' '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, args), - rest)); - }), - _List_Nil, - xs))); - } - } - }(); - var _v4 = function () { - if (!valueList.b) { - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - } else { - if (!valueList.b.b) { - var entry = valueList.a; - switch (entry.$) { - case 'S': - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - case 'Primitive': - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - case 'Sequence': - var subValueList = entry.c; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewSequenceOpen(subValueList))); - case 'Dictionary': - var keyValuePairs = entry.b; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewDictionaryOpen(keyValuePairs))); - case 'Record': - var record = entry.b; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewRecordOpen(record))); - default: - var subValueList = entry.c; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewConstructorOpen(subValueList))); - } - } else { - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : $elm$browser$Debugger$Expando$viewConstructorOpen(valueList)); - } - } - }(); - var maybeIsClosed = _v4.a; - var openHtml = _v4.b; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3($elm$browser$Debugger$Expando$lineStarter, maybeKey, maybeIsClosed, description)), - openHtml - ])); - }); -var $elm$browser$Debugger$Expando$viewConstructorEntry = F2( - function (index, value) { - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just( - $elm$core$String$fromInt(index)), - value)); - }); -var $elm$browser$Debugger$Expando$viewConstructorOpen = function (valueList) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewConstructorEntry, valueList)); -}; -var $elm$browser$Debugger$Expando$viewDictionary = F3( - function (maybeKey, isClosed, keyValuePairs) { - var starter = 'Dict(' + ($elm$core$String$fromInt( - $elm$core$List$length(keyValuePairs)) + ')'); - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - _List_fromArray( - [ - $elm$html$Html$text(starter) - ]))), - isClosed ? $elm$html$Html$text('') : $elm$browser$Debugger$Expando$viewDictionaryOpen(keyValuePairs) - ])); - }); -var $elm$browser$Debugger$Expando$viewDictionaryEntry = F2( - function (index, _v2) { - var key = _v2.a; - var value = _v2.b; - switch (key.$) { - case 'S': - var stringRep = key.a; - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(stringRep), - value)); - case 'Primitive': - var stringRep = key.a; - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(stringRep), - value)); - default: - return A2( - $elm$html$Html$div, - _List_Nil, - _List_fromArray( - [ - A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Key, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just('key'), - key)), - A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just('value'), - value)) - ])); - } - }); -var $elm$browser$Debugger$Expando$viewDictionaryOpen = function (keyValuePairs) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewDictionaryEntry, keyValuePairs)); -}; -var $elm$browser$Debugger$Expando$viewRecord = F3( - function (maybeKey, isClosed, record) { - var _v1 = isClosed ? _Utils_Tuple3( - $elm$browser$Debugger$Expando$viewTinyRecord(record).b, - $elm$html$Html$text(''), - $elm$html$Html$text('')) : _Utils_Tuple3( - _List_fromArray( - [ - $elm$html$Html$text('{') - ]), - $elm$browser$Debugger$Expando$viewRecordOpen(record), - A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad( - $elm$core$Maybe$Just(_Utils_Tuple0)), - _List_fromArray( - [ - $elm$html$Html$text('}') - ]))); - var start = _v1.a; - var middle = _v1.b; - var end = _v1.c; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - start)), - middle, - end - ])); - }); -var $elm$browser$Debugger$Expando$viewRecordEntry = function (_v0) { - var field = _v0.a; - var value = _v0.b; - return A2( - $elm$html$Html$map, - $elm$browser$Debugger$Expando$Field(field), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(field), - value)); -}; -var $elm$browser$Debugger$Expando$viewRecordOpen = function (record) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$viewRecordEntry, - $elm$core$Dict$toList(record))); -}; -var $elm$browser$Debugger$Expando$viewSequence = F4( - function (maybeKey, seqType, isClosed, valueList) { - var starter = A2( - $elm$browser$Debugger$Expando$seqTypeToString, - $elm$core$List$length(valueList), - seqType); - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - _List_fromArray( - [ - $elm$html$Html$text(starter) - ]))), - isClosed ? $elm$html$Html$text('') : $elm$browser$Debugger$Expando$viewSequenceOpen(valueList) - ])); - }); -var $elm$browser$Debugger$Expando$viewSequenceOpen = function (values) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewConstructorEntry, values)); -}; -var $elm$browser$Debugger$Main$viewExpando = F3( - function (expandoMsg, expandoModel, layout) { - var block = $elm$browser$Debugger$Main$toMouseBlocker(layout); - var _v0 = $elm$browser$Debugger$Main$toExpandoPercents(layout); - var w = _v0.a; - var h = _v0.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'block'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(' + (w + ' - 4em)')), - A2($elm$html$Html$Attributes$style, 'height', 'calc(' + (h + ' - 4em)')), - A2($elm$html$Html$Attributes$style, 'padding', '2em'), - A2($elm$html$Html$Attributes$style, 'margin', '0'), - A2($elm$html$Html$Attributes$style, 'overflow', 'auto'), - A2($elm$html$Html$Attributes$style, 'pointer-events', block), - A2($elm$html$Html$Attributes$style, '-webkit-user-select', block), - A2($elm$html$Html$Attributes$style, '-moz-user-select', block), - A2($elm$html$Html$Attributes$style, '-ms-user-select', block), - A2($elm$html$Html$Attributes$style, 'user-select', block) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#ccc'), - A2($elm$html$Html$Attributes$style, 'padding', '0 0 1em 0') - ]), - _List_fromArray( - [ - $elm$html$Html$text('-- MESSAGE') - ])), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$TweakExpandoMsg, - A2($elm$browser$Debugger$Expando$view, $elm$core$Maybe$Nothing, expandoMsg)), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#ccc'), - A2($elm$html$Html$Attributes$style, 'padding', '1em 0') - ]), - _List_fromArray( - [ - $elm$html$Html$text('-- MODEL') - ])), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$TweakExpandoModel, - A2($elm$browser$Debugger$Expando$view, $elm$core$Maybe$Nothing, expandoModel)) - ])); - }); -var $elm$browser$Debugger$Main$Jump = function (a) { - return {$: 'Jump', a: a}; -}; -var $elm$virtual_dom$VirtualDom$lazy = _VirtualDom_lazy; -var $elm$html$Html$Lazy$lazy = $elm$virtual_dom$VirtualDom$lazy; -var $elm$browser$Debugger$Main$toHistoryPercents = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return _Utils_Tuple2( - $elm$browser$Debugger$Main$toPercent(x), - '100%'); - } else { - var y = layout.c; - return _Utils_Tuple2( - '100%', - $elm$browser$Debugger$Main$toPercent(1 - y)); - } -}; -var $elm$virtual_dom$VirtualDom$lazy3 = _VirtualDom_lazy3; -var $elm$html$Html$Lazy$lazy3 = $elm$virtual_dom$VirtualDom$lazy3; -var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); -var $elm$browser$Debugger$History$idForMessageIndex = function (index) { - return 'msg-' + $elm$core$String$fromInt(index); -}; -var $elm$html$Html$Attributes$title = $elm$html$Html$Attributes$stringProperty('title'); -var $elm$browser$Debugger$History$viewMessage = F3( - function (currentIndex, index, msg) { - var messageName = _Debugger_messageToString(msg); - var className = _Utils_eq(currentIndex, index) ? 'elm-debugger-entry elm-debugger-entry-selected' : 'elm-debugger-entry'; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id( - $elm$browser$Debugger$History$idForMessageIndex(index)), - $elm$html$Html$Attributes$class(className), - $elm$html$Html$Events$onClick(index) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$title(messageName), - $elm$html$Html$Attributes$class('elm-debugger-entry-content') - ]), - _List_fromArray( - [ - $elm$html$Html$text(messageName) - ])), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry-index') - ]), - _List_fromArray( - [ - $elm$html$Html$text( - $elm$core$String$fromInt(index)) - ])) - ])); - }); -var $elm$browser$Debugger$History$consMsg = F3( - function (currentIndex, msg, _v0) { - var index = _v0.a; - var rest = _v0.b; - return _Utils_Tuple2( - index + 1, - A2( - $elm$core$List$cons, - _Utils_Tuple2( - $elm$core$String$fromInt(index), - A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewMessage, currentIndex, index, msg)), - rest)); - }); -var $elm$core$Array$length = function (_v0) { - var len = _v0.a; - return len; -}; -var $elm$core$Basics$neq = _Utils_notEqual; -var $elm$virtual_dom$VirtualDom$keyedNode = function (tag) { - return _VirtualDom_keyedNode( - _VirtualDom_noScript(tag)); -}; -var $elm$html$Html$Keyed$node = $elm$virtual_dom$VirtualDom$keyedNode; -var $elm$browser$Debugger$History$maxSnapshotSize = 31; -var $elm$browser$Debugger$History$showMoreButton = function (numMessages) { - var nextIndex = (numMessages - 1) - ($elm$browser$Debugger$History$maxSnapshotSize * 2); - var labelText = 'View more messages'; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry'), - $elm$html$Html$Events$onClick(nextIndex) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$title(labelText), - $elm$html$Html$Attributes$class('elm-debugger-entry-content') - ]), - _List_fromArray( - [ - $elm$html$Html$text(labelText) - ])), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry-index') - ]), - _List_Nil) - ])); -}; -var $elm$browser$Debugger$History$styles = A3( - $elm$html$Html$node, - 'style', - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('\n\n.elm-debugger-entry {\n cursor: pointer;\n width: 100%;\n box-sizing: border-box;\n padding: 8px;\n}\n\n.elm-debugger-entry:hover {\n background-color: rgb(41, 41, 41);\n}\n\n.elm-debugger-entry-selected, .elm-debugger-entry-selected:hover {\n background-color: rgb(10, 10, 10);\n}\n\n.elm-debugger-entry-content {\n width: calc(100% - 40px);\n padding: 0 5px;\n box-sizing: border-box;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n}\n\n.elm-debugger-entry-index {\n color: #666;\n width: 40px;\n text-align: right;\n display: block;\n float: right;\n}\n\n') - ])); -var $elm$core$Basics$ge = _Utils_ge; -var $elm$browser$Debugger$History$viewSnapshot = F3( - function (selectedIndex, index, _v0) { - var messages = _v0.messages; - return A3( - $elm$html$Html$Keyed$node, - 'div', - _List_Nil, - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$consMsg(selectedIndex), - _Utils_Tuple2(index, _List_Nil), - messages).b); - }); -var $elm$browser$Debugger$History$consSnapshot = F3( - function (selectedIndex, snapshot, _v0) { - var index = _v0.a; - var rest = _v0.b; - var nextIndex = index + $elm$core$Array$length(snapshot.messages); - var selectedIndexHelp = ((_Utils_cmp(nextIndex, selectedIndex) > 0) && (_Utils_cmp(selectedIndex, index) > -1)) ? selectedIndex : (-1); - return _Utils_Tuple2( - nextIndex, - A2( - $elm$core$List$cons, - A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewSnapshot, selectedIndexHelp, index, snapshot), - rest)); - }); -var $elm$core$Elm$JsArray$foldl = _JsArray_foldl; -var $elm$core$Array$foldl = F3( - function (func, baseCase, _v0) { - var tree = _v0.c; - var tail = _v0.d; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldl, helper, acc, subTree); - } else { - var values = node.a; - return A3($elm$core$Elm$JsArray$foldl, func, acc, values); - } - }); - return A3( - $elm$core$Elm$JsArray$foldl, - func, - A3($elm$core$Elm$JsArray$foldl, helper, baseCase, tree), - tail); - }); -var $elm$browser$Debugger$History$viewAllSnapshots = F3( - function (selectedIndex, startIndex, snapshots) { - return A2( - $elm$html$Html$div, - _List_Nil, - A3( - $elm$core$Array$foldl, - $elm$browser$Debugger$History$consSnapshot(selectedIndex), - _Utils_Tuple2(startIndex, _List_Nil), - snapshots).b); - }); -var $elm$core$Array$fromListHelp = F3( - function (list, nodeList, nodeListSize) { - fromListHelp: - while (true) { - var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, list); - var jsArray = _v0.a; - var remainingItems = _v0.b; - if (_Utils_cmp( - $elm$core$Elm$JsArray$length(jsArray), - $elm$core$Array$branchFactor) < 0) { - return A2( - $elm$core$Array$builderToArray, - true, - {nodeList: nodeList, nodeListSize: nodeListSize, tail: jsArray}); - } else { - var $temp$list = remainingItems, - $temp$nodeList = A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(jsArray), - nodeList), - $temp$nodeListSize = nodeListSize + 1; - list = $temp$list; - nodeList = $temp$nodeList; - nodeListSize = $temp$nodeListSize; - continue fromListHelp; - } - } - }); -var $elm$core$Array$fromList = function (list) { - if (!list.b) { - return $elm$core$Array$empty; - } else { - return A3($elm$core$Array$fromListHelp, list, _List_Nil, 0); - } -}; -var $elm$core$Bitwise$and = _Bitwise_and; -var $elm$core$Bitwise$shiftRightZfBy = _Bitwise_shiftRightZfBy; -var $elm$core$Array$bitMask = 4294967295 >>> (32 - $elm$core$Array$shiftStep); -var $elm$core$Elm$JsArray$unsafeGet = _JsArray_unsafeGet; -var $elm$core$Array$getHelp = F3( - function (shift, index, tree) { - getHelp: - while (true) { - var pos = $elm$core$Array$bitMask & (index >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { - var subTree = _v0.a; - var $temp$shift = shift - $elm$core$Array$shiftStep, - $temp$index = index, - $temp$tree = subTree; - shift = $temp$shift; - index = $temp$index; - tree = $temp$tree; - continue getHelp; - } else { - var values = _v0.a; - return A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, values); - } - } - }); -var $elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy; -var $elm$core$Array$tailIndex = function (len) { - return (len >>> 5) << 5; -}; -var $elm$core$Array$get = F2( - function (index, _v0) { - var len = _v0.a; - var startShift = _v0.b; - var tree = _v0.c; - var tail = _v0.d; - return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? $elm$core$Maybe$Nothing : ((_Utils_cmp( - index, - $elm$core$Array$tailIndex(len)) > -1) ? $elm$core$Maybe$Just( - A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, tail)) : $elm$core$Maybe$Just( - A3($elm$core$Array$getHelp, startShift, index, tree))); - }); -var $elm$core$Elm$JsArray$appendN = _JsArray_appendN; -var $elm$core$Elm$JsArray$slice = _JsArray_slice; -var $elm$core$Array$appendHelpBuilder = F2( - function (tail, builder) { - var tailLen = $elm$core$Elm$JsArray$length(tail); - var notAppended = ($elm$core$Array$branchFactor - $elm$core$Elm$JsArray$length(builder.tail)) - tailLen; - var appended = A3($elm$core$Elm$JsArray$appendN, $elm$core$Array$branchFactor, builder.tail, tail); - return (notAppended < 0) ? { - nodeList: A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(appended), - builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: A3($elm$core$Elm$JsArray$slice, notAppended, tailLen, tail) - } : ((!notAppended) ? { - nodeList: A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(appended), - builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: $elm$core$Elm$JsArray$empty - } : {nodeList: builder.nodeList, nodeListSize: builder.nodeListSize, tail: appended}); - }); -var $elm$core$List$drop = F2( - function (n, list) { - drop: - while (true) { - if (n <= 0) { - return list; - } else { - if (!list.b) { - return list; - } else { - var x = list.a; - var xs = list.b; - var $temp$n = n - 1, - $temp$list = xs; - n = $temp$n; - list = $temp$list; - continue drop; - } - } - } - }); -var $elm$core$Array$sliceLeft = F2( - function (from, array) { - var len = array.a; - var tree = array.c; - var tail = array.d; - if (!from) { - return array; - } else { - if (_Utils_cmp( - from, - $elm$core$Array$tailIndex(len)) > -1) { - return A4( - $elm$core$Array$Array_elm_builtin, - len - from, - $elm$core$Array$shiftStep, - $elm$core$Elm$JsArray$empty, - A3( - $elm$core$Elm$JsArray$slice, - from - $elm$core$Array$tailIndex(len), - $elm$core$Elm$JsArray$length(tail), - tail)); - } else { - var skipNodes = (from / $elm$core$Array$branchFactor) | 0; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); - } else { - var leaf = node.a; - return A2($elm$core$List$cons, leaf, acc); - } - }); - var leafNodes = A3( - $elm$core$Elm$JsArray$foldr, - helper, - _List_fromArray( - [tail]), - tree); - var nodesToInsert = A2($elm$core$List$drop, skipNodes, leafNodes); - if (!nodesToInsert.b) { - return $elm$core$Array$empty; - } else { - var head = nodesToInsert.a; - var rest = nodesToInsert.b; - var firstSlice = from - (skipNodes * $elm$core$Array$branchFactor); - var initialBuilder = { - nodeList: _List_Nil, - nodeListSize: 0, - tail: A3( - $elm$core$Elm$JsArray$slice, - firstSlice, - $elm$core$Elm$JsArray$length(head), - head) - }; - return A2( - $elm$core$Array$builderToArray, - true, - A3($elm$core$List$foldl, $elm$core$Array$appendHelpBuilder, initialBuilder, rest)); - } - } - } - }); -var $elm$core$Array$fetchNewTail = F4( - function (shift, end, treeEnd, tree) { - fetchNewTail: - while (true) { - var pos = $elm$core$Array$bitMask & (treeEnd >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var $temp$shift = shift - $elm$core$Array$shiftStep, - $temp$end = end, - $temp$treeEnd = treeEnd, - $temp$tree = sub; - shift = $temp$shift; - end = $temp$end; - treeEnd = $temp$treeEnd; - tree = $temp$tree; - continue fetchNewTail; - } else { - var values = _v0.a; - return A3($elm$core$Elm$JsArray$slice, 0, $elm$core$Array$bitMask & end, values); - } - } - }); -var $elm$core$Array$hoistTree = F3( - function (oldShift, newShift, tree) { - hoistTree: - while (true) { - if ((_Utils_cmp(oldShift, newShift) < 1) || (!$elm$core$Elm$JsArray$length(tree))) { - return tree; - } else { - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, 0, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var $temp$oldShift = oldShift - $elm$core$Array$shiftStep, - $temp$newShift = newShift, - $temp$tree = sub; - oldShift = $temp$oldShift; - newShift = $temp$newShift; - tree = $temp$tree; - continue hoistTree; - } else { - return tree; - } - } - } - }); -var $elm$core$Elm$JsArray$unsafeSet = _JsArray_unsafeSet; -var $elm$core$Array$sliceTree = F3( - function (shift, endIdx, tree) { - var lastPos = $elm$core$Array$bitMask & (endIdx >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, lastPos, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var newSub = A3($elm$core$Array$sliceTree, shift - $elm$core$Array$shiftStep, endIdx, sub); - return (!$elm$core$Elm$JsArray$length(newSub)) ? A3($elm$core$Elm$JsArray$slice, 0, lastPos, tree) : A3( - $elm$core$Elm$JsArray$unsafeSet, - lastPos, - $elm$core$Array$SubTree(newSub), - A3($elm$core$Elm$JsArray$slice, 0, lastPos + 1, tree)); - } else { - return A3($elm$core$Elm$JsArray$slice, 0, lastPos, tree); - } - }); -var $elm$core$Array$sliceRight = F2( - function (end, array) { - var len = array.a; - var startShift = array.b; - var tree = array.c; - var tail = array.d; - if (_Utils_eq(end, len)) { - return array; - } else { - if (_Utils_cmp( - end, - $elm$core$Array$tailIndex(len)) > -1) { - return A4( - $elm$core$Array$Array_elm_builtin, - end, - startShift, - tree, - A3($elm$core$Elm$JsArray$slice, 0, $elm$core$Array$bitMask & end, tail)); - } else { - var endIdx = $elm$core$Array$tailIndex(end); - var depth = $elm$core$Basics$floor( - A2( - $elm$core$Basics$logBase, - $elm$core$Array$branchFactor, - A2($elm$core$Basics$max, 1, endIdx - 1))); - var newShift = A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep); - return A4( - $elm$core$Array$Array_elm_builtin, - end, - newShift, - A3( - $elm$core$Array$hoistTree, - startShift, - newShift, - A3($elm$core$Array$sliceTree, startShift, endIdx, tree)), - A4($elm$core$Array$fetchNewTail, startShift, end, endIdx, tree)); - } - } - }); -var $elm$core$Array$translateIndex = F2( - function (index, _v0) { - var len = _v0.a; - var posIndex = (index < 0) ? (len + index) : index; - return (posIndex < 0) ? 0 : ((_Utils_cmp(posIndex, len) > 0) ? len : posIndex); - }); -var $elm$core$Array$slice = F3( - function (from, to, array) { - var correctTo = A2($elm$core$Array$translateIndex, to, array); - var correctFrom = A2($elm$core$Array$translateIndex, from, array); - return (_Utils_cmp(correctFrom, correctTo) > 0) ? $elm$core$Array$empty : A2( - $elm$core$Array$sliceLeft, - correctFrom, - A2($elm$core$Array$sliceRight, correctTo, array)); - }); -var $elm$browser$Debugger$History$viewRecentSnapshots = F3( - function (selectedIndex, recentMessagesNum, snapshots) { - var messagesToFill = $elm$browser$Debugger$History$maxSnapshotSize - recentMessagesNum; - var arrayLength = $elm$core$Array$length(snapshots); - var snapshotsToRender = function () { - var _v0 = _Utils_Tuple2( - A2($elm$core$Array$get, arrayLength - 2, snapshots), - A2($elm$core$Array$get, arrayLength - 1, snapshots)); - if ((_v0.a.$ === 'Just') && (_v0.b.$ === 'Just')) { - var fillerSnapshot = _v0.a.a; - var recentSnapshot = _v0.b.a; - return $elm$core$Array$fromList( - _List_fromArray( - [ - { - messages: A3($elm$core$Array$slice, 0, messagesToFill, fillerSnapshot.messages), - model: fillerSnapshot.model - }, - recentSnapshot - ])); - } else { - return snapshots; - } - }(); - var startingIndex = ((arrayLength * $elm$browser$Debugger$History$maxSnapshotSize) - $elm$browser$Debugger$History$maxSnapshotSize) - messagesToFill; - return A3($elm$browser$Debugger$History$viewAllSnapshots, selectedIndex, startingIndex, snapshotsToRender); - }); -var $elm$browser$Debugger$History$view = F2( - function (maybeIndex, _v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var numMessages = _v0.numMessages; - var recentMessageStartIndex = numMessages - recent.numMessages; - var index = A2($elm$core$Maybe$withDefault, -1, maybeIndex); - var newStuff = A3( - $elm$html$Html$Keyed$node, - 'div', - _List_Nil, - A3( - $elm$core$List$foldr, - $elm$browser$Debugger$History$consMsg(index), - _Utils_Tuple2(recentMessageStartIndex, _List_Nil), - recent.messages).b); - var onlyRenderRecentMessages = (!_Utils_eq(index, -1)) || ($elm$core$Array$length(snapshots) < 2); - var oldStuff = onlyRenderRecentMessages ? A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewAllSnapshots, index, 0, snapshots) : A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewRecentSnapshots, index, recent.numMessages, snapshots); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-sidebar'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'overflow-y', 'auto'), - A2($elm$html$Html$Attributes$style, 'height', 'calc(100% - 72px)') - ]), - A2( - $elm$core$List$cons, - $elm$browser$Debugger$History$styles, - A2( - $elm$core$List$cons, - newStuff, - A2( - $elm$core$List$cons, - oldStuff, - onlyRenderRecentMessages ? _List_Nil : _List_fromArray( - [ - $elm$browser$Debugger$History$showMoreButton(numMessages) - ]))))); - }); -var $elm$browser$Debugger$Main$SwapLayout = {$: 'SwapLayout'}; -var $elm$browser$Debugger$Main$toHistoryIcon = function (layout) { - if (layout.$ === 'Horizontal') { - return 'M13 1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M13 3h-10a1 1 0 0 0-1 1v5h12v-5a1 1 0 0 0-1-1z M14 10h-12v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1z'; - } else { - return 'M0 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3z M2 4v8a1 1 0 0 0 1 1h2v-10h-2a1 1 0 0 0-1 1z M6 3v10h7a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1z'; - } -}; -var $elm$browser$Debugger$Main$icon = function (path) { - return A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'svg', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'viewBox', '0 0 16 16'), - A2($elm$virtual_dom$VirtualDom$attribute, 'xmlns', 'http://www.w3.org/2000/svg'), - A2($elm$virtual_dom$VirtualDom$attribute, 'fill', 'currentColor'), - A2($elm$virtual_dom$VirtualDom$attribute, 'width', '16px'), - A2($elm$virtual_dom$VirtualDom$attribute, 'height', '16px') - ]), - _List_fromArray( - [ - A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'path', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'd', path) - ]), - _List_Nil) - ])); -}; -var $elm$browser$Debugger$Main$viewHistoryButton = F3( - function (label, msg, path) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'background', 'none'), - A2($elm$html$Html$Attributes$style, 'border', 'none'), - A2($elm$html$Html$Attributes$style, 'color', 'inherit'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - $elm$html$Html$Events$onClick(msg) - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Main$icon(path), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', '6px') - ]), - _List_fromArray( - [ - $elm$html$Html$text(label) - ])) - ])); - }); -var $elm$browser$Debugger$Main$viewHistoryOptions = function (layout) { - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'space-between'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - _List_fromArray( - [ - A3( - $elm$browser$Debugger$Main$viewHistoryButton, - 'Swap Layout', - $elm$browser$Debugger$Main$SwapLayout, - $elm$browser$Debugger$Main$toHistoryIcon(layout)), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'space-between') - ]), - _List_fromArray( - [ - A3($elm$browser$Debugger$Main$viewHistoryButton, 'Import', $elm$browser$Debugger$Main$Import, 'M5 1a1 1 0 0 1 0 2h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1a1 1 0 0 1 2 0a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M10 2a1 1 0 0 0 -2 0v6a1 1 0 0 0 1 1h6a1 1 0 0 0 0-2h-3.586l4.293-4.293a1 1 0 0 0-1.414-1.414l-4.293 4.293z'), - A3($elm$browser$Debugger$Main$viewHistoryButton, 'Export', $elm$browser$Debugger$Main$Export, 'M5 1a1 1 0 0 1 0 2h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1 a1 1 0 0 1 2 0a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M9 3a1 1 0 1 1 0-2h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-3.586l-5.293 5.293 a1 1 0 0 1-1.414-1.414l5.293 -5.293z') - ])) - ])); -}; -var $elm$browser$Debugger$Main$SliderJump = function (a) { - return {$: 'SliderJump', a: a}; -}; -var $elm$core$Basics$composeR = F3( - function (f, g, x) { - return g( - f(x)); - }); -var $elm$html$Html$input = _VirtualDom_node('input'); -var $elm$browser$Debugger$Main$isPlaying = function (maybeIndex) { - if (maybeIndex.$ === 'Nothing') { - return true; - } else { - return false; - } -}; -var $elm$html$Html$Attributes$max = $elm$html$Html$Attributes$stringProperty('max'); -var $elm$html$Html$Attributes$min = $elm$html$Html$Attributes$stringProperty('min'); -var $elm$html$Html$Events$alwaysStop = function (x) { - return _Utils_Tuple2(x, true); -}; -var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { - return {$: 'MayStopPropagation', a: a}; -}; -var $elm$html$Html$Events$stopPropagationOn = F2( - function (event, decoder) { - return A2( - $elm$virtual_dom$VirtualDom$on, - event, - $elm$virtual_dom$VirtualDom$MayStopPropagation(decoder)); - }); -var $elm$json$Json$Decode$string = _Json_decodeString; -var $elm$html$Html$Events$targetValue = A2( - $elm$json$Json$Decode$at, - _List_fromArray( - ['target', 'value']), - $elm$json$Json$Decode$string); -var $elm$html$Html$Events$onInput = function (tagger) { - return A2( - $elm$html$Html$Events$stopPropagationOn, - 'input', - A2( - $elm$json$Json$Decode$map, - $elm$html$Html$Events$alwaysStop, - A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); -}; -var $elm$core$String$toInt = _String_toInt; -var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); -var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); -var $elm$browser$Debugger$Main$viewPlayButton = function (playing) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'background', '#1293D8'), - A2($elm$html$Html$Attributes$style, 'border', 'none'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($elm$html$Html$Attributes$style, 'width', '36px'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - $elm$html$Html$Events$onClick($elm$browser$Debugger$Main$Resume) - ]), - _List_fromArray( - [ - playing ? $elm$browser$Debugger$Main$icon('M2 2h4v12h-4v-12z M10 2h4v12h-4v-12z') : $elm$browser$Debugger$Main$icon('M2 2l12 7l-12 7z') - ])); -}; -var $elm$browser$Debugger$Main$viewHistorySlider = F2( - function (history, maybeIndex) { - var lastIndex = $elm$browser$Debugger$History$size(history) - 1; - var selectedIndex = A2($elm$core$Maybe$withDefault, lastIndex, maybeIndex); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$Lazy$lazy, - $elm$browser$Debugger$Main$viewPlayButton, - $elm$browser$Debugger$Main$isPlaying(maybeIndex)), - A2( - $elm$html$Html$input, - _List_fromArray( - [ - $elm$html$Html$Attributes$type_('range'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(100% - 56px)'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'margin', '0 10px'), - $elm$html$Html$Attributes$min('0'), - $elm$html$Html$Attributes$max( - $elm$core$String$fromInt(lastIndex)), - $elm$html$Html$Attributes$value( - $elm$core$String$fromInt(selectedIndex)), - $elm$html$Html$Events$onInput( - A2( - $elm$core$Basics$composeR, - $elm$core$String$toInt, - A2( - $elm$core$Basics$composeR, - $elm$core$Maybe$withDefault(lastIndex), - $elm$browser$Debugger$Main$SliderJump))) - ]), - _List_Nil) - ])); - }); -var $elm$browser$Debugger$Main$viewHistory = F3( - function (maybeIndex, history, layout) { - var block = $elm$browser$Debugger$Main$toMouseBlocker(layout); - var _v0 = $elm$browser$Debugger$Main$toHistoryPercents(layout); - var w = _v0.a; - var h = _v0.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'width', w), - A2($elm$html$Html$Attributes$style, 'height', h), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), - A2($elm$html$Html$Attributes$style, 'color', '#DDDDDD'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(61, 61, 61)'), - A2($elm$html$Html$Attributes$style, 'pointer-events', block), - A2($elm$html$Html$Attributes$style, 'user-select', block) - ]), - _List_fromArray( - [ - A2($elm$browser$Debugger$Main$viewHistorySlider, history, maybeIndex), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$Jump, - A2($elm$browser$Debugger$History$view, maybeIndex, history)), - A2($elm$html$Html$Lazy$lazy, $elm$browser$Debugger$Main$viewHistoryOptions, layout) - ])); - }); -var $elm$browser$Debugger$Main$popoutView = function (model) { - var maybeIndex = function () { - var _v0 = model.state; - if (_v0.$ === 'Running') { - return $elm$core$Maybe$Nothing; - } else { - var index = _v0.a; - return $elm$core$Maybe$Just(index); - } - }(); - var historyToRender = $elm$browser$Debugger$Main$cachedHistory(model); - return A3( - $elm$html$Html$node, - 'body', - _Utils_ap( - $elm$browser$Debugger$Main$toDragListeners(model.layout), - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin', '0'), - A2($elm$html$Html$Attributes$style, 'padding', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '100%'), - A2($elm$html$Html$Attributes$style, 'font-family', 'monospace'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2( - $elm$html$Html$Attributes$style, - 'flex-direction', - $elm$browser$Debugger$Main$toFlexDirection(model.layout)) - ])), - _List_fromArray( - [ - A3($elm$browser$Debugger$Main$viewHistory, maybeIndex, historyToRender, model.layout), - $elm$browser$Debugger$Main$viewDragZone(model.layout), - A3($elm$browser$Debugger$Main$viewExpando, model.expandoMsg, model.expandoModel, model.layout) - ])); -}; -var $elm$browser$Debugger$Overlay$BlockAll = {$: 'BlockAll'}; -var $elm$browser$Debugger$Overlay$toBlockerType = F2( - function (isPaused, state) { - switch (state.$) { - case 'None': - return isPaused ? $elm$browser$Debugger$Overlay$BlockAll : $elm$browser$Debugger$Overlay$BlockNone; - case 'BadMetadata': - return $elm$browser$Debugger$Overlay$BlockMost; - case 'BadImport': - return $elm$browser$Debugger$Overlay$BlockMost; - default: - return $elm$browser$Debugger$Overlay$BlockMost; - } - }); -var $elm$browser$Debugger$Main$toBlockerType = function (model) { - return A2( - $elm$browser$Debugger$Overlay$toBlockerType, - $elm$browser$Debugger$Main$isPaused(model.state), - model.overlay); -}; -var $elm$browser$Debugger$Main$Horizontal = F3( - function (a, b, c) { - return {$: 'Horizontal', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Main$Running = function (a) { - return {$: 'Running', a: a}; -}; -var $elm$browser$Debugger$Main$Static = {$: 'Static'}; -var $elm$browser$Debugger$Metadata$Error = F2( - function (message, problems) { - return {message: message, problems: problems}; - }); -var $elm$json$Json$Decode$decodeValue = _Json_run; -var $elm$browser$Debugger$Metadata$Metadata = F2( - function (versions, types) { - return {types: types, versions: versions}; - }); -var $elm$browser$Debugger$Metadata$Types = F3( - function (message, aliases, unions) { - return {aliases: aliases, message: message, unions: unions}; - }); -var $elm$browser$Debugger$Metadata$Alias = F2( - function (args, tipe) { - return {args: args, tipe: tipe}; - }); -var $elm$json$Json$Decode$list = _Json_decodeList; -var $elm$browser$Debugger$Metadata$decodeAlias = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Alias, - A2( - $elm$json$Json$Decode$field, - 'args', - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)), - A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); -var $elm$browser$Debugger$Metadata$Union = F2( - function (args, tags) { - return {args: args, tags: tags}; - }); -var $elm$core$Dict$fromList = function (assocs) { - return A3( - $elm$core$List$foldl, - F2( - function (_v0, dict) { - var key = _v0.a; - var value = _v0.b; - return A3($elm$core$Dict$insert, key, value, dict); - }), - $elm$core$Dict$empty, - assocs); -}; -var $elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs; -var $elm$json$Json$Decode$dict = function (decoder) { - return A2( - $elm$json$Json$Decode$map, - $elm$core$Dict$fromList, - $elm$json$Json$Decode$keyValuePairs(decoder)); -}; -var $elm$browser$Debugger$Metadata$decodeUnion = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Union, - A2( - $elm$json$Json$Decode$field, - 'args', - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)), - A2( - $elm$json$Json$Decode$field, - 'tags', - $elm$json$Json$Decode$dict( - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)))); -var $elm$json$Json$Decode$map3 = _Json_map3; -var $elm$browser$Debugger$Metadata$decodeTypes = A4( - $elm$json$Json$Decode$map3, - $elm$browser$Debugger$Metadata$Types, - A2($elm$json$Json$Decode$field, 'message', $elm$json$Json$Decode$string), - A2( - $elm$json$Json$Decode$field, - 'aliases', - $elm$json$Json$Decode$dict($elm$browser$Debugger$Metadata$decodeAlias)), - A2( - $elm$json$Json$Decode$field, - 'unions', - $elm$json$Json$Decode$dict($elm$browser$Debugger$Metadata$decodeUnion))); -var $elm$browser$Debugger$Metadata$Versions = function (elm) { - return {elm: elm}; -}; -var $elm$browser$Debugger$Metadata$decodeVersions = A2( - $elm$json$Json$Decode$map, - $elm$browser$Debugger$Metadata$Versions, - A2($elm$json$Json$Decode$field, 'elm', $elm$json$Json$Decode$string)); -var $elm$browser$Debugger$Metadata$decoder = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Metadata, - A2($elm$json$Json$Decode$field, 'versions', $elm$browser$Debugger$Metadata$decodeVersions), - A2($elm$json$Json$Decode$field, 'types', $elm$browser$Debugger$Metadata$decodeTypes)); -var $elm$browser$Debugger$Metadata$ProblemType = F2( - function (name, problems) { - return {name: name, problems: problems}; - }); -var $elm$core$List$maybeCons = F3( - function (f, mx, xs) { - var _v0 = f(mx); - if (_v0.$ === 'Just') { - var x = _v0.a; - return A2($elm$core$List$cons, x, xs); - } else { - return xs; - } - }); -var $elm$core$List$filterMap = F2( - function (f, xs) { - return A3( - $elm$core$List$foldr, - $elm$core$List$maybeCons(f), - _List_Nil, - xs); - }); -var $elm$core$String$contains = _String_contains; -var $elm$browser$Debugger$Metadata$hasProblem = F2( - function (tipe, _v0) { - var problem = _v0.a; - var token = _v0.b; - return A2($elm$core$String$contains, token, tipe) ? $elm$core$Maybe$Just(problem) : $elm$core$Maybe$Nothing; - }); -var $elm$browser$Debugger$Metadata$Decoder = {$: 'Decoder'}; -var $elm$browser$Debugger$Metadata$Function = {$: 'Function'}; -var $elm$browser$Debugger$Metadata$Process = {$: 'Process'}; -var $elm$browser$Debugger$Metadata$Program = {$: 'Program'}; -var $elm$browser$Debugger$Metadata$Request = {$: 'Request'}; -var $elm$browser$Debugger$Metadata$Socket = {$: 'Socket'}; -var $elm$browser$Debugger$Metadata$Task = {$: 'Task'}; -var $elm$browser$Debugger$Metadata$VirtualDom = {$: 'VirtualDom'}; -var $elm$browser$Debugger$Metadata$problemTable = _List_fromArray( - [ - _Utils_Tuple2($elm$browser$Debugger$Metadata$Function, '->'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Decoder, 'Json.Decode.Decoder'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Task, 'Task.Task'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Process, 'Process.Id'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Socket, 'WebSocket.LowLevel.WebSocket'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Request, 'Http.Request'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Program, 'Platform.Program'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$VirtualDom, 'VirtualDom.Node'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$VirtualDom, 'VirtualDom.Attribute') - ]); -var $elm$browser$Debugger$Metadata$findProblems = function (tipe) { - return A2( - $elm$core$List$filterMap, - $elm$browser$Debugger$Metadata$hasProblem(tipe), - $elm$browser$Debugger$Metadata$problemTable); -}; -var $elm$browser$Debugger$Metadata$collectBadAliases = F3( - function (name, _v0, list) { - var tipe = _v0.tipe; - var _v1 = $elm$browser$Debugger$Metadata$findProblems(tipe); - if (!_v1.b) { - return list; - } else { - var problems = _v1; - return A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Metadata$ProblemType, name, problems), - list); - } - }); -var $elm$core$List$append = F2( - function (xs, ys) { - if (!ys.b) { - return xs; - } else { - return A3($elm$core$List$foldr, $elm$core$List$cons, ys, xs); - } - }); -var $elm$core$List$concat = function (lists) { - return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); -}; -var $elm$core$List$concatMap = F2( - function (f, list) { - return $elm$core$List$concat( - A2($elm$core$List$map, f, list)); - }); -var $elm$core$Dict$values = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, valueList) { - return A2($elm$core$List$cons, value, valueList); - }), - _List_Nil, - dict); -}; -var $elm$browser$Debugger$Metadata$collectBadUnions = F3( - function (name, _v0, list) { - var tags = _v0.tags; - var _v1 = A2( - $elm$core$List$concatMap, - $elm$browser$Debugger$Metadata$findProblems, - $elm$core$List$concat( - $elm$core$Dict$values(tags))); - if (!_v1.b) { - return list; - } else { - var problems = _v1; - return A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Metadata$ProblemType, name, problems), - list); - } - }); -var $elm$core$Dict$foldl = F3( - function (func, acc, dict) { - foldl: - while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return acc; - } else { - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - var $temp$func = func, - $temp$acc = A3( - func, - key, - value, - A3($elm$core$Dict$foldl, func, acc, left)), - $temp$dict = right; - func = $temp$func; - acc = $temp$acc; - dict = $temp$dict; - continue foldl; - } - } - }); -var $elm$browser$Debugger$Metadata$isPortable = function (_v0) { - var types = _v0.types; - var badAliases = A3($elm$core$Dict$foldl, $elm$browser$Debugger$Metadata$collectBadAliases, _List_Nil, types.aliases); - var _v1 = A3($elm$core$Dict$foldl, $elm$browser$Debugger$Metadata$collectBadUnions, badAliases, types.unions); - if (!_v1.b) { - return $elm$core$Maybe$Nothing; - } else { - var problems = _v1; - return $elm$core$Maybe$Just( - A2($elm$browser$Debugger$Metadata$Error, types.message, problems)); - } -}; -var $elm$browser$Debugger$Metadata$decode = function (value) { - var _v0 = A2($elm$json$Json$Decode$decodeValue, $elm$browser$Debugger$Metadata$decoder, value); - if (_v0.$ === 'Err') { - return $elm$core$Result$Err( - A2($elm$browser$Debugger$Metadata$Error, 'The compiler is generating bad metadata. This is a compiler bug!', _List_Nil)); - } else { - var metadata = _v0.a; - var _v1 = $elm$browser$Debugger$Metadata$isPortable(metadata); - if (_v1.$ === 'Nothing') { - return $elm$core$Result$Ok(metadata); - } else { - var error = _v1.a; - return $elm$core$Result$Err(error); - } - } -}; -var $elm$browser$Debugger$History$History = F3( - function (snapshots, recent, numMessages) { - return {numMessages: numMessages, recent: recent, snapshots: snapshots}; - }); -var $elm$browser$Debugger$History$RecentHistory = F3( - function (model, messages, numMessages) { - return {messages: messages, model: model, numMessages: numMessages}; - }); -var $elm$browser$Debugger$History$empty = function (model) { - return A3( - $elm$browser$Debugger$History$History, - $elm$core$Array$empty, - A3($elm$browser$Debugger$History$RecentHistory, model, _List_Nil, 0), - 0); -}; -var $elm$core$Dict$map = F2( - function (func, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Dict$RBEmpty_elm_builtin; - } else { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - A2(func, key, value), - A2($elm$core$Dict$map, func, left), - A2($elm$core$Dict$map, func, right)); - } - }); -var $elm$core$Dict$sizeHelp = F2( - function (n, dict) { - sizeHelp: - while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return n; - } else { - var left = dict.d; - var right = dict.e; - var $temp$n = A2($elm$core$Dict$sizeHelp, n + 1, right), - $temp$dict = left; - n = $temp$n; - dict = $temp$dict; - continue sizeHelp; - } - } - }); -var $elm$core$Dict$size = function (dict) { - return A2($elm$core$Dict$sizeHelp, 0, dict); -}; -var $elm$browser$Debugger$Expando$initHelp = F2( - function (isOuter, expando) { - switch (expando.$) { - case 'S': - return expando; - case 'Primitive': - return expando; - case 'Sequence': - var seqType = expando.a; - var isClosed = expando.b; - var items = expando.c; - return isOuter ? A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - false, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$initHelp(false), - items)) : (($elm$core$List$length(items) <= 8) ? A3($elm$browser$Debugger$Expando$Sequence, seqType, false, items) : expando); - case 'Dictionary': - var isClosed = expando.a; - var keyValuePairs = expando.b; - return isOuter ? A2( - $elm$browser$Debugger$Expando$Dictionary, - false, - A2( - $elm$core$List$map, - function (_v1) { - var k = _v1.a; - var v = _v1.b; - return _Utils_Tuple2( - k, - A2($elm$browser$Debugger$Expando$initHelp, false, v)); - }, - keyValuePairs)) : (($elm$core$List$length(keyValuePairs) <= 8) ? A2($elm$browser$Debugger$Expando$Dictionary, false, keyValuePairs) : expando); - case 'Record': - var isClosed = expando.a; - var entries = expando.b; - return isOuter ? A2( - $elm$browser$Debugger$Expando$Record, - false, - A2( - $elm$core$Dict$map, - F2( - function (_v2, v) { - return A2($elm$browser$Debugger$Expando$initHelp, false, v); - }), - entries)) : (($elm$core$Dict$size(entries) <= 4) ? A2($elm$browser$Debugger$Expando$Record, false, entries) : expando); - default: - var maybeName = expando.a; - var isClosed = expando.b; - var args = expando.c; - return isOuter ? A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - false, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$initHelp(false), - args)) : (($elm$core$List$length(args) <= 4) ? A3($elm$browser$Debugger$Expando$Constructor, maybeName, false, args) : expando); - } - }); -var $elm$browser$Debugger$Expando$init = function (value) { - return A2( - $elm$browser$Debugger$Expando$initHelp, - true, - _Debugger_init(value)); -}; -var $elm$core$Platform$Cmd$map = _Platform_map; -var $elm$browser$Debugger$Overlay$None = {$: 'None'}; -var $elm$browser$Debugger$Overlay$none = $elm$browser$Debugger$Overlay$None; -var $elm$browser$Debugger$Main$wrapInit = F4( - function (metadata, popout, init, flags) { - var _v0 = init(flags); - var userModel = _v0.a; - var userCommands = _v0.b; - return _Utils_Tuple2( - { - expandoModel: $elm$browser$Debugger$Expando$init(userModel), - expandoMsg: $elm$browser$Debugger$Expando$init(_Utils_Tuple0), - history: $elm$browser$Debugger$History$empty(userModel), - layout: A3($elm$browser$Debugger$Main$Horizontal, $elm$browser$Debugger$Main$Static, 0.3, 0.5), - metadata: $elm$browser$Debugger$Metadata$decode(metadata), - overlay: $elm$browser$Debugger$Overlay$none, - popout: popout, - state: $elm$browser$Debugger$Main$Running(userModel) - }, - A2($elm$core$Platform$Cmd$map, $elm$browser$Debugger$Main$UserMsg, userCommands)); - }); -var $elm$browser$Debugger$Main$getLatestModel = function (state) { - if (state.$ === 'Running') { - var model = state.a; - return model; - } else { - var model = state.c; - return model; - } -}; -var $elm$core$Platform$Sub$map = _Platform_map; -var $elm$browser$Debugger$Main$wrapSubs = F2( - function (subscriptions, model) { - return A2( - $elm$core$Platform$Sub$map, - $elm$browser$Debugger$Main$UserMsg, - subscriptions( - $elm$browser$Debugger$Main$getLatestModel(model.state))); - }); -var $elm$browser$Debugger$Main$Moving = {$: 'Moving'}; -var $elm$browser$Debugger$Main$Paused = F5( - function (a, b, c, d, e) { - return {$: 'Paused', a: a, b: b, c: c, d: d, e: e}; - }); -var $elm$browser$Debugger$History$Snapshot = F2( - function (model, messages) { - return {messages: messages, model: model}; - }); -var $elm$browser$Debugger$History$addRecent = F3( - function (msg, newModel, _v0) { - var model = _v0.model; - var messages = _v0.messages; - var numMessages = _v0.numMessages; - return _Utils_eq(numMessages, $elm$browser$Debugger$History$maxSnapshotSize) ? _Utils_Tuple2( - $elm$core$Maybe$Just( - A2( - $elm$browser$Debugger$History$Snapshot, - model, - $elm$core$Array$fromList(messages))), - A3( - $elm$browser$Debugger$History$RecentHistory, - newModel, - _List_fromArray( - [msg]), - 1)) : _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A3( - $elm$browser$Debugger$History$RecentHistory, - model, - A2($elm$core$List$cons, msg, messages), - numMessages + 1)); - }); -var $elm$core$Elm$JsArray$push = _JsArray_push; -var $elm$core$Elm$JsArray$singleton = _JsArray_singleton; -var $elm$core$Array$insertTailInTree = F4( - function (shift, index, tail, tree) { - var pos = $elm$core$Array$bitMask & (index >>> shift); - if (_Utils_cmp( - pos, - $elm$core$Elm$JsArray$length(tree)) > -1) { - if (shift === 5) { - return A2( - $elm$core$Elm$JsArray$push, - $elm$core$Array$Leaf(tail), - tree); - } else { - var newSub = $elm$core$Array$SubTree( - A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, $elm$core$Elm$JsArray$empty)); - return A2($elm$core$Elm$JsArray$push, newSub, tree); - } - } else { - var value = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (value.$ === 'SubTree') { - var subTree = value.a; - var newSub = $elm$core$Array$SubTree( - A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, subTree)); - return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); - } else { - var newSub = $elm$core$Array$SubTree( - A4( - $elm$core$Array$insertTailInTree, - shift - $elm$core$Array$shiftStep, - index, - tail, - $elm$core$Elm$JsArray$singleton(value))); - return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); - } - } - }); -var $elm$core$Array$unsafeReplaceTail = F2( - function (newTail, _v0) { - var len = _v0.a; - var startShift = _v0.b; - var tree = _v0.c; - var tail = _v0.d; - var originalTailLen = $elm$core$Elm$JsArray$length(tail); - var newTailLen = $elm$core$Elm$JsArray$length(newTail); - var newArrayLen = len + (newTailLen - originalTailLen); - if (_Utils_eq(newTailLen, $elm$core$Array$branchFactor)) { - var overflow = _Utils_cmp(newArrayLen >>> $elm$core$Array$shiftStep, 1 << startShift) > 0; - if (overflow) { - var newShift = startShift + $elm$core$Array$shiftStep; - var newTree = A4( - $elm$core$Array$insertTailInTree, - newShift, - len, - newTail, - $elm$core$Elm$JsArray$singleton( - $elm$core$Array$SubTree(tree))); - return A4($elm$core$Array$Array_elm_builtin, newArrayLen, newShift, newTree, $elm$core$Elm$JsArray$empty); - } else { - return A4( - $elm$core$Array$Array_elm_builtin, - newArrayLen, - startShift, - A4($elm$core$Array$insertTailInTree, startShift, len, newTail, tree), - $elm$core$Elm$JsArray$empty); - } - } else { - return A4($elm$core$Array$Array_elm_builtin, newArrayLen, startShift, tree, newTail); - } - }); -var $elm$core$Array$push = F2( - function (a, array) { - var tail = array.d; - return A2( - $elm$core$Array$unsafeReplaceTail, - A2($elm$core$Elm$JsArray$push, a, tail), - array); - }); -var $elm$browser$Debugger$History$add = F3( - function (msg, model, _v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var numMessages = _v0.numMessages; - var _v1 = A3($elm$browser$Debugger$History$addRecent, msg, model, recent); - if (_v1.a.$ === 'Just') { - var snapshot = _v1.a.a; - var newRecent = _v1.b; - return A3( - $elm$browser$Debugger$History$History, - A2($elm$core$Array$push, snapshot, snapshots), - newRecent, - numMessages + 1); - } else { - var _v2 = _v1.a; - var newRecent = _v1.b; - return A3($elm$browser$Debugger$History$History, snapshots, newRecent, numMessages + 1); - } - }); -var $elm$core$Basics$always = F2( - function (a, _v0) { - return a; - }); -var $elm$browser$Debugger$Overlay$BadImport = function (a) { - return {$: 'BadImport', a: a}; -}; -var $elm$browser$Debugger$Overlay$RiskyImport = F2( - function (a, b) { - return {$: 'RiskyImport', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$VersionChanged = F2( - function (a, b) { - return {$: 'VersionChanged', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$MessageChanged = F2( - function (a, b) { - return {$: 'MessageChanged', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$SomethingChanged = function (a) { - return {$: 'SomethingChanged', a: a}; -}; -var $elm$browser$Debugger$Report$AliasChange = function (a) { - return {$: 'AliasChange', a: a}; -}; -var $elm$browser$Debugger$Metadata$checkAlias = F4( - function (name, old, _new, changes) { - return (_Utils_eq(old.tipe, _new.tipe) && _Utils_eq(old.args, _new.args)) ? changes : A2( - $elm$core$List$cons, - $elm$browser$Debugger$Report$AliasChange(name), - changes); - }); -var $elm$browser$Debugger$Report$UnionChange = F2( - function (a, b) { - return {$: 'UnionChange', a: a, b: b}; - }); -var $elm$browser$Debugger$Metadata$addTag = F3( - function (tag, _v0, changes) { - return _Utils_update( - changes, - { - added: A2($elm$core$List$cons, tag, changes.added) - }); - }); -var $elm$browser$Debugger$Metadata$checkTag = F4( - function (tag, old, _new, changes) { - return _Utils_eq(old, _new) ? changes : _Utils_update( - changes, - { - changed: A2($elm$core$List$cons, tag, changes.changed) - }); - }); -var $elm$browser$Debugger$Report$TagChanges = F4( - function (removed, changed, added, argsMatch) { - return {added: added, argsMatch: argsMatch, changed: changed, removed: removed}; - }); -var $elm$browser$Debugger$Report$emptyTagChanges = function (argsMatch) { - return A4($elm$browser$Debugger$Report$TagChanges, _List_Nil, _List_Nil, _List_Nil, argsMatch); -}; -var $elm$browser$Debugger$Report$hasTagChanges = function (tagChanges) { - return _Utils_eq( - tagChanges, - A4($elm$browser$Debugger$Report$TagChanges, _List_Nil, _List_Nil, _List_Nil, true)); -}; -var $elm$core$Dict$merge = F6( - function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { - var stepState = F3( - function (rKey, rValue, _v0) { - stepState: - while (true) { - var list = _v0.a; - var result = _v0.b; - if (!list.b) { - return _Utils_Tuple2( - list, - A3(rightStep, rKey, rValue, result)); - } else { - var _v2 = list.a; - var lKey = _v2.a; - var lValue = _v2.b; - var rest = list.b; - if (_Utils_cmp(lKey, rKey) < 0) { - var $temp$rKey = rKey, - $temp$rValue = rValue, - $temp$_v0 = _Utils_Tuple2( - rest, - A3(leftStep, lKey, lValue, result)); - rKey = $temp$rKey; - rValue = $temp$rValue; - _v0 = $temp$_v0; - continue stepState; - } else { - if (_Utils_cmp(lKey, rKey) > 0) { - return _Utils_Tuple2( - list, - A3(rightStep, rKey, rValue, result)); - } else { - return _Utils_Tuple2( - rest, - A4(bothStep, lKey, lValue, rValue, result)); - } - } - } - } - }); - var _v3 = A3( - $elm$core$Dict$foldl, - stepState, - _Utils_Tuple2( - $elm$core$Dict$toList(leftDict), - initialResult), - rightDict); - var leftovers = _v3.a; - var intermediateResult = _v3.b; - return A3( - $elm$core$List$foldl, - F2( - function (_v4, result) { - var k = _v4.a; - var v = _v4.b; - return A3(leftStep, k, v, result); - }), - intermediateResult, - leftovers); - }); -var $elm$browser$Debugger$Metadata$removeTag = F3( - function (tag, _v0, changes) { - return _Utils_update( - changes, - { - removed: A2($elm$core$List$cons, tag, changes.removed) - }); - }); -var $elm$browser$Debugger$Metadata$checkUnion = F4( - function (name, old, _new, changes) { - var tagChanges = A6( - $elm$core$Dict$merge, - $elm$browser$Debugger$Metadata$removeTag, - $elm$browser$Debugger$Metadata$checkTag, - $elm$browser$Debugger$Metadata$addTag, - old.tags, - _new.tags, - $elm$browser$Debugger$Report$emptyTagChanges( - _Utils_eq(old.args, _new.args))); - return $elm$browser$Debugger$Report$hasTagChanges(tagChanges) ? changes : A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Report$UnionChange, name, tagChanges), - changes); - }); -var $elm$browser$Debugger$Metadata$ignore = F3( - function (key, value, report) { - return report; - }); -var $elm$browser$Debugger$Metadata$checkTypes = F2( - function (old, _new) { - return (!_Utils_eq(old.message, _new.message)) ? A2($elm$browser$Debugger$Report$MessageChanged, old.message, _new.message) : $elm$browser$Debugger$Report$SomethingChanged( - A6( - $elm$core$Dict$merge, - $elm$browser$Debugger$Metadata$ignore, - $elm$browser$Debugger$Metadata$checkUnion, - $elm$browser$Debugger$Metadata$ignore, - old.unions, - _new.unions, - A6($elm$core$Dict$merge, $elm$browser$Debugger$Metadata$ignore, $elm$browser$Debugger$Metadata$checkAlias, $elm$browser$Debugger$Metadata$ignore, old.aliases, _new.aliases, _List_Nil))); - }); -var $elm$browser$Debugger$Metadata$check = F2( - function (old, _new) { - return (!_Utils_eq(old.versions.elm, _new.versions.elm)) ? A2($elm$browser$Debugger$Report$VersionChanged, old.versions.elm, _new.versions.elm) : A2($elm$browser$Debugger$Metadata$checkTypes, old.types, _new.types); - }); -var $elm$browser$Debugger$Report$CorruptHistory = {$: 'CorruptHistory'}; -var $elm$browser$Debugger$Overlay$corruptImport = $elm$browser$Debugger$Overlay$BadImport($elm$browser$Debugger$Report$CorruptHistory); -var $elm$json$Json$Decode$decodeString = _Json_runOnString; -var $elm$browser$Debugger$Report$Fine = {$: 'Fine'}; -var $elm$browser$Debugger$Report$Impossible = {$: 'Impossible'}; -var $elm$browser$Debugger$Report$Risky = {$: 'Risky'}; -var $elm$core$Basics$not = _Basics_not; -var $elm$core$List$isEmpty = function (xs) { - if (!xs.b) { - return true; - } else { - return false; - } -}; -var $elm$browser$Debugger$Report$some = function (list) { - return !$elm$core$List$isEmpty(list); -}; -var $elm$browser$Debugger$Report$evaluateChange = function (change) { - if (change.$ === 'AliasChange') { - return $elm$browser$Debugger$Report$Impossible; - } else { - var removed = change.b.removed; - var changed = change.b.changed; - var added = change.b.added; - var argsMatch = change.b.argsMatch; - return ((!argsMatch) || ($elm$browser$Debugger$Report$some(changed) || $elm$browser$Debugger$Report$some(removed))) ? $elm$browser$Debugger$Report$Impossible : ($elm$browser$Debugger$Report$some(added) ? $elm$browser$Debugger$Report$Risky : $elm$browser$Debugger$Report$Fine); - } -}; -var $elm$browser$Debugger$Report$worstCase = F2( - function (status, statusList) { - worstCase: - while (true) { - if (!statusList.b) { - return status; - } else { - switch (statusList.a.$) { - case 'Impossible': - var _v1 = statusList.a; - return $elm$browser$Debugger$Report$Impossible; - case 'Risky': - var _v2 = statusList.a; - var rest = statusList.b; - var $temp$status = $elm$browser$Debugger$Report$Risky, - $temp$statusList = rest; - status = $temp$status; - statusList = $temp$statusList; - continue worstCase; - default: - var _v3 = statusList.a; - var rest = statusList.b; - var $temp$status = status, - $temp$statusList = rest; - status = $temp$status; - statusList = $temp$statusList; - continue worstCase; - } - } - } - }); -var $elm$browser$Debugger$Report$evaluate = function (report) { - switch (report.$) { - case 'CorruptHistory': - return $elm$browser$Debugger$Report$Impossible; - case 'VersionChanged': - return $elm$browser$Debugger$Report$Impossible; - case 'MessageChanged': - return $elm$browser$Debugger$Report$Impossible; - default: - var changes = report.a; - return A2( - $elm$browser$Debugger$Report$worstCase, - $elm$browser$Debugger$Report$Fine, - A2($elm$core$List$map, $elm$browser$Debugger$Report$evaluateChange, changes)); - } -}; -var $elm$json$Json$Decode$value = _Json_decodeValue; -var $elm$browser$Debugger$Overlay$uploadDecoder = A3( - $elm$json$Json$Decode$map2, - F2( - function (x, y) { - return _Utils_Tuple2(x, y); - }), - A2($elm$json$Json$Decode$field, 'metadata', $elm$browser$Debugger$Metadata$decoder), - A2($elm$json$Json$Decode$field, 'history', $elm$json$Json$Decode$value)); -var $elm$browser$Debugger$Overlay$assessImport = F2( - function (metadata, jsonString) { - var _v0 = A2($elm$json$Json$Decode$decodeString, $elm$browser$Debugger$Overlay$uploadDecoder, jsonString); - if (_v0.$ === 'Err') { - return $elm$core$Result$Err($elm$browser$Debugger$Overlay$corruptImport); - } else { - var _v1 = _v0.a; - var foreignMetadata = _v1.a; - var rawHistory = _v1.b; - var report = A2($elm$browser$Debugger$Metadata$check, foreignMetadata, metadata); - var _v2 = $elm$browser$Debugger$Report$evaluate(report); - switch (_v2.$) { - case 'Impossible': - return $elm$core$Result$Err( - $elm$browser$Debugger$Overlay$BadImport(report)); - case 'Risky': - return $elm$core$Result$Err( - A2($elm$browser$Debugger$Overlay$RiskyImport, report, rawHistory)); - default: - return $elm$core$Result$Ok(rawHistory); - } - } - }); -var $elm$core$Platform$Cmd$batch = _Platform_batch; -var $elm$browser$Debugger$Overlay$close = F2( - function (msg, state) { - switch (state.$) { - case 'None': - return $elm$core$Maybe$Nothing; - case 'BadMetadata': - return $elm$core$Maybe$Nothing; - case 'BadImport': - return $elm$core$Maybe$Nothing; - default: - var rawHistory = state.b; - if (msg.$ === 'Cancel') { - return $elm$core$Maybe$Nothing; - } else { - return $elm$core$Maybe$Just(rawHistory); - } - } - }); -var $elm$browser$Debugger$History$elmToJs = A2($elm$core$Basics$composeR, _Json_wrap, _Debugger_unsafeCoerce); -var $elm$browser$Debugger$History$encodeHelp = F2( - function (snapshot, allMessages) { - return A3($elm$core$Array$foldl, $elm$core$List$cons, allMessages, snapshot.messages); - }); -var $elm$json$Json$Encode$list = F2( - function (func, entries) { - return _Json_wrap( - A3( - $elm$core$List$foldl, - _Json_addEntry(func), - _Json_emptyArray(_Utils_Tuple0), - entries)); - }); -var $elm$browser$Debugger$History$encode = function (_v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - return A2( - $elm$json$Json$Encode$list, - $elm$browser$Debugger$History$elmToJs, - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$encodeHelp, - $elm$core$List$reverse(recent.messages), - snapshots)); -}; -var $elm$json$Json$Encode$object = function (pairs) { - return _Json_wrap( - A3( - $elm$core$List$foldl, - F2( - function (_v0, obj) { - var k = _v0.a; - var v = _v0.b; - return A3(_Json_addField, k, v, obj); - }), - _Json_emptyObject(_Utils_Tuple0), - pairs)); -}; -var $elm$browser$Debugger$Metadata$encodeAlias = function (_v0) { - var args = _v0.args; - var tipe = _v0.tipe; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'args', - A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, args)), - _Utils_Tuple2( - 'type', - $elm$json$Json$Encode$string(tipe)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeDict = F2( - function (f, dict) { - return $elm$json$Json$Encode$object( - $elm$core$Dict$toList( - A2( - $elm$core$Dict$map, - F2( - function (key, value) { - return f(value); - }), - dict))); - }); -var $elm$browser$Debugger$Metadata$encodeUnion = function (_v0) { - var args = _v0.args; - var tags = _v0.tags; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'args', - A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, args)), - _Utils_Tuple2( - 'tags', - A2( - $elm$browser$Debugger$Metadata$encodeDict, - $elm$json$Json$Encode$list($elm$json$Json$Encode$string), - tags)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeTypes = function (_v0) { - var message = _v0.message; - var unions = _v0.unions; - var aliases = _v0.aliases; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'message', - $elm$json$Json$Encode$string(message)), - _Utils_Tuple2( - 'aliases', - A2($elm$browser$Debugger$Metadata$encodeDict, $elm$browser$Debugger$Metadata$encodeAlias, aliases)), - _Utils_Tuple2( - 'unions', - A2($elm$browser$Debugger$Metadata$encodeDict, $elm$browser$Debugger$Metadata$encodeUnion, unions)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeVersions = function (_v0) { - var elm = _v0.elm; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'elm', - $elm$json$Json$Encode$string(elm)) - ])); -}; -var $elm$browser$Debugger$Metadata$encode = function (_v0) { - var versions = _v0.versions; - var types = _v0.types; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'versions', - $elm$browser$Debugger$Metadata$encodeVersions(versions)), - _Utils_Tuple2( - 'types', - $elm$browser$Debugger$Metadata$encodeTypes(types)) - ])); -}; -var $elm$core$Basics$identity = function (x) { - return x; -}; -var $elm$core$Task$Perform = function (a) { - return {$: 'Perform', a: a}; -}; -var $elm$core$Task$succeed = _Scheduler_succeed; -var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0); -var $elm$core$Task$andThen = _Scheduler_andThen; -var $elm$core$Task$map = F2( - function (func, taskA) { - return A2( - $elm$core$Task$andThen, - function (a) { - return $elm$core$Task$succeed( - func(a)); - }, - taskA); - }); -var $elm$core$Task$map2 = F3( - function (func, taskA, taskB) { - return A2( - $elm$core$Task$andThen, - function (a) { - return A2( - $elm$core$Task$andThen, - function (b) { - return $elm$core$Task$succeed( - A2(func, a, b)); - }, - taskB); - }, - taskA); - }); -var $elm$core$Task$sequence = function (tasks) { - return A3( - $elm$core$List$foldr, - $elm$core$Task$map2($elm$core$List$cons), - $elm$core$Task$succeed(_List_Nil), - tasks); -}; -var $elm$core$Platform$sendToApp = _Platform_sendToApp; -var $elm$core$Task$spawnCmd = F2( - function (router, _v0) { - var task = _v0.a; - return _Scheduler_spawn( - A2( - $elm$core$Task$andThen, - $elm$core$Platform$sendToApp(router), - task)); - }); -var $elm$core$Task$onEffects = F3( - function (router, commands, state) { - return A2( - $elm$core$Task$map, - function (_v0) { - return _Utils_Tuple0; - }, - $elm$core$Task$sequence( - A2( - $elm$core$List$map, - $elm$core$Task$spawnCmd(router), - commands))); - }); -var $elm$core$Task$onSelfMsg = F3( - function (_v0, _v1, _v2) { - return $elm$core$Task$succeed(_Utils_Tuple0); - }); -var $elm$core$Task$cmdMap = F2( - function (tagger, _v0) { - var task = _v0.a; - return $elm$core$Task$Perform( - A2($elm$core$Task$map, tagger, task)); - }); -_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); -var $elm$core$Task$command = _Platform_leaf('Task'); -var $elm$core$Task$perform = F2( - function (toMessage, task) { - return $elm$core$Task$command( - $elm$core$Task$Perform( - A2($elm$core$Task$map, toMessage, task))); - }); -var $elm$browser$Debugger$Main$download = F2( - function (metadata, history) { - var historyLength = $elm$browser$Debugger$History$size(history); - return A2( - $elm$core$Task$perform, - function (_v0) { - return $elm$browser$Debugger$Main$NoOp; - }, - A2( - _Debugger_download, - historyLength, - _Json_unwrap( - $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'metadata', - $elm$browser$Debugger$Metadata$encode(metadata)), - _Utils_Tuple2( - 'history', - $elm$browser$Debugger$History$encode(history)) - ]))))); - }); -var $elm$browser$Debugger$Main$Vertical = F3( - function (a, b, c) { - return {$: 'Vertical', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Main$drag = F2( - function (info, layout) { - if (layout.$ === 'Horizontal') { - var status = layout.a; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, status, info.x / info.width, y); - } else { - var status = layout.a; - var x = layout.b; - return A3($elm$browser$Debugger$Main$Vertical, status, x, info.y / info.height); - } - }); -var $elm$browser$Debugger$History$Stepping = F2( - function (a, b) { - return {$: 'Stepping', a: a, b: b}; - }); -var $elm$browser$Debugger$History$Done = F2( - function (a, b) { - return {$: 'Done', a: a, b: b}; - }); -var $elm$browser$Debugger$History$getHelp = F3( - function (update, msg, getResult) { - if (getResult.$ === 'Done') { - return getResult; - } else { - var n = getResult.a; - var model = getResult.b; - return (!n) ? A2( - $elm$browser$Debugger$History$Done, - msg, - A2(update, msg, model).a) : A2( - $elm$browser$Debugger$History$Stepping, - n - 1, - A2(update, msg, model).a); - } - }); -var $elm$browser$Debugger$History$undone = function (getResult) { - undone: - while (true) { - if (getResult.$ === 'Done') { - var msg = getResult.a; - var model = getResult.b; - return _Utils_Tuple2(model, msg); - } else { - var $temp$getResult = getResult; - getResult = $temp$getResult; - continue undone; - } - } -}; -var $elm$browser$Debugger$History$get = F3( - function (update, index, history) { - get: - while (true) { - var recent = history.recent; - var snapshotMax = history.numMessages - recent.numMessages; - if (_Utils_cmp(index, snapshotMax) > -1) { - return $elm$browser$Debugger$History$undone( - A3( - $elm$core$List$foldr, - $elm$browser$Debugger$History$getHelp(update), - A2($elm$browser$Debugger$History$Stepping, index - snapshotMax, recent.model), - recent.messages)); - } else { - var _v0 = A2($elm$core$Array$get, (index / $elm$browser$Debugger$History$maxSnapshotSize) | 0, history.snapshots); - if (_v0.$ === 'Nothing') { - var $temp$update = update, - $temp$index = index, - $temp$history = history; - update = $temp$update; - index = $temp$index; - history = $temp$history; - continue get; - } else { - var model = _v0.a.model; - var messages = _v0.a.messages; - return $elm$browser$Debugger$History$undone( - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$getHelp(update), - A2($elm$browser$Debugger$History$Stepping, index % $elm$browser$Debugger$History$maxSnapshotSize, model), - messages)); - } - } - } - }); -var $elm$browser$Debugger$History$getRecentMsg = function (history) { - getRecentMsg: - while (true) { - var _v0 = history.recent.messages; - if (!_v0.b) { - var $temp$history = history; - history = $temp$history; - continue getRecentMsg; - } else { - var first = _v0.a; - return first; - } - } -}; -var $elm$core$Dict$get = F2( - function (targetKey, dict) { - get: + return a >>> offset; +}); +var $elm$core$Basics$EQ = 1; +var $elm$core$Basics$GT = 2; +var $elm$core$Basics$LT = 0; +var $elm$core$List$cons = _List_cons; +var $elm$core$Dict$foldr = F3( + function (func, acc, t) { + foldr: while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Maybe$Nothing; + if (t.$ === -2) { + return acc; } else { - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1.$) { - case 'LT': - var $temp$targetKey = targetKey, - $temp$dict = left; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - case 'EQ': - return $elm$core$Maybe$Just(value); - default: - var $temp$targetKey = targetKey, - $temp$dict = right; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - } - } - } - }); -var $elm$browser$Debugger$Expando$mergeDictHelp = F3( - function (oldDict, key, value) { - var _v12 = A2($elm$core$Dict$get, key, oldDict); - if (_v12.$ === 'Nothing') { - return value; - } else { - var oldValue = _v12.a; - return A2($elm$browser$Debugger$Expando$mergeHelp, oldValue, value); - } - }); -var $elm$browser$Debugger$Expando$mergeHelp = F2( - function (old, _new) { - var _v3 = _Utils_Tuple2(old, _new); - _v3$6: - while (true) { - switch (_v3.b.$) { - case 'S': - return _new; - case 'Primitive': - return _new; - case 'Sequence': - if (_v3.a.$ === 'Sequence') { - var _v4 = _v3.a; - var isClosed = _v4.b; - var oldValues = _v4.c; - var _v5 = _v3.b; - var seqType = _v5.a; - var newValues = _v5.c; - return A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - isClosed, - A2($elm$browser$Debugger$Expando$mergeListHelp, oldValues, newValues)); - } else { - break _v3$6; - } - case 'Dictionary': - if (_v3.a.$ === 'Dictionary') { - var _v6 = _v3.a; - var isClosed = _v6.a; - var _v7 = _v3.b; - var keyValuePairs = _v7.b; - return A2($elm$browser$Debugger$Expando$Dictionary, isClosed, keyValuePairs); - } else { - break _v3$6; - } - case 'Record': - if (_v3.a.$ === 'Record') { - var _v8 = _v3.a; - var isClosed = _v8.a; - var oldDict = _v8.b; - var _v9 = _v3.b; - var newDict = _v9.b; - return A2( - $elm$browser$Debugger$Expando$Record, - isClosed, - A2( - $elm$core$Dict$map, - $elm$browser$Debugger$Expando$mergeDictHelp(oldDict), - newDict)); - } else { - break _v3$6; - } - default: - if (_v3.a.$ === 'Constructor') { - var _v10 = _v3.a; - var isClosed = _v10.b; - var oldValues = _v10.c; - var _v11 = _v3.b; - var maybeName = _v11.a; - var newValues = _v11.c; - return A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - isClosed, - A2($elm$browser$Debugger$Expando$mergeListHelp, oldValues, newValues)); - } else { - break _v3$6; - } + var key = t.b; + var value = t.c; + var left = t.d; + var right = t.e; + var $temp$func = func, + $temp$acc = A3( + func, + key, + value, + A3($elm$core$Dict$foldr, func, acc, right)), + $temp$t = left; + func = $temp$func; + acc = $temp$acc; + t = $temp$t; + continue foldr; } } - return _new; }); -var $elm$browser$Debugger$Expando$mergeListHelp = F2( - function (olds, news) { - var _v0 = _Utils_Tuple2(olds, news); - if (!_v0.a.b) { - return news; - } else { - if (!_v0.b.b) { - return news; - } else { - var _v1 = _v0.a; - var x = _v1.a; - var xs = _v1.b; - var _v2 = _v0.b; - var y = _v2.a; - var ys = _v2.b; +var $elm$core$Dict$toList = function (dict) { + return A3( + $elm$core$Dict$foldr, + F3( + function (key, value, list) { return A2( $elm$core$List$cons, - A2($elm$browser$Debugger$Expando$mergeHelp, x, y), - A2($elm$browser$Debugger$Expando$mergeListHelp, xs, ys)); - } - } - }); -var $elm$browser$Debugger$Expando$merge = F2( - function (value, expando) { - return A2( - $elm$browser$Debugger$Expando$mergeHelp, - expando, - _Debugger_init(value)); - }); -var $elm$browser$Debugger$Main$jumpUpdate = F3( - function (update, index, model) { - var history = $elm$browser$Debugger$Main$cachedHistory(model); - var currentMsg = $elm$browser$Debugger$History$getRecentMsg(history); - var currentModel = $elm$browser$Debugger$Main$getLatestModel(model.state); - var _v0 = A3($elm$browser$Debugger$History$get, update, index, history); - var indexModel = _v0.a; - var indexMsg = _v0.b; - return _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, indexModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, indexMsg, model.expandoMsg), - state: A5($elm$browser$Debugger$Main$Paused, index, indexModel, currentModel, currentMsg, history) - }); - }); -var $elm$browser$Debugger$History$jsToElm = A2($elm$core$Basics$composeR, _Json_unwrap, _Debugger_unsafeCoerce); -var $elm$browser$Debugger$History$decoder = F2( - function (initialModel, update) { - var addMessage = F2( - function (rawMsg, _v0) { - var model = _v0.a; - var history = _v0.b; - var msg = $elm$browser$Debugger$History$jsToElm(rawMsg); - return _Utils_Tuple2( - A2(update, msg, model), - A3($elm$browser$Debugger$History$add, msg, model, history)); - }); - var updateModel = function (rawMsgs) { - return A3( - $elm$core$List$foldl, - addMessage, - _Utils_Tuple2( - initialModel, - $elm$browser$Debugger$History$empty(initialModel)), - rawMsgs); - }; - return A2( - $elm$json$Json$Decode$map, - updateModel, - $elm$json$Json$Decode$list($elm$json$Json$Decode$value)); - }); -var $elm$browser$Debugger$History$getInitialModel = function (_v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var _v1 = A2($elm$core$Array$get, 0, snapshots); - if (_v1.$ === 'Just') { - var model = _v1.a.model; - return model; - } else { - return recent.model; - } + _Utils_Tuple2(key, value), + list); + }), + _List_Nil, + dict); }; -var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); -var $elm$browser$Debugger$Main$loadNewHistory = F3( - function (rawHistory, update, model) { - var pureUserUpdate = F2( - function (msg, userModel) { - return A2(update, msg, userModel).a; +var $elm$core$Dict$keys = function (dict) { + return A3( + $elm$core$Dict$foldr, + F3( + function (key, value, keyList) { + return A2($elm$core$List$cons, key, keyList); + }), + _List_Nil, + dict); +}; +var $elm$core$Set$toList = function (_v0) { + var dict = _v0; + return $elm$core$Dict$keys(dict); +}; +var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; +var $elm$core$Array$foldr = F3( + function (func, baseCase, _v0) { + var tree = _v0.c; + var tail = _v0.d; + var helper = F2( + function (node, acc) { + if (!node.$) { + var subTree = node.a; + return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); + } else { + var values = node.a; + return A3($elm$core$Elm$JsArray$foldr, func, acc, values); + } }); - var initialUserModel = $elm$browser$Debugger$History$getInitialModel(model.history); - var decoder = A2($elm$browser$Debugger$History$decoder, initialUserModel, pureUserUpdate); - var _v0 = A2($elm$json$Json$Decode$decodeValue, decoder, rawHistory); - if (_v0.$ === 'Err') { - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: $elm$browser$Debugger$Overlay$corruptImport}), - $elm$core$Platform$Cmd$none); - } else { - var _v1 = _v0.a; - var latestUserModel = _v1.a; - var newHistory = _v1.b; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: $elm$browser$Debugger$Expando$init(latestUserModel), - expandoMsg: $elm$browser$Debugger$Expando$init( - $elm$browser$Debugger$History$getRecentMsg(newHistory)), - history: newHistory, - overlay: $elm$browser$Debugger$Overlay$none, - state: $elm$browser$Debugger$Main$Running(latestUserModel) - }), - $elm$core$Platform$Cmd$none); - } + return A3( + $elm$core$Elm$JsArray$foldr, + helper, + A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail), + tree); }); -var $elm$browser$Debugger$Main$scroll = function (popout) { - return A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - _Debugger_scroll(popout)); +var $elm$core$Array$toList = function (array) { + return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); }; -var $elm$browser$Debugger$Main$scrollTo = F2( - function (id, popout) { - return A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - A2(_Debugger_scrollTo, id, popout)); +var $elm$core$Result$Err = function (a) { + return {$: 1, a: a}; +}; +var $elm$json$Json$Decode$Failure = F2( + function (a, b) { + return {$: 3, a: a, b: b}; }); -var $elm$browser$Debugger$Main$setDragStatus = F2( - function (status, layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, status, x, y); - } else { - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Vertical, status, x, y); - } +var $elm$json$Json$Decode$Field = F2( + function (a, b) { + return {$: 0, a: a, b: b}; }); -var $elm$browser$Debugger$Main$swapLayout = function (layout) { - if (layout.$ === 'Horizontal') { - var s = layout.a; - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Vertical, s, x, y); - } else { - var s = layout.a; - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, s, x, y); - } -}; -var $elm$core$Dict$getMin = function (dict) { - getMin: - while (true) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { - var left = dict.d; - var $temp$dict = left; - dict = $temp$dict; - continue getMin; - } else { - return dict; - } - } +var $elm$json$Json$Decode$Index = F2( + function (a, b) { + return {$: 1, a: a, b: b}; + }); +var $elm$core$Result$Ok = function (a) { + return {$: 0, a: a}; }; -var $elm$core$Dict$moveRedLeft = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.e.d.$ === 'RBNode_elm_builtin') && (dict.e.d.a.$ === 'Red')) { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v1 = dict.d; - var lClr = _v1.a; - var lK = _v1.b; - var lV = _v1.c; - var lLeft = _v1.d; - var lRight = _v1.e; - var _v2 = dict.e; - var rClr = _v2.a; - var rK = _v2.b; - var rV = _v2.c; - var rLeft = _v2.d; - var _v3 = rLeft.a; - var rlK = rLeft.b; - var rlV = rLeft.c; - var rlL = rLeft.d; - var rlR = rLeft.e; - var rRight = _v2.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - rlK, - rlV, - A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - rlL), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rlR, rRight)); - } else { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v4 = dict.d; - var lClr = _v4.a; - var lK = _v4.b; - var lV = _v4.c; - var lLeft = _v4.d; - var lRight = _v4.e; - var _v5 = dict.e; - var rClr = _v5.a; - var rK = _v5.b; - var rV = _v5.c; - var rLeft = _v5.d; - var rRight = _v5.e; - if (clr.$ === 'Black') { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } - } - } else { - return dict; - } +var $elm$json$Json$Decode$OneOf = function (a) { + return {$: 2, a: a}; }; -var $elm$core$Dict$moveRedRight = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.d.d.$ === 'RBNode_elm_builtin') && (dict.d.d.a.$ === 'Red')) { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v1 = dict.d; - var lClr = _v1.a; - var lK = _v1.b; - var lV = _v1.c; - var _v2 = _v1.d; - var _v3 = _v2.a; - var llK = _v2.b; - var llV = _v2.c; - var llLeft = _v2.d; - var llRight = _v2.e; - var lRight = _v1.e; - var _v4 = dict.e; - var rClr = _v4.a; - var rK = _v4.b; - var rV = _v4.c; - var rLeft = _v4.d; - var rRight = _v4.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - lK, - lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - lRight, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight))); - } else { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v5 = dict.d; - var lClr = _v5.a; - var lK = _v5.b; - var lV = _v5.c; - var lLeft = _v5.d; - var lRight = _v5.e; - var _v6 = dict.e; - var rClr = _v6.a; - var rK = _v6.b; - var rV = _v6.c; - var rLeft = _v6.d; - var rRight = _v6.e; - if (clr.$ === 'Black') { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } - } - } else { - return dict; - } +var $elm$core$Basics$False = 1; +var $elm$core$Basics$add = _Basics_add; +var $elm$core$Maybe$Just = function (a) { + return {$: 0, a: a}; }; -var $elm$core$Dict$removeHelpPrepEQGT = F7( - function (targetKey, dict, color, key, value, left, right) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { - var _v1 = left.a; - var lK = left.b; - var lV = left.c; - var lLeft = left.d; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - lK, - lV, - lLeft, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, lRight, right)); - } else { - _v2$2: - while (true) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Black')) { - if (right.d.$ === 'RBNode_elm_builtin') { - if (right.d.a.$ === 'Black') { - var _v3 = right.a; - var _v4 = right.d; - var _v5 = _v4.a; - return $elm$core$Dict$moveRedRight(dict); - } else { - break _v2$2; - } - } else { - var _v6 = right.a; - var _v7 = right.d; - return $elm$core$Dict$moveRedRight(dict); - } - } else { - break _v2$2; - } - } - return dict; - } +var $elm$core$Maybe$Nothing = {$: 1}; +var $elm$core$String$all = _String_all; +var $elm$core$Basics$and = _Basics_and; +var $elm$core$Basics$append = _Utils_append; +var $elm$json$Json$Encode$encode = _Json_encode; +var $elm$core$String$fromInt = _String_fromNumber; +var $elm$core$String$join = F2( + function (sep, chunks) { + return A2( + _String_join, + sep, + _List_toArray(chunks)); }); -var $elm$core$Dict$removeMin = function (dict) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var lColor = left.a; - var lLeft = left.d; - var right = dict.e; - if (lColor.$ === 'Black') { - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { - var _v3 = lLeft.a; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - $elm$core$Dict$removeMin(left), - right); - } else { - var _v4 = $elm$core$Dict$moveRedLeft(dict); - if (_v4.$ === 'RBNode_elm_builtin') { - var nColor = _v4.a; - var nKey = _v4.b; - var nValue = _v4.c; - var nLeft = _v4.d; - var nRight = _v4.e; - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - $elm$core$Dict$removeMin(nLeft), - nRight); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - } - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - $elm$core$Dict$removeMin(left), - right); - } - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } +var $elm$core$String$split = F2( + function (sep, string) { + return _List_fromArray( + A2(_String_split, sep, string)); + }); +var $elm$json$Json$Decode$indent = function (str) { + return A2( + $elm$core$String$join, + '\n ', + A2($elm$core$String$split, '\n', str)); }; -var $elm$core$Dict$removeHelp = F2( - function (targetKey, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Dict$RBEmpty_elm_builtin; - } else { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - if (_Utils_cmp(targetKey, key) < 0) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Black')) { - var _v4 = left.a; - var lLeft = left.d; - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { - var _v6 = lLeft.a; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - A2($elm$core$Dict$removeHelp, targetKey, left), - right); - } else { - var _v7 = $elm$core$Dict$moveRedLeft(dict); - if (_v7.$ === 'RBNode_elm_builtin') { - var nColor = _v7.a; - var nKey = _v7.b; - var nValue = _v7.c; - var nLeft = _v7.d; - var nRight = _v7.e; - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - A2($elm$core$Dict$removeHelp, targetKey, nLeft), - nRight); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - } - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - A2($elm$core$Dict$removeHelp, targetKey, left), - right); - } +var $elm$core$List$foldl = F3( + function (func, acc, list) { + foldl: + while (true) { + if (!list.b) { + return acc; } else { - return A2( - $elm$core$Dict$removeHelpEQGT, - targetKey, - A7($elm$core$Dict$removeHelpPrepEQGT, targetKey, dict, color, key, value, left, right)); + var x = list.a; + var xs = list.b; + var $temp$func = func, + $temp$acc = A2(func, x, acc), + $temp$list = xs; + func = $temp$func; + acc = $temp$acc; + list = $temp$list; + continue foldl; } } }); -var $elm$core$Dict$removeHelpEQGT = F2( - function (targetKey, dict) { - if (dict.$ === 'RBNode_elm_builtin') { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - if (_Utils_eq(targetKey, key)) { - var _v1 = $elm$core$Dict$getMin(right); - if (_v1.$ === 'RBNode_elm_builtin') { - var minKey = _v1.b; - var minValue = _v1.c; - return A5( - $elm$core$Dict$balance, - color, - minKey, - minValue, - left, - $elm$core$Dict$removeMin(right)); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } +var $elm$core$List$length = function (xs) { + return A3( + $elm$core$List$foldl, + F2( + function (_v0, i) { + return i + 1; + }), + 0, + xs); +}; +var $elm$core$List$map2 = _List_map2; +var $elm$core$Basics$le = _Utils_le; +var $elm$core$Basics$sub = _Basics_sub; +var $elm$core$List$rangeHelp = F3( + function (lo, hi, list) { + rangeHelp: + while (true) { + if (_Utils_cmp(lo, hi) < 1) { + var $temp$lo = lo, + $temp$hi = hi - 1, + $temp$list = A2($elm$core$List$cons, hi, list); + lo = $temp$lo; + hi = $temp$hi; + list = $temp$list; + continue rangeHelp; } else { - return A5( - $elm$core$Dict$balance, - color, - key, - value, - left, - A2($elm$core$Dict$removeHelp, targetKey, right)); + return list; } - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - }); -var $elm$core$Dict$remove = F2( - function (key, dict) { - var _v0 = A2($elm$core$Dict$removeHelp, key, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { - var _v1 = _v0.a; - var k = _v0.b; - var v = _v0.c; - var l = _v0.d; - var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); - } else { - var x = _v0; - return x; - } - }); -var $elm$core$Dict$update = F3( - function (targetKey, alter, dictionary) { - var _v0 = alter( - A2($elm$core$Dict$get, targetKey, dictionary)); - if (_v0.$ === 'Just') { - var value = _v0.a; - return A3($elm$core$Dict$insert, targetKey, value, dictionary); - } else { - return A2($elm$core$Dict$remove, targetKey, dictionary); - } - }); -var $elm$browser$Debugger$Expando$updateIndex = F3( - function (n, func, list) { - if (!list.b) { - return _List_Nil; - } else { - var x = list.a; - var xs = list.b; - return (n <= 0) ? A2( - $elm$core$List$cons, - func(x), - xs) : A2( - $elm$core$List$cons, - x, - A3($elm$browser$Debugger$Expando$updateIndex, n - 1, func, xs)); } }); -var $elm$browser$Debugger$Expando$update = F2( - function (msg, value) { - switch (value.$) { - case 'S': - return value; - case 'Primitive': - return value; - case 'Sequence': - var seqType = value.a; - var isClosed = value.b; - var valueList = value.c; - switch (msg.$) { - case 'Toggle': - return A3($elm$browser$Debugger$Expando$Sequence, seqType, !isClosed, valueList); - case 'Index': - if (msg.a.$ === 'None') { - var _v3 = msg.a; - var index = msg.b; - var subMsg = msg.c; - return A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - $elm$browser$Debugger$Expando$update(subMsg), - valueList)); - } else { - return value; - } - default: - return value; - } - case 'Dictionary': - var isClosed = value.a; - var keyValuePairs = value.b; - switch (msg.$) { - case 'Toggle': - return A2($elm$browser$Debugger$Expando$Dictionary, !isClosed, keyValuePairs); - case 'Index': - var redirect = msg.a; - var index = msg.b; - var subMsg = msg.c; - switch (redirect.$) { - case 'None': - return value; - case 'Key': - return A2( - $elm$browser$Debugger$Expando$Dictionary, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - function (_v6) { - var k = _v6.a; - var v = _v6.b; - return _Utils_Tuple2( - A2($elm$browser$Debugger$Expando$update, subMsg, k), - v); - }, - keyValuePairs)); - default: - return A2( - $elm$browser$Debugger$Expando$Dictionary, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - function (_v7) { - var k = _v7.a; - var v = _v7.b; - return _Utils_Tuple2( - k, - A2($elm$browser$Debugger$Expando$update, subMsg, v)); - }, - keyValuePairs)); - } - default: - return value; - } - case 'Record': - var isClosed = value.a; - var valueDict = value.b; - switch (msg.$) { - case 'Toggle': - return A2($elm$browser$Debugger$Expando$Record, !isClosed, valueDict); - case 'Index': - return value; - default: - var field = msg.a; - var subMsg = msg.b; - return A2( - $elm$browser$Debugger$Expando$Record, - isClosed, - A3( - $elm$core$Dict$update, - field, - $elm$browser$Debugger$Expando$updateField(subMsg), - valueDict)); - } - default: - var maybeName = value.a; - var isClosed = value.b; - var valueList = value.c; - switch (msg.$) { - case 'Toggle': - return A3($elm$browser$Debugger$Expando$Constructor, maybeName, !isClosed, valueList); - case 'Index': - if (msg.a.$ === 'None') { - var _v10 = msg.a; - var index = msg.b; - var subMsg = msg.c; - return A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - $elm$browser$Debugger$Expando$update(subMsg), - valueList)); - } else { - return value; - } - default: - return value; - } - } +var $elm$core$List$range = F2( + function (lo, hi) { + return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil); }); -var $elm$browser$Debugger$Expando$updateField = F2( - function (msg, maybeExpando) { - if (maybeExpando.$ === 'Nothing') { - return maybeExpando; - } else { - var expando = maybeExpando.a; - return $elm$core$Maybe$Just( - A2($elm$browser$Debugger$Expando$update, msg, expando)); - } +var $elm$core$List$indexedMap = F2( + function (f, xs) { + return A3( + $elm$core$List$map2, + f, + A2( + $elm$core$List$range, + 0, + $elm$core$List$length(xs) - 1), + xs); }); -var $elm$browser$Debugger$Main$Upload = function (a) { - return {$: 'Upload', a: a}; +var $elm$core$Char$toCode = _Char_toCode; +var $elm$core$Char$isLower = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (97 <= code) && (code <= 122); +}; +var $elm$core$Char$isUpper = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (code <= 90) && (65 <= code); +}; +var $elm$core$Basics$or = _Basics_or; +var $elm$core$Char$isAlpha = function (_char) { + return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); +}; +var $elm$core$Char$isDigit = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (code <= 57) && (48 <= code); }; -var $elm$browser$Debugger$Main$upload = function (popout) { - return A2( - $elm$core$Task$perform, - $elm$browser$Debugger$Main$Upload, - _Debugger_upload(popout)); +var $elm$core$Char$isAlphaNum = function (_char) { + return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); }; -var $elm$browser$Debugger$Overlay$BadMetadata = function (a) { - return {$: 'BadMetadata', a: a}; +var $elm$core$List$reverse = function (list) { + return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); }; -var $elm$browser$Debugger$Overlay$badMetadata = $elm$browser$Debugger$Overlay$BadMetadata; -var $elm$browser$Debugger$Main$withGoodMetadata = F2( - function (model, func) { - var _v0 = model.metadata; - if (_v0.$ === 'Ok') { - var metadata = _v0.a; - return func(metadata); - } else { - var error = _v0.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - overlay: $elm$browser$Debugger$Overlay$badMetadata(error) - }), - $elm$core$Platform$Cmd$none); - } +var $elm$core$String$uncons = _String_uncons; +var $elm$json$Json$Decode$errorOneOf = F2( + function (i, error) { + return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent( + $elm$json$Json$Decode$errorToString(error)))); }); -var $elm$browser$Debugger$Main$wrapUpdate = F3( - function (update, msg, model) { - wrapUpdate: +var $elm$json$Json$Decode$errorToString = function (error) { + return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); +}; +var $elm$json$Json$Decode$errorToStringHelp = F2( + function (error, context) { + errorToStringHelp: while (true) { - switch (msg.$) { - case 'NoOp': - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'UserMsg': - var userMsg = msg.a; - var userModel = $elm$browser$Debugger$Main$getLatestModel(model.state); - var newHistory = A3($elm$browser$Debugger$History$add, userMsg, userModel, model.history); - var _v1 = A2(update, userMsg, userModel); - var newUserModel = _v1.a; - var userCmds = _v1.b; - var commands = A2($elm$core$Platform$Cmd$map, $elm$browser$Debugger$Main$UserMsg, userCmds); - var _v2 = model.state; - if (_v2.$ === 'Running') { - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, newUserModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, userMsg, model.expandoMsg), - history: newHistory, - state: $elm$browser$Debugger$Main$Running(newUserModel) - }), - $elm$core$Platform$Cmd$batch( - _List_fromArray( - [ - commands, - $elm$browser$Debugger$Main$scroll(model.popout) - ]))); - } else { - var index = _v2.a; - var indexModel = _v2.b; - var history = _v2.e; - return _Utils_Tuple2( - _Utils_update( - model, - { - history: newHistory, - state: A5($elm$browser$Debugger$Main$Paused, index, indexModel, newUserModel, userMsg, history) - }), - commands); - } - case 'TweakExpandoMsg': - var eMsg = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoMsg: A2($elm$browser$Debugger$Expando$update, eMsg, model.expandoMsg) - }), - $elm$core$Platform$Cmd$none); - case 'TweakExpandoModel': - var eMsg = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$update, eMsg, model.expandoModel) - }), - $elm$core$Platform$Cmd$none); - case 'Resume': - var _v3 = model.state; - if (_v3.$ === 'Running') { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } else { - var userModel = _v3.c; - var userMsg = _v3.d; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, userModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, userMsg, model.expandoMsg), - state: $elm$browser$Debugger$Main$Running(userModel) - }), - $elm$browser$Debugger$Main$scroll(model.popout)); - } - case 'Jump': - var index = msg.a; - return _Utils_Tuple2( - A3($elm$browser$Debugger$Main$jumpUpdate, update, index, model), - $elm$core$Platform$Cmd$none); - case 'SliderJump': - var index = msg.a; - return _Utils_Tuple2( - A3($elm$browser$Debugger$Main$jumpUpdate, update, index, model), - A2( - $elm$browser$Debugger$Main$scrollTo, - $elm$browser$Debugger$History$idForMessageIndex(index), - model.popout)); - case 'Open': - return _Utils_Tuple2( - model, - A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - _Debugger_open(model.popout))); - case 'Up': - var _v4 = model.state; - if (_v4.$ === 'Running') { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } else { - var i = _v4.a; - var history = _v4.e; - var targetIndex = i + 1; - if (_Utils_cmp( - targetIndex, - $elm$browser$Debugger$History$size(history)) < 0) { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$SliderJump(targetIndex), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } else { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$Resume, - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } - } - case 'Down': - var _v5 = model.state; - if (_v5.$ === 'Running') { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$Jump( - $elm$browser$Debugger$History$size(model.history) - 1), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } else { - var index = _v5.a; - if (index > 0) { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$SliderJump(index - 1), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; + switch (error.$) { + case 0: + var f = error.a; + var err = error.b; + var isSimple = function () { + var _v1 = $elm$core$String$uncons(f); + if (_v1.$ === 1) { + return false; } else { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + var _v2 = _v1.a; + var _char = _v2.a; + var rest = _v2.b; + return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest); } - } - case 'Import': - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (_v6) { - return _Utils_Tuple2( - model, - $elm$browser$Debugger$Main$upload(model.popout)); - }); - case 'Export': - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (metadata) { - return _Utils_Tuple2( - model, - A2($elm$browser$Debugger$Main$download, metadata, model.history)); - }); - case 'Upload': - var jsonString = msg.a; - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (metadata) { - var _v7 = A2($elm$browser$Debugger$Overlay$assessImport, metadata, jsonString); - if (_v7.$ === 'Err') { - var newOverlay = _v7.a; - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: newOverlay}), - $elm$core$Platform$Cmd$none); + }(); + var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']')); + var $temp$error = err, + $temp$context = A2($elm$core$List$cons, fieldName, context); + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + case 1: + var i = error.a; + var err = error.b; + var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); + var $temp$error = err, + $temp$context = A2($elm$core$List$cons, indexName, context); + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + case 2: + var errors = error.a; + if (!errors.b) { + return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { + if (!context.b) { + return '!'; } else { - var rawHistory = _v7.a; - return A3($elm$browser$Debugger$Main$loadNewHistory, rawHistory, update, model); + return ' at json' + A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)); } - }); - case 'OverlayMsg': - var overlayMsg = msg.a; - var _v8 = A2($elm$browser$Debugger$Overlay$close, overlayMsg, model.overlay); - if (_v8.$ === 'Nothing') { - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: $elm$browser$Debugger$Overlay$none}), - $elm$core$Platform$Cmd$none); + }(); } else { - var rawHistory = _v8.a; - return A3($elm$browser$Debugger$Main$loadNewHistory, rawHistory, update, model); + if (!errors.b.b) { + var err = errors.a; + var $temp$error = err, + $temp$context = context; + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + } else { + var starter = function () { + if (!context.b) { + return 'Json.Decode.oneOf'; + } else { + return 'The Json.Decode.oneOf at json' + A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)); + } + }(); + var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt( + $elm$core$List$length(errors)) + ' ways:')); + return A2( + $elm$core$String$join, + '\n\n', + A2( + $elm$core$List$cons, + introduction, + A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors))); + } } - case 'SwapLayout': - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: $elm$browser$Debugger$Main$swapLayout(model.layout) - }), - $elm$core$Platform$Cmd$none); - case 'DragStart': - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$setDragStatus, $elm$browser$Debugger$Main$Moving, model.layout) - }), - $elm$core$Platform$Cmd$none); - case 'Drag': - var info = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$drag, info, model.layout) - }), - $elm$core$Platform$Cmd$none); default: - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$setDragStatus, $elm$browser$Debugger$Main$Static, model.layout) - }), - $elm$core$Platform$Cmd$none); + var msg = error.a; + var json = error.b; + var introduction = function () { + if (!context.b) { + return 'Problem with the given value:\n\n'; + } else { + return 'Problem with the value at json' + (A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)) + ':\n\n '); + } + }(); + return introduction + ($elm$json$Json$Decode$indent( + A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg)); + } + } + }); +var $elm$core$Array$branchFactor = 32; +var $elm$core$Array$Array_elm_builtin = F4( + function (a, b, c, d) { + return {$: 0, a: a, b: b, c: c, d: d}; + }); +var $elm$core$Elm$JsArray$empty = _JsArray_empty; +var $elm$core$Basics$ceiling = _Basics_ceiling; +var $elm$core$Basics$fdiv = _Basics_fdiv; +var $elm$core$Basics$logBase = F2( + function (base, number) { + return _Basics_log(number) / _Basics_log(base); + }); +var $elm$core$Basics$toFloat = _Basics_toFloat; +var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( + A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor)); +var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty); +var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; +var $elm$core$Array$Leaf = function (a) { + return {$: 1, a: a}; +}; +var $elm$core$Basics$apL = F2( + function (f, x) { + return f(x); + }); +var $elm$core$Basics$apR = F2( + function (x, f) { + return f(x); + }); +var $elm$core$Basics$eq = _Utils_equal; +var $elm$core$Basics$floor = _Basics_floor; +var $elm$core$Elm$JsArray$length = _JsArray_length; +var $elm$core$Basics$gt = _Utils_gt; +var $elm$core$Basics$max = F2( + function (x, y) { + return (_Utils_cmp(x, y) > 0) ? x : y; + }); +var $elm$core$Basics$mul = _Basics_mul; +var $elm$core$Array$SubTree = function (a) { + return {$: 0, a: a}; +}; +var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; +var $elm$core$Array$compressNodes = F2( + function (nodes, acc) { + compressNodes: + while (true) { + var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes); + var node = _v0.a; + var remainingNodes = _v0.b; + var newAcc = A2( + $elm$core$List$cons, + $elm$core$Array$SubTree(node), + acc); + if (!remainingNodes.b) { + return $elm$core$List$reverse(newAcc); + } else { + var $temp$nodes = remainingNodes, + $temp$acc = newAcc; + nodes = $temp$nodes; + acc = $temp$acc; + continue compressNodes; + } + } + }); +var $elm$core$Tuple$first = function (_v0) { + var x = _v0.a; + return x; +}; +var $elm$core$Array$treeFromBuilder = F2( + function (nodeList, nodeListSize) { + treeFromBuilder: + while (true) { + var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor); + if (newNodeSize === 1) { + return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a; + } else { + var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil), + $temp$nodeListSize = newNodeSize; + nodeList = $temp$nodeList; + nodeListSize = $temp$nodeListSize; + continue treeFromBuilder; + } + } + }); +var $elm$core$Array$builderToArray = F2( + function (reverseNodeList, builder) { + if (!builder.s) { + return A4( + $elm$core$Array$Array_elm_builtin, + $elm$core$Elm$JsArray$length(builder.x), + $elm$core$Array$shiftStep, + $elm$core$Elm$JsArray$empty, + builder.x); + } else { + var treeLen = builder.s * $elm$core$Array$branchFactor; + var depth = $elm$core$Basics$floor( + A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.y) : builder.y; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.s); + return A4( + $elm$core$Array$Array_elm_builtin, + $elm$core$Elm$JsArray$length(builder.x) + treeLen, + A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), + tree, + builder.x); + } + }); +var $elm$core$Basics$idiv = _Basics_idiv; +var $elm$core$Basics$lt = _Utils_lt; +var $elm$core$Array$initializeHelp = F5( + function (fn, fromIndex, len, nodeList, tail) { + initializeHelp: + while (true) { + if (fromIndex < 0) { + return A2( + $elm$core$Array$builderToArray, + false, + {y: nodeList, s: (len / $elm$core$Array$branchFactor) | 0, x: tail}); + } else { + var leaf = $elm$core$Array$Leaf( + A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); + var $temp$fn = fn, + $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor, + $temp$len = len, + $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList), + $temp$tail = tail; + fn = $temp$fn; + fromIndex = $temp$fromIndex; + len = $temp$len; + nodeList = $temp$nodeList; + tail = $temp$tail; + continue initializeHelp; } } }); +var $elm$core$Basics$remainderBy = _Basics_remainderBy; +var $elm$core$Array$initialize = F2( + function (len, fn) { + if (len <= 0) { + return $elm$core$Array$empty; + } else { + var tailLen = len % $elm$core$Array$branchFactor; + var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn); + var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor; + return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); + } + }); +var $elm$core$Basics$True = 0; +var $elm$core$Result$isOk = function (result) { + if (!result.$) { + return true; + } else { + return false; + } +}; +var $elm$json$Json$Decode$map = _Json_map1; +var $elm$json$Json$Decode$map2 = _Json_map2; +var $elm$json$Json$Decode$succeed = _Json_succeed; +var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { + switch (handler.$) { + case 0: + return 0; + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } +}; var $elm$browser$Browser$External = function (a) { - return {$: 'External', a: a}; + return {$: 1, a: a}; }; var $elm$browser$Browser$Internal = function (a) { - return {$: 'Internal', a: a}; + return {$: 0, a: a}; }; -var $elm$browser$Browser$Dom$NotFound = function (a) { - return {$: 'NotFound', a: a}; +var $elm$core$Basics$identity = function (x) { + return x; }; -var $elm$url$Url$Http = {$: 'Http'}; -var $elm$url$Url$Https = {$: 'Https'}; +var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; +var $elm$url$Url$Http = 0; +var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query}; + return {bX: fragment, b1: host, z: path, cw: port_, cC: protocol, cD: query}; }); +var $elm$core$String$contains = _String_contains; +var $elm$core$String$length = _String_length; +var $elm$core$String$slice = _String_slice; var $elm$core$String$dropLeft = F2( function (n, string) { return (n < 1) ? string : A3( @@ -10449,6 +4936,11 @@ var $elm$core$String$indexes = _String_indexes; var $elm$core$String$isEmpty = function (string) { return string === ''; }; +var $elm$core$String$left = F2( + function (n, string) { + return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string); + }); +var $elm$core$String$toInt = _String_toInt; var $elm$url$Url$chompBeforePath = F5( function (protocol, path, params, frag, str) { if ($elm$core$String$isEmpty(str) || A2($elm$core$String$contains, '@', str)) { @@ -10463,7 +4955,7 @@ var $elm$url$Url$chompBeforePath = F5( var i = _v0.a; var _v1 = $elm$core$String$toInt( A2($elm$core$String$dropLeft, i + 1, str)); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return $elm$core$Maybe$Nothing; } else { var port_ = _v1; @@ -10542,46 +5034,196 @@ var $elm$url$Url$chompAfterProtocol = F2( } } }); -var $elm$core$String$startsWith = _String_startsWith; -var $elm$url$Url$fromString = function (str) { - return A2($elm$core$String$startsWith, 'http://', str) ? A2( - $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Http, - A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( - $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Https, - A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); -}; -var $elm$core$Basics$never = function (_v0) { - never: - while (true) { - var nvr = _v0.a; - var $temp$_v0 = nvr; - _v0 = $temp$_v0; - continue never; - } -}; +var $elm$core$String$startsWith = _String_startsWith; +var $elm$url$Url$fromString = function (str) { + return A2($elm$core$String$startsWith, 'http://', str) ? A2( + $elm$url$Url$chompAfterProtocol, + 0, + A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( + $elm$url$Url$chompAfterProtocol, + 1, + A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); +}; +var $elm$core$Basics$never = function (_v0) { + never: + while (true) { + var nvr = _v0; + var $temp$_v0 = nvr; + _v0 = $temp$_v0; + continue never; + } +}; +var $elm$core$Task$Perform = $elm$core$Basics$identity; +var $elm$core$Task$succeed = _Scheduler_succeed; +var $elm$core$Task$init = $elm$core$Task$succeed(0); +var $elm$core$List$foldrHelper = F4( + function (fn, acc, ctr, ls) { + if (!ls.b) { + return acc; + } else { + var a = ls.a; + var r1 = ls.b; + if (!r1.b) { + return A2(fn, a, acc); + } else { + var b = r1.a; + var r2 = r1.b; + if (!r2.b) { + return A2( + fn, + a, + A2(fn, b, acc)); + } else { + var c = r2.a; + var r3 = r2.b; + if (!r3.b) { + return A2( + fn, + a, + A2( + fn, + b, + A2(fn, c, acc))); + } else { + var d = r3.a; + var r4 = r3.b; + var res = (ctr > 500) ? A3( + $elm$core$List$foldl, + fn, + acc, + $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4); + return A2( + fn, + a, + A2( + fn, + b, + A2( + fn, + c, + A2(fn, d, res)))); + } + } + } + } + }); +var $elm$core$List$foldr = F3( + function (fn, acc, ls) { + return A4($elm$core$List$foldrHelper, fn, acc, 0, ls); + }); +var $elm$core$List$map = F2( + function (f, xs) { + return A3( + $elm$core$List$foldr, + F2( + function (x, acc) { + return A2( + $elm$core$List$cons, + f(x), + acc); + }), + _List_Nil, + xs); + }); +var $elm$core$Task$andThen = _Scheduler_andThen; +var $elm$core$Task$map = F2( + function (func, taskA) { + return A2( + $elm$core$Task$andThen, + function (a) { + return $elm$core$Task$succeed( + func(a)); + }, + taskA); + }); +var $elm$core$Task$map2 = F3( + function (func, taskA, taskB) { + return A2( + $elm$core$Task$andThen, + function (a) { + return A2( + $elm$core$Task$andThen, + function (b) { + return $elm$core$Task$succeed( + A2(func, a, b)); + }, + taskB); + }, + taskA); + }); +var $elm$core$Task$sequence = function (tasks) { + return A3( + $elm$core$List$foldr, + $elm$core$Task$map2($elm$core$List$cons), + $elm$core$Task$succeed(_List_Nil), + tasks); +}; +var $elm$core$Platform$sendToApp = _Platform_sendToApp; +var $elm$core$Task$spawnCmd = F2( + function (router, _v0) { + var task = _v0; + return _Scheduler_spawn( + A2( + $elm$core$Task$andThen, + $elm$core$Platform$sendToApp(router), + task)); + }); +var $elm$core$Task$onEffects = F3( + function (router, commands, state) { + return A2( + $elm$core$Task$map, + function (_v0) { + return 0; + }, + $elm$core$Task$sequence( + A2( + $elm$core$List$map, + $elm$core$Task$spawnCmd(router), + commands))); + }); +var $elm$core$Task$onSelfMsg = F3( + function (_v0, _v1, _v2) { + return $elm$core$Task$succeed(0); + }); +var $elm$core$Task$cmdMap = F2( + function (tagger, _v0) { + var task = _v0; + return A2($elm$core$Task$map, tagger, task); + }); +_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); +var $elm$core$Task$command = _Platform_leaf('Task'); +var $elm$core$Task$perform = F2( + function (toMessage, task) { + return $elm$core$Task$command( + A2($elm$core$Task$map, toMessage, task)); + }); var $elm$browser$Browser$element = _Browser_element; var $author$project$Main$Editor = function (a) { - return {$: 'Editor', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$PortOutgoingFormFields = function (a) { - return {$: 'PortOutgoingFormFields', a: a}; + return {$: 0, a: a}; }; +var $elm$core$Platform$Cmd$batch = _Platform_batch; var $author$project$Main$Config = F4( function (viewMode, formFields, formValues, shortTextTypeList) { - return {formFields: formFields, formValues: formValues, shortTextTypeList: shortTextTypeList, viewMode: viewMode}; + return {g: formFields, a7: formValues, al: shortTextTypeList, ac: viewMode}; }); var $elm_community$json_extra$Json$Decode$Extra$andMap = $elm$json$Json$Decode$map2($elm$core$Basics$apR); var $author$project$Main$FormField = F6( function (label, name, presence, description, type_, visibilityRule) { - return {description: description, label: label, name: name, presence: presence, type_: type_, visibilityRule: visibilityRule}; + return {S: description, d: label, Q: name, w: presence, a: type_, m: visibilityRule}; }); var $author$project$Main$AttributeNotNeeded = function (a) { - return {$: 'AttributeNotNeeded', a: a}; + return {$: 0, a: a}; }; +var $elm$json$Json$Decode$field = _Json_decodeField; +var $elm$json$Json$Decode$at = F2( + function (fields, decoder) { + return A3($elm$core$List$foldr, $elm$json$Json$Decode$field, decoder, fields); + }); var $author$project$Main$AttributeGiven = function (a) { - return {$: 'AttributeGiven', a: a}; + return {$: 2, a: a}; }; var $elm$json$Json$Decode$null = _Json_decodeNull; var $elm$json$Json$Decode$oneOf = _Json_oneOf; @@ -10602,6 +5244,7 @@ var $author$project$Main$decodeAttributeOptional = F2( decodeValue) ])); }); +var $elm$json$Json$Decode$string = _Json_decodeString; var $author$project$Main$decodeFormFieldDescription = $elm$json$Json$Decode$oneOf( _List_fromArray( [ @@ -10641,19 +5284,19 @@ var $author$project$Main$decodeFormFieldMaybeName = $elm$json$Json$Decode$oneOf( $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) ])); var $author$project$Main$ChooseMultiple = function (a) { - return {$: 'ChooseMultiple', a: a}; + return {$: 4, a: a}; }; var $author$project$Main$ChooseOne = function (a) { - return {$: 'ChooseOne', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$Dropdown = function (a) { - return {$: 'Dropdown', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$LongText = function (a) { - return {$: 'LongText', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$ShortText = function (a) { - return {$: 'ShortText', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$andThen = _Json_andThen; var $author$project$Main$choiceDelimiter = ' | '; @@ -10664,8 +5307,8 @@ var $author$project$Main$choiceFromString = function (s) { if (!_v0.b.b) { var value = _v0.a; return { - label: value, - value: $elm$core$String$trim(value) + d: value, + j: $elm$core$String$trim(value) }; } else { if (!_v0.b.b.b) { @@ -10673,31 +5316,31 @@ var $author$project$Main$choiceFromString = function (s) { var _v1 = _v0.b; var label = _v1.a; return { - label: label, - value: $elm$core$String$trim(value) + d: label, + j: $elm$core$String$trim(value) }; } else { var value = _v0.a; var labels = _v0.b; return { - label: A2($elm$core$String$join, $author$project$Main$choiceDelimiter, labels), - value: $elm$core$String$trim(value) + d: A2($elm$core$String$join, $author$project$Main$choiceDelimiter, labels), + j: $elm$core$String$trim(value) }; } } } else { return { - label: s, - value: $elm$core$String$trim(s) + d: s, + j: $elm$core$String$trim(s) }; } }; var $author$project$Main$decodeChoice = A2($elm$json$Json$Decode$map, $author$project$Main$choiceFromString, $elm$json$Json$Decode$string); var $author$project$Main$FilterContainsFieldValueOf = function (a) { - return {$: 'FilterContainsFieldValueOf', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$FilterStartsWithFieldValueOf = function (a) { - return {$: 'FilterStartsWithFieldValueOf', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$fail = _Json_fail; var $author$project$Main$decodeChoiceFilter = A2( @@ -10721,12 +5364,160 @@ var $author$project$Main$decodeChoiceFilter = A2( A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); var $author$project$Main$RawCustomElement = F3( function (inputType, inputTag, attributes) { - return {attributes: attributes, inputTag: inputTag, inputType: inputType}; + return {p: attributes, N: inputTag, B: inputType}; }); var $author$project$Main$defaultInputTag = 'input'; +var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; +var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; +var $elm$core$Dict$Black = 1; +var $elm$core$Dict$RBNode_elm_builtin = F5( + function (a, b, c, d, e) { + return {$: -1, a: a, b: b, c: c, d: d, e: e}; + }); +var $elm$core$Dict$Red = 0; +var $elm$core$Dict$balance = F5( + function (color, key, value, left, right) { + if ((right.$ === -1) && (!right.a)) { + var _v1 = right.a; + var rK = right.b; + var rV = right.c; + var rLeft = right.d; + var rRight = right.e; + if ((left.$ === -1) && (!left.a)) { + var _v3 = left.a; + var lK = left.b; + var lV = left.c; + var lLeft = left.d; + var lRight = left.e; + return A5( + $elm$core$Dict$RBNode_elm_builtin, + 0, + key, + value, + A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); + } else { + return A5( + $elm$core$Dict$RBNode_elm_builtin, + color, + rK, + rV, + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), + rRight); + } + } else { + if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { + var _v5 = left.a; + var lK = left.b; + var lV = left.c; + var _v6 = left.d; + var _v7 = _v6.a; + var llK = _v6.b; + var llV = _v6.c; + var llLeft = _v6.d; + var llRight = _v6.e; + var lRight = left.e; + return A5( + $elm$core$Dict$RBNode_elm_builtin, + 0, + lK, + lV, + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); + } else { + return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); + } + } + }); +var $elm$core$Basics$compare = _Utils_compare; +var $elm$core$Dict$insertHelp = F3( + function (key, value, dict) { + if (dict.$ === -2) { + return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); + } else { + var nColor = dict.a; + var nKey = dict.b; + var nValue = dict.c; + var nLeft = dict.d; + var nRight = dict.e; + var _v1 = A2($elm$core$Basics$compare, key, nKey); + switch (_v1) { + case 0: + return A5( + $elm$core$Dict$balance, + nColor, + nKey, + nValue, + A3($elm$core$Dict$insertHelp, key, value, nLeft), + nRight); + case 1: + return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); + default: + return A5( + $elm$core$Dict$balance, + nColor, + nKey, + nValue, + nLeft, + A3($elm$core$Dict$insertHelp, key, value, nRight)); + } + } + }); +var $elm$core$Dict$insert = F3( + function (key, value, dict) { + var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); + if ((_v0.$ === -1) && (!_v0.a)) { + var _v1 = _v0.a; + var k = _v0.b; + var v = _v0.c; + var l = _v0.d; + var r = _v0.e; + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); + } else { + var x = _v0; + return x; + } + }); +var $elm$core$Dict$fromList = function (assocs) { + return A3( + $elm$core$List$foldl, + F2( + function (_v0, dict) { + var key = _v0.a; + var value = _v0.b; + return A3($elm$core$Dict$insert, key, value, dict); + }), + $elm$core$Dict$empty, + assocs); +}; var $author$project$Main$AttributeInvalid = function (a) { - return {$: 'AttributeInvalid', a: a}; + return {$: 1, a: a}; }; +var $elm$core$Dict$foldl = F3( + function (func, acc, dict) { + foldl: + while (true) { + if (dict.$ === -2) { + return acc; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var $temp$func = func, + $temp$acc = A3( + func, + key, + value, + A3($elm$core$Dict$foldl, func, acc, left)), + $temp$dict = right; + func = $temp$func; + acc = $temp$acc; + dict = $temp$dict; + continue foldl; + } + } + }); var $elm$core$Dict$filter = F2( function (isGood, dict) { return A3( @@ -10738,18 +5529,50 @@ var $elm$core$Dict$filter = F2( $elm$core$Dict$empty, dict); }); +var $elm$core$Dict$get = F2( + function (targetKey, dict) { + get: + while (true) { + if (dict.$ === -2) { + return $elm$core$Maybe$Nothing; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var _v1 = A2($elm$core$Basics$compare, targetKey, key); + switch (_v1) { + case 0: + var $temp$targetKey = targetKey, + $temp$dict = left; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + case 1: + return $elm$core$Maybe$Just(value); + default: + var $temp$targetKey = targetKey, + $temp$dict = right; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + } + } + } + }); +var $elm$core$Basics$neq = _Utils_notEqual; var $author$project$Main$fromRawCustomElement = function (ele) { return { - attributes: A2( + p: A2( $elm$core$Dict$filter, F2( function (k, _v0) { return k !== 'list'; }), - ele.attributes), - datalist: function () { - var _v1 = A2($elm$core$Dict$get, 'list', ele.attributes); - if (_v1.$ === 'Just') { + ele.p), + ae: function () { + var _v1 = A2($elm$core$Dict$get, 'list', ele.p); + if (!_v1.$) { var s = _v1.a; var _v2 = A2( $elm$core$String$split, @@ -10766,11 +5589,11 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - inputTag: ele.inputTag, - inputType: ele.inputType, - max: function () { - var _v3 = A2($elm$core$Dict$get, 'max', ele.attributes); - if (_v3.$ === 'Just') { + N: ele.N, + B: ele.B, + aq: function () { + var _v3 = A2($elm$core$Dict$get, 'max', ele.p); + if (!_v3.$) { if (_v3.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { @@ -10781,15 +5604,15 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - maxlength: function () { - var _v4 = A2($elm$core$Dict$get, 'maxlength', ele.attributes); - if (_v4.$ === 'Just') { + ah: function () { + var _v4 = A2($elm$core$Dict$get, 'maxlength', ele.p); + if (!_v4.$) { if (_v4.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { var value = _v4.a; var _v5 = $elm$core$String$toInt(value); - if (_v5.$ === 'Just') { + if (!_v5.$) { var _int = _v5.a; return $author$project$Main$AttributeGiven(_int); } else { @@ -10800,9 +5623,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - min: function () { - var _v6 = A2($elm$core$Dict$get, 'min', ele.attributes); - if (_v6.$ === 'Just') { + ar: function () { + var _v6 = A2($elm$core$Dict$get, 'min', ele.p); + if (!_v6.$) { if (_v6.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { @@ -10813,9 +5636,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - multiple: function () { - var _v7 = A2($elm$core$Dict$get, 'multiple', ele.attributes); - if (_v7.$ === 'Just') { + aM: function () { + var _v7 = A2($elm$core$Dict$get, 'multiple', ele.p); + if (!_v7.$) { switch (_v7.a) { case '': return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); @@ -10833,6 +5656,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { }() }; }; +var $elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs; +var $elm$json$Json$Decode$decodeValue = _Json_run; +var $elm$json$Json$Decode$value = _Json_decodeValue; var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( function (fieldName, decoder) { var finishDecoding = function (json) { @@ -10840,7 +5666,7 @@ var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( $elm$json$Json$Decode$decodeValue, A2($elm$json$Json$Decode$field, fieldName, $elm$json$Json$Decode$value), json); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var val = _v0.a; return A2( $elm$json$Json$Decode$map, @@ -10852,6 +5678,15 @@ var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( }; return A2($elm$json$Json$Decode$andThen, finishDecoding, $elm$json$Json$Decode$value); }); +var $elm$core$Maybe$withDefault = F2( + function (_default, maybe) { + if (!maybe.$) { + var value = maybe.a; + return value; + } else { + return _default; + } + }); var $author$project$Main$decodeCustomElement = A2( $elm$json$Json$Decode$map, $author$project$Main$fromRawCustomElement, @@ -10877,6 +5712,8 @@ var $author$project$Main$decodeCustomElement = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'inputType', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$RawCustomElement))))); +var $elm$json$Json$Decode$int = _Json_decodeInt; +var $elm$json$Json$Decode$list = _Json_decodeList; var $elm$json$Json$Decode$maybe = function (decoder) { return $elm$json$Json$Decode$oneOf( _List_fromArray( @@ -10914,7 +5751,7 @@ var $author$project$Main$decodeInputField = A2( F2( function (choices, filter) { return $author$project$Main$Dropdown( - {choices: choices, filter: filter}); + {k: choices, e: filter}); })))); case 'ChooseOne': return A2( @@ -10931,7 +5768,7 @@ var $author$project$Main$decodeInputField = A2( F2( function (choices, filter) { return $author$project$Main$ChooseOne( - {choices: choices, filter: filter}); + {k: choices, e: filter}); })))); case 'ChooseMultiple': return A2( @@ -10956,26 +5793,26 @@ var $author$project$Main$decodeInputField = A2( F4( function (choices, minRequired, maxAllowed, filter) { return $author$project$Main$ChooseMultiple( - {choices: choices, filter: filter, maxAllowed: maxAllowed, minRequired: minRequired}); + {k: choices, e: filter, T: maxAllowed, P: minRequired}); })))))); default: return $elm$json$Json$Decode$fail('Unknown input field type: ' + type_); } }, A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); -var $author$project$Main$Optional = {$: 'Optional'}; -var $author$project$Main$System = {$: 'System'}; -var $author$project$Main$Required = {$: 'Required'}; +var $author$project$Main$Optional = 1; +var $author$project$Main$System = 2; +var $author$project$Main$Required = 0; var $author$project$Main$decodePresenceString = A2( $elm$json$Json$Decode$andThen, function (str) { switch (str) { case 'Required': - return $elm$json$Json$Decode$succeed($author$project$Main$Required); + return $elm$json$Json$Decode$succeed(0); case 'Optional': - return $elm$json$Json$Decode$succeed($author$project$Main$Optional); + return $elm$json$Json$Decode$succeed(1); case 'System': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); default: return $elm$json$Json$Decode$fail('Unknown presence: ' + str); } @@ -10990,11 +5827,11 @@ var $author$project$Main$decodePresence = $elm$json$Json$Decode$oneOf( function (type_) { switch (type_) { case 'System': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); case 'SystemRequired': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); case 'SystemOptional': - return $elm$json$Json$Decode$succeed($author$project$Main$Optional); + return $elm$json$Json$Decode$succeed(1); default: return $elm$json$Json$Decode$fail('Unknown presence type: ' + type_); } @@ -11005,30 +5842,33 @@ var $elm$json$Json$Decode$bool = _Json_decodeBool; var $author$project$Main$decodeRequired = A2( $elm$json$Json$Decode$map, function (b) { - return b ? $author$project$Main$Required : $author$project$Main$Optional; + return b ? 0 : 1; }, A2($elm$json$Json$Decode$field, 'required', $elm$json$Json$Decode$bool)); var $author$project$Main$HideWhen = function (a) { - return {$: 'HideWhen', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$ShowWhen = function (a) { - return {$: 'ShowWhen', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$Field = F2( function (a, b) { - return {$: 'Field', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $author$project$Main$EndsWith = function (a) { - return {$: 'EndsWith', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$Equals = function (a) { - return {$: 'Equals', a: a}; + return {$: 0, a: a}; +}; +var $author$project$Main$EqualsField = function (a) { + return {$: 4, a: a}; }; var $author$project$Main$GreaterThan = function (a) { - return {$: 'GreaterThan', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$StringContains = function (a) { - return {$: 'StringContains', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$decodeComparison = A2( $elm$json$Json$Decode$andThen, @@ -11054,6 +5894,11 @@ var $author$project$Main$decodeComparison = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$GreaterThan)); + case 'EqualsField': + return A2( + $elm_community$json_extra$Json$Decode$Extra$andMap, + A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string), + $elm$json$Json$Decode$succeed($author$project$Main$EqualsField)); default: return $elm$json$Json$Decode$fail('Unknown comparison type: ' + str); } @@ -11102,7 +5947,7 @@ var $author$project$Main$decodeVisibilityRule = A2( A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); var $elm$core$Maybe$andThen = F2( function (callback, maybeValue) { - if (maybeValue.$ === 'Just') { + if (!maybeValue.$) { var value = maybeValue.a; return callback(value); } else { @@ -11157,10 +6002,67 @@ var $author$project$Main$decodeFormField = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'label', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$FormField))))))); +var $elm$core$Array$fromListHelp = F3( + function (list, nodeList, nodeListSize) { + fromListHelp: + while (true) { + var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, list); + var jsArray = _v0.a; + var remainingItems = _v0.b; + if (_Utils_cmp( + $elm$core$Elm$JsArray$length(jsArray), + $elm$core$Array$branchFactor) < 0) { + return A2( + $elm$core$Array$builderToArray, + true, + {y: nodeList, s: nodeListSize, x: jsArray}); + } else { + var $temp$list = remainingItems, + $temp$nodeList = A2( + $elm$core$List$cons, + $elm$core$Array$Leaf(jsArray), + nodeList), + $temp$nodeListSize = nodeListSize + 1; + list = $temp$list; + nodeList = $temp$nodeList; + nodeListSize = $temp$nodeListSize; + continue fromListHelp; + } + } + }); +var $elm$core$Array$fromList = function (list) { + if (!list.b) { + return $elm$core$Array$empty; + } else { + return A3($elm$core$Array$fromListHelp, list, _List_Nil, 0); + } +}; var $author$project$Main$decodeFormFields = A2( $elm$json$Json$Decode$map, $elm$core$Array$fromList, $elm$json$Json$Decode$list($author$project$Main$decodeFormField)); +var $elm$core$List$append = F2( + function (xs, ys) { + if (!ys.b) { + return xs; + } else { + return A3($elm$core$List$foldr, $elm$core$List$cons, ys, xs); + } + }); +var $elm$core$List$concat = function (lists) { + return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); +}; +var $elm$core$List$concatMap = F2( + function (f, list) { + return $elm$core$List$concat( + A2($elm$core$List$map, f, list)); + }); +var $elm$json$Json$Decode$dict = function (decoder) { + return A2( + $elm$json$Json$Decode$map, + $elm$core$Dict$fromList, + $elm$json$Json$Decode$keyValuePairs(decoder)); +}; var $elm$core$Tuple$pair = F2( function (a, b) { return _Utils_Tuple2(a, b); @@ -11197,7 +6099,7 @@ var $author$project$Main$decodeShortTextTypeList = function () { var inputTag = _v1.a; var attributes = _v1.b; return $author$project$Main$fromRawCustomElement( - {attributes: attributes, inputTag: inputTag, inputType: inputType}); + {p: attributes, N: inputTag, B: inputType}); }, $elm$core$Dict$toList(dict)); }; @@ -11212,20 +6114,20 @@ var $author$project$Main$decodeShortTextTypeList = function () { }(); var $elm_community$json_extra$Json$Decode$Extra$fromMaybe = F2( function (error, val) { - if (val.$ === 'Just') { + if (!val.$) { var v = val.a; return $elm$json$Json$Decode$succeed(v); } else { return $elm$json$Json$Decode$fail(error); } }); -var $author$project$Main$CollectData = {$: 'CollectData'}; +var $author$project$Main$CollectData = {$: 1}; var $author$project$Main$viewModeFromString = function (str) { switch (str) { case 'Editor': return $elm$core$Maybe$Just( $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing})); + {aB: $elm$core$Maybe$Nothing})); case 'CollectData': return $elm$core$Maybe$Just($author$project$Main$CollectData); default: @@ -11246,13 +6148,13 @@ var $author$project$Main$decodeConfig = A2( [ $author$project$Main$fromRawCustomElement( { - attributes: $elm$core$Dict$fromList( + p: $elm$core$Dict$fromList( _List_fromArray( [ _Utils_Tuple2('type', 'text') ])), - inputTag: $author$project$Main$defaultInputTag, - inputType: 'Single-line free text' + N: $author$project$Main$defaultInputTag, + B: 'Single-line free text' }) ])), A2($elm_community$json_extra$Json$Decode$Extra$optionalNullableField, 'shortTextTypeList', $author$project$Main$decodeShortTextTypeList)), @@ -11274,7 +6176,7 @@ var $author$project$Main$decodeConfig = A2( $elm$json$Json$Decode$map, $elm$core$Maybe$withDefault( $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing})), + {aB: $elm$core$Maybe$Nothing})), A2($elm_community$json_extra$Json$Decode$Extra$optionalNullableField, 'viewMode', $author$project$Main$decodeViewMode)), $elm$json$Json$Decode$succeed($author$project$Main$Config))))); var $elm$core$List$singleton = function (value) { @@ -11292,9 +6194,9 @@ var $author$project$Main$decodeListOrSingleton = function (decoder) { var $author$project$Main$encodeAttributeOptional = F2( function (encodeValue, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': + case 0: return $elm$json$Json$Encode$null; - case 'AttributeInvalid': + case 1: return $elm$json$Json$Encode$null; default: var value = attributeOptional.a; @@ -11303,17 +6205,31 @@ var $author$project$Main$encodeAttributeOptional = F2( }); var $author$project$Main$choiceToString = function (choice) { return _Utils_eq( - $elm$core$String$trim(choice.label), - $elm$core$String$trim(choice.value)) ? choice.label : _Utils_ap( - choice.value, - _Utils_ap($author$project$Main$choiceDelimiter, choice.label)); + $elm$core$String$trim(choice.d), + $elm$core$String$trim(choice.j)) ? choice.d : _Utils_ap( + choice.j, + _Utils_ap($author$project$Main$choiceDelimiter, choice.d)); }; +var $elm$json$Json$Encode$string = _Json_wrap; var $author$project$Main$encodeChoice = function (choice) { return $elm$json$Json$Encode$string( $author$project$Main$choiceToString(choice)); }; +var $elm$json$Json$Encode$object = function (pairs) { + return _Json_wrap( + A3( + $elm$core$List$foldl, + F2( + function (_v0, obj) { + var k = _v0.a; + var v = _v0.b; + return A3(_Json_addField, k, v, obj); + }), + _Json_emptyObject(0), + pairs)); +}; var $author$project$Main$encodeChoiceFilter = function (filter) { - if (filter.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { var fieldName = filter.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11348,17 +6264,17 @@ var $elm$core$Tuple$mapSecond = F2( func(y)); }); var $author$project$Main$encodePairsFromRawCustomElements = function (customElement) { - var inputTagAttrs = _Utils_eq(customElement.inputTag, $author$project$Main$defaultInputTag) ? _List_Nil : _List_fromArray( + var inputTagAttrs = _Utils_eq(customElement.N, $author$project$Main$defaultInputTag) ? _List_Nil : _List_fromArray( [ _Utils_Tuple2( 'inputTag', - $elm$json$Json$Encode$string(customElement.inputTag)) + $elm$json$Json$Encode$string(customElement.N)) ]); var encodedAttrs = function () { var _v0 = A2( $elm$core$List$map, $elm$core$Tuple$mapSecond($elm$json$Json$Encode$string), - $elm$core$Dict$toList(customElement.attributes)); + $elm$core$Dict$toList(customElement.p)); if (!_v0.b) { return _List_Nil; } else { @@ -11375,13 +6291,13 @@ var $author$project$Main$encodePairsFromRawCustomElements = function (customElem $elm$core$List$cons, _Utils_Tuple2( 'inputType', - $elm$json$Json$Encode$string(customElement.inputType)), + $elm$json$Json$Encode$string(customElement.B)), _Utils_ap(inputTagAttrs, encodedAttrs)); }; var $author$project$Main$toRawCustomElement = function (ele) { var addMultipleIfGiven = function (dict) { - var _v7 = ele.multiple; - if (_v7.$ === 'AttributeGiven') { + var _v7 = ele.aM; + if (_v7.$ === 2) { if (_v7.a) { return A3($elm$core$Dict$insert, 'multiple', 'true', dict); } else { @@ -11398,8 +6314,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMinIfGiven = function (dict) { - var _v5 = ele.min; - if (_v5.$ === 'AttributeGiven') { + var _v5 = ele.ar; + if (_v5.$ === 2) { var value = _v5.a; return A3($elm$core$Dict$insert, 'min', value, dict); } else { @@ -11413,8 +6329,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMaxLengthIfGiven = function (dict) { - var _v3 = ele.maxlength; - if (_v3.$ === 'AttributeGiven') { + var _v3 = ele.ah; + if (_v3.$ === 2) { var _int = _v3.a; return A3( $elm$core$Dict$insert, @@ -11432,8 +6348,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMaxIfGiven = function (dict) { - var _v1 = ele.max; - if (_v1.$ === 'AttributeGiven') { + var _v1 = ele.aq; + if (_v1.$ === 2) { var value = _v1.a; return A3($elm$core$Dict$insert, 'max', value, dict); } else { @@ -11447,9 +6363,9 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addDatalistIfGiven = function (dict) { - var _v0 = ele.datalist; + var _v0 = ele.ae; switch (_v0.$) { - case 'AttributeGiven': + case 2: var list = _v0.a; return A3( $elm$core$Dict$insert, @@ -11459,20 +6375,20 @@ var $author$project$Main$toRawCustomElement = function (ele) { '\n', A2($elm$core$List$map, $author$project$Main$choiceToString, list)), dict); - case 'AttributeInvalid': + case 1: return dict; default: return dict; } }; return { - attributes: addMaxIfGiven( + p: addMaxIfGiven( addMinIfGiven( addDatalistIfGiven( addMultipleIfGiven( - addMaxLengthIfGiven(ele.attributes))))), - inputTag: ele.inputTag, - inputType: ele.inputType + addMaxLengthIfGiven(ele.p))))), + N: ele.N, + B: ele.B }; }; var $author$project$Main$encodePairsFromCustomElement = function (customElement) { @@ -11491,9 +6407,18 @@ var $elm$core$List$filter = F2( list); }); var $elm$json$Json$Encode$int = _Json_wrap; +var $elm$json$Json$Encode$list = F2( + function (func, entries) { + return _Json_wrap( + A3( + $elm$core$List$foldl, + _Json_addEntry(func), + _Json_emptyArray(0), + entries)); + }); var $author$project$Main$encodeInputField = function (inputField) { switch (inputField.$) { - case 'ShortText': + case 0: var customElement = inputField.a; return $elm$json$Json$Encode$object( A2( @@ -11502,7 +6427,7 @@ var $author$project$Main$encodeInputField = function (inputField) { 'type', $elm$json$Json$Encode$string('ShortText')), $author$project$Main$encodePairsFromCustomElement(customElement))); - case 'LongText': + case 1: var optionalMaxLength = inputField.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11514,9 +6439,9 @@ var $author$project$Main$encodeInputField = function (inputField) { 'maxLength', A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$int, optionalMaxLength)) ])); - case 'Dropdown': - var choices = inputField.a.choices; - var filter = inputField.a.filter; + case 2: + var choices = inputField.a.k; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11532,13 +6457,13 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v1) { - var value = _v1.value; + var value = _v1.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11550,9 +6475,9 @@ var $author$project$Main$encodeInputField = function (inputField) { return _List_Nil; } }())); - case 'ChooseOne': - var choices = inputField.a.choices; - var filter = inputField.a.filter; + case 3: + var choices = inputField.a.k; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11568,13 +6493,13 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v3) { - var value = _v3.value; + var value = _v3.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11587,10 +6512,10 @@ var $author$project$Main$encodeInputField = function (inputField) { } }())); default: - var choices = inputField.a.choices; - var minRequired = inputField.a.minRequired; - var maxAllowed = inputField.a.maxAllowed; - var filter = inputField.a.filter; + var choices = inputField.a.k; + var minRequired = inputField.a.P; + var maxAllowed = inputField.a.T; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11606,14 +6531,14 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v5) { - var value = _v5.value; + var value = _v5.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), _Utils_ap( function () { - if (minRequired.$ === 'Just') { + if (!minRequired.$) { var min = minRequired.a; return _List_fromArray( [ @@ -11627,7 +6552,7 @@ var $author$project$Main$encodeInputField = function (inputField) { }(), _Utils_ap( function () { - if (maxAllowed.$ === 'Just') { + if (!maxAllowed.$) { var max = maxAllowed.a; return _List_fromArray( [ @@ -11640,7 +6565,7 @@ var $author$project$Main$encodeInputField = function (inputField) { } }(), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11655,10 +6580,10 @@ var $author$project$Main$encodeInputField = function (inputField) { } }; var $author$project$Main$encodePresence = function (presence) { - switch (presence.$) { - case 'Required': + switch (presence) { + case 0: return $elm$json$Json$Encode$string('Required'); - case 'Optional': + case 1: return $elm$json$Json$Encode$string('Optional'); default: return $elm$json$Json$Encode$string('System'); @@ -11666,7 +6591,7 @@ var $author$project$Main$encodePresence = function (presence) { }; var $author$project$Main$encodeComparison = function (comparison) { switch (comparison.$) { - case 'Equals': + case 0: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11678,7 +6603,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - case 'StringContains': + case 1: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11690,7 +6615,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - case 'EndsWith': + case 2: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11702,7 +6627,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - default: + case 3: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11714,6 +6639,18 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); + default: + var fieldName = comparison.a; + return $elm$json$Json$Encode$object( + _List_fromArray( + [ + _Utils_Tuple2( + 'type', + $elm$json$Json$Encode$string('EqualsField')), + _Utils_Tuple2( + 'value', + $elm$json$Json$Encode$string(fieldName)) + ])); } }; var $author$project$Main$encodeCondition = function (condition) { @@ -11734,7 +6671,7 @@ var $author$project$Main$encodeCondition = function (condition) { ])); }; var $author$project$Main$encodeVisibilityRule = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11778,12 +6715,12 @@ var $author$project$Main$encodeFormFields = function (formFields) { [ _Utils_Tuple2( 'label', - $elm$json$Json$Encode$string(formField.label)), + $elm$json$Json$Encode$string(formField.d)), _Utils_Tuple2( 'name', function () { - var _v0 = formField.name; - if (_v0.$ === 'Just') { + var _v0 = formField.Q; + if (!_v0.$) { var name = _v0.a; return $elm$json$Json$Encode$string(name); } else { @@ -11792,22 +6729,22 @@ var $author$project$Main$encodeFormFields = function (formFields) { }()), _Utils_Tuple2( 'presence', - $author$project$Main$encodePresence(formField.presence)), + $author$project$Main$encodePresence(formField.w)), _Utils_Tuple2( 'description', - A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$string, formField.description)), + A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$string, formField.S)), _Utils_Tuple2( 'type', - $author$project$Main$encodeInputField(formField.type_)), + $author$project$Main$encodeInputField(formField.a)), _Utils_Tuple2( 'visibilityRule', - A2($elm$json$Json$Encode$list, $author$project$Main$encodeVisibilityRule, formField.visibilityRule)) + A2($elm$json$Json$Encode$list, $author$project$Main$encodeVisibilityRule, formField.m)) ]))); }, $elm$core$Array$toList(formFields))); }; var $author$project$Main$encodePortOutgoingValue = function (value) { - if (value.$ === 'PortOutgoingFormFields') { + if (!value.$) { var formFields = value.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11832,7 +6769,7 @@ var $author$project$Main$encodePortOutgoingValue = function (value) { } }; var $author$project$Main$fieldNameOf = function (formField) { - return A2($elm$core$Maybe$withDefault, formField.label, formField.name); + return A2($elm$core$Maybe$withDefault, formField.d, formField.Q); }; var $elm$core$Array$filter = F2( function (isGood, array) { @@ -11878,14 +6815,14 @@ var $elm$core$List$member = F2( }); var $author$project$Main$filterValuesByFieldChoices = F2( function (field, values) { - var _v0 = field.type_; + var _v0 = field.a; switch (_v0.$) { - case 'Dropdown': - var choices = _v0.a.choices; + case 2: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11894,12 +6831,12 @@ var $author$project$Main$filterValuesByFieldChoices = F2( return A2($elm$core$List$member, value, validChoiceValues); }, values); - case 'ChooseOne': - var choices = _v0.a.choices; + case 3: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11908,12 +6845,12 @@ var $author$project$Main$filterValuesByFieldChoices = F2( return A2($elm$core$List$member, value, validChoiceValues); }, values); - case 'ChooseMultiple': - var choices = _v0.a.choices; + case 4: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11930,27 +6867,38 @@ var $elm$core$Array$isEmpty = function (_v0) { var len = _v0.a; return !len; }; +var $elm$core$List$isEmpty = function (xs) { + if (!xs.b) { + return true; + } else { + return false; + } +}; var $author$project$Main$isUsingFilter = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'ChooseMultiple': - var filter = _v0.a.filter; + case 4: + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseOne': - var filter = _v0.a.filter; + case 3: + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); default: - var filter = _v0.a.filter; + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); } }; +var $elm$core$Array$length = function (_v0) { + var len = _v0.a; + return len; +}; var $elm$core$Maybe$map = F2( function (f, maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { var value = maybe.a; return $elm$core$Maybe$Just( f(value)); @@ -11959,7 +6907,7 @@ var $elm$core$Maybe$map = F2( } }); var $elm$core$Result$toMaybe = function (result) { - if (result.$ === 'Ok') { + if (!result.$) { var v = result.a; return $elm$core$Maybe$Just(v); } else { @@ -11977,19 +6925,21 @@ var $author$project$Main$maybeDecode = F3( A2($elm_community$json_extra$Json$Decode$Extra$optionalField, key, decoder), jsonValue))); }); +var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); +var $elm$core$Basics$not = _Basics_not; var $author$project$Main$outgoing = _Platform_outgoingPort('outgoing', $elm$core$Basics$identity); var $author$project$Main$init = function (flags) { var defaultShortTextTypeList = _List_fromArray( [ $author$project$Main$fromRawCustomElement( { - attributes: $elm$core$Dict$fromList( + p: $elm$core$Dict$fromList( _List_fromArray( [ _Utils_Tuple2('type', 'text') ])), - inputTag: $author$project$Main$defaultInputTag, - inputType: 'Single-line free text' + N: $author$project$Main$defaultInputTag, + B: 'Single-line free text' }) ]); var defaultShortTextTypeListWithout = function (shortTextTypeList) { @@ -12001,7 +6951,7 @@ var $author$project$Main$init = function (flags) { defaultShortTextTypeList); }; var _v0 = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$decodeConfig, flags); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var config = _v0.a; var initialTrackedFormValues = $elm$core$Dict$fromList( A2( @@ -12009,8 +6959,8 @@ var $author$project$Main$init = function (flags) { function (field) { var fieldName = $author$project$Main$fieldNameOf(field); var rawValues = function () { - var _v1 = field.type_; - if (_v1.$ === 'ChooseMultiple') { + var _v1 = field.a; + if (_v1.$ === 4) { return A2( $elm$core$Maybe$withDefault, _List_Nil, @@ -12018,7 +6968,7 @@ var $author$project$Main$init = function (flags) { $author$project$Main$maybeDecode, fieldName, $author$project$Main$decodeListOrSingleton($elm$json$Json$Decode$string), - config.formValues)); + config.a7)); } else { return A2( $elm$core$Maybe$withDefault, @@ -12026,95 +6976,99 @@ var $author$project$Main$init = function (flags) { A2( $elm$core$Maybe$map, $elm$core$List$singleton, - A3($author$project$Main$maybeDecode, fieldName, $elm$json$Json$Decode$string, config.formValues))); + A3($author$project$Main$maybeDecode, fieldName, $elm$json$Json$Decode$string, config.a7))); } }(); var filteredValues = A2($author$project$Main$filterValuesByFieldChoices, field, rawValues); return _Utils_Tuple2(fieldName, filteredValues); }, - $elm$core$Array$toList(config.formFields))); + $elm$core$Array$toList(config.g))); var effectiveShortTextTypeList = _Utils_ap( - defaultShortTextTypeListWithout(config.shortTextTypeList), - config.shortTextTypeList); + defaultShortTextTypeListWithout(config.al), + config.al); return _Utils_Tuple2( { - dragged: $elm$core$Maybe$Nothing, - formFields: config.formFields, - initError: $elm$core$Maybe$Nothing, - needsFormLogic: !$elm$core$Array$isEmpty( + q: $elm$core$Maybe$Nothing, + g: config.g, + aW: $elm$core$Maybe$Nothing, + _: !$elm$core$Array$isEmpty( A2( $elm$core$Array$filter, function (f) { - return $author$project$Main$isUsingFilter(f) || (!$elm$core$List$isEmpty(f.visibilityRule)); + return $author$project$Main$isUsingFilter(f) || (!$elm$core$List$isEmpty(f.m)); }, - config.formFields)), - nextQuestionNumber: $elm$core$Array$length(config.formFields) + 1, - selectedFieldIndex: $elm$core$Maybe$Nothing, - shortTextTypeDict: $elm$core$Dict$fromList( + config.g)), + aa: $elm$core$Array$length(config.g) + 1, + F: $elm$core$Maybe$Nothing, + ak: $elm$core$Dict$fromList( A2( $elm$core$List$map, function (customElement) { - return _Utils_Tuple2(customElement.inputType, customElement); + return _Utils_Tuple2(customElement.B, customElement); }, effectiveShortTextTypeList)), - shortTextTypeList: effectiveShortTextTypeList, - trackedFormValues: initialTrackedFormValues, - viewMode: config.viewMode + al: effectiveShortTextTypeList, + u: initialTrackedFormValues, + ac: config.ac }, $elm$core$Platform$Cmd$batch( _List_fromArray( [ $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( - $author$project$Main$PortOutgoingFormFields(config.formFields))) + $author$project$Main$PortOutgoingFormFields(config.g))) ]))); } else { var err = _v0.a; return _Utils_Tuple2( { - dragged: $elm$core$Maybe$Nothing, - formFields: $elm$core$Array$empty, - initError: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Nothing, + g: $elm$core$Array$empty, + aW: $elm$core$Maybe$Just( $elm$json$Json$Decode$errorToString(err)), - needsFormLogic: false, - nextQuestionNumber: 1, - selectedFieldIndex: $elm$core$Maybe$Nothing, - shortTextTypeDict: $elm$core$Dict$empty, - shortTextTypeList: _List_Nil, - trackedFormValues: $elm$core$Dict$empty, - viewMode: $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing}) + _: false, + aa: 1, + F: $elm$core$Maybe$Nothing, + ak: $elm$core$Dict$empty, + al: _List_Nil, + u: $elm$core$Dict$empty, + ac: $author$project$Main$Editor( + {aB: $elm$core$Maybe$Nothing}) }, $elm$core$Platform$Cmd$none); } }; var $author$project$Main$OnPortIncoming = function (a) { - return {$: 'OnPortIncoming', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$incoming = _Platform_incomingPort('incoming', $elm$json$Json$Decode$value); var $author$project$Main$subscriptions = function (_v0) { return $author$project$Main$incoming($author$project$Main$OnPortIncoming); }; -var $author$project$Main$AnimateYellowFade = {$: 'AnimateYellowFade'}; +var $author$project$Main$AnimateYellowFade = 0; var $author$project$Main$DoSleepDo = F2( function (a, b) { - return {$: 'DoSleepDo', a: a, b: b}; + return {$: 14, a: a, b: b}; }); var $author$project$Main$DragExisting = function (a) { - return {$: 'DragExisting', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$DragNew = function (a) { - return {$: 'DragNew', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$Drop = function (a) { - return {$: 'Drop', a: a}; + return {$: 13, a: a}; }; var $author$project$Main$PortOutgoingFormValues = function (a) { - return {$: 'PortOutgoingFormValues', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$SetEditorAnimate = function (a) { - return {$: 'SetEditorAnimate', a: a}; + return {$: 7, a: a}; }; +var $elm$core$Basics$always = F2( + function (a, _v0) { + return a; + }); var $author$project$Main$animateFadeDuration = 500; var $author$project$Main$decodePortIncomingValue = A2( $elm$json$Json$Decode$andThen, @@ -12135,7 +7089,7 @@ var $elm$json$Json$Encode$dict = F3( toValue(value), obj); }), - _Json_emptyObject(_Utils_Tuple0), + _Json_emptyObject(0), dictionary)); }); var $elm$core$List$head = function (list) { @@ -12147,16 +7101,22 @@ var $elm$core$List$head = function (list) { return $elm$core$Maybe$Nothing; } }; +var $elm$core$Elm$JsArray$foldl = _JsArray_foldl; var $elm$core$Elm$JsArray$indexedMap = _JsArray_indexedMap; +var $elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy; +var $elm$core$Bitwise$shiftRightZfBy = _Bitwise_shiftRightZfBy; +var $elm$core$Array$tailIndex = function (len) { + return (len >>> 5) << 5; +}; var $elm$core$Array$indexedMap = F2( function (func, _v0) { var len = _v0.a; var tree = _v0.c; var tail = _v0.d; var initialBuilder = { - nodeList: _List_Nil, - nodeListSize: 0, - tail: A3( + y: _List_Nil, + s: 0, + x: A3( $elm$core$Elm$JsArray$indexedMap, func, $elm$core$Array$tailIndex(len), @@ -12164,18 +7124,18 @@ var $elm$core$Array$indexedMap = F2( }; var helper = F2( function (node, builder) { - if (node.$ === 'SubTree') { + if (!node.$) { var subTree = node.a; return A3($elm$core$Elm$JsArray$foldl, helper, builder, subTree); } else { var leaf = node.a; - var offset = builder.nodeListSize * $elm$core$Array$branchFactor; + var offset = builder.s * $elm$core$Array$branchFactor; var mappedLeaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$indexedMap, func, offset, leaf)); return { - nodeList: A2($elm$core$List$cons, mappedLeaf, builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: builder.tail + y: A2($elm$core$List$cons, mappedLeaf, builder.y), + s: builder.s + 1, + x: builder.x }; } }); @@ -12186,18 +7146,80 @@ var $elm$core$Array$indexedMap = F2( }); var $author$project$Main$mustBeOptional = function (inputField) { switch (inputField.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'Dropdown': + case 2: return false; - case 'ChooseOne': + case 3: return false; default: return true; } }; +var $elm$core$Bitwise$and = _Bitwise_and; +var $elm$core$Array$bitMask = 4294967295 >>> (32 - $elm$core$Array$shiftStep); +var $elm$core$Basics$ge = _Utils_ge; +var $elm$core$Elm$JsArray$unsafeGet = _JsArray_unsafeGet; +var $elm$core$Array$getHelp = F3( + function (shift, index, tree) { + getHelp: + while (true) { + var pos = $elm$core$Array$bitMask & (index >>> shift); + var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); + if (!_v0.$) { + var subTree = _v0.a; + var $temp$shift = shift - $elm$core$Array$shiftStep, + $temp$index = index, + $temp$tree = subTree; + shift = $temp$shift; + index = $temp$index; + tree = $temp$tree; + continue getHelp; + } else { + var values = _v0.a; + return A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, values); + } + } + }); +var $elm$core$Array$get = F2( + function (index, _v0) { + var len = _v0.a; + var startShift = _v0.b; + var tree = _v0.c; + var tail = _v0.d; + return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? $elm$core$Maybe$Nothing : ((_Utils_cmp( + index, + $elm$core$Array$tailIndex(len)) > -1) ? $elm$core$Maybe$Just( + A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, tail)) : $elm$core$Maybe$Just( + A3($elm$core$Array$getHelp, startShift, index, tree))); + }); +var $elm$core$Tuple$second = function (_v0) { + var y = _v0.b; + return y; +}; +var $elm$core$List$drop = F2( + function (n, list) { + drop: + while (true) { + if (n <= 0) { + return list; + } else { + if (!list.b) { + return list; + } else { + var x = list.a; + var xs = list.b; + var $temp$n = n - 1, + $temp$list = xs; + n = $temp$n; + list = $temp$list; + continue drop; + } + } + } + }); var $elm$core$List$takeReverse = F3( function (n, list, kept) { takeReverse: @@ -12332,32 +7354,32 @@ var $elm_community$list_extra$List$Extra$splitAt = F2( }); var $author$project$Main$onDropped = F2( function (targetIndex, model) { - var _v0 = model.dragged; - if (_v0.$ === 'Just') { - if (_v0.a.$ === 'DragExisting') { - var dragIndex = _v0.a.a.dragIndex; - var dropIndex = _v0.a.a.dropIndex; - if (targetIndex.$ === 'Nothing') { + var _v0 = model.q; + if (!_v0.$) { + if (!_v0.a.$) { + var dragIndex = _v0.a.a.a6; + var dropIndex = _v0.a.a.G; + if (targetIndex.$ === 1) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var index = targetIndex.a; - if (dropIndex.$ === 'Just') { + if (!dropIndex.$) { var _v3 = dropIndex.a; var dropTargetIndex = _v3.a; if (_Utils_eq(dragIndex, index) || (!_Utils_eq(index, dropTargetIndex))) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var newFormFields = $elm$core$Array$fromList( function (list) { - var draggedField = A2($elm$core$Array$get, dragIndex, model.formFields); + var draggedField = A2($elm$core$Array$get, dragIndex, model.g); var _v5 = A2($elm_community$list_extra$List$Extra$splitAt, index, list); var before = _v5.a; var after = _v5.b; - if (draggedField.$ === 'Just') { + if (!draggedField.$) { var field = draggedField.a; return $elm$core$List$concat( _List_fromArray( @@ -12383,33 +7405,33 @@ var $author$project$Main$onDropped = F2( A2( $elm$core$List$indexedMap, $elm$core$Tuple$pair, - $elm$core$Array$toList(model.formFields)))))); + $elm$core$Array$toList(model.g)))))); return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing, formFields: newFormFields}); + {q: $elm$core$Maybe$Nothing, g: newFormFields}); } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } } } else { - var field = _v0.a.a.field; - var dropIndex = _v0.a.a.dropIndex; - if (targetIndex.$ === 'Nothing') { + var field = _v0.a.a.bU; + var dropIndex = _v0.a.a.G; + if (targetIndex.$ === 1) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var index = targetIndex.a; - if (dropIndex.$ === 'Just') { + if (!dropIndex.$) { var _v9 = dropIndex.a; var dropTargetIndex = _v9.a; if (!_Utils_eq(index, dropTargetIndex)) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var newFormFields = $elm$core$Array$fromList( function (list) { @@ -12420,35 +7442,114 @@ var $author$project$Main$onDropped = F2( before, A2($elm$core$List$cons, field, after)); }( - $elm$core$Array$toList(model.formFields))); + $elm$core$Array$toList(model.g))); return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing, formFields: newFormFields, nextQuestionNumber: model.nextQuestionNumber + 1}); + {q: $elm$core$Maybe$Nothing, g: newFormFields, aa: model.aa + 1}); } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } } } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); + } + }); +var $elm$core$Elm$JsArray$push = _JsArray_push; +var $elm$core$Elm$JsArray$singleton = _JsArray_singleton; +var $elm$core$Elm$JsArray$unsafeSet = _JsArray_unsafeSet; +var $elm$core$Array$insertTailInTree = F4( + function (shift, index, tail, tree) { + var pos = $elm$core$Array$bitMask & (index >>> shift); + if (_Utils_cmp( + pos, + $elm$core$Elm$JsArray$length(tree)) > -1) { + if (shift === 5) { + return A2( + $elm$core$Elm$JsArray$push, + $elm$core$Array$Leaf(tail), + tree); + } else { + var newSub = $elm$core$Array$SubTree( + A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, $elm$core$Elm$JsArray$empty)); + return A2($elm$core$Elm$JsArray$push, newSub, tree); + } + } else { + var value = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); + if (!value.$) { + var subTree = value.a; + var newSub = $elm$core$Array$SubTree( + A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, subTree)); + return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); + } else { + var newSub = $elm$core$Array$SubTree( + A4( + $elm$core$Array$insertTailInTree, + shift - $elm$core$Array$shiftStep, + index, + tail, + $elm$core$Elm$JsArray$singleton(value))); + return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); + } + } + }); +var $elm$core$Array$unsafeReplaceTail = F2( + function (newTail, _v0) { + var len = _v0.a; + var startShift = _v0.b; + var tree = _v0.c; + var tail = _v0.d; + var originalTailLen = $elm$core$Elm$JsArray$length(tail); + var newTailLen = $elm$core$Elm$JsArray$length(newTail); + var newArrayLen = len + (newTailLen - originalTailLen); + if (_Utils_eq(newTailLen, $elm$core$Array$branchFactor)) { + var overflow = _Utils_cmp(newArrayLen >>> $elm$core$Array$shiftStep, 1 << startShift) > 0; + if (overflow) { + var newShift = startShift + $elm$core$Array$shiftStep; + var newTree = A4( + $elm$core$Array$insertTailInTree, + newShift, + len, + newTail, + $elm$core$Elm$JsArray$singleton( + $elm$core$Array$SubTree(tree))); + return A4($elm$core$Array$Array_elm_builtin, newArrayLen, newShift, newTree, $elm$core$Elm$JsArray$empty); + } else { + return A4( + $elm$core$Array$Array_elm_builtin, + newArrayLen, + startShift, + A4($elm$core$Array$insertTailInTree, startShift, len, newTail, tree), + $elm$core$Elm$JsArray$empty); + } + } else { + return A4($elm$core$Array$Array_elm_builtin, newArrayLen, startShift, tree, newTail); } }); +var $elm$core$Array$push = F2( + function (a, array) { + var tail = array.d; + return A2( + $elm$core$Array$unsafeReplaceTail, + A2($elm$core$Elm$JsArray$push, a, tail), + array); + }); var $elm$core$Process$sleep = _Process_sleep; var $author$project$Main$stringFromInputField = function (inputField) { switch (inputField.$) { - case 'ShortText': - var inputType = inputField.a.inputType; + case 0: + var inputType = inputField.a.B; return inputType; - case 'LongText': + case 1: return 'Multi-line description'; - case 'Dropdown': + case 2: return 'Dropdown'; - case 'ChooseOne': + case 3: return 'Radio buttons'; default: return 'Checkboxes'; @@ -12458,7 +7559,7 @@ var $elm$core$Array$setHelp = F4( function (shift, index, value, tree) { var pos = $elm$core$Array$bitMask & (index >>> shift); var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { + if (!_v0.$) { var subTree = _v0.a; var newSub = A4($elm$core$Array$setHelp, shift - $elm$core$Array$shiftStep, index, value, subTree); return A3( @@ -12501,7 +7602,7 @@ var $author$project$Main$swapArrayIndex = F3( var maybeJ = A2($elm$core$Array$get, j, arr); var maybeI = A2($elm$core$Array$get, i, arr); var _v0 = _Utils_Tuple2(maybeI, maybeJ); - if ((_v0.a.$ === 'Just') && (_v0.b.$ === 'Just')) { + if ((!_v0.a.$) && (!_v0.b.$)) { var iVal = _v0.a.a; var jVal = _v0.b.a; return A3( @@ -12534,42 +7635,42 @@ var $elm$core$Array$toIndexedList = function (array) { }; var $author$project$Main$updateDragged = F2( function (maybeDroppable, dragged) { - if (maybeDroppable.$ === 'Nothing') { + if (maybeDroppable.$ === 1) { return dragged; } else { var _v1 = maybeDroppable.a; var targetField = _v1.b; - if (dragged.$ === 'DragExisting') { + if (!dragged.$) { var details = dragged.a; - var _v3 = details.dropIndex; - if (_v3.$ === 'Just') { + var _v3 = details.G; + if (!_v3.$) { var _v4 = _v3.a; var existingField = _v4.b; return _Utils_eq(existingField, targetField) ? dragged : $author$project$Main$DragExisting( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } else { return $author$project$Main$DragExisting( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } } else { var details = dragged.a; - var _v5 = details.dropIndex; - if (_v5.$ === 'Just') { + var _v5 = details.G; + if (!_v5.$) { var _v6 = _v5.a; var existingField = _v6.b; return _Utils_eq(existingField, targetField) ? dragged : $author$project$Main$DragNew( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } else { return $author$project$Main$DragNew( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } } } @@ -12604,15 +7705,15 @@ var $elm_community$list_extra$List$Extra$removeAt = F2( var $author$project$Main$toggleAttributeOptional = F2( function (toggle, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': - if (attributeOptional.a.$ === 'Nothing') { + case 0: + if (attributeOptional.a.$ === 1) { var _v1 = attributeOptional.a; return toggle ? $author$project$Main$AttributeInvalid('') : attributeOptional; } else { var a = attributeOptional.a.a; return toggle ? $author$project$Main$AttributeGiven(a) : attributeOptional; } - case 'AttributeInvalid': + case 1: return toggle ? attributeOptional : $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); default: var a = attributeOptional.a; @@ -12625,13 +7726,16 @@ var $author$project$Main$updateComparison = F2( switch (comparisonType) { case 'Equals': switch (comparison.$) { - case 'Equals': + case 0: + var str = comparison.a; + return $author$project$Main$Equals(str); + case 1: var str = comparison.a; return $author$project$Main$Equals(str); - case 'StringContains': + case 2: var str = comparison.a; return $author$project$Main$Equals(str); - case 'EndsWith': + case 3: var str = comparison.a; return $author$project$Main$Equals(str); default: @@ -12640,13 +7744,16 @@ var $author$project$Main$updateComparison = F2( } case 'StringContains': switch (comparison.$) { - case 'Equals': + case 0: var str = comparison.a; return $author$project$Main$StringContains(str); - case 'StringContains': + case 1: var str = comparison.a; return $author$project$Main$StringContains(str); - case 'EndsWith': + case 2: + var str = comparison.a; + return $author$project$Main$StringContains(str); + case 3: var str = comparison.a; return $author$project$Main$StringContains(str); default: @@ -12655,13 +7762,16 @@ var $author$project$Main$updateComparison = F2( } case 'EndsWith': switch (comparison.$) { - case 'Equals': + case 0: + var str = comparison.a; + return $author$project$Main$EndsWith(str); + case 1: var str = comparison.a; return $author$project$Main$EndsWith(str); - case 'StringContains': + case 2: var str = comparison.a; return $author$project$Main$EndsWith(str); - case 'EndsWith': + case 3: var str = comparison.a; return $author$project$Main$EndsWith(str); default: @@ -12670,19 +7780,40 @@ var $author$project$Main$updateComparison = F2( } case 'GreaterThan': switch (comparison.$) { - case 'Equals': + case 0: var str = comparison.a; return $author$project$Main$GreaterThan(str); - case 'StringContains': + case 1: var str = comparison.a; return $author$project$Main$GreaterThan(str); - case 'EndsWith': + case 2: + var str = comparison.a; + return $author$project$Main$GreaterThan(str); + case 3: var str = comparison.a; return $author$project$Main$GreaterThan(str); default: var str = comparison.a; return $author$project$Main$GreaterThan(str); } + case 'EqualsField': + switch (comparison.$) { + case 0: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 1: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 2: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 3: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + default: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + } default: return comparison; } @@ -12699,14 +7830,16 @@ var $author$project$Main$updateComparisonInCondition = F2( var $author$project$Main$updateComparisonValue = F2( function (newValue, comparison) { switch (comparison.$) { - case 'Equals': + case 0: return $author$project$Main$Equals(newValue); - case 'StringContains': + case 1: return $author$project$Main$StringContains(newValue); - case 'EndsWith': + case 2: return $author$project$Main$EndsWith(newValue); - default: + case 3: return $author$project$Main$GreaterThan(newValue); + default: + return $author$project$Main$EqualsField(newValue); } }); var $author$project$Main$updateConditions = F3( @@ -12721,7 +7854,7 @@ var $author$project$Main$updateConditions = F3( }); var $author$project$Main$updateConditionsInRule = F2( function (updater, rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $author$project$Main$ShowWhen( updater(conditions)); @@ -12751,7 +7884,7 @@ var $author$project$Main$updateVisibilityRuleAt = F3( rules); }); var $author$project$Main$visibilityRuleCondition = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return conditions; } else { @@ -12762,43 +7895,43 @@ var $author$project$Main$visibilityRuleCondition = function (rule) { var $author$project$Main$updateFormField = F5( function (msg, fieldIndex, string, formFields, formField) { switch (msg.$) { - case 'OnLabelInput': + case 0: return _Utils_update( formField, - {label: string}); - case 'OnDescriptionInput': + {d: string}); + case 1: return (string === '') ? _Utils_update( formField, { - description: $author$project$Main$AttributeInvalid('') + S: $author$project$Main$AttributeInvalid('') }) : _Utils_update( formField, { - description: $author$project$Main$AttributeGiven(string) + S: $author$project$Main$AttributeGiven(string) }); - case 'OnDescriptionToggle': + case 2: var bool = msg.a; return _Utils_update( formField, { - description: A2($author$project$Main$toggleAttributeOptional, bool, formField.description) + S: A2($author$project$Main$toggleAttributeOptional, bool, formField.S) }); - case 'OnRequiredInput': + case 3: var bool = msg.a; return bool ? _Utils_update( formField, - {presence: $author$project$Main$Required}) : _Utils_update( + {w: 0}) : _Utils_update( formField, - {presence: $author$project$Main$Optional}); - case 'OnCheckboxMinRequiredInput': + {w: 1}); + case 16: var minStr = msg.a; - var _v1 = formField.type_; - if (_v1.$ === 'ChooseMultiple') { + var _v1 = formField.a; + if (_v1.$ === 4) { var settings = _v1.a; var newMinRequired = $elm$core$String$isEmpty(minStr) ? $elm$core$Maybe$Nothing : $elm$core$String$toInt(minStr); var adjustedMinRequired = function () { - var _v3 = _Utils_Tuple2(newMinRequired, settings.maxAllowed); - if ((_v3.a.$ === 'Just') && (_v3.b.$ === 'Just')) { + var _v3 = _Utils_Tuple2(newMinRequired, settings.T); + if ((!_v3.a.$) && (!_v3.b.$)) { var min = _v3.a.a; var max = _v3.b.a; return (_Utils_cmp(min, max) > 0) ? $elm$core$Maybe$Just(max) : $elm$core$Maybe$Just(min); @@ -12808,12 +7941,12 @@ var $author$project$Main$updateFormField = F5( } }(); var finalMinRequired = function () { - if (adjustedMinRequired.$ === 'Just') { + if (!adjustedMinRequired.$) { var min = adjustedMinRequired.a; return (_Utils_cmp( min, - $elm$core$List$length(settings.choices)) > 0) ? $elm$core$Maybe$Just( - $elm$core$List$length(settings.choices)) : $elm$core$Maybe$Just(min); + $elm$core$List$length(settings.k)) > 0) ? $elm$core$Maybe$Just( + $elm$core$List$length(settings.k)) : $elm$core$Maybe$Just(min); } else { return $elm$core$Maybe$Nothing; } @@ -12821,23 +7954,23 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {minRequired: finalMinRequired})) + {P: finalMinRequired})) }); } else { return formField; } - case 'OnCheckboxMaxAllowedInput': + case 17: var maxStr = msg.a; - var _v4 = formField.type_; - if (_v4.$ === 'ChooseMultiple') { + var _v4 = formField.a; + if (_v4.$ === 4) { var settings = _v4.a; var newMaxAllowed = $elm$core$String$isEmpty(maxStr) ? $elm$core$Maybe$Nothing : $elm$core$String$toInt(maxStr); var adjustedMaxAllowed = function () { - var _v6 = _Utils_Tuple2(newMaxAllowed, settings.minRequired); - if ((_v6.a.$ === 'Just') && (_v6.b.$ === 'Just')) { + var _v6 = _Utils_Tuple2(newMaxAllowed, settings.P); + if ((!_v6.a.$) && (!_v6.b.$)) { var max = _v6.a.a; var min = _v6.b.a; return (_Utils_cmp(max, min) < 0) ? $elm$core$Maybe$Just(min) : $elm$core$Maybe$Just(max); @@ -12847,12 +7980,12 @@ var $author$project$Main$updateFormField = F5( } }(); var finalMaxAllowed = function () { - if (adjustedMaxAllowed.$ === 'Just') { + if (!adjustedMaxAllowed.$) { var max = adjustedMaxAllowed.a; return (_Utils_cmp( max, - $elm$core$List$length(settings.choices)) > 0) ? $elm$core$Maybe$Just( - $elm$core$List$length(settings.choices)) : $elm$core$Maybe$Just(max); + $elm$core$List$length(settings.k)) > 0) ? $elm$core$Maybe$Just( + $elm$core$List$length(settings.k)) : $elm$core$Maybe$Just(max); } else { return $elm$core$Maybe$Nothing; } @@ -12860,82 +7993,82 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {maxAllowed: finalMaxAllowed})) + {T: finalMaxAllowed})) }); } else { return formField; } - case 'OnDateMinInput': + case 20: var minStr = msg.a; - var _v7 = formField.type_; - if (_v7.$ === 'ShortText') { + var _v7 = formField.a; + if (!_v7.$) { var customElement = _v7.a; var newCustomElement = _Utils_update( customElement, { - min: $elm$core$String$isEmpty(minStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(minStr) + ar: $elm$core$String$isEmpty(minStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(minStr) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDateMaxInput': + case 21: var maxStr = msg.a; - var _v8 = formField.type_; - if (_v8.$ === 'ShortText') { + var _v8 = formField.a; + if (!_v8.$) { var customElement = _v8.a; var newCustomElement = _Utils_update( customElement, { - max: $elm$core$String$isEmpty(maxStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(maxStr) + aq: $elm$core$String$isEmpty(maxStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(maxStr) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnChoicesInput': - var _v9 = formField.type_; + case 4: + var _v9 = formField.a; switch (_v9.$) { - case 'ShortText': + case 0: return formField; - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: var settings = _v9.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, $elm$core$String$lines(string)) })) }); - case 'ChooseOne': + case 3: var settings = _v9.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, $elm$core$String$lines(string)) @@ -12949,8 +8082,8 @@ var $author$project$Main$updateFormField = F5( $elm$core$String$lines(string)); var newChoicesCount = $elm$core$List$length(newChoices); var newMaxAllowed = function () { - var _v11 = settings.maxAllowed; - if (_v11.$ === 'Just') { + var _v11 = settings.T; + if (!_v11.$) { var max = _v11.a; return (_Utils_cmp(max, newChoicesCount) > 0) ? ((newChoicesCount > 0) ? $elm$core$Maybe$Just(newChoicesCount) : $elm$core$Maybe$Nothing) : $elm$core$Maybe$Just(max); } else { @@ -12958,8 +8091,8 @@ var $author$project$Main$updateFormField = F5( } }(); var newMinRequired = function () { - var _v10 = settings.minRequired; - if (_v10.$ === 'Just') { + var _v10 = settings.P; + if (!_v10.$) { var min = _v10.a; return (_Utils_cmp(min, newChoicesCount) > 0) ? ((newChoicesCount > 0) ? $elm$core$Maybe$Just(newChoicesCount) : $elm$core$Maybe$Nothing) : $elm$core$Maybe$Just(min); } else { @@ -12969,79 +8102,79 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {choices: newChoices, maxAllowed: newMaxAllowed, minRequired: newMinRequired})) + {k: newChoices, T: newMaxAllowed, P: newMinRequired})) }); } - case 'OnMultipleToggle': + case 5: var bool = msg.a; - var _v12 = formField.type_; + var _v12 = formField.a; switch (_v12.$) { - case 'ShortText': + case 0: var customElement = _v12.a; var newCustomElement = _Utils_update( customElement, { - multiple: $author$project$Main$AttributeGiven(bool) + aM: $author$project$Main$AttributeGiven(bool) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnMaxLengthToggle': + case 6: var bool = msg.a; - var _v13 = formField.type_; + var _v13 = formField.a; switch (_v13.$) { - case 'ShortText': + case 0: var customElement = _v13.a; var newCustomElement = _Utils_update( customElement, { - maxlength: A2($author$project$Main$toggleAttributeOptional, bool, customElement.maxlength) + ah: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ah) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: var maxlength = _v13.a; return _Utils_update( formField, { - type_: $author$project$Main$LongText( + a: $author$project$Main$LongText( A2($author$project$Main$toggleAttributeOptional, bool, maxlength)) }); - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnMaxLengthInput': - var _v14 = formField.type_; + case 7: + var _v14 = formField.a; switch (_v14.$) { - case 'ShortText': + case 0: var customElement = _v14.a; var newCustomElement = _Utils_update( customElement, { - maxlength: function () { + ah: function () { var _v15 = $elm$core$String$toInt(string); - if (_v15.$ === 'Just') { + if (!_v15.$) { var i = _v15.a; return $author$project$Main$AttributeGiven(i); } else { @@ -13052,12 +8185,12 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: var newMaxlength = function () { var _v16 = $elm$core$String$toInt(string); - if (_v16.$ === 'Just') { + if (!_v16.$) { var i = _v16.a; return $author$project$Main$AttributeGiven(i); } else { @@ -13067,85 +8200,85 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$LongText(newMaxlength) + a: $author$project$Main$LongText(newMaxlength) }); - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnDateMinToggle': + case 18: var bool = msg.a; - var _v17 = formField.type_; - if (_v17.$ === 'ShortText') { + var _v17 = formField.a; + if (!_v17.$) { var customElement = _v17.a; var newCustomElement = _Utils_update( customElement, { - min: A2($author$project$Main$toggleAttributeOptional, bool, customElement.min) + ar: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ar) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDateMaxToggle': + case 19: var bool = msg.a; - var _v18 = formField.type_; - if (_v18.$ === 'ShortText') { + var _v18 = formField.a; + if (!_v18.$) { var customElement = _v18.a; var newCustomElement = _Utils_update( customElement, { - max: A2($author$project$Main$toggleAttributeOptional, bool, customElement.max) + aq: A2($author$project$Main$toggleAttributeOptional, bool, customElement.aq) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDatalistToggle': + case 8: var bool = msg.a; - var _v19 = formField.type_; + var _v19 = formField.a; switch (_v19.$) { - case 'ShortText': + case 0: var customElement = _v19.a; var newCustomElement = _Utils_update( customElement, { - datalist: A2($author$project$Main$toggleAttributeOptional, bool, customElement.datalist) + ae: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ae) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnDatalistInput': - var _v20 = formField.type_; + case 9: + var _v20 = formField.a; switch (_v20.$) { - case 'ShortText': + case 0: var customElement = _v20.a; var newCustomElement = _Utils_update( customElement, { - datalist: function () { + ae: function () { var _v21 = A2($elm$core$String$split, '\n', string); if (!_v21.b) { return $author$project$Main$AttributeInvalid(string); @@ -13159,24 +8292,24 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnVisibilityRuleTypeInput': + case 10: if (msg.b === '\n') { var ruleIndex = msg.a; return _Utils_update( formField, { - visibilityRule: A2($elm_community$list_extra$List$Extra$removeAt, ruleIndex, formField.visibilityRule) + m: A2($elm_community$list_extra$List$Extra$removeAt, ruleIndex, formField.m) }); } else { var ruleIndex = msg.a; @@ -13184,7 +8317,7 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, function (rule) { @@ -13199,17 +8332,17 @@ var $author$project$Main$updateFormField = F5( return rule; } }, - formField.visibilityRule) + formField.m) }); } - case 'OnVisibilityConditionTypeInput': + case 11: var ruleIndex = msg.a; var conditionIndex = msg.b; var str = msg.c; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13218,21 +8351,21 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateComparisonInCondition( $author$project$Main$updateComparison(str)))), - formField.visibilityRule) + formField.m) }); - case 'OnVisibilityConditionFieldInput': + case 12: if (msg.c === '\n') { var ruleIndex = msg.a; var conditionIndex = msg.b; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( $elm_community$list_extra$List$Extra$removeAt(conditionIndex)), - formField.visibilityRule) + formField.m) }); } else { var ruleIndex = msg.a; @@ -13241,7 +8374,7 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13250,17 +8383,17 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateFieldnameInCondition( $elm$core$Basics$always(newFieldName)))), - formField.visibilityRule) + formField.m) }); } - case 'OnVisibilityConditionValueInput': + case 13: var ruleIndex = msg.a; var conditionIndex = msg.b; var newValue = msg.c; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13269,14 +8402,14 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateComparisonInCondition( $author$project$Main$updateComparisonValue(newValue)))), - formField.visibilityRule) + formField.m) }); - case 'OnAddVisibilityRule': + case 14: return _Utils_update( formField, { - visibilityRule: _Utils_ap( - formField.visibilityRule, + m: _Utils_ap( + formField.m, _List_fromArray( [ $author$project$Main$ShowWhen( @@ -13289,7 +8422,7 @@ var $author$project$Main$updateFormField = F5( ])) ])) }); - case 'OnVisibilityConditionDuplicate': + case 15: var ruleIndex = msg.a; var newCondition = function (conditions) { var _v24 = $elm$core$List$reverse(conditions); @@ -13309,11 +8442,11 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $author$project$Main$ShowWhen( _Utils_ap( @@ -13333,56 +8466,56 @@ var $author$project$Main$updateFormField = F5( ]))); } }, - formField.visibilityRule) + formField.m) }); - case 'OnFilterToggle': + case 22: var checked = msg.a; - var _v25 = formField.type_; + var _v25 = formField.a; switch (_v25.$) { - case 'Dropdown': + case 2: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); - case 'ChooseOne': + case 3: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); - case 'ChooseMultiple': + case 4: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); default: return formField; } - case 'OnFilterTypeSelect': + case 23: var filterType = msg.a; var updateFilter = function (existingFilter) { - if (existingFilter.$ === 'Just') { - if (existingFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!existingFilter.$) { + if (!existingFilter.a.$) { var fieldName = existingFilter.a.a; return (filterType === 'contains') ? $elm$core$Maybe$Just( $author$project$Main$FilterContainsFieldValueOf(fieldName)) : existingFilter; @@ -13397,42 +8530,42 @@ var $author$project$Main$updateFormField = F5( $author$project$Main$FilterContainsFieldValueOf('')) : $elm$core$Maybe$Nothing); } }; - var _v26 = formField.type_; + var _v26 = formField.a; switch (_v26.$) { - case 'Dropdown': + case 2: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); - case 'ChooseOne': + case 3: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); - case 'ChooseMultiple': + case 4: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); default: @@ -13441,8 +8574,8 @@ var $author$project$Main$updateFormField = F5( default: var fieldName = msg.a; var updateSourceField = function (existingFilter) { - if (existingFilter.$ === 'Just') { - if (existingFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!existingFilter.$) { + if (!existingFilter.a.$) { return $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf(fieldName)); } else { @@ -13454,42 +8587,42 @@ var $author$project$Main$updateFormField = F5( $author$project$Main$FilterStartsWithFieldValueOf(fieldName)); } }; - var _v28 = formField.type_; + var _v28 = formField.a; switch (_v28.$) { - case 'Dropdown': + case 2: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); - case 'ChooseOne': + case 3: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); - case 'ChooseMultiple': + case 4: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); default: @@ -13499,43 +8632,43 @@ var $author$project$Main$updateFormField = F5( }); var $author$project$Main$when = F2( function (bool, condition) { - return bool ? condition._true : condition._false; + return bool ? condition.a1 : condition.aV; }); var $author$project$Main$update = F2( function (msg, model) { update: while (true) { switch (msg.$) { - case 'NoOp': + case 0: return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'OnPortIncoming': + case 1: var value = msg.a; var _v1 = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$decodePortIncomingValue, value); - if (_v1.$ === 'Ok') { + if (!_v1.$) { var _v2 = _v1.a; return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'AddFormField': + case 2: var fieldType = msg.a; var newFormField = { - description: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), - label: $author$project$Main$stringFromInputField(fieldType) + (' question ' + $elm$core$String$fromInt(model.nextQuestionNumber)), - name: $elm$core$Maybe$Nothing, - presence: A2( + S: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), + d: $author$project$Main$stringFromInputField(fieldType) + (' question ' + $elm$core$String$fromInt(model.aa)), + Q: $elm$core$Maybe$Nothing, + w: A2( $author$project$Main$when, $author$project$Main$mustBeOptional(fieldType), - {_false: $author$project$Main$Required, _true: $author$project$Main$Optional}), - type_: fieldType, - visibilityRule: _List_Nil + {aV: 0, a1: 1}), + a: fieldType, + m: _List_Nil }; - var newFormFields = A2($elm$core$Array$push, newFormField, model.formFields); + var newFormFields = A2($elm$core$Array$push, newFormField, model.g); var newIndex = $elm$core$Array$length(newFormFields) - 1; return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields, nextQuestionNumber: model.nextQuestionNumber + 1}), + {g: newFormFields, aa: model.aa + 1}), $elm$core$Platform$Cmd$batch( _List_fromArray( [ @@ -13553,11 +8686,11 @@ var $author$project$Main$update = F2( [ $author$project$Main$SetEditorAnimate( $elm$core$Maybe$Just( - _Utils_Tuple2(newIndex, $author$project$Main$AnimateYellowFade))), + _Utils_Tuple2(newIndex, 0))), $author$project$Main$SetEditorAnimate($elm$core$Maybe$Nothing) ])))) ]))); - case 'DeleteFormField': + case 3: var fieldIndex = msg.a; var newFormFields = $elm$core$Array$fromList( A2( @@ -13569,41 +8702,41 @@ var $author$project$Main$update = F2( var i = _v3.a; return !_Utils_eq(i, fieldIndex); }, - $elm$core$Array$toIndexedList(model.formFields)))); + $elm$core$Array$toIndexedList(model.g)))); return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields, selectedFieldIndex: $elm$core$Maybe$Nothing}), + {g: newFormFields, F: $elm$core$Maybe$Nothing}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'MoveFormFieldUp': + case 4: var fieldIndex = msg.a; - var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex - 1, model.formFields); + var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex - 1, model.g); return _Utils_Tuple2( _Utils_update( model, { - formFields: newFormFields, - selectedFieldIndex: $elm$core$Maybe$Just(fieldIndex - 1) + g: newFormFields, + F: $elm$core$Maybe$Just(fieldIndex - 1) }), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'MoveFormFieldDown': + case 5: var fieldIndex = msg.a; - var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex + 1, model.formFields); + var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex + 1, model.g); return _Utils_Tuple2( _Utils_update( model, { - formFields: newFormFields, - selectedFieldIndex: $elm$core$Maybe$Just(fieldIndex + 1) + g: newFormFields, + F: $elm$core$Maybe$Just(fieldIndex + 1) }), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'OnFormField': + case 6: var fmsg = msg.a; var fieldIndex = msg.b; var string = msg.c; @@ -13611,41 +8744,41 @@ var $author$project$Main$update = F2( $elm$core$Array$indexedMap, F2( function (i, formField) { - return _Utils_eq(i, fieldIndex) ? A5($author$project$Main$updateFormField, fmsg, fieldIndex, string, model.formFields, formField) : formField; + return _Utils_eq(i, fieldIndex) ? A5($author$project$Main$updateFormField, fmsg, fieldIndex, string, model.g, formField) : formField; }), - model.formFields); + model.g); return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields}), + {g: newFormFields}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'SetEditorAnimate': + case 7: var maybeAnimate = msg.a; return _Utils_Tuple2( _Utils_update( model, { - viewMode: $author$project$Main$Editor( - {maybeAnimate: maybeAnimate}) + ac: $author$project$Main$Editor( + {aB: maybeAnimate}) }), $elm$core$Platform$Cmd$none); - case 'SelectField': + case 8: var fieldIndex = msg.a; - var _v4 = _Utils_Tuple2(model.selectedFieldIndex, fieldIndex); - if ((_v4.a.$ === 'Just') && (_v4.b.$ === 'Nothing')) { + var _v4 = _Utils_Tuple2(model.F, fieldIndex); + if ((!_v4.a.$) && (_v4.b.$ === 1)) { var prevIndex = _v4.a.a; var _v5 = _v4.b; return _Utils_Tuple2( _Utils_update( model, { - selectedFieldIndex: $elm$core$Maybe$Nothing, - viewMode: $author$project$Main$Editor( + F: $elm$core$Maybe$Nothing, + ac: $author$project$Main$Editor( { - maybeAnimate: $elm$core$Maybe$Just( - _Utils_Tuple2(prevIndex, $author$project$Main$AnimateYellowFade)) + aB: $elm$core$Maybe$Just( + _Utils_Tuple2(prevIndex, 0)) }) }), $elm$core$Platform$Cmd$none); @@ -13653,41 +8786,41 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {selectedFieldIndex: fieldIndex}), + {F: fieldIndex}), $elm$core$Platform$Cmd$none); } - case 'DragStart': + case 9: var fieldIndex = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Just( $author$project$Main$DragExisting( - {dragIndex: fieldIndex, dropIndex: $elm$core$Maybe$Nothing})), - selectedFieldIndex: $elm$core$Maybe$Nothing + {a6: fieldIndex, G: $elm$core$Maybe$Nothing})), + F: $elm$core$Maybe$Nothing }), $elm$core$Platform$Cmd$none); - case 'DragStartNew': + case 10: var fieldIndex = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Just( $author$project$Main$DragNew( { - dropIndex: $elm$core$Maybe$Just( + G: $elm$core$Maybe$Just( _Utils_Tuple2(0, $elm$core$Maybe$Nothing)), - field: fieldIndex + bU: fieldIndex })) }), $elm$core$Platform$Cmd$none); - case 'DragEnd': - var _v6 = model.dragged; - if (_v6.$ === 'Just') { - if (_v6.a.$ === 'DragExisting') { - var dropIndex = _v6.a.a.dropIndex; + case 11: + var _v6 = model.q; + if (!_v6.$) { + if (!_v6.a.$) { + var dropIndex = _v6.a.a.G; var $temp$msg = $author$project$Main$Drop( A2($elm$core$Maybe$map, $elm$core$Tuple$first, dropIndex)), $temp$model = model; @@ -13695,7 +8828,7 @@ var $author$project$Main$update = F2( model = $temp$model; continue update; } else { - var dropIndex = _v6.a.a.dropIndex; + var dropIndex = _v6.a.a.G; var $temp$msg = $author$project$Main$Drop( A2($elm$core$Maybe$map, $elm$core$Tuple$first, dropIndex)), $temp$model = model; @@ -13707,30 +8840,30 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}), + {q: $elm$core$Maybe$Nothing}), $elm$core$Platform$Cmd$none); } - case 'DragOver': + case 12: var maybeDroppable = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: A2( + q: A2( $elm$core$Maybe$map, $author$project$Main$updateDragged(maybeDroppable), - model.dragged) + model.q) }), $elm$core$Platform$Cmd$none); - case 'Drop': + case 13: var targetFieldIndex = msg.a; var newModel = A2($author$project$Main$onDropped, targetFieldIndex, model); return _Utils_Tuple2( newModel, - (!_Utils_eq(newModel.formFields, model.formFields)) ? $author$project$Main$outgoing( + (!_Utils_eq(newModel.g, model.g)) ? $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( - $author$project$Main$PortOutgoingFormFields(newModel.formFields))) : $elm$core$Platform$Cmd$none); - case 'DoSleepDo': + $author$project$Main$PortOutgoingFormFields(newModel.g))) : $elm$core$Platform$Cmd$none); + case 14: if (!msg.b.b) { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } else { @@ -13765,16 +8898,16 @@ var $author$project$Main$update = F2( $author$project$Main$fieldNameOf(f), fieldName); }, - $elm$core$Array$toList(model.formFields))); + $elm$core$Array$toList(model.g))); var currentValues = A2( $elm$core$Maybe$withDefault, _List_Nil, - A2($elm$core$Dict$get, fieldName, model.trackedFormValues)); + A2($elm$core$Dict$get, fieldName, model.u)); var newValues = function () { - if (formField.$ === 'Just') { + if (!formField.$) { var field = formField.a; - var _v11 = field.type_; - if (_v11.$ === 'ChooseMultiple') { + var _v11 = field.a; + if (_v11.$ === 4) { return A2($elm$core$List$member, value, currentValues) ? A2( $elm$core$List$filter, $elm$core$Basics$neq(value), @@ -13788,7 +8921,7 @@ var $author$project$Main$update = F2( [value]); } }(); - var newTrackedFormValues = A3($elm$core$Dict$insert, fieldName, newValues, model.trackedFormValues); + var newTrackedFormValues = A3($elm$core$Dict$insert, fieldName, newValues, model.u); var formValues = A3( $elm$json$Json$Encode$dict, $elm$core$Basics$identity, @@ -13807,58 +8940,72 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {trackedFormValues: newTrackedFormValues}), + {u: newTrackedFormValues}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormValues(formValues)))); } } }); +var $elm$html$Html$Attributes$stringProperty = F2( + function (key, string) { + return A2( + _VirtualDom_property, + key, + $elm$json$Json$Encode$string(string)); + }); +var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); +var $elm$html$Html$div = _VirtualDom_node('div'); var $elm$html$Html$h3 = _VirtualDom_node('h3'); var $elm$html$Html$pre = _VirtualDom_node('pre'); +var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; +var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; +var $elm$html$Html$input = _VirtualDom_node('input'); var $elm$html$Html$Attributes$name = $elm$html$Html$Attributes$stringProperty('name'); var $author$project$Main$stringFromViewMode = function (viewMode) { - if (viewMode.$ === 'Editor') { + if (!viewMode.$) { return 'Editor'; } else { return 'CollectData'; } }; -var $author$project$Main$DragEnd = {$: 'DragEnd'}; -var $author$project$Main$NoOp = {$: 'NoOp'}; +var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); +var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); +var $author$project$Main$DragEnd = {$: 11}; +var $author$project$Main$NoOp = {$: 0}; var $author$project$Main$SelectField = function (a) { - return {$: 'SelectField', a: a}; + return {$: 8, a: a}; }; var $author$project$Main$allInputField = _List_fromArray( [ $author$project$Main$Dropdown( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'])), - filter: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing }), $author$project$Main$ChooseOne( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Yes', 'No'])), - filter: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing }), $author$project$Main$ChooseMultiple( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Apple', 'Banana', 'Cantaloupe', 'Durian'])), - filter: $elm$core$Maybe$Nothing, - maxAllowed: $elm$core$Maybe$Nothing, - minRequired: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing, + T: $elm$core$Maybe$Nothing, + P: $elm$core$Maybe$Nothing }), $author$project$Main$LongText( $author$project$Main$AttributeGiven(160)) @@ -13873,15 +9020,33 @@ var $elm$html$Html$Attributes$classList = function (classes) { $elm$core$Tuple$first, A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); }; +var $elm$core$List$maybeCons = F3( + function (f, mx, xs) { + var _v0 = f(mx); + if (!_v0.$) { + var x = _v0.a; + return A2($elm$core$List$cons, x, xs); + } else { + return xs; + } + }); +var $elm$core$List$filterMap = F2( + function (f, xs) { + return A3( + $elm$core$List$foldr, + $elm$core$List$maybeCons(f), + _List_Nil, + xs); + }); var $author$project$Main$fieldsWithPlaceholder = F2( function (fields, dragged) { - if (dragged.$ === 'Nothing') { + if (dragged.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { - if (dragged.a.$ === 'DragExisting') { - var dragIndex = dragged.a.a.dragIndex; - var dropIndex = dragged.a.a.dropIndex; - if (dropIndex.$ === 'Nothing') { + if (!dragged.a.$) { + var dragIndex = dragged.a.a.a6; + var dropIndex = dragged.a.a.G; + if (dropIndex.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { var _v2 = dropIndex.a; @@ -13912,8 +9077,8 @@ var $author$project$Main$fieldsWithPlaceholder = F2( ])); } } else { - var dropIndex = dragged.a.a.dropIndex; - if (dropIndex.$ === 'Nothing') { + var dropIndex = dragged.a.a.G; + if (dropIndex.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { var _v4 = dropIndex.a; @@ -13932,8 +9097,25 @@ var $author$project$Main$fieldsWithPlaceholder = F2( } }); var $elm$html$Html$h2 = _VirtualDom_node('h2'); +var $elm$virtual_dom$VirtualDom$Normal = function (a) { + return {$: 0, a: a}; +}; +var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; +var $elm$html$Html$Events$on = F2( + function (event, decoder) { + return A2( + $elm$virtual_dom$VirtualDom$on, + event, + $elm$virtual_dom$VirtualDom$Normal(decoder)); + }); +var $elm$html$Html$Events$onClick = function (msg) { + return A2( + $elm$html$Html$Events$on, + 'click', + $elm$json$Json$Decode$succeed(msg)); +}; var $elm$virtual_dom$VirtualDom$MayPreventDefault = function (a) { - return {$: 'MayPreventDefault', a: a}; + return {$: 2, a: a}; }; var $elm$html$Html$Events$preventDefaultOn = F2( function (event, decoder) { @@ -13943,8 +9125,15 @@ var $elm$html$Html$Events$preventDefaultOn = F2( $elm$virtual_dom$VirtualDom$MayPreventDefault(decoder)); }); var $author$project$Main$DragStart = function (a) { - return {$: 'DragStart', a: a}; + return {$: 9, a: a}; }; +var $elm$virtual_dom$VirtualDom$attribute = F2( + function (key, value) { + return A2( + _VirtualDom_attribute, + _VirtualDom_noOnOrFormAction(key), + _VirtualDom_noJavaScriptOrHtmlUri(value)); + }); var $elm$html$Html$Attributes$attribute = $elm$virtual_dom$VirtualDom$attribute; var $elm$svg$Svg$Attributes$class = _VirtualDom_attribute('class'); var $elm$svg$Svg$Attributes$fill = _VirtualDom_attribute('fill'); @@ -13999,7 +9188,7 @@ var $author$project$Main$dragHandleIcon = A2( _List_Nil) ])); var $author$project$Main$DragOver = function (a) { - return {$: 'DragOver', a: a}; + return {$: 12, a: a}; }; var $author$project$Main$dragOverDecoder = F2( function (index, maybeFormField) { @@ -14017,8 +9206,8 @@ var $author$project$Main$isConditionReferencingField = F2( }); var $author$project$Main$isFieldUsedInChoiceFilter = F2( function (fieldName, maybeFilter) { - if (maybeFilter.$ === 'Just') { - if (maybeFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!maybeFilter.$) { + if (!maybeFilter.a.$) { var sourceField = maybeFilter.a.a; return _Utils_eq(sourceField, fieldName); } else { @@ -14032,14 +9221,14 @@ var $author$project$Main$isFieldUsedInChoiceFilter = F2( var $author$project$Main$isFieldUsedInFilter = F2( function (fieldName, inputField) { switch (inputField.$) { - case 'Dropdown': - var filter = inputField.a.filter; + case 2: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); - case 'ChooseOne': - var filter = inputField.a.filter; + case 3: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); - case 'ChooseMultiple': - var filter = inputField.a.filter; + case 4: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); default: return false; @@ -14051,7 +9240,7 @@ var $author$project$Main$isFieldReferencedBy = F2( var isUsedInChoiceFilters = A2( $elm$core$List$any, function (field) { - return A2($author$project$Main$isFieldUsedInFilter, fieldName, field.type_); + return A2($author$project$Main$isFieldUsedInFilter, fieldName, field.a); }, fieldList); var isUsedInVisibilityRules = A2( @@ -14060,7 +9249,7 @@ var $author$project$Main$isFieldReferencedBy = F2( return A2( $elm$core$List$any, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return A2( $elm$core$List$any, @@ -14074,51 +9263,62 @@ var $author$project$Main$isFieldReferencedBy = F2( conditions); } }, - field.visibilityRule); + field.m); }, fieldList); - return {usedInChoiceFilters: isUsedInChoiceFilters, usedInVisibilityRules: isUsedInVisibilityRules}; + return {a3: isUsedInChoiceFilters, a4: isUsedInVisibilityRules}; + }); +var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { + return {$: 1, a: a}; +}; +var $elm$html$Html$Events$stopPropagationOn = F2( + function (event, decoder) { + return A2( + $elm$virtual_dom$VirtualDom$on, + event, + $elm$virtual_dom$VirtualDom$MayStopPropagation(decoder)); }); +var $elm$html$Html$Attributes$title = $elm$html$Html$Attributes$stringProperty('title'); var $elm$html$Html$Attributes$for = $elm$html$Html$Attributes$stringProperty('htmlFor'); var $elm$html$Html$label = _VirtualDom_node('label'); var $author$project$Main$maybeMaxLengthOf = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': - var maxlength = _v0.a.maxlength; + case 0: + var maxlength = _v0.a.ah; switch (maxlength.$) { - case 'AttributeGiven': + case 2: var i = maxlength.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'LongText': + case 1: var maxlength = _v0.a; switch (maxlength.$) { - case 'AttributeGiven': + case 2: var i = maxlength.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'Dropdown': + case 2: return $elm$core$Maybe$Nothing; - case 'ChooseOne': + case 3: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } }; var $author$project$Main$requiredData = function (presence) { - switch (presence.$) { - case 'Required': + switch (presence) { + case 0: return true; - case 'Optional': + case 1: return false; default: return true; @@ -14157,14 +9357,14 @@ var $author$project$Main$attributesFromTuple = function (_v0) { A2($elm$html$Html$Attributes$attribute, k, v)); }; var $author$project$Main$isOptionalTemporalInput = function (formField) { - var _v0 = _Utils_Tuple2(formField.presence, formField.type_); - if ((_v0.a.$ === 'Optional') && (_v0.b.$ === 'ShortText')) { + var _v0 = _Utils_Tuple2(formField.w, formField.a); + if ((_v0.a === 1) && (!_v0.b.$)) { var _v1 = _v0.a; var customElement = _v0.b.a; var inputType = A2( $elm$core$Maybe$withDefault, '', - A2($elm$core$Dict$get, 'type', customElement.attributes)); + A2($elm$core$Dict$get, 'type', customElement.p)); return A2( $elm$core$List$member, inputType, @@ -14202,14 +9402,14 @@ var $author$project$Main$defaultValue = function (str) { var $elm$core$String$toLower = _String_toLower; var $author$project$Main$filterChoices = F3( function (maybeFilter, formValues, choices) { - if (maybeFilter.$ === 'Just') { - if (maybeFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!maybeFilter.$) { + if (!maybeFilter.a.$) { var fieldName = maybeFilter.a.a; var _v1 = A2( $elm$core$Maybe$andThen, $elm$core$List$head, A2($elm$core$Dict$get, fieldName, formValues)); - if (_v1.$ === 'Just') { + if (!_v1.$) { var filterValue = _v1.a; return $elm$core$String$isEmpty(filterValue) ? _List_Nil : A2( $elm$core$List$filter, @@ -14217,10 +9417,10 @@ var $author$project$Main$filterChoices = F3( return A2( $elm$core$String$startsWith, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.value)) || A2( + $elm$core$String$toLower(choice.j)) || A2( $elm$core$String$startsWith, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.label)); + $elm$core$String$toLower(choice.d)); }, choices); } else { @@ -14232,7 +9432,7 @@ var $author$project$Main$filterChoices = F3( $elm$core$Maybe$andThen, $elm$core$List$head, A2($elm$core$Dict$get, fieldName, formValues)); - if (_v2.$ === 'Just') { + if (!_v2.$) { var filterValue = _v2.a; return $elm$core$String$isEmpty(filterValue) ? _List_Nil : A2( $elm$core$List$filter, @@ -14240,10 +9440,10 @@ var $author$project$Main$filterChoices = F3( return A2( $elm$core$String$contains, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.value)) || A2( + $elm$core$String$toLower(choice.j)) || A2( $elm$core$String$contains, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.label)); + $elm$core$String$toLower(choice.d)); }, choices); } else { @@ -14254,12 +9454,18 @@ var $author$project$Main$filterChoices = F3( return choices; } }); +var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); var $elm$html$Html$Attributes$maxlength = function (n) { return A2( _VirtualDom_attribute, 'maxlength', $elm$core$String$fromInt(n)); }; +var $elm$virtual_dom$VirtualDom$node = function (tag) { + return _VirtualDom_node( + _VirtualDom_noScript(tag)); +}; +var $elm$html$Html$node = $elm$virtual_dom$VirtualDom$node; var $elm$html$Html$option = _VirtualDom_node('option'); var $elm$html$Html$Attributes$placeholder = $elm$html$Html$Attributes$stringProperty('placeholder'); var $elm$html$Html$Attributes$required = $elm$html$Html$Attributes$boolProperty('required'); @@ -14316,21 +9522,21 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( var disabledMode = A2( $elm$core$List$member, A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled'), - config.customAttrs); + config.Y); var chosenForYou = function (choices) { - var _v10 = formField.presence; - switch (_v10.$) { - case 'Optional': + var _v10 = formField.w; + switch (_v10) { + case 1: return false; - case 'Required': + case 0: return $elm$core$List$length(choices) === 1; default: return $elm$core$List$length(choices) === 1; } }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: var customElement = _v0.a; var extraAttrs = A2( $elm$core$List$filterMap, @@ -14345,12 +9551,12 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))), + A2($elm$core$Dict$get, fieldName, config.u))), A2( $elm$core$List$map, $author$project$Main$attributesFromTuple, - $elm$core$Dict$toList(customElement.attributes)))); - var extraAttrKeys = $elm$core$Dict$keys(customElement.attributes); + $elm$core$Dict$toList(customElement.p)))); + var extraAttrKeys = $elm$core$Dict$keys(customElement.p); var shortTextAttrs = A2( $elm$core$List$filterMap, $author$project$Main$attributesFromTuple, @@ -14367,13 +9573,13 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$map, function ($) { - return $.attributes; + return $.p; }, - A2($elm$core$Dict$get, customElement.inputType, config.shortTextTypeDict)))))); + A2($elm$core$Dict$get, customElement.B, config.ak)))))); var _v1 = function () { - var _v2 = customElement.datalist; + var _v2 = customElement.ae; switch (_v2.$) { - case 'AttributeGiven': + case 2: var list = _v2.a; return _Utils_Tuple2( _List_fromArray( @@ -14393,15 +9599,15 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(choice.value) + $elm$html$Html$Attributes$value(choice.j) ]), _List_fromArray( [ - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])); }, list))); - case 'AttributeNotNeeded': + case 0: return _Utils_Tuple2( _List_Nil, $elm$html$Html$text('')); @@ -14420,18 +9626,18 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( [ A3( $elm$html$Html$node, - customElement.inputTag, + customElement.N, _Utils_ap( _List_fromArray( [ A2( $elm$html$Html$Attributes$attribute, 'class', - A3($author$project$Main$buildInputClassString, formField, fieldName, config.trackedFormValues)), + A3($author$project$Main$buildInputClassString, formField, fieldName, config.u)), $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), _Utils_ap( dataListAttrs, @@ -14440,12 +9646,12 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( _Utils_ap( extraAttrs, _Utils_ap( - config.customAttrs, - config.onInput(fieldName)))))), + config.Y, + config.aO(fieldName)))))), _List_Nil), dataListElement ])); - case 'LongText': + case 1: var extraAttrs = A2( $elm$core$List$filterMap, $elm$core$Basics$identity, @@ -14465,7 +9671,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))) + A2($elm$core$Dict$get, fieldName, config.u))) ])); return A2( $author$project$Main$textarea, @@ -14476,28 +9682,28 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)), + $author$project$Main$requiredData(formField.w)), $elm$html$Html$Attributes$placeholder(' ') ]), _Utils_ap( extraAttrs, _Utils_ap( - config.customAttrs, - config.onInput(fieldName)))), + config.Y, + config.aO(fieldName)))), _List_Nil); - case 'Dropdown': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 2: + var choices = _v0.a.k; + var filter = _v0.a.e; var valueString = A2( $elm$core$Maybe$withDefault, '', A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + A2($elm$core$Dict$get, fieldName, config.u))); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14514,9 +9720,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), disabledMode ? $elm$html$Html$Attributes$class('tff-select-disabled') : $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), - config.onChange(fieldName)), + config.bf(fieldName)), A2( $elm$core$List$cons, A2( @@ -14529,7 +9735,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( (valueString === '') && (!chosenForYou(filteredChoices))), A2($elm$html$Html$Attributes$attribute, 'value', '') ]), - config.customAttrs), + config.Y), _List_fromArray( [ $elm$html$Html$text('-- Select an option --') @@ -14541,32 +9747,32 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$option, A2( $elm$core$List$cons, - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), A2( $elm$core$List$cons, $author$project$Main$defaultSelected( - _Utils_eq(valueString, choice.value) || chosenForYou(filteredChoices)), - config.customAttrs)), + _Utils_eq(valueString, choice.j) || chosenForYou(filteredChoices)), + config.Y)), _List_fromArray( [ - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])); }, filteredChoices))) ])); - case 'ChooseOne': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 3: + var choices = _v0.a.k; + var filter = _v0.a.e; var valueString = A2( $elm$core$Maybe$withDefault, '', A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + A2($elm$core$Dict$get, fieldName, config.u))); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14607,32 +9813,32 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$type_('radio'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$name(fieldName), - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), $elm$html$Html$Attributes$checked( - _Utils_eq(valueString, choice.value) || chosenForYou(filteredChoices)), + _Utils_eq(valueString, choice.j) || chosenForYou(filteredChoices)), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), _Utils_ap( - config.customAttrs, - config.onInput(fieldName))), + config.Y, + config.aO(fieldName))), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])) ])); }, filteredChoices)) ])); default: - var choices = _v0.a.choices; - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; - var filter = _v0.a.filter; + var choices = _v0.a.k; + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; + var filter = _v0.a.e; var values = A2( $elm$core$Maybe$withDefault, _List_Nil, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues)); + A2($elm$core$Dict$get, fieldName, config.u)); var selectedCount = $elm$core$List$length(values); var validationElement = ((!disabledMode) && ((!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) || (!_Utils_eq(maxAllowed, $elm$core$Maybe$Nothing)))) ? _List_fromArray( [ @@ -14666,8 +9872,8 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( ]) : _List_Nil; var isValid = function () { var _v5 = _Utils_Tuple2(minRequired, maxAllowed); - if (_v5.a.$ === 'Just') { - if (_v5.b.$ === 'Just') { + if (!_v5.a.$) { + if (!_v5.b.$) { var min = _v5.a.a; var max = _v5.b.a; return (_Utils_cmp(selectedCount, min) > -1) && (_Utils_cmp(selectedCount, max) < 1); @@ -14677,7 +9883,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( return _Utils_cmp(selectedCount, min) > -1; } } else { - if (_v5.b.$ === 'Just') { + if (!_v5.b.$) { var _v7 = _v5.a; var max = _v5.b.a; return _Utils_cmp(selectedCount, max) < 1; @@ -14688,9 +9894,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( } } }(); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14711,14 +9917,14 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$core$List$map, function (choice) { var alreadyFull = function () { - if (maxAllowed.$ === 'Just') { + if (!maxAllowed.$) { var m = maxAllowed.a; return _Utils_cmp(selectedCount, m) > -1; } else { return false; } }(); - var shouldDisable = alreadyFull && (!A2($elm$core$List$member, choice.value, values)); + var shouldDisable = alreadyFull && (!A2($elm$core$List$member, choice.j, values)); return A2( $elm$html$Html$div, _List_fromArray( @@ -14743,9 +9949,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$name(fieldName), - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), $elm$html$Html$Attributes$checked( - A2($elm$core$List$member, choice.value, values) || chosenForYou(filteredChoices)) + A2($elm$core$List$member, choice.j, values) || chosenForYou(filteredChoices)) ]), _Utils_ap( shouldDisable ? _List_fromArray( @@ -14753,11 +9959,11 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled') ]) : _List_Nil, _Utils_ap( - config.customAttrs, - A2(config.onChooseMany, fieldName, choice)))), + config.Y, + A2(config.bg, fieldName, choice)))), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])) ])); }, @@ -14780,8 +9986,8 @@ var $author$project$Main$viewFormFieldPreview = F3( $elm$html$Html$Attributes$class( 'tff-field-group' + A2( $author$project$Main$when, - $author$project$Main$requiredData(formField.presence), - {_false: '', _true: ' tff-required'})) + $author$project$Main$requiredData(formField.w), + {aV: '', a1: ' tff-required'})) ]), _List_fromArray( [ @@ -14794,16 +10000,16 @@ var $author$project$Main$viewFormFieldPreview = F3( ]), _List_fromArray( [ - $elm$html$Html$text(formField.label), + $elm$html$Html$text(formField.d), function () { - var _v0 = formField.presence; - switch (_v0.$) { - case 'Required': + var _v0 = formField.w; + switch (_v0) { + case 0: return $elm$html$Html$text(''); - case 'Optional': - var _v1 = formField.type_; - if (_v1.$ === 'ChooseMultiple') { - var minRequired = _v1.a.minRequired; + case 1: + var _v1 = formField.a; + if (_v1.$ === 4) { + var minRequired = _v1.a.P; return (!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) ? $elm$html$Html$text('') : $elm$html$Html$text(' (optional)'); } else { return $elm$html$Html$text(' (optional)'); @@ -14824,11 +10030,11 @@ var $author$project$Main$viewFormFieldPreview = F3( [ $elm$html$Html$text( function () { - var _v2 = formField.description; + var _v2 = formField.S; switch (_v2.$) { - case 'AttributeNotNeeded': + case 0: return ''; - case 'AttributeInvalid': + case 1: var s = _v2.a; return s; default: @@ -14838,7 +10044,7 @@ var $author$project$Main$viewFormFieldPreview = F3( }()), function () { var _v3 = $author$project$Main$maybeMaxLengthOf(formField); - if (_v3.$ === 'Just') { + if (!_v3.$) { var maxLength = _v3.a; return $elm$html$Html$text( ' (max ' + ($elm$core$String$fromInt(maxLength) + ' characters)')); @@ -14852,7 +10058,7 @@ var $author$project$Main$viewFormFieldPreview = F3( }); var $author$project$Main$renderFormBuilderField = F4( function (maybeAnimate, model, index, maybeFormField) { - if (maybeFormField.$ === 'Nothing') { + if (maybeFormField.$ === 1) { return A2( $elm$html$Html$div, _List_fromArray( @@ -14887,7 +10093,7 @@ var $author$project$Main$renderFormBuilderField = F4( A2( $elm$html$Html$Attributes$attribute, 'data-input-field', - $author$project$Main$stringFromInputField(formField.type_)), + $author$project$Main$stringFromInputField(formField.a)), A2( $elm$html$Html$Events$preventDefaultOn, 'dragover', @@ -14917,7 +10123,7 @@ var $author$project$Main$renderFormBuilderField = F4( _Utils_Tuple2( 'tff-animate-fadeOut', function () { - if ((maybeAnimate.$ === 'Just') && (maybeAnimate.a.b.$ === 'AnimateFadeOut')) { + if ((!maybeAnimate.$) && (maybeAnimate.a.b === 1)) { var _v2 = maybeAnimate.a; var i = _v2.a; var _v3 = _v2.b; @@ -14929,7 +10135,7 @@ var $author$project$Main$renderFormBuilderField = F4( _Utils_Tuple2( 'tff-animate-yellowFade', function () { - if ((maybeAnimate.$ === 'Just') && (maybeAnimate.a.b.$ === 'AnimateYellowFade')) { + if ((!maybeAnimate.$) && (!maybeAnimate.a.b)) { var _v5 = maybeAnimate.a; var i = _v5.a; var _v6 = _v5.b; @@ -14951,7 +10157,7 @@ var $author$project$Main$renderFormBuilderField = F4( $elm$html$Html$Attributes$attribute, 'data-selected', _Utils_eq( - model.selectedFieldIndex, + model.F, $elm$core$Maybe$Just(index)) ? 'true' : 'false'), A2($elm$html$Html$Attributes$attribute, 'draggable', 'true'), A2( @@ -14975,25 +10181,25 @@ var $author$project$Main$renderFormBuilderField = F4( _List_fromArray( [$author$project$Main$dragHandleIcon])), function () { - var hasVisibilityRules = !$elm$core$List$isEmpty(formField.visibilityRule); + var hasVisibilityRules = !$elm$core$List$isEmpty(formField.m); var hasFilterChoices = function () { - var _v7 = formField.type_; + var _v7 = formField.a; switch (_v7.$) { - case 'Dropdown': - var filter = _v7.a.filter; + case 2: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseOne': - var filter = _v7.a.filter; + case 3: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseMultiple': - var filter = _v7.a.filter; + case 4: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); default: return false; } }(); var fieldName = $author$project$Main$fieldNameOf(formField); - var referencedInfo = A2($author$project$Main$isFieldReferencedBy, fieldName, model.formFields); + var referencedInfo = A2($author$project$Main$isFieldReferencedBy, fieldName, model.g); return A2( $elm$html$Html$div, _List_fromArray( @@ -15002,57 +10208,57 @@ var $author$project$Main$renderFormBuilderField = F4( ]), _List_fromArray( [ - (hasVisibilityRules || referencedInfo.usedInVisibilityRules) ? A2( + (hasVisibilityRules || referencedInfo.a4) ? A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class( hasVisibilityRules ? 'tff-logic-indicator tff-logic-indicator-blue' : 'tff-logic-indicator tff-logic-indicator-gray'), $elm$html$Html$Attributes$title( - (hasVisibilityRules && referencedInfo.usedInVisibilityRules) ? 'This field has visibility logic and other fields\' visibility depends on it' : (hasVisibilityRules ? 'This field has visibility logic' : 'Other fields\' visibility depends on this field\'s value')) + (hasVisibilityRules && referencedInfo.a4) ? 'This field has visibility logic and other fields\' visibility depends on it' : (hasVisibilityRules ? 'This field has visibility logic' : 'Other fields\' visibility depends on this field\'s value')) ]), _List_fromArray( [ $elm$html$Html$text( - (hasVisibilityRules && referencedInfo.usedInVisibilityRules) ? 'Contains & affects logic' : (hasVisibilityRules ? 'Contains logic' : 'Affects logic')) + (hasVisibilityRules && referencedInfo.a4) ? 'Contains & affects logic' : (hasVisibilityRules ? 'Contains logic' : 'Affects logic')) ])) : $elm$html$Html$text(''), - (hasFilterChoices || referencedInfo.usedInChoiceFilters) ? A2( + (hasFilterChoices || referencedInfo.a3) ? A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class( hasFilterChoices ? 'tff-logic-indicator tff-logic-indicator-orange' : 'tff-logic-indicator tff-logic-indicator-gray'), $elm$html$Html$Attributes$title( - (hasFilterChoices && referencedInfo.usedInChoiceFilters) ? 'This field filters choices and other fields\' choices depend on it' : (hasFilterChoices ? 'This field filters choices based on another field' : 'Other fields\' choices depend on this field\'s value')) + (hasFilterChoices && referencedInfo.a3) ? 'This field filters choices and other fields\' choices depend on it' : (hasFilterChoices ? 'This field filters choices based on another field' : 'Other fields\' choices depend on this field\'s value')) ]), _List_fromArray( [ $elm$html$Html$text( - (hasFilterChoices && referencedInfo.usedInChoiceFilters) ? 'Filters & affects choices' : (hasFilterChoices ? 'Filters choices' : 'Affects choices')) + (hasFilterChoices && referencedInfo.a3) ? 'Filters & affects choices' : (hasFilterChoices ? 'Filters choices' : 'Affects choices')) ])) : $elm$html$Html$text('') ])); }(), A3( $author$project$Main$viewFormFieldPreview, { - customAttrs: _List_fromArray( + Y: _List_fromArray( [ A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled') ]), - formFields: model.formFields, - needsFormLogic: false, - onChange: function (_v8) { + g: model.g, + _: false, + bf: function (_v8) { return _List_Nil; }, - onChooseMany: F2( + bg: F2( function (_v9, _v10) { return _List_Nil; }), - onInput: function (_v11) { + aO: function (_v11) { return _List_Nil; }, - shortTextTypeDict: model.shortTextTypeDict, - trackedFormValues: model.trackedFormValues + ak: model.ak, + u: model.u }, index, formField) @@ -15062,10 +10268,10 @@ var $author$project$Main$renderFormBuilderField = F4( } }); var $author$project$Main$AddFormField = function (a) { - return {$: 'AddFormField', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$DragStartNew = function (a) { - return {$: 'DragStartNew', a: a}; + return {$: 10, a: a}; }; var $author$project$Main$viewAddQuestionsList = F2( function (nextQuestionNumber, inputFields) { @@ -15093,15 +10299,15 @@ var $author$project$Main$viewAddQuestionsList = F2( $elm$json$Json$Decode$succeed( $author$project$Main$DragStartNew( { - description: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), - label: $author$project$Main$stringFromInputField(inputField) + (' question ' + $elm$core$String$fromInt(nextQuestionNumber)), - name: $elm$core$Maybe$Nothing, - presence: A2( + S: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), + d: $author$project$Main$stringFromInputField(inputField) + (' question ' + $elm$core$String$fromInt(nextQuestionNumber)), + Q: $elm$core$Maybe$Nothing, + w: A2( $author$project$Main$when, $author$project$Main$mustBeOptional(inputField), - {_false: $author$project$Main$Required, _true: $author$project$Main$Optional}), - type_: inputField, - visibilityRule: _List_Nil + {aV: 0, a1: 1}), + a: inputField, + m: _List_Nil }))), A2( $elm$html$Html$Events$on, @@ -15116,35 +10322,36 @@ var $author$project$Main$viewAddQuestionsList = F2( }, inputFields)); }); -var $author$project$Main$AnimateFadeOut = {$: 'AnimateFadeOut'}; +var $elm$html$Html$button = _VirtualDom_node('button'); +var $author$project$Main$AnimateFadeOut = 1; var $author$project$Main$DeleteFormField = function (a) { - return {$: 'DeleteFormField', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$MoveFormFieldDown = function (a) { - return {$: 'MoveFormFieldDown', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$MoveFormFieldUp = function (a) { - return {$: 'MoveFormFieldUp', a: a}; + return {$: 4, a: a}; }; -var $author$project$Main$OnDescriptionInput = {$: 'OnDescriptionInput'}; +var $author$project$Main$OnDescriptionInput = {$: 1}; var $author$project$Main$OnDescriptionToggle = function (a) { - return {$: 'OnDescriptionToggle', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$OnFormField = F3( function (a, b, c) { - return {$: 'OnFormField', a: a, b: b, c: c}; + return {$: 6, a: a, b: b, c: c}; }); -var $author$project$Main$OnLabelInput = {$: 'OnLabelInput'}; +var $author$project$Main$OnLabelInput = {$: 0}; var $author$project$Main$OnMultipleToggle = function (a) { - return {$: 'OnMultipleToggle', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$OnRequiredInput = function (a) { - return {$: 'OnRequiredInput', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$allowsTogglingMultiple = function (inputField) { switch (inputField.$) { - case 'ShortText': - var attributes = inputField.a.attributes; + case 0: + var attributes = inputField.a.p; return A2( $elm$core$List$member, A2($elm$core$Dict$get, 'multiple', attributes), @@ -15153,11 +10360,11 @@ var $author$project$Main$allowsTogglingMultiple = function (inputField) { $elm$core$Maybe$Just('true'), $elm$core$Maybe$Just('false') ])); - case 'LongText': + case 1: return false; - case 'Dropdown': + case 2: return false; - case 'ChooseOne': + case 3: return false; default: return false; @@ -15169,7 +10376,7 @@ var $author$project$Main$hasDuplicateLabel = F3( $elm$core$List$any, function (_v1) { var f = _v1.b; - return _Utils_eq(f.label, newLabel); + return _Utils_eq(f.d, newLabel); }, A2( $elm$core$List$filter, @@ -15199,7 +10406,7 @@ var $elm$html$Html$Events$onCheck = function (tagger) { var $author$project$Main$inputAttributeOptional = F2( function (options, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': + case 0: return A2( $elm$html$Html$div, _List_fromArray( @@ -15223,14 +10430,14 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(false), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])) ])); - case 'AttributeInvalid': + case 1: var str = attributeOptional.a; return A2( $elm$html$Html$div, @@ -15255,13 +10462,13 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(true), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])), - options.htmlNode( + options.af( $elm$core$Result$Err(str)) ])); default: @@ -15289,78 +10496,97 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(true), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])), - options.htmlNode( + options.af( $elm$core$Result$Ok(a)) ])); } }); var $author$project$Main$maybeMultipleOf = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': - var multiple = _v0.a.multiple; + case 0: + var multiple = _v0.a.aM; switch (multiple.$) { - case 'AttributeGiven': + case 2: var i = multiple.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'LongText': + case 1: return $elm$core$Maybe$Nothing; - case 'Dropdown': + case 2: return $elm$core$Maybe$Nothing; - case 'ChooseOne': + case 3: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } }; +var $elm$html$Html$Events$alwaysStop = function (x) { + return _Utils_Tuple2(x, true); +}; +var $elm$html$Html$Events$targetValue = A2( + $elm$json$Json$Decode$at, + _List_fromArray( + ['target', 'value']), + $elm$json$Json$Decode$string); +var $elm$html$Html$Events$onInput = function (tagger) { + return A2( + $elm$html$Html$Events$stopPropagationOn, + 'input', + A2( + $elm$json$Json$Decode$map, + $elm$html$Html$Events$alwaysStop, + A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); +}; var $elm$html$Html$Attributes$pattern = $elm$html$Html$Attributes$stringProperty('pattern'); var $author$project$Main$OnCheckboxMaxAllowedInput = function (a) { - return {$: 'OnCheckboxMaxAllowedInput', a: a}; + return {$: 17, a: a}; }; var $author$project$Main$OnCheckboxMinRequiredInput = function (a) { - return {$: 'OnCheckboxMinRequiredInput', a: a}; + return {$: 16, a: a}; }; -var $author$project$Main$OnChoicesInput = {$: 'OnChoicesInput'}; -var $author$project$Main$OnDatalistInput = {$: 'OnDatalistInput'}; +var $author$project$Main$OnChoicesInput = {$: 4}; +var $author$project$Main$OnDatalistInput = {$: 9}; var $author$project$Main$OnDatalistToggle = function (a) { - return {$: 'OnDatalistToggle', a: a}; + return {$: 8, a: a}; }; var $author$project$Main$OnDateMaxInput = function (a) { - return {$: 'OnDateMaxInput', a: a}; + return {$: 21, a: a}; }; var $author$project$Main$OnDateMaxToggle = function (a) { - return {$: 'OnDateMaxToggle', a: a}; + return {$: 19, a: a}; }; var $author$project$Main$OnDateMinInput = function (a) { - return {$: 'OnDateMinInput', a: a}; + return {$: 20, a: a}; }; var $author$project$Main$OnDateMinToggle = function (a) { - return {$: 'OnDateMinToggle', a: a}; + return {$: 18, a: a}; }; var $author$project$Main$OnFilterSourceFieldSelect = function (a) { - return {$: 'OnFilterSourceFieldSelect', a: a}; + return {$: 24, a: a}; }; var $author$project$Main$OnFilterToggle = function (a) { - return {$: 'OnFilterToggle', a: a}; + return {$: 22, a: a}; }; var $author$project$Main$OnFilterTypeSelect = function (a) { - return {$: 'OnFilterTypeSelect', a: a}; + return {$: 23, a: a}; }; -var $author$project$Main$OnMaxLengthInput = {$: 'OnMaxLengthInput'}; +var $author$project$Main$OnMaxLengthInput = {$: 7}; var $author$project$Main$OnMaxLengthToggle = function (a) { - return {$: 'OnMaxLengthToggle', a: a}; + return {$: 6, a: a}; }; +var $elm$html$Html$Attributes$max = $elm$html$Html$Attributes$stringProperty('max'); +var $elm$html$Html$Attributes$min = $elm$html$Html$Attributes$stringProperty('min'); var $elm$html$Html$Attributes$minlength = function (n) { return A2( _VirtualDom_attribute, @@ -15379,7 +10605,7 @@ var $author$project$Main$otherQuestionTitles = F2( $elm$core$List$map, function (_v1) { var f = _v1.b; - return {label: f.label, name: f.name}; + return {d: f.d, Q: f.Q}; }, A2( $elm$core$List$filter, @@ -15402,8 +10628,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( var filterSettings = function (filter) { if (!_Utils_eq(filter, $elm$core$Maybe$Nothing)) { var sourceFieldName = function () { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { var name = filter.a.a; return name; } else { @@ -15416,8 +10642,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( }(); var otherFields = A2($author$project$Main$otherQuestionTitles, formFields, index); var filterType = function () { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { return 'startswith'; } else { return 'contains'; @@ -15542,7 +10768,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $elm$core$List$map, function (field) { - var fieldValue = A2($elm$core$Maybe$withDefault, field.label, field.name); + var fieldValue = A2($elm$core$Maybe$withDefault, field.d, field.Q); var isSelected = _Utils_eq(fieldValue, sourceFieldName); return A2( $elm$html$Html$option, @@ -15557,7 +10783,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( 'value of ' + A2( $elm$json$Json$Encode$encode, 0, - $elm$json$Json$Encode$string(field.label))) + $elm$json$Json$Encode$string(field.d))) ])); }, otherFields))) @@ -15644,11 +10870,11 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( $elm$html$Html$Attributes$required(true), $elm$html$Html$Attributes$readonly( function () { - var _v8 = formField.presence; - switch (_v8.$) { - case 'Required': + var _v8 = formField.w; + switch (_v8) { + case 0: return false; - case 'Optional': + case 1: return false; default: return true; @@ -15663,9 +10889,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil) ])); }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: var customElement = _v0.a; var maybeShortTextTypeMaxLength = A2( $elm$core$Maybe$andThen, @@ -15676,27 +10902,27 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $elm$core$Maybe$map, function ($) { - return $.attributes; + return $.p; }, $elm$core$List$head( A2( $elm$core$List$filter, function (_v6) { - var inputType = _v6.inputType; - return _Utils_eq(inputType, customElement.inputType); + var inputType = _v6.B; + return _Utils_eq(inputType, customElement.B); }, shortTextTypeList))))); return _Utils_ap( _List_fromArray( [ function () { - if (maybeShortTextTypeMaxLength.$ === 'Nothing') { + if (maybeShortTextTypeMaxLength.$ === 1) { return A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { + af: function (result) { var valueString = function () { - if (result.$ === 'Ok') { + if (!result.$) { var i = result.a; return $elm$core$String$fromInt(i); } else { @@ -15718,8 +10944,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]), _List_Nil); }, - label: 'Limit number of characters', - onCheck: function (b) { + d: 'Limit number of characters', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnMaxLengthToggle(b), @@ -15727,7 +10953,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.maxlength); + customElement.ah); } else { var i = maybeShortTextTypeMaxLength.a; return A2( @@ -15745,8 +10971,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var a = result.a; return A2( $author$project$Main$textarea, @@ -15782,8 +11008,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Suggested values', - onCheck: function (b) { + d: 'Suggested values', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDatalistToggle(b), @@ -15791,18 +11017,18 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.datalist) + customElement.ae) ]), - ((customElement.inputType === 'date') || (A2( + ((customElement.B === 'date') || (A2( $elm$core$Maybe$withDefault, '', - A2($elm$core$Dict$get, 'type', customElement.attributes)) === 'date')) ? _List_fromArray( + A2($elm$core$Dict$get, 'type', customElement.p)) === 'date')) ? _List_fromArray( [ A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var dateStr = result.a; return A2( $elm$html$Html$input, @@ -15844,8 +11070,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Minimum date', - onCheck: function (b) { + d: 'Minimum date', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDateMinToggle(b), @@ -15853,12 +11079,12 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.min), + customElement.ar), A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var dateStr = result.a; return A2( $elm$html$Html$input, @@ -15900,8 +11126,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Maximum date', - onCheck: function (b) { + d: 'Maximum date', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDateMaxToggle(b), @@ -15909,17 +11135,17 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.max) + customElement.aq) ]) : _List_Nil); - case 'LongText': + case 1: var optionalMaxLength = _v0.a; return _List_fromArray( [ A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var i = result.a; return A2( $elm$html$Html$input, @@ -15952,8 +11178,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Limit number of characters', - onCheck: function (b) { + d: 'Limit number of characters', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnMaxLengthToggle(b), @@ -15963,9 +11189,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( }, optionalMaxLength) ]); - case 'Dropdown': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 2: + var choices = _v0.a.k; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -15973,9 +11199,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( filterCheckbox(filter) ]), filterSettings(filter)); - case 'ChooseOne': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 3: + var choices = _v0.a.k; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -15984,10 +11210,10 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]), filterSettings(filter)); default: - var choices = _v0.a.choices; - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; - var filter = _v0.a.filter; + var choices = _v0.a.k; + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -16107,25 +11333,43 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]))); } }); -var $author$project$Main$OnAddVisibilityRule = {$: 'OnAddVisibilityRule'}; +var $author$project$Main$OnAddVisibilityRule = {$: 14}; +var $elm$core$List$intersperse = F2( + function (sep, xs) { + if (!xs.b) { + return _List_Nil; + } else { + var hd = xs.a; + var tl = xs.b; + var step = F2( + function (x, rest) { + return A2( + $elm$core$List$cons, + sep, + A2($elm$core$List$cons, x, rest)); + }); + var spersed = A3($elm$core$List$foldr, step, _List_Nil, tl); + return A2($elm$core$List$cons, hd, spersed); + } + }); var $author$project$Main$OnVisibilityConditionDuplicate = function (a) { - return {$: 'OnVisibilityConditionDuplicate', a: a}; + return {$: 15, a: a}; }; var $author$project$Main$OnVisibilityConditionFieldInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionFieldInput', a: a, b: b, c: c}; + return {$: 12, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityConditionTypeInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionTypeInput', a: a, b: b, c: c}; + return {$: 11, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityConditionValueInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionValueInput', a: a, b: b, c: c}; + return {$: 13, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityRuleTypeInput = F2( function (a, b) { - return {$: 'OnVisibilityRuleTypeInput', a: a, b: b}; + return {$: 10, a: a, b: b}; }); var $author$project$Main$comparisonOf = function (condition) { var comparison = condition.b; @@ -16134,26 +11378,32 @@ var $author$project$Main$comparisonOf = function (condition) { var $author$project$Main$isComparingWith = F2( function (expected, given) { switch (expected.$) { - case 'Equals': - if (given.$ === 'Equals') { + case 0: + if (!given.$) { return true; } else { return false; } - case 'StringContains': - if (given.$ === 'StringContains') { + case 1: + if (given.$ === 1) { return true; } else { return false; } - case 'EndsWith': - if (given.$ === 'EndsWith') { + case 2: + if (given.$ === 2) { + return true; + } else { + return false; + } + case 3: + if (given.$ === 3) { return true; } else { return false; } default: - if (given.$ === 'GreaterThan') { + if (given.$ === 4) { return true; } else { return false; @@ -16161,24 +11411,48 @@ var $author$project$Main$isComparingWith = F2( } }); var $author$project$Main$isHideWhen = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { return false; } else { return true; } }; var $author$project$Main$isShowWhen = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { return true; } else { return false; } }; +var $elm$core$Basics$composeR = F3( + function (f, g, x) { + return g( + f(x)); + }); var $author$project$Main$selectInputGroup = function (_v0) { - var selectAttrs = _v0.selectAttrs; - var options = _v0.options; - var inputAttrs = _v0.inputAttrs; - var children = _v0.children; + var selectAttrs = _v0.cN; + var options = _v0.cs; + var inputNode = _v0.b5; + var optionToNode = function (opt) { + return A2( + $elm$html$Html$option, + A2( + $elm$core$List$filterMap, + $elm$core$Basics$identity, + _List_fromArray( + [ + $elm$core$Maybe$Just( + $elm$html$Html$Attributes$value(opt.j)), + opt.bi ? $elm$core$Maybe$Just( + $elm$html$Html$Attributes$selected(true)) : $elm$core$Maybe$Nothing, + opt.bL ? $elm$core$Maybe$Just( + A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled')) : $elm$core$Maybe$Nothing + ])), + _List_fromArray( + [ + $elm$html$Html$text(opt.d) + ])); + }; var calculatedAttrs = A2( $elm$core$List$append, _List_fromArray( @@ -16187,15 +11461,16 @@ var $author$project$Main$selectInputGroup = function (_v0) { ]), A2( $elm$core$List$map, - function (_v3) { - var value = _v3.a; - return $elm$html$Html$Attributes$value(value); - }, + A2( + $elm$core$Basics$composeR, + function ($) { + return $.j; + }, + $elm$html$Html$Attributes$value), A2( $elm$core$List$filter, - function (_v2) { - var selected = _v2.c; - return selected; + function ($) { + return $.bi; }, options))); return A2( @@ -16225,34 +11500,10 @@ var $author$project$Main$selectInputGroup = function (_v0) { A2( $elm$html$Html$select, _Utils_ap(calculatedAttrs, selectAttrs), - A2( - $elm$core$List$map, - function (_v1) { - var value = _v1.a; - var label = _v1.b; - var selected = _v1.c; - return A2( - $elm$html$Html$option, - _List_fromArray( - [ - $elm$html$Html$Attributes$value(value), - $elm$html$Html$Attributes$selected(selected) - ]), - _List_fromArray( - [ - $elm$html$Html$text(label) - ])); - }, - options)), + A2($elm$core$List$map, optionToNode, options)), $author$project$Main$selectArrowDown ])), - A2( - $elm$html$Html$input, - A2( - $elm$core$List$cons, - $elm$html$Html$Attributes$class('tff-selectinput-input'), - inputAttrs), - children) + inputNode ])) ])); }; @@ -16275,12 +11526,12 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$core$Array$toList(formFields))); var datalistId = 'datalist-' + ($elm$core$String$fromInt(fieldIndex) + ('-' + ($elm$core$String$fromInt(ruleIndex) + ('-' + $elm$core$String$fromInt(conditionIndex))))); var datalistElement = function () { - if (selectedField.$ === 'Just') { + if (!selectedField.$) { var field = selectedField.a; - var _v7 = field.type_; + var _v7 = field.a; switch (_v7.$) { - case 'Dropdown': - var choices = _v7.a.choices; + case 2: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16295,13 +11546,13 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, choices))); - case 'ChooseOne': - var choices = _v7.a.choices; + case 3: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16316,13 +11567,13 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, choices))); - case 'ChooseMultiple': - var choices = _v7.a.choices; + case 4: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16337,7 +11588,7 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, @@ -16350,7 +11601,7 @@ var $author$project$Main$visibilityRuleSection = F4( } }(); var datalistAttr = function () { - if (datalistElement.$ === 'Just') { + if (!datalistElement.$) { return _List_fromArray( [ A2($elm$html$Html$Attributes$attribute, 'list', datalistId) @@ -16432,43 +11683,42 @@ var $author$project$Main$visibilityRuleSection = F4( 'value of ' + A2( $elm$json$Json$Encode$encode, 0, - $elm$json$Json$Encode$string(field.label))) + $elm$json$Json$Encode$string(field.d))) ])); }, A2($author$project$Main$otherQuestionTitles, formFields, fieldIndex)))) ])), - $author$project$Main$selectInputGroup( - { - children: function () { - if (datalistElement.$ === 'Just') { - var element = datalistElement.a; - return _List_fromArray( - [element]); - } else { - return _List_Nil; - } - }(), - inputAttrs: _Utils_ap( + function () { + var optionRecord = F4( + function (value, label, selected, disabled) { + return {bL: disabled, d: label, bi: selected, j: value}; + }); + var comparisonValueString = function () { + switch (rule.b.$) { + case 0: + var v = rule.b.a; + return v; + case 1: + var v = rule.b.a; + return v; + case 2: + var v = rule.b.a; + return v; + case 3: + var v = rule.b.a; + return v; + default: + var v = rule.b.a; + return v; + } + }(); + var textInputNode = A2( + $elm$html$Html$input, + _Utils_ap( _List_fromArray( [ $elm$html$Html$Attributes$type_('text'), - $elm$html$Html$Attributes$value( - function () { - switch (rule.b.$) { - case 'Equals': - var v = rule.b.a; - return v; - case 'StringContains': - var v = rule.b.a; - return v; - case 'EndsWith': - var v = rule.b.a; - return v; - default: - var v = rule.b.a; - return v; - } - }()), + $elm$html$Html$Attributes$value(comparisonValueString), $elm$html$Html$Events$onInput( function (str) { return A3( @@ -16481,50 +11731,155 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$Attributes$class('tff-comparison-value') ]), datalistAttr), - options: _List_fromArray( - [ - _Utils_Tuple3( - 'Equals', - 'Equals', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$Equals('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'StringContains', - 'Contains', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$StringContains('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'EndsWith', - 'Ends with', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$EndsWith('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'GreaterThan', - 'Greater than', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$GreaterThan('something'), - $author$project$Main$comparisonOf(rule))) - ]), - selectAttrs: _List_fromArray( + _List_Nil); + var candidateFields = A2($author$project$Main$otherQuestionTitles, formFields, fieldIndex); + var candidateFieldsExceptSelf = A2( + $elm$core$List$filter, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return !_Utils_eq(fn, selectedFieldName); + }, + candidateFields); + var equalsFieldDisabled = $elm$core$List$isEmpty(candidateFieldsExceptSelf); + var optionsList = _List_fromArray( + [ + A4( + optionRecord, + 'Equals', + 'Equals', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$Equals('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'StringContains', + 'Contains', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$StringContains('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'EndsWith', + 'Ends with', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$EndsWith('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'GreaterThan', + 'Greater than', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$GreaterThan('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'EqualsField', + 'Equals (field)', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$EqualsField('something'), + $author$project$Main$comparisonOf(rule)), + equalsFieldDisabled) + ]); + var otherFields = A2( + $elm$core$List$filter, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return !_Utils_eq(fn, selectedFieldName); + }, + candidateFields); + var fieldSelectNode = A2( + $elm$html$Html$select, + _List_fromArray( [ + $elm$html$Html$Attributes$class('tff-text-field tff-question-title'), $author$project$Main$onChange( function (str) { return A3( $author$project$Main$OnFormField, - A3($author$project$Main$OnVisibilityConditionTypeInput, ruleIndex, conditionIndex, str), + A3($author$project$Main$OnVisibilityConditionValueInput, ruleIndex, conditionIndex, str), fieldIndex, ''); }), - $elm$html$Html$Attributes$class('tff-comparison-type') - ]) - }) + $elm$html$Html$Attributes$value(comparisonValueString) + ]), + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$option, + _List_fromArray( + [ + $elm$html$Html$Attributes$value('') + ]), + _List_fromArray( + [ + $elm$html$Html$text('-- Select a field --') + ])), + A2( + $elm$core$List$map, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return A2( + $elm$html$Html$option, + _List_fromArray( + [ + $elm$html$Html$Attributes$value(fn), + $elm$html$Html$Attributes$selected( + _Utils_eq(fn, comparisonValueString)) + ]), + _List_fromArray( + [ + $elm$html$Html$text( + 'value of ' + A2( + $elm$json$Json$Encode$encode, + 0, + $elm$json$Json$Encode$string(f.d))) + ])); + }, + otherFields))); + var inputNode = function () { + var _v3 = $author$project$Main$comparisonOf(rule); + if (_v3.$ === 4) { + return equalsFieldDisabled ? A2( + $elm$html$Html$input, + _List_fromArray( + [ + $elm$html$Html$Attributes$type_('text'), + $elm$html$Html$Attributes$value(''), + A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled'), + $elm$html$Html$Attributes$class('tff-comparison-value') + ]), + _List_Nil) : fieldSelectNode; + } else { + return textInputNode; + } + }(); + return $author$project$Main$selectInputGroup( + { + b5: inputNode, + cs: optionsList, + cN: _List_fromArray( + [ + $author$project$Main$onChange( + function (str) { + return A3( + $author$project$Main$OnFormField, + A3($author$project$Main$OnVisibilityConditionTypeInput, ruleIndex, conditionIndex, str), + fieldIndex, + ''); + }), + $elm$html$Html$Attributes$class('tff-comparison-type') + ]) + }); + }() ])); }); var rulesHtml = A2( @@ -16572,7 +11927,7 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$Attributes$required(true), $elm$html$Html$Attributes$value( function () { - if (visibilityRule.$ === 'ShowWhen') { + if (!visibilityRule.$) { return 'ShowWhen'; } else { return 'HideWhen'; @@ -16698,7 +12053,7 @@ var $author$project$Main$visibilityRulesSection = F3( A2( $elm$core$List$indexedMap, A2($author$project$Main$visibilityRuleSection, index, formFields), - formField.visibilityRule))), + formField.m))), A2( $elm$html$Html$div, _List_fromArray( @@ -16725,7 +12080,7 @@ var $author$project$Main$visibilityRulesSection = F3( }); var $author$project$Main$viewFormFieldBuilder = F5( function (shortTextTypeList, index, totalLength, formFields, formField) { - var isDuplicateLabel = A3($author$project$Main$hasDuplicateLabel, index, formField.label, formFields); + var isDuplicateLabel = A3($author$project$Main$hasDuplicateLabel, index, formField.d, formFields); var patternAttr = isDuplicateLabel ? _List_fromArray( [ $elm$html$Html$Attributes$pattern('^$') @@ -16750,7 +12105,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( [ $author$project$Main$SetEditorAnimate( $elm$core$Maybe$Just( - _Utils_Tuple2(index, $author$project$Main$AnimateFadeOut))), + _Utils_Tuple2(index, 1))), $author$project$Main$DeleteFormField(index) ]))) ]), @@ -16783,7 +12138,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked( - $author$project$Main$requiredData(formField.presence)), + $author$project$Main$requiredData(formField.w)), $elm$html$Html$Events$onCheck( function (b) { return A3( @@ -16839,7 +12194,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( $elm$html$Html$text(' '), $elm$html$Html$text( 'Accept multiple ' + $elm$core$String$toLower( - $author$project$Main$stringFromInputField(formField.type_))) + $author$project$Main$stringFromInputField(formField.a))) ])) ])); var buildFieldClass = 'tff-build-field'; @@ -16870,7 +12225,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( _List_fromArray( [ $elm$html$Html$text( - $author$project$Main$stringFromInputField(formField.type_) + ' question title') + $author$project$Main$stringFromInputField(formField.a) + ' question title') ])), A2( $elm$html$Html$input, @@ -16879,7 +12234,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( [ $elm$html$Html$Attributes$type_('text'), $elm$html$Html$Attributes$id('label-' + idSuffix), - $elm$html$Html$Attributes$value(formField.label), + $elm$html$Html$Attributes$value(formField.d), $elm$html$Html$Attributes$required(true), $elm$html$Html$Events$onInput( A2($author$project$Main$OnFormField, $author$project$Main$OnLabelInput, index)), @@ -16899,27 +12254,27 @@ var $author$project$Main$viewFormFieldBuilder = F5( ])) : $elm$html$Html$text('') ])), function () { - if ($author$project$Main$mustBeOptional(formField.type_)) { + if ($author$project$Main$mustBeOptional(formField.a)) { return $elm$html$Html$text(''); } else { - var _v0 = formField.presence; - switch (_v0.$) { - case 'Required': + var _v0 = formField.w; + switch (_v0) { + case 0: return configureRequiredCheckbox; - case 'Optional': + case 1: return configureRequiredCheckbox; default: return $elm$html$Html$text(''); } } }(), - $author$project$Main$allowsTogglingMultiple(formField.type_) ? configureMultipleCheckbox : $elm$html$Html$text(''), + $author$project$Main$allowsTogglingMultiple(formField.a) ? configureMultipleCheckbox : $elm$html$Html$text(''), A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { + af: function (result) { var valueString = function () { - if (result.$ === 'Ok') { + if (!result.$) { var a = result.a; return a; } else { @@ -16939,8 +12294,8 @@ var $author$project$Main$viewFormFieldBuilder = F5( ]), _List_Nil); }, - label: 'Question description', - onCheck: function (b) { + d: 'Question description', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDescriptionToggle(b), @@ -16948,7 +12303,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( ''); } }, - formField.description) + formField.S) ]), _Utils_ap( A4($author$project$Main$viewFormFieldOptionsBuilder, shortTextTypeList, index, formFields, formField), @@ -17001,11 +12356,11 @@ var $author$project$Main$viewFormFieldBuilder = F5( ])) ])), function () { - var _v2 = formField.presence; - switch (_v2.$) { - case 'Required': + var _v2 = formField.w; + switch (_v2) { + case 0: return deleteFieldButton; - case 'Optional': + case 1: return deleteFieldButton; default: return $elm$html$Html$text(''); @@ -17021,7 +12376,7 @@ var $author$project$Main$viewRightPanel = function (modelData) { A2( $elm$core$List$cons, 'tff-right-panel', - (!_Utils_eq(modelData.selectedFieldIndex, $elm$core$Maybe$Nothing)) ? _List_fromArray( + (!_Utils_eq(modelData.F, $elm$core$Maybe$Nothing)) ? _List_fromArray( ['tff-panel-visible']) : _List_Nil)); return A2( $elm$html$Html$div, @@ -17069,18 +12424,18 @@ var $author$project$Main$viewRightPanel = function (modelData) { _List_fromArray( [ function () { - var _v0 = modelData.selectedFieldIndex; - if (_v0.$ === 'Just') { + var _v0 = modelData.F; + if (!_v0.$) { var index = _v0.a; - var _v1 = A2($elm$core$Array$get, index, modelData.formFields); - if (_v1.$ === 'Just') { + var _v1 = A2($elm$core$Array$get, index, modelData.g); + if (!_v1.$) { var formField = _v1.a; return A5( $author$project$Main$viewFormFieldBuilder, - modelData.shortTextTypeList, + modelData.al, index, - $elm$core$Array$length(modelData.formFields), - modelData.formFields, + $elm$core$Array$length(modelData.g), + modelData.g, formField); } else { return $elm$html$Html$text('Select a field to edit its settings'); @@ -17096,14 +12451,14 @@ var $author$project$Main$viewFormBuilder = F2( function (maybeAnimate, model) { var maybeFieldsList = A2( $author$project$Main$fieldsWithPlaceholder, - $elm$core$Array$toList(model.formFields), - model.dragged); + $elm$core$Array$toList(model.g), + model.q); var extraOptions = A2( $elm$core$List$map, function (customElement) { return $author$project$Main$ShortText(customElement); }, - model.shortTextTypeList); + model.al); return _List_fromArray( [ A2( @@ -17129,7 +12484,7 @@ var $author$project$Main$viewFormBuilder = F2( [ _Utils_Tuple2( 'tff-panel-hidden', - !_Utils_eq(model.selectedFieldIndex, $elm$core$Maybe$Nothing)) + !_Utils_eq(model.F, $elm$core$Maybe$Nothing)) ])) ]), _List_fromArray( @@ -17146,7 +12501,7 @@ var $author$project$Main$viewFormBuilder = F2( ])), A2( $author$project$Main$viewAddQuestionsList, - model.nextQuestionNumber, + model.aa, _Utils_ap($author$project$Main$allInputField, extraOptions)) ])), A2( @@ -17159,7 +12514,7 @@ var $author$project$Main$viewFormBuilder = F2( [ _Utils_Tuple2( 'tff-panel-hidden', - !_Utils_eq(model.selectedFieldIndex, $elm$core$Maybe$Nothing)) + !_Utils_eq(model.F, $elm$core$Maybe$Nothing)) ])), $elm$html$Html$Events$onClick( $author$project$Main$SelectField($elm$core$Maybe$Nothing)) @@ -17187,7 +12542,7 @@ var $author$project$Main$viewFormBuilder = F2( }); var $author$project$Main$OnFormValuesUpdated = F2( function (a, b) { - return {$: 'OnFormValuesUpdated', a: a, b: b}; + return {$: 15, a: a, b: b}; }); var $author$project$Main$fieldHasEmptyFilter = F2( function (formField, trackedFormValues) { @@ -17204,8 +12559,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( A2($elm$core$Dict$get, fieldName, trackedFormValues)))); }; var getFilterField = function (filter) { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { var fieldName = filter.a.a; return $elm$core$Maybe$Just(fieldName); } else { @@ -17216,10 +12571,10 @@ var $author$project$Main$fieldHasEmptyFilter = F2( return $elm$core$Maybe$Nothing; } }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'Dropdown': - var filter = _v0.a.filter; + case 2: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17227,8 +12582,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( $elm$core$Maybe$map, isFilterFieldEmpty, getFilterField(filter))); - case 'ChooseOne': - var filter = _v0.a.filter; + case 3: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17236,8 +12591,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( $elm$core$Maybe$map, isFilterFieldEmpty, getFilterField(filter))); - case 'ChooseMultiple': - var filter = _v0.a.filter; + case 4: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17250,22 +12605,27 @@ var $author$project$Main$fieldHasEmptyFilter = F2( } }); var $author$project$Main$isChooseManyUsingMinMax = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'ChooseMultiple': - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; + case 4: + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; return (!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) || (!_Utils_eq(maxAllowed, $elm$core$Maybe$Nothing)); - case 'ChooseOne': + case 3: return false; default: return false; } }; +var $elm$core$Basics$composeL = F3( + function (g, f, x) { + return g( + f(x)); + }); var $elm$core$List$all = F2( function (isOkay, list) { return !A2( @@ -17280,7 +12640,7 @@ var $author$project$Main$evaluateCondition = F2( var fieldName = condition.a; var comparison = condition.b; switch (comparison.$) { - case 'Equals': + case 0: var givenValue = comparison.a; return A2( $elm$core$List$member, @@ -17289,7 +12649,7 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - case 'StringContains': + case 1: var givenValue = comparison.a; return A2( $elm$core$List$any, @@ -17298,7 +12658,7 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - case 'EndsWith': + case 2: var givenValue = comparison.a; return A2( $elm$core$List$any, @@ -17307,13 +12667,13 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - default: + case 3: var givenValue = comparison.a; return A2( $elm$core$List$any, function (formValue) { var _v2 = $elm$core$String$toFloat(givenValue); - if (_v2.$ === 'Just') { + if (!_v2.$) { var givenFloat = _v2.a; return A2( $elm$core$Maybe$withDefault, @@ -17332,6 +12692,21 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); + default: + var otherFieldName = comparison.a; + var otherValues = A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, otherFieldName, trackedFormValues)); + return A2( + $elm$core$List$any, + function (v) { + return A2($elm$core$List$member, v, otherValues); + }, + A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, fieldName, trackedFormValues))); } }); var $author$project$Main$isVisibilityRuleSatisfied = F2( @@ -17339,7 +12714,7 @@ var $author$project$Main$isVisibilityRuleSatisfied = F2( return $elm$core$List$isEmpty(rules) || A2( $elm$core$List$any, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return A2( $elm$core$List$all, @@ -17357,10 +12732,10 @@ var $author$project$Main$isVisibilityRuleSatisfied = F2( }); var $author$project$Main$viewFormPreview = F2( function (customAttrs, _v0) { - var formFields = _v0.formFields; - var needsFormLogic = _v0.needsFormLogic; - var trackedFormValues = _v0.trackedFormValues; - var shortTextTypeDict = _v0.shortTextTypeDict; + var formFields = _v0.g; + var needsFormLogic = _v0._; + var trackedFormValues = _v0.u; + var shortTextTypeDict = _v0.ak; var onInputAttrs = function (fieldName) { return _List_fromArray( [ @@ -17379,7 +12754,7 @@ var $author$project$Main$viewFormPreview = F2( [ $elm$html$Html$Events$onCheck( function (_v5) { - return A2($author$project$Main$OnFormValuesUpdated, fieldName, choice.value); + return A2($author$project$Main$OnFormValuesUpdated, fieldName, choice.j); }) ]); }); @@ -17400,21 +12775,21 @@ var $author$project$Main$viewFormPreview = F2( $elm$core$Array$toList(formFields)); var needsEventHandlers = needsFormLogic || (isAnyChooseManyUsingMinMax || hasOptionalTemporalInputs); var config = { - customAttrs: customAttrs, - formFields: formFields, - needsFormLogic: needsFormLogic, - onChange: needsEventHandlers ? onChangeAttrs : function (_v1) { + Y: customAttrs, + g: formFields, + _: needsFormLogic, + bf: needsEventHandlers ? onChangeAttrs : function (_v1) { return _List_Nil; }, - onChooseMany: needsEventHandlers ? onChooseManyAttrs : F2( + bg: needsEventHandlers ? onChooseManyAttrs : F2( function (_v2, _v3) { return _List_Nil; }), - onInput: needsEventHandlers ? onInputAttrs : function (_v4) { + aO: needsEventHandlers ? onInputAttrs : function (_v4) { return _List_Nil; }, - shortTextTypeDict: shortTextTypeDict, - trackedFormValues: trackedFormValues + ak: shortTextTypeDict, + u: trackedFormValues }; return $elm$core$Array$toList( A2( @@ -17423,7 +12798,7 @@ var $author$project$Main$viewFormPreview = F2( A2( $elm$core$Array$filter, function (formField) { - return A2($author$project$Main$isVisibilityRuleSatisfied, formField.visibilityRule, trackedFormValues) && (!A2($author$project$Main$fieldHasEmptyFilter, formField, trackedFormValues)); + return A2($author$project$Main$isVisibilityRuleSatisfied, formField.m, trackedFormValues) && (!A2($author$project$Main$fieldHasEmptyFilter, formField, trackedFormValues)); }, formFields))); }); @@ -17433,11 +12808,11 @@ var $author$project$Main$viewMain = function (model) { _List_fromArray( [ $elm$html$Html$Attributes$class( - 'tff tff-container tff-mode-' + $author$project$Main$stringFromViewMode(model.viewMode)) + 'tff tff-container tff-mode-' + $author$project$Main$stringFromViewMode(model.ac)) ]), function () { - var _v0 = model.viewMode; - if (_v0.$ === 'Editor') { + var _v0 = model.ac; + if (!_v0.$) { var editorAttr = _v0.a; return A2( $elm$core$List$cons, @@ -17451,18 +12826,18 @@ var $author$project$Main$viewMain = function (model) { A2( $elm$json$Json$Encode$encode, 0, - $author$project$Main$encodeFormFields(model.formFields))) + $author$project$Main$encodeFormFields(model.g))) ]), _List_Nil), - A2($author$project$Main$viewFormBuilder, editorAttr.maybeAnimate, model)); + A2($author$project$Main$viewFormBuilder, editorAttr.aB, model)); } else { return A2($author$project$Main$viewFormPreview, _List_Nil, model); } }()); }; var $author$project$Main$view = function (model) { - var _v0 = model.initError; - if (_v0.$ === 'Just') { + var _v0 = model.aW; + if (!_v0.$) { var errString = _v0.a; return A2( $elm$html$Html$div, @@ -17492,9 +12867,9 @@ var $author$project$Main$view = function (model) { } }; var $author$project$Main$main = $elm$browser$Browser$element( - {init: $author$project$Main$init, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view}); + {ds: $author$project$Main$init, dS: $author$project$Main$subscriptions, dV: $author$project$Main$update, dW: $author$project$Main$view}); /* -_Platform_export({'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)({"versions":{"elm":"0.19.1"},"types":{"message":"Main.Msg","aliases":{"Main.Droppable":{"args":[],"type":"( Basics.Int, Maybe.Maybe Main.FormField )"},"Main.FormField":{"args":[],"type":"{ label : String.String, name : Maybe.Maybe String.String, presence : Main.Presence, description : Main.AttributeOptional String.String, type_ : Main.InputField, visibilityRule : List.List Main.VisibilityRule }"},"Main.Choice":{"args":[],"type":"{ label : String.String, value : String.String }"},"Main.CustomElement":{"args":[],"type":"{ inputType : String.String, inputTag : String.String, attributes : Dict.Dict String.String String.String, multiple : Main.AttributeOptional Basics.Bool, maxlength : Main.AttributeOptional Basics.Int, datalist : Main.AttributeOptional (List.List Main.Choice), min : Main.AttributeOptional String.String, max : Main.AttributeOptional String.String }"}},"unions":{"Main.Msg":{"args":[],"tags":{"NoOp":[],"OnPortIncoming":["Json.Encode.Value"],"AddFormField":["Main.InputField"],"DeleteFormField":["Basics.Int"],"MoveFormFieldUp":["Basics.Int"],"MoveFormFieldDown":["Basics.Int"],"OnFormField":["Main.FormFieldMsg","Basics.Int","String.String"],"SetEditorAnimate":["Maybe.Maybe ( Basics.Int, Main.Animate )"],"SelectField":["Maybe.Maybe Basics.Int"],"DragStart":["Basics.Int"],"DragStartNew":["Main.FormField"],"DragEnd":[],"DragOver":["Maybe.Maybe Main.Droppable"],"Drop":["Maybe.Maybe Basics.Int"],"DoSleepDo":["Basics.Float","List.List Main.Msg"],"OnFormValuesUpdated":["String.String","String.String"]}},"Main.Animate":{"args":[],"tags":{"AnimateYellowFade":[],"AnimateFadeOut":[]}},"Main.AttributeOptional":{"args":["a"],"tags":{"AttributeNotNeeded":["Maybe.Maybe a"],"AttributeInvalid":["String.String"],"AttributeGiven":["a"]}},"Basics.Float":{"args":[],"tags":{"Float":[]}},"Main.FormFieldMsg":{"args":[],"tags":{"OnLabelInput":[],"OnDescriptionInput":[],"OnDescriptionToggle":["Basics.Bool"],"OnRequiredInput":["Basics.Bool"],"OnChoicesInput":[],"OnMultipleToggle":["Basics.Bool"],"OnMaxLengthToggle":["Basics.Bool"],"OnMaxLengthInput":[],"OnDatalistToggle":["Basics.Bool"],"OnDatalistInput":[],"OnVisibilityRuleTypeInput":["Basics.Int","String.String"],"OnVisibilityConditionTypeInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionFieldInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionValueInput":["Basics.Int","Basics.Int","String.String"],"OnAddVisibilityRule":[],"OnVisibilityConditionDuplicate":["Basics.Int"],"OnCheckboxMinRequiredInput":["String.String"],"OnCheckboxMaxAllowedInput":["String.String"],"OnDateMinToggle":["Basics.Bool"],"OnDateMaxToggle":["Basics.Bool"],"OnDateMinInput":["String.String"],"OnDateMaxInput":["String.String"],"OnFilterToggle":["Basics.Bool"],"OnFilterTypeSelect":["String.String"],"OnFilterSourceFieldSelect":["String.String"]}},"Main.InputField":{"args":[],"tags":{"ShortText":["Main.CustomElement"],"LongText":["Main.AttributeOptional Basics.Int"],"Dropdown":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseOne":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseMultiple":["{ choices : List.List Main.Choice, minRequired : Maybe.Maybe Basics.Int, maxAllowed : Maybe.Maybe Basics.Int, filter : Maybe.Maybe Main.ChoiceFilter }"]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Main.Presence":{"args":[],"tags":{"Required":[],"Optional":[],"System":[]}},"String.String":{"args":[],"tags":{"String":[]}},"Json.Encode.Value":{"args":[],"tags":{"Value":[]}},"Main.VisibilityRule":{"args":[],"tags":{"ShowWhen":["List.List Main.Condition"],"HideWhen":["List.List Main.Condition"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Main.ChoiceFilter":{"args":[],"tags":{"FilterStartsWithFieldValueOf":["String.String"],"FilterContainsFieldValueOf":["String.String"]}},"Main.Condition":{"args":[],"tags":{"Field":["String.String","Main.Comparison"]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":[]}},"Main.Comparison":{"args":[],"tags":{"Equals":["String.String"],"StringContains":["String.String"],"EndsWith":["String.String"],"GreaterThan":["String.String"]}},"Dict.NColor":{"args":[],"tags":{"Red":[],"Black":[]}}}}})}});}(this)); +_Platform_export({'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)(0)}});}(this)); */ -export const Elm = {'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)({"versions":{"elm":"0.19.1"},"types":{"message":"Main.Msg","aliases":{"Main.Droppable":{"args":[],"type":"( Basics.Int, Maybe.Maybe Main.FormField )"},"Main.FormField":{"args":[],"type":"{ label : String.String, name : Maybe.Maybe String.String, presence : Main.Presence, description : Main.AttributeOptional String.String, type_ : Main.InputField, visibilityRule : List.List Main.VisibilityRule }"},"Main.Choice":{"args":[],"type":"{ label : String.String, value : String.String }"},"Main.CustomElement":{"args":[],"type":"{ inputType : String.String, inputTag : String.String, attributes : Dict.Dict String.String String.String, multiple : Main.AttributeOptional Basics.Bool, maxlength : Main.AttributeOptional Basics.Int, datalist : Main.AttributeOptional (List.List Main.Choice), min : Main.AttributeOptional String.String, max : Main.AttributeOptional String.String }"}},"unions":{"Main.Msg":{"args":[],"tags":{"NoOp":[],"OnPortIncoming":["Json.Encode.Value"],"AddFormField":["Main.InputField"],"DeleteFormField":["Basics.Int"],"MoveFormFieldUp":["Basics.Int"],"MoveFormFieldDown":["Basics.Int"],"OnFormField":["Main.FormFieldMsg","Basics.Int","String.String"],"SetEditorAnimate":["Maybe.Maybe ( Basics.Int, Main.Animate )"],"SelectField":["Maybe.Maybe Basics.Int"],"DragStart":["Basics.Int"],"DragStartNew":["Main.FormField"],"DragEnd":[],"DragOver":["Maybe.Maybe Main.Droppable"],"Drop":["Maybe.Maybe Basics.Int"],"DoSleepDo":["Basics.Float","List.List Main.Msg"],"OnFormValuesUpdated":["String.String","String.String"]}},"Main.Animate":{"args":[],"tags":{"AnimateYellowFade":[],"AnimateFadeOut":[]}},"Main.AttributeOptional":{"args":["a"],"tags":{"AttributeNotNeeded":["Maybe.Maybe a"],"AttributeInvalid":["String.String"],"AttributeGiven":["a"]}},"Basics.Float":{"args":[],"tags":{"Float":[]}},"Main.FormFieldMsg":{"args":[],"tags":{"OnLabelInput":[],"OnDescriptionInput":[],"OnDescriptionToggle":["Basics.Bool"],"OnRequiredInput":["Basics.Bool"],"OnChoicesInput":[],"OnMultipleToggle":["Basics.Bool"],"OnMaxLengthToggle":["Basics.Bool"],"OnMaxLengthInput":[],"OnDatalistToggle":["Basics.Bool"],"OnDatalistInput":[],"OnVisibilityRuleTypeInput":["Basics.Int","String.String"],"OnVisibilityConditionTypeInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionFieldInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionValueInput":["Basics.Int","Basics.Int","String.String"],"OnAddVisibilityRule":[],"OnVisibilityConditionDuplicate":["Basics.Int"],"OnCheckboxMinRequiredInput":["String.String"],"OnCheckboxMaxAllowedInput":["String.String"],"OnDateMinToggle":["Basics.Bool"],"OnDateMaxToggle":["Basics.Bool"],"OnDateMinInput":["String.String"],"OnDateMaxInput":["String.String"],"OnFilterToggle":["Basics.Bool"],"OnFilterTypeSelect":["String.String"],"OnFilterSourceFieldSelect":["String.String"]}},"Main.InputField":{"args":[],"tags":{"ShortText":["Main.CustomElement"],"LongText":["Main.AttributeOptional Basics.Int"],"Dropdown":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseOne":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseMultiple":["{ choices : List.List Main.Choice, minRequired : Maybe.Maybe Basics.Int, maxAllowed : Maybe.Maybe Basics.Int, filter : Maybe.Maybe Main.ChoiceFilter }"]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Main.Presence":{"args":[],"tags":{"Required":[],"Optional":[],"System":[]}},"String.String":{"args":[],"tags":{"String":[]}},"Json.Encode.Value":{"args":[],"tags":{"Value":[]}},"Main.VisibilityRule":{"args":[],"tags":{"ShowWhen":["List.List Main.Condition"],"HideWhen":["List.List Main.Condition"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Main.ChoiceFilter":{"args":[],"tags":{"FilterStartsWithFieldValueOf":["String.String"],"FilterContainsFieldValueOf":["String.String"]}},"Main.Condition":{"args":[],"tags":{"Field":["String.String","Main.Comparison"]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":[]}},"Main.Comparison":{"args":[],"tags":{"Equals":["String.String"],"StringContains":["String.String"],"EndsWith":["String.String"],"GreaterThan":["String.String"]}},"Dict.NColor":{"args":[],"tags":{"Red":[],"Black":[]}}}}})}}; +export const Elm = {'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)(0)}}; \ No newline at end of file diff --git a/dist/tiny-form-fields.js b/dist/tiny-form-fields.js index 91765eb..342e6ee 100644 --- a/dist/tiny-form-fields.js +++ b/dist/tiny-form-fields.js @@ -77,7 +77,7 @@ function A9(fun, a, b, c, d, e, f, g, h, i) { return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i); } -console.warn('Compiled in DEBUG mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.'); + // EQUALITY @@ -113,7 +113,7 @@ function _Utils_eqHelp(x, y, depth, stack) return true; } - /**/ + /**_UNUSED/ if (x.$ === 'Set_elm_builtin') { x = $elm$core$Set$toList(x); @@ -126,7 +126,7 @@ function _Utils_eqHelp(x, y, depth, stack) } //*/ - /**_UNUSED/ + /**/ if (x.$ < 0) { x = $elm$core$Dict$toList(x); @@ -161,7 +161,7 @@ function _Utils_cmp(x, y, ord) return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; } - /**/ + /**_UNUSED/ if (x instanceof String) { var a = x.valueOf(); @@ -170,10 +170,10 @@ function _Utils_cmp(x, y, ord) } //*/ - /**_UNUSED/ + /**/ if (typeof x.$ === 'undefined') //*/ - /**/ + /**_UNUSED/ if (x.$[0] === '#') //*/ { @@ -203,17 +203,17 @@ var _Utils_compare = F2(function(x, y) // COMMON VALUES -var _Utils_Tuple0_UNUSED = 0; -var _Utils_Tuple0 = { $: '#0' }; +var _Utils_Tuple0 = 0; +var _Utils_Tuple0_UNUSED = { $: '#0' }; -function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; } -function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; } +function _Utils_Tuple2(a, b) { return { a: a, b: b }; } +function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } -function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; } -function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } +function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } +function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } -function _Utils_chr_UNUSED(c) { return c; } -function _Utils_chr(c) { return new String(c); } +function _Utils_chr(c) { return c; } +function _Utils_chr_UNUSED(c) { return new String(c); } // RECORDS @@ -264,11 +264,11 @@ function _Utils_ap(xs, ys) -var _List_Nil_UNUSED = { $: 0 }; -var _List_Nil = { $: '[]' }; +var _List_Nil = { $: 0 }; +var _List_Nil_UNUSED = { $: '[]' }; -function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; } -function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; } +function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } +function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } var _List_cons = F2(_List_Cons); @@ -499,12 +499,12 @@ var _JsArray_appendN = F3(function(n, dest, source) // LOG -var _Debug_log_UNUSED = F2(function(tag, value) +var _Debug_log = F2(function(tag, value) { return value; }); -var _Debug_log = F2(function(tag, value) +var _Debug_log_UNUSED = F2(function(tag, value) { console.log(tag + ': ' + _Debug_toString(value)); return value; @@ -530,12 +530,12 @@ function _Debug_todoCase(moduleName, region, value) // TO STRING -function _Debug_toString_UNUSED(value) +function _Debug_toString(value) { return ''; } -function _Debug_toString(value) +function _Debug_toString_UNUSED(value) { return _Debug_toAnsiString(false, value); } @@ -720,13 +720,13 @@ function _Debug_toHexDigit(n) // CRASH -function _Debug_crash_UNUSED(identifier) +function _Debug_crash(identifier) { throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); } -function _Debug_crash(identifier, fact1, fact2, fact3, fact4) +function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) { switch(identifier) { @@ -784,11 +784,11 @@ function _Debug_crash(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.start.line === region.end.line) + if (region.bl.aL === region.bN.aL) { - return 'on line ' + region.start.line; + return 'on line ' + region.bl.aL; } - return 'on lines ' + region.start.line + ' through ' + region.end.line; + return 'on lines ' + region.bl.aL + ' through ' + region.bN.aL; } @@ -1212,7 +1212,7 @@ function _Char_toLocaleLower(char) -/**/ +/**_UNUSED/ function _Json_errorToString(error) { return $elm$json$Json$Decode$errorToString(error); @@ -1616,11 +1616,11 @@ var _Json_encode = F2(function(indentLevel, value) return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; }); -function _Json_wrap(value) { return { $: 0, a: value }; } -function _Json_unwrap(value) { return value.a; } +function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } +function _Json_unwrap_UNUSED(value) { return value.a; } -function _Json_wrap_UNUSED(value) { return value; } -function _Json_unwrap_UNUSED(value) { return value; } +function _Json_wrap(value) { return value; } +function _Json_unwrap(value) { return value; } function _Json_emptyArray() { return []; } function _Json_emptyObject() { return {}; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.ds, + impl.dV, + impl.dS, function() { return function() {} } ); }); @@ -1872,7 +1872,7 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) { var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); - $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/); + $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); var managers = {}; var initPair = init(result.a); var model = initPair.a; @@ -2316,7 +2316,7 @@ function _Platform_setupIncomingPort(name, sendToApp) // -function _Platform_export_UNUSED(exports) +function _Platform_export(exports) { scope['Elm'] ? _Platform_mergeExportsProd(scope['Elm'], exports) @@ -2337,7 +2337,7 @@ function _Platform_mergeExportsProd(obj, exports) } -function _Platform_export(exports) +function _Platform_export_UNUSED(exports) { scope['Elm'] ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) @@ -2377,10 +2377,10 @@ var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args { // NOTE: this function needs _Platform_export available to work - /**_UNUSED/ + /**/ var node = args['node']; //*/ - /**/ + /**_UNUSED/ var node = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ @@ -2655,14 +2655,14 @@ function _VirtualDom_noInnerHtmlOrFormAction(key) function _VirtualDom_noJavaScriptUri(value) { return _VirtualDom_RE_js.test(value) - ? /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ : value; } function _VirtualDom_noJavaScriptOrHtmlUri(value) { return _VirtualDom_RE_js_html.test(value) - ? /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + ? /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ : value; } @@ -2670,7 +2670,7 @@ function _VirtualDom_noJavaScriptOrHtmlJson(value) { return (typeof _Json_unwrap(value) === 'string' && _VirtualDom_RE_js_html.test(_Json_unwrap(value))) ? _Json_wrap( - /**_UNUSED/''//*//**/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ + /**/''//*//**_UNUSED/'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'//*/ ) : value; } @@ -2719,9 +2719,9 @@ var _VirtualDom_mapEventTuple = F2(function(func, tuple) var _VirtualDom_mapEventRecord = F2(function(func, record) { return { - message: func(record.message), - stopPropagation: record.stopPropagation, - preventDefault: record.preventDefault + ai: func(record.ai), + bm: record.bm, + bh: record.bh } }); @@ -2989,11 +2989,11 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) // 3 = Custom var value = result.a; - var message = !tag ? value : tag < 3 ? value.a : value.message; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation; + var message = !tag ? value : tag < 3 ? value.a : value.ai; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.bm; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.bh) && event.preventDefault(), eventNode ); var tagger; @@ -3932,6503 +3932,990 @@ function _VirtualDom_dekey(keyedNode) -var _Bitwise_and = F2(function(a, b) -{ - return a & b; -}); - -var _Bitwise_or = F2(function(a, b) -{ - return a | b; -}); - -var _Bitwise_xor = F2(function(a, b) -{ - return a ^ b; -}); - -function _Bitwise_complement(a) -{ - return ~a; -}; - -var _Bitwise_shiftLeftBy = F2(function(offset, a) -{ - return a << offset; -}); - -var _Bitwise_shiftRightBy = F2(function(offset, a) -{ - return a >> offset; -}); - -var _Bitwise_shiftRightZfBy = F2(function(offset, a) -{ - return a >>> offset; -}); - - - - -// HELPERS - - -function _Debugger_unsafeCoerce(value) -{ - return value; -} - +// ELEMENT -// PROGRAMS +var _Debugger_element; -var _Debugger_element = F4(function(impl, flagDecoder, debugMetadata, args) +var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args) { return _Platform_initialize( flagDecoder, args, - A3($elm$browser$Debugger$Main$wrapInit, _Json_wrap(debugMetadata), _Debugger_popout(), impl.init), - $elm$browser$Debugger$Main$wrapUpdate(impl.update), - $elm$browser$Debugger$Main$wrapSubs(impl.subscriptions), - function(sendToApp, initialModel) - { - var view = impl.view; - var title = _VirtualDom_doc.title; + impl.ds, + impl.dV, + impl.dS, + function(sendToApp, initialModel) { + var view = impl.dW; + /**/ + var domNode = args['node']; + //*/ + /**_UNUSED/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); + //*/ var currNode = _VirtualDom_virtualize(domNode); - var currBlocker = $elm$browser$Debugger$Main$toBlockerType(initialModel); - var currPopout; - - var cornerNode = _VirtualDom_doc.createElement('div'); - domNode.parentNode.insertBefore(cornerNode, domNode.nextSibling); - var cornerCurr = _VirtualDom_virtualize(cornerNode); - - initialModel.popout.a = sendToApp; return _Browser_makeAnimator(initialModel, function(model) { - var nextNode = A2(_VirtualDom_map, $elm$browser$Debugger$Main$UserMsg, view($elm$browser$Debugger$Main$getUserModel(model))); + var nextNode = view(model); var patches = _VirtualDom_diff(currNode, nextNode); domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp); currNode = nextNode; - - // update blocker - - var nextBlocker = $elm$browser$Debugger$Main$toBlockerType(model); - _Debugger_updateBlocker(currBlocker, nextBlocker); - currBlocker = nextBlocker; - - // view corner - - var cornerNext = $elm$browser$Debugger$Main$cornerView(model); - var cornerPatches = _VirtualDom_diff(cornerCurr, cornerNext); - cornerNode = _VirtualDom_applyPatches(cornerNode, cornerCurr, cornerPatches, sendToApp); - cornerCurr = cornerNext; - - if (!model.popout.b) - { - currPopout = undefined; - return; - } - - // view popout - - _VirtualDom_doc = model.popout.b; // SWITCH TO POPOUT DOC - currPopout || (currPopout = _VirtualDom_virtualize(model.popout.b)); - var nextPopout = $elm$browser$Debugger$Main$popoutView(model); - var popoutPatches = _VirtualDom_diff(currPopout, nextPopout); - _VirtualDom_applyPatches(model.popout.b.body, currPopout, popoutPatches, sendToApp); - currPopout = nextPopout; - _VirtualDom_doc = document; // SWITCH BACK TO NORMAL DOC }); } ); }); -var _Debugger_document = F4(function(impl, flagDecoder, debugMetadata, args) + +// DOCUMENT + + +var _Debugger_document; + +var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args) { return _Platform_initialize( flagDecoder, args, - A3($elm$browser$Debugger$Main$wrapInit, _Json_wrap(debugMetadata), _Debugger_popout(), impl.init), - $elm$browser$Debugger$Main$wrapUpdate(impl.update), - $elm$browser$Debugger$Main$wrapSubs(impl.subscriptions), - function(sendToApp, initialModel) - { - var divertHrefToApp = impl.setup && impl.setup(function(x) { return sendToApp($elm$browser$Debugger$Main$UserMsg(x)); }); - var view = impl.view; + impl.ds, + impl.dV, + impl.dS, + function(sendToApp, initialModel) { + var divertHrefToApp = impl.bj && impl.bj(sendToApp) + var view = impl.dW; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); - var currBlocker = $elm$browser$Debugger$Main$toBlockerType(initialModel); - var currPopout; - - initialModel.popout.a = sendToApp; - return _Browser_makeAnimator(initialModel, function(model) { _VirtualDom_divertHrefToApp = divertHrefToApp; - var doc = view($elm$browser$Debugger$Main$getUserModel(model)); - var nextNode = _VirtualDom_node('body')(_List_Nil)( - _Utils_ap( - A2($elm$core$List$map, _VirtualDom_map($elm$browser$Debugger$Main$UserMsg), doc.body), - _List_Cons($elm$browser$Debugger$Main$cornerView(model), _List_Nil) - ) - ); + var doc = view(model); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.c7); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); - - // update blocker - - var nextBlocker = $elm$browser$Debugger$Main$toBlockerType(model); - _Debugger_updateBlocker(currBlocker, nextBlocker); - currBlocker = nextBlocker; - - // view popout - - if (!model.popout.b) { currPopout = undefined; return; } - - _VirtualDom_doc = model.popout.b; // SWITCH TO POPOUT DOC - currPopout || (currPopout = _VirtualDom_virtualize(model.popout.b)); - var nextPopout = $elm$browser$Debugger$Main$popoutView(model); - var popoutPatches = _VirtualDom_diff(currPopout, nextPopout); - _VirtualDom_applyPatches(model.popout.b.body, currPopout, popoutPatches, sendToApp); - currPopout = nextPopout; - _VirtualDom_doc = document; // SWITCH BACK TO NORMAL DOC + (title !== doc.cV) && (_VirtualDom_doc.title = title = doc.cV); }); } ); }); -function _Debugger_popout() -{ - return { - b: undefined, - a: undefined - }; -} -function _Debugger_isOpen(popout) -{ - return !!popout.b; -} +// ANIMATION -function _Debugger_open(popout) -{ - return _Scheduler_binding(function(callback) - { - _Debugger_openWindow(popout); - callback(_Scheduler_succeed(_Utils_Tuple0)); - }); -} -function _Debugger_openWindow(popout) +var _Browser_cancelAnimationFrame = + typeof cancelAnimationFrame !== 'undefined' + ? cancelAnimationFrame + : function(id) { clearTimeout(id); }; + +var _Browser_requestAnimationFrame = + typeof requestAnimationFrame !== 'undefined' + ? requestAnimationFrame + : function(callback) { return setTimeout(callback, 1000 / 60); }; + + +function _Browser_makeAnimator(model, draw) { - var w = $elm$browser$Debugger$Main$initialWindowWidth, - h = $elm$browser$Debugger$Main$initialWindowHeight, - x = screen.width - w, - y = screen.height - h; - - var debuggerWindow = window.open('', '', 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y); - var doc = debuggerWindow.document; - doc.title = 'Elm Debugger'; - - // handle arrow keys - doc.addEventListener('keydown', function(event) { - event.metaKey && event.which === 82 && window.location.reload(); - event.key === 'ArrowUp' && (popout.a($elm$browser$Debugger$Main$Up ), event.preventDefault()); - event.key === 'ArrowDown' && (popout.a($elm$browser$Debugger$Main$Down), event.preventDefault()); - }); + draw(model); - // handle window close - window.addEventListener('unload', close); - debuggerWindow.addEventListener('unload', function() { - popout.b = undefined; - popout.a($elm$browser$Debugger$Main$NoOp); - window.removeEventListener('unload', close); - }); + var state = 0; - function close() { - popout.b = undefined; - popout.a($elm$browser$Debugger$Main$NoOp); - debuggerWindow.close(); + function updateIfNeeded() + { + state = state === 1 + ? 0 + : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 ); } - // register new window - popout.b = doc; + return function(nextModel, isSync) + { + model = nextModel; + + isSync + ? ( draw(model), + state === 2 && (state = 1) + ) + : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded), + state = 2 + ); + }; } -// SCROLL +// APPLICATION -function _Debugger_scroll(popout) +function _Browser_application(impl) { - return _Scheduler_binding(function(callback) - { - if (popout.b) + var onUrlChange = impl.dJ; + var onUrlRequest = impl.dK; + var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; + + return _Browser_document({ + bj: function(sendToApp) { - var msgs = popout.b.getElementById('elm-debugger-sidebar'); - if (msgs && msgs.scrollTop !== 0) + key.a = sendToApp; + _Browser_window.addEventListener('popstate', key); + _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key); + + return F2(function(domNode, event) { - msgs.scrollTop = 0; - } - } - callback(_Scheduler_succeed(_Utils_Tuple0)); + if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download')) + { + event.preventDefault(); + var href = domNode.href; + var curr = _Browser_getUrl(); + var next = $elm$url$Url$fromString(href).a; + sendToApp(onUrlRequest( + (next + && curr.cC === next.cC + && curr.b1 === next.b1 + && curr.cw.a === next.cw.a + ) + ? $elm$browser$Browser$Internal(next) + : $elm$browser$Browser$External(href) + )); + } + }); + }, + ds: function(flags) + { + return A3(impl.ds, flags, _Browser_getUrl(), key); + }, + dW: impl.dW, + dV: impl.dV, + dS: impl.dS }); } +function _Browser_getUrl() +{ + return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1); +} -var _Debugger_scrollTo = F2(function(id, popout) +var _Browser_go = F2(function(key, n) { - return _Scheduler_binding(function(callback) - { - if (popout.b) - { - var msg = popout.b.getElementById(id); - if (msg) - { - msg.scrollIntoView(false); - } - } - callback(_Scheduler_succeed(_Utils_Tuple0)); - }); + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + n && history.go(n); + key(); + })); }); +var _Browser_pushUrl = F2(function(key, url) +{ + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + history.pushState({}, '', url); + key(); + })); +}); - -// UPLOAD - - -function _Debugger_upload(popout) +var _Browser_replaceUrl = F2(function(key, url) { - return _Scheduler_binding(function(callback) - { - var doc = popout.b || document; - var element = doc.createElement('input'); - element.setAttribute('type', 'file'); - element.setAttribute('accept', 'text/json'); - element.style.display = 'none'; - element.addEventListener('change', function(event) - { - var fileReader = new FileReader(); - fileReader.onload = function(e) - { - callback(_Scheduler_succeed(e.target.result)); - }; - fileReader.readAsText(event.target.files[0]); - doc.body.removeChild(element); - }); - doc.body.appendChild(element); - element.click(); - }); -} + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { + history.replaceState({}, '', url); + key(); + })); +}); -// DOWNLOAD +// GLOBAL EVENTS + +var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} }; +var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode; +var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode; -var _Debugger_download = F2(function(historyLength, json) +var _Browser_on = F3(function(node, eventName, sendToSelf) { - return _Scheduler_binding(function(callback) + return _Scheduler_spawn(_Scheduler_binding(function(callback) { - var fileName = 'history-' + historyLength + '.txt'; - var jsonString = JSON.stringify(json); - var mime = 'text/plain;charset=utf-8'; - var done = _Scheduler_succeed(_Utils_Tuple0); - - // for IE10+ - if (navigator.msSaveBlob) - { - navigator.msSaveBlob(new Blob([jsonString], {type: mime}), fileName); - return callback(done); - } + function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } + node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true }); + return function() { node.removeEventListener(eventName, handler); }; + })); +}); - // for HTML5 - var element = document.createElement('a'); - element.setAttribute('href', 'data:' + mime + ',' + encodeURIComponent(jsonString)); - element.setAttribute('download', fileName); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - callback(done); - }); +var _Browser_decodeEvent = F2(function(decoder, event) +{ + var result = _Json_runHelp(decoder, event); + return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing; }); -// POPOUT CONTENT +// PAGE VISIBILITY -function _Debugger_messageToString(value) +function _Browser_visibilityInfo() { - if (typeof value === 'boolean') - { - return value ? 'True' : 'False'; - } + return (typeof _VirtualDom_doc.hidden !== 'undefined') + ? { dp: 'hidden', db: 'visibilitychange' } + : + (typeof _VirtualDom_doc.mozHidden !== 'undefined') + ? { dp: 'mozHidden', db: 'mozvisibilitychange' } + : + (typeof _VirtualDom_doc.msHidden !== 'undefined') + ? { dp: 'msHidden', db: 'msvisibilitychange' } + : + (typeof _VirtualDom_doc.webkitHidden !== 'undefined') + ? { dp: 'webkitHidden', db: 'webkitvisibilitychange' } + : { dp: 'hidden', db: 'visibilitychange' }; +} - if (typeof value === 'number') - { - return value + ''; - } - if (typeof value === 'string') - { - return '"' + _Debugger_addSlashes(value, false) + '"'; - } - if (value instanceof String) - { - return "'" + _Debugger_addSlashes(value, true) + "'"; - } +// ANIMATION FRAMES - if (typeof value !== 'object' || value === null || !('$' in value)) - { - return '…'; - } - if (typeof value.$ === 'number') +function _Browser_rAF() +{ + return _Scheduler_binding(function(callback) { - return '…'; - } + var id = _Browser_requestAnimationFrame(function() { + callback(_Scheduler_succeed(Date.now())); + }); - var code = value.$.charCodeAt(0); - if (code === 0x23 /* # */ || /* a */ 0x61 <= code && code <= 0x7A /* z */) - { - return '…'; - } + return function() { + _Browser_cancelAnimationFrame(id); + }; + }); +} - if (['Array_elm_builtin', 'Set_elm_builtin', 'RBNode_elm_builtin', 'RBEmpty_elm_builtin'].indexOf(value.$) >= 0) - { - return '…'; - } - var keys = Object.keys(value); - switch (keys.length) +function _Browser_now() +{ + return _Scheduler_binding(function(callback) { - case 1: - return value.$; - case 2: - return value.$ + ' ' + _Debugger_messageToString(value.a); - default: - return value.$ + ' … ' + _Debugger_messageToString(value[keys[keys.length - 1]]); - } + callback(_Scheduler_succeed(Date.now())); + }); } -function _Debugger_init(value) -{ - if (typeof value === 'boolean') - { - return A3($elm$browser$Debugger$Expando$Constructor, $elm$core$Maybe$Just(value ? 'True' : 'False'), true, _List_Nil); - } - if (typeof value === 'number') - { - return $elm$browser$Debugger$Expando$Primitive(value + ''); - } +// DOM STUFF - if (typeof value === 'string') - { - return $elm$browser$Debugger$Expando$S('"' + _Debugger_addSlashes(value, false) + '"'); - } - if (value instanceof String) +function _Browser_withNode(id, doStuff) +{ + return _Scheduler_binding(function(callback) { - return $elm$browser$Debugger$Expando$S("'" + _Debugger_addSlashes(value, true) + "'"); - } + _Browser_requestAnimationFrame(function() { + var node = document.getElementById(id); + callback(node + ? _Scheduler_succeed(doStuff(node)) + : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)) + ); + }); + }); +} - if (typeof value === 'object' && '$' in value) + +function _Browser_withWindow(doStuff) +{ + return _Scheduler_binding(function(callback) { - var tag = value.$; + _Browser_requestAnimationFrame(function() { + callback(_Scheduler_succeed(doStuff())); + }); + }); +} - if (tag === '::' || tag === '[]') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$ListSeq, true, - A2($elm$core$List$map, _Debugger_init, value) - ); - } - if (tag === 'Set_elm_builtin') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$SetSeq, true, - A3($elm$core$Set$foldr, _Debugger_initCons, _List_Nil, value) - ); - } +// FOCUS and BLUR - if (tag === 'RBNode_elm_builtin' || tag == 'RBEmpty_elm_builtin') - { - return A2($elm$browser$Debugger$Expando$Dictionary, true, - A3($elm$core$Dict$foldr, _Debugger_initKeyValueCons, _List_Nil, value) - ); - } - if (tag === 'Array_elm_builtin') - { - return A3($elm$browser$Debugger$Expando$Sequence, $elm$browser$Debugger$Expando$ArraySeq, true, - A3($elm$core$Array$foldr, _Debugger_initCons, _List_Nil, value) - ); - } +var _Browser_call = F2(function(functionName, id) +{ + return _Browser_withNode(id, function(node) { + node[functionName](); + return _Utils_Tuple0; + }); +}); - if (typeof tag === 'number') - { - return $elm$browser$Debugger$Expando$Primitive(''); - } - var char = tag.charCodeAt(0); - if (char === 35 || 65 <= char && char <= 90) - { - var list = _List_Nil; - for (var i in value) - { - if (i === '$') continue; - list = _List_Cons(_Debugger_init(value[i]), list); - } - return A3($elm$browser$Debugger$Expando$Constructor, char === 35 ? $elm$core$Maybe$Nothing : $elm$core$Maybe$Just(tag), true, $elm$core$List$reverse(list)); - } - return $elm$browser$Debugger$Expando$Primitive(''); - } +// WINDOW VIEWPORT - if (typeof value === 'object') - { - var dict = $elm$core$Dict$empty; - for (var i in value) - { - dict = A3($elm$core$Dict$insert, i, _Debugger_init(value[i]), dict); - } - return A2($elm$browser$Debugger$Expando$Record, true, dict); - } - return $elm$browser$Debugger$Expando$Primitive(''); +function _Browser_getViewport() +{ + return { + cL: _Browser_getScene(), + cZ: { + c0: _Browser_window.pageXOffset, + c1: _Browser_window.pageYOffset, + c$: _Browser_doc.documentElement.clientWidth, + b$: _Browser_doc.documentElement.clientHeight + } + }; } -var _Debugger_initCons = F2(function initConsHelp(value, list) +function _Browser_getScene() { - return _List_Cons(_Debugger_init(value), list); -}); + var body = _Browser_doc.body; + var elem = _Browser_doc.documentElement; + return { + c$: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + b$: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + }; +} -var _Debugger_initKeyValueCons = F3(function(key, value, list) +var _Browser_setViewport = F2(function(x, y) { - return _List_Cons( - _Utils_Tuple2(_Debugger_init(key), _Debugger_init(value)), - list - ); + return _Browser_withWindow(function() + { + _Browser_window.scroll(x, y); + return _Utils_Tuple0; + }); }); -function _Debugger_addSlashes(str, isChar) + + +// ELEMENT VIEWPORT + + +function _Browser_getViewportOf(id) { - var s = str - .replace(/\\/g, '\\\\') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - .replace(/\r/g, '\\r') - .replace(/\v/g, '\\v') - .replace(/\0/g, '\\0'); - if (isChar) - { - return s.replace(/\'/g, '\\\''); - } - else + return _Browser_withNode(id, function(node) { - return s.replace(/\"/g, '\\"'); - } + return { + cL: { + c$: node.scrollWidth, + b$: node.scrollHeight + }, + cZ: { + c0: node.scrollLeft, + c1: node.scrollTop, + c$: node.clientWidth, + b$: node.clientHeight + } + }; + }); } - -// BLOCK EVENTS +var _Browser_setViewportOf = F3(function(id, x, y) +{ + return _Browser_withNode(id, function(node) + { + node.scrollLeft = x; + node.scrollTop = y; + return _Utils_Tuple0; + }); +}); -function _Debugger_updateBlocker(oldBlocker, newBlocker) -{ - if (oldBlocker === newBlocker) return; - var oldEvents = _Debugger_blockerToEvents(oldBlocker); - var newEvents = _Debugger_blockerToEvents(newBlocker); +// ELEMENT - // remove old blockers - for (var i = 0; i < oldEvents.length; i++) - { - document.removeEventListener(oldEvents[i], _Debugger_blocker, true); - } - // add new blockers - for (var i = 0; i < newEvents.length; i++) +function _Browser_getElement(id) +{ + return _Browser_withNode(id, function(node) { - document.addEventListener(newEvents[i], _Debugger_blocker, true); - } + var rect = node.getBoundingClientRect(); + var x = _Browser_window.pageXOffset; + var y = _Browser_window.pageYOffset; + return { + cL: _Browser_getScene(), + cZ: { + c0: x, + c1: y, + c$: _Browser_doc.documentElement.clientWidth, + b$: _Browser_doc.documentElement.clientHeight + }, + di: { + c0: x + rect.left, + c1: y + rect.top, + c$: rect.width, + b$: rect.height + } + }; + }); } -function _Debugger_blocker(event) + +// LOAD and RELOAD + + +function _Browser_reload(skipCache) { - if (event.type === 'keydown' && event.metaKey && event.which === 82) + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) { - return; - } + _VirtualDom_doc.location.reload(skipCache); + })); +} - var isScroll = event.type === 'scroll' || event.type === 'wheel'; - for (var node = event.target; node; node = node.parentNode) +function _Browser_load(url) +{ + return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) { - if (isScroll ? node.id === 'elm-debugger-details' : node.id === 'elm-debugger-overlay') + try { - return; + _Browser_window.location = url; } - } - - event.stopPropagation(); - event.preventDefault(); -} - -function _Debugger_blockerToEvents(blocker) -{ - return blocker === $elm$browser$Debugger$Overlay$BlockNone - ? [] - : blocker === $elm$browser$Debugger$Overlay$BlockMost - ? _Debugger_mostEvents - : _Debugger_allEvents; + catch(err) + { + // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. + // Other browsers reload the page, so let's be consistent about that. + _VirtualDom_doc.location.reload(false); + } + })); } -var _Debugger_mostEvents = [ - 'click', 'dblclick', 'mousemove', - 'mouseup', 'mousedown', 'mouseenter', 'mouseleave', - 'touchstart', 'touchend', 'touchcancel', 'touchmove', - 'pointerdown', 'pointerup', 'pointerover', 'pointerout', - 'pointerenter', 'pointerleave', 'pointermove', 'pointercancel', - 'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop', - 'keyup', 'keydown', 'keypress', - 'input', 'change', - 'focus', 'blur' -]; -var _Debugger_allEvents = _Debugger_mostEvents.concat('wheel', 'scroll'); +var _Bitwise_and = F2(function(a, b) +{ + return a & b; +}); +var _Bitwise_or = F2(function(a, b) +{ + return a | b; +}); +var _Bitwise_xor = F2(function(a, b) +{ + return a ^ b; +}); -// ELEMENT +function _Bitwise_complement(a) +{ + return ~a; +}; +var _Bitwise_shiftLeftBy = F2(function(offset, a) +{ + return a << offset; +}); -var _Debugger_element; +var _Bitwise_shiftRightBy = F2(function(offset, a) +{ + return a >> offset; +}); -var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debugMetadata, args) +var _Bitwise_shiftRightZfBy = F2(function(offset, a) { - return _Platform_initialize( - flagDecoder, - args, - impl.init, - impl.update, - impl.subscriptions, - function(sendToApp, initialModel) { - var view = impl.view; - /**_UNUSED/ - var domNode = args['node']; - //*/ - /**/ - var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); - //*/ - var currNode = _VirtualDom_virtualize(domNode); - - return _Browser_makeAnimator(initialModel, function(model) - { - var nextNode = view(model); - var patches = _VirtualDom_diff(currNode, nextNode); - domNode = _VirtualDom_applyPatches(domNode, currNode, patches, sendToApp); - currNode = nextNode; - }); - } - ); -}); - - - -// DOCUMENT - - -var _Debugger_document; - -var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, debugMetadata, args) -{ - return _Platform_initialize( - flagDecoder, - args, - impl.init, - impl.update, - impl.subscriptions, - function(sendToApp, initialModel) { - var divertHrefToApp = impl.setup && impl.setup(sendToApp) - var view = impl.view; - var title = _VirtualDom_doc.title; - var bodyNode = _VirtualDom_doc.body; - var currNode = _VirtualDom_virtualize(bodyNode); - return _Browser_makeAnimator(initialModel, function(model) - { - _VirtualDom_divertHrefToApp = divertHrefToApp; - var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body); - var patches = _VirtualDom_diff(currNode, nextNode); - bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); - currNode = nextNode; - _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); - }); - } - ); -}); - - - -// ANIMATION - - -var _Browser_cancelAnimationFrame = - typeof cancelAnimationFrame !== 'undefined' - ? cancelAnimationFrame - : function(id) { clearTimeout(id); }; - -var _Browser_requestAnimationFrame = - typeof requestAnimationFrame !== 'undefined' - ? requestAnimationFrame - : function(callback) { return setTimeout(callback, 1000 / 60); }; - - -function _Browser_makeAnimator(model, draw) -{ - draw(model); - - var state = 0; - - function updateIfNeeded() - { - state = state === 1 - ? 0 - : ( _Browser_requestAnimationFrame(updateIfNeeded), draw(model), 1 ); - } - - return function(nextModel, isSync) - { - model = nextModel; - - isSync - ? ( draw(model), - state === 2 && (state = 1) - ) - : ( state === 0 && _Browser_requestAnimationFrame(updateIfNeeded), - state = 2 - ); - }; -} - - - -// APPLICATION - - -function _Browser_application(impl) -{ - var onUrlChange = impl.onUrlChange; - var onUrlRequest = impl.onUrlRequest; - var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; - - return _Browser_document({ - setup: function(sendToApp) - { - key.a = sendToApp; - _Browser_window.addEventListener('popstate', key); - _Browser_window.navigator.userAgent.indexOf('Trident') < 0 || _Browser_window.addEventListener('hashchange', key); - - return F2(function(domNode, event) - { - if (!event.ctrlKey && !event.metaKey && !event.shiftKey && event.button < 1 && !domNode.target && !domNode.hasAttribute('download')) - { - event.preventDefault(); - var href = domNode.href; - var curr = _Browser_getUrl(); - var next = $elm$url$Url$fromString(href).a; - sendToApp(onUrlRequest( - (next - && curr.protocol === next.protocol - && curr.host === next.host - && curr.port_.a === next.port_.a - ) - ? $elm$browser$Browser$Internal(next) - : $elm$browser$Browser$External(href) - )); - } - }); - }, - init: function(flags) - { - return A3(impl.init, flags, _Browser_getUrl(), key); - }, - view: impl.view, - update: impl.update, - subscriptions: impl.subscriptions - }); -} - -function _Browser_getUrl() -{ - return $elm$url$Url$fromString(_VirtualDom_doc.location.href).a || _Debug_crash(1); -} - -var _Browser_go = F2(function(key, n) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - n && history.go(n); - key(); - })); -}); - -var _Browser_pushUrl = F2(function(key, url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - history.pushState({}, '', url); - key(); - })); -}); - -var _Browser_replaceUrl = F2(function(key, url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function() { - history.replaceState({}, '', url); - key(); - })); -}); - - - -// GLOBAL EVENTS - - -var _Browser_fakeNode = { addEventListener: function() {}, removeEventListener: function() {} }; -var _Browser_doc = typeof document !== 'undefined' ? document : _Browser_fakeNode; -var _Browser_window = typeof window !== 'undefined' ? window : _Browser_fakeNode; - -var _Browser_on = F3(function(node, eventName, sendToSelf) -{ - return _Scheduler_spawn(_Scheduler_binding(function(callback) - { - function handler(event) { _Scheduler_rawSpawn(sendToSelf(event)); } - node.addEventListener(eventName, handler, _VirtualDom_passiveSupported && { passive: true }); - return function() { node.removeEventListener(eventName, handler); }; - })); -}); - -var _Browser_decodeEvent = F2(function(decoder, event) -{ - var result = _Json_runHelp(decoder, event); - return $elm$core$Result$isOk(result) ? $elm$core$Maybe$Just(result.a) : $elm$core$Maybe$Nothing; -}); - - - -// PAGE VISIBILITY - - -function _Browser_visibilityInfo() -{ - return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { hidden: 'hidden', change: 'visibilitychange' } - : - (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { hidden: 'mozHidden', change: 'mozvisibilitychange' } - : - (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { hidden: 'msHidden', change: 'msvisibilitychange' } - : - (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' } - : { hidden: 'hidden', change: 'visibilitychange' }; -} - - - -// ANIMATION FRAMES - - -function _Browser_rAF() -{ - return _Scheduler_binding(function(callback) - { - var id = _Browser_requestAnimationFrame(function() { - callback(_Scheduler_succeed(Date.now())); - }); - - return function() { - _Browser_cancelAnimationFrame(id); - }; - }); -} - - -function _Browser_now() -{ - return _Scheduler_binding(function(callback) - { - callback(_Scheduler_succeed(Date.now())); - }); -} - - - -// DOM STUFF - - -function _Browser_withNode(id, doStuff) -{ - return _Scheduler_binding(function(callback) - { - _Browser_requestAnimationFrame(function() { - var node = document.getElementById(id); - callback(node - ? _Scheduler_succeed(doStuff(node)) - : _Scheduler_fail($elm$browser$Browser$Dom$NotFound(id)) - ); - }); - }); -} - - -function _Browser_withWindow(doStuff) -{ - return _Scheduler_binding(function(callback) - { - _Browser_requestAnimationFrame(function() { - callback(_Scheduler_succeed(doStuff())); - }); - }); -} - - -// FOCUS and BLUR - - -var _Browser_call = F2(function(functionName, id) -{ - return _Browser_withNode(id, function(node) { - node[functionName](); - return _Utils_Tuple0; - }); -}); - - - -// WINDOW VIEWPORT - - -function _Browser_getViewport() -{ - return { - scene: _Browser_getScene(), - viewport: { - x: _Browser_window.pageXOffset, - y: _Browser_window.pageYOffset, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight - } - }; -} - -function _Browser_getScene() -{ - var body = _Browser_doc.body; - var elem = _Browser_doc.documentElement; - return { - width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) - }; -} - -var _Browser_setViewport = F2(function(x, y) -{ - return _Browser_withWindow(function() - { - _Browser_window.scroll(x, y); - return _Utils_Tuple0; - }); -}); - - - -// ELEMENT VIEWPORT - - -function _Browser_getViewportOf(id) -{ - return _Browser_withNode(id, function(node) - { - return { - scene: { - width: node.scrollWidth, - height: node.scrollHeight - }, - viewport: { - x: node.scrollLeft, - y: node.scrollTop, - width: node.clientWidth, - height: node.clientHeight - } - }; - }); -} - - -var _Browser_setViewportOf = F3(function(id, x, y) -{ - return _Browser_withNode(id, function(node) - { - node.scrollLeft = x; - node.scrollTop = y; - return _Utils_Tuple0; - }); -}); - - - -// ELEMENT - - -function _Browser_getElement(id) -{ - return _Browser_withNode(id, function(node) - { - var rect = node.getBoundingClientRect(); - var x = _Browser_window.pageXOffset; - var y = _Browser_window.pageYOffset; - return { - scene: _Browser_getScene(), - viewport: { - x: x, - y: y, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight - }, - element: { - x: x + rect.left, - y: y + rect.top, - width: rect.width, - height: rect.height - } - }; - }); -} - - - -// LOAD and RELOAD - - -function _Browser_reload(skipCache) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) - { - _VirtualDom_doc.location.reload(skipCache); - })); -} - -function _Browser_load(url) -{ - return A2($elm$core$Task$perform, $elm$core$Basics$never, _Scheduler_binding(function(callback) - { - try - { - _Browser_window.location = url; - } - catch(err) - { - // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. - // Other browsers reload the page, so let's be consistent about that. - _VirtualDom_doc.location.reload(false); - } - })); -} -var $elm$core$Basics$EQ = {$: 'EQ'}; -var $elm$core$Basics$GT = {$: 'GT'}; -var $elm$core$Basics$LT = {$: 'LT'}; -var $elm$core$List$cons = _List_cons; -var $elm$core$Dict$foldr = F3( - function (func, acc, t) { - foldr: - while (true) { - if (t.$ === 'RBEmpty_elm_builtin') { - return acc; - } else { - var key = t.b; - var value = t.c; - var left = t.d; - var right = t.e; - var $temp$func = func, - $temp$acc = A3( - func, - key, - value, - A3($elm$core$Dict$foldr, func, acc, right)), - $temp$t = left; - func = $temp$func; - acc = $temp$acc; - t = $temp$t; - continue foldr; - } - } - }); -var $elm$core$Dict$toList = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, list) { - return A2( - $elm$core$List$cons, - _Utils_Tuple2(key, value), - list); - }), - _List_Nil, - dict); -}; -var $elm$core$Dict$keys = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, keyList) { - return A2($elm$core$List$cons, key, keyList); - }), - _List_Nil, - dict); -}; -var $elm$core$Set$toList = function (_v0) { - var dict = _v0.a; - return $elm$core$Dict$keys(dict); -}; -var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; -var $elm$core$Array$foldr = F3( - function (func, baseCase, _v0) { - var tree = _v0.c; - var tail = _v0.d; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); - } else { - var values = node.a; - return A3($elm$core$Elm$JsArray$foldr, func, acc, values); - } - }); - return A3( - $elm$core$Elm$JsArray$foldr, - helper, - A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail), - tree); - }); -var $elm$core$Array$toList = function (array) { - return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); -}; -var $elm$core$Result$Err = function (a) { - return {$: 'Err', a: a}; -}; -var $elm$json$Json$Decode$Failure = F2( - function (a, b) { - return {$: 'Failure', a: a, b: b}; - }); -var $elm$json$Json$Decode$Field = F2( - function (a, b) { - return {$: 'Field', a: a, b: b}; - }); -var $elm$json$Json$Decode$Index = F2( - function (a, b) { - return {$: 'Index', a: a, b: b}; - }); -var $elm$core$Result$Ok = function (a) { - return {$: 'Ok', a: a}; -}; -var $elm$json$Json$Decode$OneOf = function (a) { - return {$: 'OneOf', a: a}; -}; -var $elm$core$Basics$False = {$: 'False'}; -var $elm$core$Basics$add = _Basics_add; -var $elm$core$Maybe$Just = function (a) { - return {$: 'Just', a: a}; -}; -var $elm$core$Maybe$Nothing = {$: 'Nothing'}; -var $elm$core$String$all = _String_all; -var $elm$core$Basics$and = _Basics_and; -var $elm$core$Basics$append = _Utils_append; -var $elm$json$Json$Encode$encode = _Json_encode; -var $elm$core$String$fromInt = _String_fromNumber; -var $elm$core$String$join = F2( - function (sep, chunks) { - return A2( - _String_join, - sep, - _List_toArray(chunks)); - }); -var $elm$core$String$split = F2( - function (sep, string) { - return _List_fromArray( - A2(_String_split, sep, string)); - }); -var $elm$json$Json$Decode$indent = function (str) { - return A2( - $elm$core$String$join, - '\n ', - A2($elm$core$String$split, '\n', str)); -}; -var $elm$core$List$foldl = F3( - function (func, acc, list) { - foldl: - while (true) { - if (!list.b) { - return acc; - } else { - var x = list.a; - var xs = list.b; - var $temp$func = func, - $temp$acc = A2(func, x, acc), - $temp$list = xs; - func = $temp$func; - acc = $temp$acc; - list = $temp$list; - continue foldl; - } - } - }); -var $elm$core$List$length = function (xs) { - return A3( - $elm$core$List$foldl, - F2( - function (_v0, i) { - return i + 1; - }), - 0, - xs); -}; -var $elm$core$List$map2 = _List_map2; -var $elm$core$Basics$le = _Utils_le; -var $elm$core$Basics$sub = _Basics_sub; -var $elm$core$List$rangeHelp = F3( - function (lo, hi, list) { - rangeHelp: - while (true) { - if (_Utils_cmp(lo, hi) < 1) { - var $temp$lo = lo, - $temp$hi = hi - 1, - $temp$list = A2($elm$core$List$cons, hi, list); - lo = $temp$lo; - hi = $temp$hi; - list = $temp$list; - continue rangeHelp; - } else { - return list; - } - } - }); -var $elm$core$List$range = F2( - function (lo, hi) { - return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil); - }); -var $elm$core$List$indexedMap = F2( - function (f, xs) { - return A3( - $elm$core$List$map2, - f, - A2( - $elm$core$List$range, - 0, - $elm$core$List$length(xs) - 1), - xs); - }); -var $elm$core$Char$toCode = _Char_toCode; -var $elm$core$Char$isLower = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (97 <= code) && (code <= 122); -}; -var $elm$core$Char$isUpper = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (code <= 90) && (65 <= code); -}; -var $elm$core$Basics$or = _Basics_or; -var $elm$core$Char$isAlpha = function (_char) { - return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); -}; -var $elm$core$Char$isDigit = function (_char) { - var code = $elm$core$Char$toCode(_char); - return (code <= 57) && (48 <= code); -}; -var $elm$core$Char$isAlphaNum = function (_char) { - return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); -}; -var $elm$core$List$reverse = function (list) { - return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); -}; -var $elm$core$String$uncons = _String_uncons; -var $elm$json$Json$Decode$errorOneOf = F2( - function (i, error) { - return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent( - $elm$json$Json$Decode$errorToString(error)))); - }); -var $elm$json$Json$Decode$errorToString = function (error) { - return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); -}; -var $elm$json$Json$Decode$errorToStringHelp = F2( - function (error, context) { - errorToStringHelp: - while (true) { - switch (error.$) { - case 'Field': - var f = error.a; - var err = error.b; - var isSimple = function () { - var _v1 = $elm$core$String$uncons(f); - if (_v1.$ === 'Nothing') { - return false; - } else { - var _v2 = _v1.a; - var _char = _v2.a; - var rest = _v2.b; - return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest); - } - }(); - var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']')); - var $temp$error = err, - $temp$context = A2($elm$core$List$cons, fieldName, context); - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - case 'Index': - var i = error.a; - var err = error.b; - var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); - var $temp$error = err, - $temp$context = A2($elm$core$List$cons, indexName, context); - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - case 'OneOf': - var errors = error.a; - if (!errors.b) { - return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { - if (!context.b) { - return '!'; - } else { - return ' at json' + A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)); - } - }(); - } else { - if (!errors.b.b) { - var err = errors.a; - var $temp$error = err, - $temp$context = context; - error = $temp$error; - context = $temp$context; - continue errorToStringHelp; - } else { - var starter = function () { - if (!context.b) { - return 'Json.Decode.oneOf'; - } else { - return 'The Json.Decode.oneOf at json' + A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)); - } - }(); - var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt( - $elm$core$List$length(errors)) + ' ways:')); - return A2( - $elm$core$String$join, - '\n\n', - A2( - $elm$core$List$cons, - introduction, - A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors))); - } - } - default: - var msg = error.a; - var json = error.b; - var introduction = function () { - if (!context.b) { - return 'Problem with the given value:\n\n'; - } else { - return 'Problem with the value at json' + (A2( - $elm$core$String$join, - '', - $elm$core$List$reverse(context)) + ':\n\n '); - } - }(); - return introduction + ($elm$json$Json$Decode$indent( - A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg)); - } - } - }); -var $elm$core$Array$branchFactor = 32; -var $elm$core$Array$Array_elm_builtin = F4( - function (a, b, c, d) { - return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d}; - }); -var $elm$core$Elm$JsArray$empty = _JsArray_empty; -var $elm$core$Basics$ceiling = _Basics_ceiling; -var $elm$core$Basics$fdiv = _Basics_fdiv; -var $elm$core$Basics$logBase = F2( - function (base, number) { - return _Basics_log(number) / _Basics_log(base); - }); -var $elm$core$Basics$toFloat = _Basics_toFloat; -var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( - A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor)); -var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty); -var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; -var $elm$core$Array$Leaf = function (a) { - return {$: 'Leaf', a: a}; -}; -var $elm$core$Basics$apL = F2( - function (f, x) { - return f(x); - }); -var $elm$core$Basics$apR = F2( - function (x, f) { - return f(x); - }); -var $elm$core$Basics$eq = _Utils_equal; -var $elm$core$Basics$floor = _Basics_floor; -var $elm$core$Elm$JsArray$length = _JsArray_length; -var $elm$core$Basics$gt = _Utils_gt; -var $elm$core$Basics$max = F2( - function (x, y) { - return (_Utils_cmp(x, y) > 0) ? x : y; - }); -var $elm$core$Basics$mul = _Basics_mul; -var $elm$core$Array$SubTree = function (a) { - return {$: 'SubTree', a: a}; -}; -var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; -var $elm$core$Array$compressNodes = F2( - function (nodes, acc) { - compressNodes: - while (true) { - var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes); - var node = _v0.a; - var remainingNodes = _v0.b; - var newAcc = A2( - $elm$core$List$cons, - $elm$core$Array$SubTree(node), - acc); - if (!remainingNodes.b) { - return $elm$core$List$reverse(newAcc); - } else { - var $temp$nodes = remainingNodes, - $temp$acc = newAcc; - nodes = $temp$nodes; - acc = $temp$acc; - continue compressNodes; - } - } - }); -var $elm$core$Tuple$first = function (_v0) { - var x = _v0.a; - return x; -}; -var $elm$core$Array$treeFromBuilder = F2( - function (nodeList, nodeListSize) { - treeFromBuilder: - while (true) { - var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor); - if (newNodeSize === 1) { - return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a; - } else { - var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil), - $temp$nodeListSize = newNodeSize; - nodeList = $temp$nodeList; - nodeListSize = $temp$nodeListSize; - continue treeFromBuilder; - } - } - }); -var $elm$core$Array$builderToArray = F2( - function (reverseNodeList, builder) { - if (!builder.nodeListSize) { - return A4( - $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail), - $elm$core$Array$shiftStep, - $elm$core$Elm$JsArray$empty, - builder.tail); - } else { - var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor; - var depth = $elm$core$Basics$floor( - A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize); - return A4( - $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail) + treeLen, - A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), - tree, - builder.tail); - } - }); -var $elm$core$Basics$idiv = _Basics_idiv; -var $elm$core$Basics$lt = _Utils_lt; -var $elm$core$Array$initializeHelp = F5( - function (fn, fromIndex, len, nodeList, tail) { - initializeHelp: - while (true) { - if (fromIndex < 0) { - return A2( - $elm$core$Array$builderToArray, - false, - {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail}); - } else { - var leaf = $elm$core$Array$Leaf( - A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); - var $temp$fn = fn, - $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor, - $temp$len = len, - $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList), - $temp$tail = tail; - fn = $temp$fn; - fromIndex = $temp$fromIndex; - len = $temp$len; - nodeList = $temp$nodeList; - tail = $temp$tail; - continue initializeHelp; - } - } - }); -var $elm$core$Basics$remainderBy = _Basics_remainderBy; -var $elm$core$Array$initialize = F2( - function (len, fn) { - if (len <= 0) { - return $elm$core$Array$empty; - } else { - var tailLen = len % $elm$core$Array$branchFactor; - var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn); - var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor; - return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); - } - }); -var $elm$core$Basics$True = {$: 'True'}; -var $elm$core$Result$isOk = function (result) { - if (result.$ === 'Ok') { - return true; - } else { - return false; - } -}; -var $elm$json$Json$Decode$map = _Json_map1; -var $elm$json$Json$Decode$map2 = _Json_map2; -var $elm$json$Json$Decode$succeed = _Json_succeed; -var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { - switch (handler.$) { - case 'Normal': - return 0; - case 'MayStopPropagation': - return 1; - case 'MayPreventDefault': - return 2; - default: - return 3; - } -}; -var $elm$browser$Debugger$Expando$ArraySeq = {$: 'ArraySeq'}; -var $elm$browser$Debugger$Overlay$BlockMost = {$: 'BlockMost'}; -var $elm$browser$Debugger$Overlay$BlockNone = {$: 'BlockNone'}; -var $elm$browser$Debugger$Expando$Constructor = F3( - function (a, b, c) { - return {$: 'Constructor', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$Dictionary = F2( - function (a, b) { - return {$: 'Dictionary', a: a, b: b}; - }); -var $elm$browser$Debugger$Main$Down = {$: 'Down'}; -var $elm$browser$Debugger$Expando$ListSeq = {$: 'ListSeq'}; -var $elm$browser$Debugger$Main$NoOp = {$: 'NoOp'}; -var $elm$browser$Debugger$Expando$Primitive = function (a) { - return {$: 'Primitive', a: a}; -}; -var $elm$browser$Debugger$Expando$Record = F2( - function (a, b) { - return {$: 'Record', a: a, b: b}; - }); -var $elm$browser$Debugger$Expando$S = function (a) { - return {$: 'S', a: a}; -}; -var $elm$browser$Debugger$Expando$Sequence = F3( - function (a, b, c) { - return {$: 'Sequence', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$SetSeq = {$: 'SetSeq'}; -var $elm$browser$Debugger$Main$Up = {$: 'Up'}; -var $elm$browser$Debugger$Main$UserMsg = function (a) { - return {$: 'UserMsg', a: a}; -}; -var $elm$browser$Debugger$Main$Export = {$: 'Export'}; -var $elm$browser$Debugger$Main$Import = {$: 'Import'}; -var $elm$browser$Debugger$Main$Open = {$: 'Open'}; -var $elm$browser$Debugger$Main$OverlayMsg = function (a) { - return {$: 'OverlayMsg', a: a}; -}; -var $elm$browser$Debugger$Main$Resume = {$: 'Resume'}; -var $elm$browser$Debugger$Main$isPaused = function (state) { - if (state.$ === 'Running') { - return false; - } else { - return true; - } -}; -var $elm$browser$Debugger$History$size = function (history) { - return history.numMessages; -}; -var $elm$browser$Debugger$Overlay$Accept = function (a) { - return {$: 'Accept', a: a}; -}; -var $elm$browser$Debugger$Overlay$Choose = F2( - function (a, b) { - return {$: 'Choose', a: a, b: b}; - }); -var $elm$html$Html$div = _VirtualDom_node('div'); -var $elm$json$Json$Encode$string = _Json_wrap; -var $elm$html$Html$Attributes$stringProperty = F2( - function (key, string) { - return A2( - _VirtualDom_property, - key, - $elm$json$Json$Encode$string(string)); - }); -var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); -var $elm$virtual_dom$VirtualDom$Normal = function (a) { - return {$: 'Normal', a: a}; -}; -var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; -var $elm$html$Html$Events$on = F2( - function (event, decoder) { - return A2( - $elm$virtual_dom$VirtualDom$on, - event, - $elm$virtual_dom$VirtualDom$Normal(decoder)); - }); -var $elm$html$Html$Events$onClick = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'click', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$html$Html$span = _VirtualDom_node('span'); -var $elm$virtual_dom$VirtualDom$style = _VirtualDom_style; -var $elm$html$Html$Attributes$style = $elm$virtual_dom$VirtualDom$style; -var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; -var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; -var $elm$html$Html$a = _VirtualDom_node('a'); -var $elm$browser$Debugger$Overlay$goodNews1 = '\nThe good news is that having values like this in your message type is not\nso great in the long run. You are better off using simpler data, like\n'; -var $elm$browser$Debugger$Overlay$goodNews2 = '\nfunction can pattern match on that data and call whatever functions, JSON\ndecoders, etc. you need. This makes the code much more explicit and easy to\nfollow for other readers (or you in a few months!)\n'; -var $elm$html$Html$Attributes$href = function (url) { - return A2( - $elm$html$Html$Attributes$stringProperty, - 'href', - _VirtualDom_noJavaScriptUri(url)); -}; -var $elm$core$List$foldrHelper = F4( - function (fn, acc, ctr, ls) { - if (!ls.b) { - return acc; - } else { - var a = ls.a; - var r1 = ls.b; - if (!r1.b) { - return A2(fn, a, acc); - } else { - var b = r1.a; - var r2 = r1.b; - if (!r2.b) { - return A2( - fn, - a, - A2(fn, b, acc)); - } else { - var c = r2.a; - var r3 = r2.b; - if (!r3.b) { - return A2( - fn, - a, - A2( - fn, - b, - A2(fn, c, acc))); - } else { - var d = r3.a; - var r4 = r3.b; - var res = (ctr > 500) ? A3( - $elm$core$List$foldl, - fn, - acc, - $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4); - return A2( - fn, - a, - A2( - fn, - b, - A2( - fn, - c, - A2(fn, d, res)))); - } - } - } - } - }); -var $elm$core$List$foldr = F3( - function (fn, acc, ls) { - return A4($elm$core$List$foldrHelper, fn, acc, 0, ls); - }); -var $elm$core$List$map = F2( - function (f, xs) { - return A3( - $elm$core$List$foldr, - F2( - function (x, acc) { - return A2( - $elm$core$List$cons, - f(x), - acc); - }), - _List_Nil, - xs); - }); -var $elm$html$Html$p = _VirtualDom_node('p'); -var $elm$html$Html$ul = _VirtualDom_node('ul'); -var $elm$html$Html$code = _VirtualDom_node('code'); -var $elm$browser$Debugger$Overlay$viewCode = function (name) { - return A2( - $elm$html$Html$code, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(name) - ])); -}; -var $elm$browser$Debugger$Overlay$addCommas = function (items) { - if (!items.b) { - return ''; - } else { - if (!items.b.b) { - var item = items.a; - return item; - } else { - if (!items.b.b.b) { - var item1 = items.a; - var _v1 = items.b; - var item2 = _v1.a; - return item1 + (' and ' + item2); - } else { - var lastItem = items.a; - var otherItems = items.b; - return A2( - $elm$core$String$join, - ', ', - _Utils_ap( - otherItems, - _List_fromArray( - [' and ' + lastItem]))); - } - } - } -}; -var $elm$html$Html$li = _VirtualDom_node('li'); -var $elm$browser$Debugger$Overlay$problemToString = function (problem) { - switch (problem.$) { - case 'Function': - return 'functions'; - case 'Decoder': - return 'JSON decoders'; - case 'Task': - return 'tasks'; - case 'Process': - return 'processes'; - case 'Socket': - return 'web sockets'; - case 'Request': - return 'HTTP requests'; - case 'Program': - return 'programs'; - default: - return 'virtual DOM values'; - } -}; -var $elm$browser$Debugger$Overlay$viewProblemType = function (_v0) { - var name = _v0.name; - var problems = _v0.problems; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name), - $elm$html$Html$text( - ' can contain ' + ($elm$browser$Debugger$Overlay$addCommas( - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$problemToString, problems)) + '.')) - ])); -}; -var $elm$browser$Debugger$Overlay$viewBadMetadata = function (_v0) { - var message = _v0.message; - var problems = _v0.problems; - return _List_fromArray( - [ - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('The '), - $elm$browser$Debugger$Overlay$viewCode(message), - $elm$html$Html$text(' type of your program cannot be reliably serialized for history files.') - ])), - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('Functions cannot be serialized, nor can values that contain functions. This is a problem in these places:') - ])), - A2( - $elm$html$Html$ul, - _List_Nil, - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$viewProblemType, problems)), - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text($elm$browser$Debugger$Overlay$goodNews1), - A2( - $elm$html$Html$a, - _List_fromArray( - [ - $elm$html$Html$Attributes$href('https://guide.elm-lang.org/types/custom_types.html') - ]), - _List_fromArray( - [ - $elm$html$Html$text('custom types') - ])), - $elm$html$Html$text(', in your messages. From there, your '), - $elm$browser$Debugger$Overlay$viewCode('update'), - $elm$html$Html$text($elm$browser$Debugger$Overlay$goodNews2) - ])) - ]); -}; -var $elm$virtual_dom$VirtualDom$map = _VirtualDom_map; -var $elm$html$Html$map = $elm$virtual_dom$VirtualDom$map; -var $elm$browser$Debugger$Overlay$Cancel = {$: 'Cancel'}; -var $elm$browser$Debugger$Overlay$Proceed = {$: 'Proceed'}; -var $elm$html$Html$button = _VirtualDom_node('button'); -var $elm$browser$Debugger$Overlay$viewButtons = function (buttons) { - var btn = F2( - function (msg, string) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin-right', '20px'), - $elm$html$Html$Events$onClick(msg) - ]), - _List_fromArray( - [ - $elm$html$Html$text(string) - ])); - }); - var buttonNodes = function () { - if (buttons.$ === 'Accept') { - var proceed = buttons.a; - return _List_fromArray( - [ - A2(btn, $elm$browser$Debugger$Overlay$Proceed, proceed) - ]); - } else { - var cancel = buttons.a; - var proceed = buttons.b; - return _List_fromArray( - [ - A2(btn, $elm$browser$Debugger$Overlay$Cancel, cancel), - A2(btn, $elm$browser$Debugger$Overlay$Proceed, proceed) - ]); - } - }(); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'height', '60px'), - A2($elm$html$Html$Attributes$style, 'line-height', '60px'), - A2($elm$html$Html$Attributes$style, 'text-align', 'right'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - buttonNodes); -}; -var $elm$browser$Debugger$Overlay$viewMessage = F4( - function (config, title, details, buttons) { - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-overlay'), - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100vw'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'none'), - A2($elm$html$Html$Attributes$style, 'font-family', '\'Trebuchet MS\', \'Lucida Grande\', \'Bitstream Vera Sans\', \'Helvetica Neue\', sans-serif'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483647') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2($elm$html$Html$Attributes$style, 'width', '600px'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'padding-left', 'calc(50% - 300px)'), - A2($elm$html$Html$Attributes$style, 'padding-right', 'calc(50% - 300px)'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgba(200, 200, 200, 0.7)'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '36px'), - A2($elm$html$Html$Attributes$style, 'height', '80px'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)'), - A2($elm$html$Html$Attributes$style, 'padding-left', '22px'), - A2($elm$html$Html$Attributes$style, 'vertical-align', 'middle'), - A2($elm$html$Html$Attributes$style, 'line-height', '80px') - ]), - _List_fromArray( - [ - $elm$html$Html$text(title) - ])), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-details'), - A2($elm$html$Html$Attributes$style, 'padding', ' 8px 20px'), - A2($elm$html$Html$Attributes$style, 'overflow-y', 'auto'), - A2($elm$html$Html$Attributes$style, 'max-height', 'calc(100vh - 156px)'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(61, 61, 61)') - ]), - details), - A2( - $elm$html$Html$map, - config.wrap, - $elm$browser$Debugger$Overlay$viewButtons(buttons)) - ])) - ])); - }); -var $elm$virtual_dom$VirtualDom$attribute = F2( - function (key, value) { - return A2( - _VirtualDom_attribute, - _VirtualDom_noOnOrFormAction(key), - _VirtualDom_noJavaScriptOrHtmlUri(value)); - }); -var $elm$core$Basics$negate = function (n) { - return -n; -}; -var $elm$virtual_dom$VirtualDom$nodeNS = F2( - function (namespace, tag) { - return A2( - _VirtualDom_nodeNS, - namespace, - _VirtualDom_noScript(tag)); - }); -var $elm$core$String$fromFloat = _String_fromNumber; -var $elm$browser$Debugger$Overlay$viewShape = F4( - function (x, y, angle, coordinates) { - return A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'polygon', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'points', coordinates), - A2( - $elm$virtual_dom$VirtualDom$attribute, - 'transform', - 'translate(' + ($elm$core$String$fromFloat(x) + (' ' + ($elm$core$String$fromFloat(y) + (') rotate(' + ($elm$core$String$fromFloat(-angle) + ')')))))) - ]), - _List_Nil); - }); -var $elm$browser$Debugger$Overlay$elmLogo = A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'svg', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'viewBox', '-300 -300 600 600'), - A2($elm$virtual_dom$VirtualDom$attribute, 'xmlns', 'http://www.w3.org/2000/svg'), - A2($elm$virtual_dom$VirtualDom$attribute, 'fill', 'currentColor'), - A2($elm$virtual_dom$VirtualDom$attribute, 'width', '24px'), - A2($elm$virtual_dom$VirtualDom$attribute, 'height', '24px') - ]), - _List_fromArray( - [ - A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'g', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'transform', 'scale(1 -1)') - ]), - _List_fromArray( - [ - A4($elm$browser$Debugger$Overlay$viewShape, 0, -210, 0, '-280,-90 0,190 280,-90'), - A4($elm$browser$Debugger$Overlay$viewShape, -210, 0, 90, '-280,-90 0,190 280,-90'), - A4($elm$browser$Debugger$Overlay$viewShape, 207, 207, 45, '-198,-66 0,132 198,-66'), - A4($elm$browser$Debugger$Overlay$viewShape, 150, 0, 0, '-130,0 0,-130 130,0 0,130'), - A4($elm$browser$Debugger$Overlay$viewShape, -89, 239, 0, '-191,61 69,61 191,-61 -69,-61'), - A4($elm$browser$Debugger$Overlay$viewShape, 0, 106, 180, '-130,-44 0,86 130,-44'), - A4($elm$browser$Debugger$Overlay$viewShape, 256, -150, 270, '-130,-44 0,86 130,-44') - ])) - ])); -var $elm$core$String$length = _String_length; -var $elm$browser$Debugger$Overlay$viewMiniControls = F2( - function (config, numMsgs) { - var string = $elm$core$String$fromInt(numMsgs); - var width = $elm$core$String$fromInt( - 2 + $elm$core$String$length(string)); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'bottom', '2em'), - A2($elm$html$Html$Attributes$style, 'right', '2em'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(42px + ' + (width + 'ch)')), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'background-color', '#1293D8'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'font-family', 'monospace'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483647'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - $elm$html$Html$Events$onClick(config.open) - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$elmLogo, - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', 'calc(1ch + 6px)'), - A2($elm$html$Html$Attributes$style, 'padding-right', '1ch') - ]), - _List_fromArray( - [ - $elm$html$Html$text(string) - ])) - ])); - }); -var $elm$browser$Debugger$Overlay$explanationBad = '\nThe messages in this history do not match the messages handled by your\nprogram. I noticed changes in the following types:\n'; -var $elm$browser$Debugger$Overlay$explanationRisky = '\nThis history seems old. It will work with this program, but some\nmessages have been added since the history was created:\n'; -var $elm$core$List$intersperse = F2( - function (sep, xs) { - if (!xs.b) { - return _List_Nil; - } else { - var hd = xs.a; - var tl = xs.b; - var step = F2( - function (x, rest) { - return A2( - $elm$core$List$cons, - sep, - A2($elm$core$List$cons, x, rest)); - }); - var spersed = A3($elm$core$List$foldr, step, _List_Nil, tl); - return A2($elm$core$List$cons, hd, spersed); - } - }); -var $elm$browser$Debugger$Overlay$viewMention = F2( - function (tags, verbed) { - var _v0 = A2( - $elm$core$List$map, - $elm$browser$Debugger$Overlay$viewCode, - $elm$core$List$reverse(tags)); - if (!_v0.b) { - return $elm$html$Html$text(''); - } else { - if (!_v0.b.b) { - var tag = _v0.a; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(verbed), - tag, - $elm$html$Html$text('.') - ])); - } else { - if (!_v0.b.b.b) { - var tag2 = _v0.a; - var _v1 = _v0.b; - var tag1 = _v1.a; - return A2( - $elm$html$Html$li, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text(verbed), - tag1, - $elm$html$Html$text(' and '), - tag2, - $elm$html$Html$text('.') - ])); - } else { - var lastTag = _v0.a; - var otherTags = _v0.b; - return A2( - $elm$html$Html$li, - _List_Nil, - A2( - $elm$core$List$cons, - $elm$html$Html$text(verbed), - _Utils_ap( - A2( - $elm$core$List$intersperse, - $elm$html$Html$text(', '), - $elm$core$List$reverse(otherTags)), - _List_fromArray( - [ - $elm$html$Html$text(', and '), - lastTag, - $elm$html$Html$text('.') - ])))); - } - } - } - }); -var $elm$browser$Debugger$Overlay$viewChange = function (change) { - return A2( - $elm$html$Html$li, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin', '8px 0') - ]), - function () { - if (change.$ === 'AliasChange') { - var name = change.a; - return _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '1.5em') - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name) - ])) - ]); - } else { - var name = change.a; - var removed = change.b.removed; - var changed = change.b.changed; - var added = change.b.added; - var argsMatch = change.b.argsMatch; - return _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '1.5em') - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Overlay$viewCode(name) - ])), - A2( - $elm$html$Html$ul, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'list-style-type', 'disc'), - A2($elm$html$Html$Attributes$style, 'padding-left', '2em') - ]), - _List_fromArray( - [ - A2($elm$browser$Debugger$Overlay$viewMention, removed, 'Removed '), - A2($elm$browser$Debugger$Overlay$viewMention, changed, 'Changed '), - A2($elm$browser$Debugger$Overlay$viewMention, added, 'Added ') - ])), - argsMatch ? $elm$html$Html$text('') : $elm$html$Html$text('This may be due to the fact that the type variable names changed.') - ]); - } - }()); -}; -var $elm$browser$Debugger$Overlay$viewReport = F2( - function (isBad, report) { - switch (report.$) { - case 'CorruptHistory': - return _List_fromArray( - [ - $elm$html$Html$text('Looks like this history file is corrupt. I cannot understand it.') - ]); - case 'VersionChanged': - var old = report.a; - var _new = report.b; - return _List_fromArray( - [ - $elm$html$Html$text('This history was created with Elm ' + (old + (', but you are using Elm ' + (_new + ' right now.')))) - ]); - case 'MessageChanged': - var old = report.a; - var _new = report.b; - return _List_fromArray( - [ - $elm$html$Html$text('To import some other history, the overall message type must' + ' be the same. The old history has '), - $elm$browser$Debugger$Overlay$viewCode(old), - $elm$html$Html$text(' messages, but the new program works with '), - $elm$browser$Debugger$Overlay$viewCode(_new), - $elm$html$Html$text(' messages.') - ]); - default: - var changes = report.a; - return _List_fromArray( - [ - A2( - $elm$html$Html$p, - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text( - isBad ? $elm$browser$Debugger$Overlay$explanationBad : $elm$browser$Debugger$Overlay$explanationRisky) - ])), - A2( - $elm$html$Html$ul, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'list-style-type', 'none'), - A2($elm$html$Html$Attributes$style, 'padding-left', '20px') - ]), - A2($elm$core$List$map, $elm$browser$Debugger$Overlay$viewChange, changes)) - ]); - } - }); -var $elm$browser$Debugger$Overlay$view = F5( - function (config, isPaused, isOpen, numMsgs, state) { - switch (state.$) { - case 'None': - return isOpen ? $elm$html$Html$text('') : (isPaused ? A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-overlay'), - A2($elm$html$Html$Attributes$style, 'position', 'fixed'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100vw'), - A2($elm$html$Html$Attributes$style, 'height', '100vh'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'center'), - A2($elm$html$Html$Attributes$style, 'pointer-events', 'auto'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgba(200, 200, 200, 0.7)'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'font-family', '\'Trebuchet MS\', \'Lucida Grande\', \'Bitstream Vera Sans\', \'Helvetica Neue\', sans-serif'), - A2($elm$html$Html$Attributes$style, 'z-index', '2147483646'), - $elm$html$Html$Events$onClick(config.resume) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'font-size', '80px') - ]), - _List_fromArray( - [ - $elm$html$Html$text('Click to Resume') - ])), - A2($elm$browser$Debugger$Overlay$viewMiniControls, config, numMsgs) - ])) : A2($elm$browser$Debugger$Overlay$viewMiniControls, config, numMsgs)); - case 'BadMetadata': - var badMetadata_ = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Cannot use Import or Export', - $elm$browser$Debugger$Overlay$viewBadMetadata(badMetadata_), - $elm$browser$Debugger$Overlay$Accept('Ok')); - case 'BadImport': - var report = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Cannot Import History', - A2($elm$browser$Debugger$Overlay$viewReport, true, report), - $elm$browser$Debugger$Overlay$Accept('Ok')); - default: - var report = state.a; - return A4( - $elm$browser$Debugger$Overlay$viewMessage, - config, - 'Warning', - A2($elm$browser$Debugger$Overlay$viewReport, false, report), - A2($elm$browser$Debugger$Overlay$Choose, 'Cancel', 'Import Anyway')); - } - }); -var $elm$browser$Debugger$Main$cornerView = function (model) { - return A5( - $elm$browser$Debugger$Overlay$view, - {exportHistory: $elm$browser$Debugger$Main$Export, importHistory: $elm$browser$Debugger$Main$Import, open: $elm$browser$Debugger$Main$Open, resume: $elm$browser$Debugger$Main$Resume, wrap: $elm$browser$Debugger$Main$OverlayMsg}, - $elm$browser$Debugger$Main$isPaused(model.state), - _Debugger_isOpen(model.popout), - $elm$browser$Debugger$History$size(model.history), - model.overlay); -}; -var $elm$core$Dict$RBEmpty_elm_builtin = {$: 'RBEmpty_elm_builtin'}; -var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; -var $elm$core$Set$foldr = F3( - function (func, initialState, _v0) { - var dict = _v0.a; - return A3( - $elm$core$Dict$foldr, - F3( - function (key, _v1, state) { - return A2(func, key, state); - }), - initialState, - dict); - }); -var $elm$browser$Debugger$Main$getCurrentModel = function (state) { - if (state.$ === 'Running') { - var model = state.a; - return model; - } else { - var model = state.b; - return model; - } -}; -var $elm$browser$Debugger$Main$getUserModel = function (model) { - return $elm$browser$Debugger$Main$getCurrentModel(model.state); -}; -var $elm$browser$Debugger$Main$initialWindowHeight = 420; -var $elm$browser$Debugger$Main$initialWindowWidth = 900; -var $elm$core$Dict$Black = {$: 'Black'}; -var $elm$core$Dict$RBNode_elm_builtin = F5( - function (a, b, c, d, e) { - return {$: 'RBNode_elm_builtin', a: a, b: b, c: c, d: d, e: e}; - }); -var $elm$core$Dict$Red = {$: 'Red'}; -var $elm$core$Dict$balance = F5( - function (color, key, value, left, right) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Red')) { - var _v1 = right.a; - var rK = right.b; - var rV = right.c; - var rLeft = right.d; - var rRight = right.e; - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { - var _v3 = left.a; - var lK = left.b; - var lV = left.c; - var lLeft = left.d; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - key, - value, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - rK, - rV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, left, rLeft), - rRight); - } - } else { - if ((((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) && (left.d.$ === 'RBNode_elm_builtin')) && (left.d.a.$ === 'Red')) { - var _v5 = left.a; - var lK = left.b; - var lV = left.c; - var _v6 = left.d; - var _v7 = _v6.a; - var llK = _v6.b; - var llV = _v6.c; - var llLeft = _v6.d; - var llRight = _v6.e; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - lK, - lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, key, value, lRight, right)); - } else { - return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); - } - } - }); -var $elm$core$Basics$compare = _Utils_compare; -var $elm$core$Dict$insertHelp = F3( - function (key, value, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); - } else { - var nColor = dict.a; - var nKey = dict.b; - var nValue = dict.c; - var nLeft = dict.d; - var nRight = dict.e; - var _v1 = A2($elm$core$Basics$compare, key, nKey); - switch (_v1.$) { - case 'LT': - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - A3($elm$core$Dict$insertHelp, key, value, nLeft), - nRight); - case 'EQ': - return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); - default: - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - nLeft, - A3($elm$core$Dict$insertHelp, key, value, nRight)); - } - } - }); -var $elm$core$Dict$insert = F3( - function (key, value, dict) { - var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { - var _v1 = _v0.a; - var k = _v0.b; - var v = _v0.c; - var l = _v0.d; - var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); - } else { - var x = _v0; - return x; - } - }); -var $elm$browser$Debugger$Main$cachedHistory = function (model) { - var _v0 = model.state; - if (_v0.$ === 'Running') { - return model.history; - } else { - var history = _v0.e; - return history; - } -}; -var $elm$virtual_dom$VirtualDom$node = function (tag) { - return _VirtualDom_node( - _VirtualDom_noScript(tag)); -}; -var $elm$html$Html$node = $elm$virtual_dom$VirtualDom$node; -var $elm$browser$Debugger$Main$DragEnd = {$: 'DragEnd'}; -var $elm$browser$Debugger$Main$getDragStatus = function (layout) { - if (layout.$ === 'Horizontal') { - var status = layout.a; - return status; - } else { - var status = layout.a; - return status; - } -}; -var $elm$browser$Debugger$Main$Drag = function (a) { - return {$: 'Drag', a: a}; -}; -var $elm$browser$Debugger$Main$DragInfo = F5( - function (x, y, down, width, height) { - return {down: down, height: height, width: width, x: x, y: y}; - }); -var $elm$json$Json$Decode$field = _Json_decodeField; -var $elm$json$Json$Decode$at = F2( - function (fields, decoder) { - return A3($elm$core$List$foldr, $elm$json$Json$Decode$field, decoder, fields); - }); -var $elm$json$Json$Decode$float = _Json_decodeFloat; -var $elm$browser$Debugger$Main$decodeDimension = function (field) { - return A2( - $elm$json$Json$Decode$at, - _List_fromArray( - ['currentTarget', 'ownerDocument', 'defaultView', field]), - $elm$json$Json$Decode$float); -}; -var $elm$json$Json$Decode$int = _Json_decodeInt; -var $elm$json$Json$Decode$map5 = _Json_map5; -var $elm$browser$Debugger$Main$onMouseMove = A2( - $elm$html$Html$Events$on, - 'mousemove', - A2( - $elm$json$Json$Decode$map, - $elm$browser$Debugger$Main$Drag, - A6( - $elm$json$Json$Decode$map5, - $elm$browser$Debugger$Main$DragInfo, - A2($elm$json$Json$Decode$field, 'pageX', $elm$json$Json$Decode$float), - A2($elm$json$Json$Decode$field, 'pageY', $elm$json$Json$Decode$float), - A2( - $elm$json$Json$Decode$field, - 'buttons', - A2( - $elm$json$Json$Decode$map, - function (v) { - return v === 1; - }, - $elm$json$Json$Decode$int)), - $elm$browser$Debugger$Main$decodeDimension('innerWidth'), - $elm$browser$Debugger$Main$decodeDimension('innerHeight')))); -var $elm$html$Html$Events$onMouseUp = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'mouseup', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$browser$Debugger$Main$toDragListeners = function (layout) { - var _v0 = $elm$browser$Debugger$Main$getDragStatus(layout); - if (_v0.$ === 'Static') { - return _List_Nil; - } else { - return _List_fromArray( - [ - $elm$browser$Debugger$Main$onMouseMove, - $elm$html$Html$Events$onMouseUp($elm$browser$Debugger$Main$DragEnd) - ]); - } -}; -var $elm$browser$Debugger$Main$toFlexDirection = function (layout) { - if (layout.$ === 'Horizontal') { - return 'row'; - } else { - return 'column-reverse'; - } -}; -var $elm$browser$Debugger$Main$DragStart = {$: 'DragStart'}; -var $elm$html$Html$Events$onMouseDown = function (msg) { - return A2( - $elm$html$Html$Events$on, - 'mousedown', - $elm$json$Json$Decode$succeed(msg)); -}; -var $elm$browser$Debugger$Main$toPercent = function (fraction) { - return $elm$core$String$fromFloat(100 * fraction) + '%'; -}; -var $elm$browser$Debugger$Main$viewDragZone = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2($elm$html$Html$Attributes$style, 'top', '0'), - A2( - $elm$html$Html$Attributes$style, - 'left', - $elm$browser$Debugger$Main$toPercent(x)), - A2($elm$html$Html$Attributes$style, 'margin-left', '-5px'), - A2($elm$html$Html$Attributes$style, 'width', '10px'), - A2($elm$html$Html$Attributes$style, 'height', '100%'), - A2($elm$html$Html$Attributes$style, 'cursor', 'col-resize'), - $elm$html$Html$Events$onMouseDown($elm$browser$Debugger$Main$DragStart) - ]), - _List_Nil); - } else { - var y = layout.c; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'position', 'absolute'), - A2( - $elm$html$Html$Attributes$style, - 'top', - $elm$browser$Debugger$Main$toPercent(y)), - A2($elm$html$Html$Attributes$style, 'left', '0'), - A2($elm$html$Html$Attributes$style, 'margin-top', '-5px'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '10px'), - A2($elm$html$Html$Attributes$style, 'cursor', 'row-resize'), - $elm$html$Html$Events$onMouseDown($elm$browser$Debugger$Main$DragStart) - ]), - _List_Nil); - } -}; -var $elm$browser$Debugger$Main$TweakExpandoModel = function (a) { - return {$: 'TweakExpandoModel', a: a}; -}; -var $elm$browser$Debugger$Main$TweakExpandoMsg = function (a) { - return {$: 'TweakExpandoMsg', a: a}; -}; -var $elm$browser$Debugger$Main$toExpandoPercents = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return _Utils_Tuple2( - $elm$browser$Debugger$Main$toPercent(1 - x), - '100%'); - } else { - var y = layout.c; - return _Utils_Tuple2( - '100%', - $elm$browser$Debugger$Main$toPercent(y)); - } -}; -var $elm$browser$Debugger$Main$toMouseBlocker = function (layout) { - var _v0 = $elm$browser$Debugger$Main$getDragStatus(layout); - if (_v0.$ === 'Static') { - return 'auto'; - } else { - return 'none'; - } -}; -var $elm$browser$Debugger$Expando$Field = F2( - function (a, b) { - return {$: 'Field', a: a, b: b}; - }); -var $elm$browser$Debugger$Expando$Index = F3( - function (a, b, c) { - return {$: 'Index', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Expando$Key = {$: 'Key'}; -var $elm$browser$Debugger$Expando$None = {$: 'None'}; -var $elm$browser$Debugger$Expando$Toggle = {$: 'Toggle'}; -var $elm$browser$Debugger$Expando$Value = {$: 'Value'}; -var $elm$browser$Debugger$Expando$blue = A2($elm$html$Html$Attributes$style, 'color', 'rgb(28, 0, 207)'); -var $elm$core$Basics$composeL = F3( - function (g, f, x) { - return g( - f(x)); - }); -var $elm$browser$Debugger$Expando$leftPad = function (maybeKey) { - if (maybeKey.$ === 'Nothing') { - return _List_Nil; - } else { - return _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', '4ch') - ]); - } -}; -var $elm$browser$Debugger$Expando$makeArrow = function (arrow) { - return A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#777'), - A2($elm$html$Html$Attributes$style, 'padding-left', '2ch'), - A2($elm$html$Html$Attributes$style, 'width', '2ch'), - A2($elm$html$Html$Attributes$style, 'display', 'inline-block') - ]), - _List_fromArray( - [ - $elm$html$Html$text(arrow) - ])); -}; -var $elm$browser$Debugger$Expando$purple = A2($elm$html$Html$Attributes$style, 'color', 'rgb(136, 19, 145)'); -var $elm$browser$Debugger$Expando$lineStarter = F3( - function (maybeKey, maybeIsClosed, description) { - var arrow = function () { - if (maybeIsClosed.$ === 'Nothing') { - return $elm$browser$Debugger$Expando$makeArrow(''); - } else { - if (maybeIsClosed.a) { - return $elm$browser$Debugger$Expando$makeArrow('▸'); - } else { - return $elm$browser$Debugger$Expando$makeArrow('▾'); - } - } - }(); - if (maybeKey.$ === 'Nothing') { - return A2($elm$core$List$cons, arrow, description); - } else { - var key = maybeKey.a; - return A2( - $elm$core$List$cons, - arrow, - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(key) - ])), - A2( - $elm$core$List$cons, - $elm$html$Html$text(' = '), - description))); - } - }); -var $elm$browser$Debugger$Expando$red = A2($elm$html$Html$Attributes$style, 'color', 'rgb(196, 26, 22)'); -var $elm$core$Tuple$second = function (_v0) { - var y = _v0.b; - return y; -}; -var $elm$browser$Debugger$Expando$seqTypeToString = F2( - function (n, seqType) { - switch (seqType.$) { - case 'ListSeq': - return 'List(' + ($elm$core$String$fromInt(n) + ')'); - case 'SetSeq': - return 'Set(' + ($elm$core$String$fromInt(n) + ')'); - default: - return 'Array(' + ($elm$core$String$fromInt(n) + ')'); - } - }); -var $elm$core$String$slice = _String_slice; -var $elm$core$String$left = F2( - function (n, string) { - return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string); - }); -var $elm$core$String$right = F2( - function (n, string) { - return (n < 1) ? '' : A3( - $elm$core$String$slice, - -n, - $elm$core$String$length(string), - string); - }); -var $elm$browser$Debugger$Expando$elideMiddle = function (str) { - return ($elm$core$String$length(str) <= 18) ? str : (A2($elm$core$String$left, 8, str) + ('...' + A2($elm$core$String$right, 8, str))); -}; -var $elm$core$Dict$isEmpty = function (dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return true; - } else { - return false; - } -}; -var $elm$browser$Debugger$Expando$viewExtraTinyRecord = F3( - function (length, starter, entries) { - if (!entries.b) { - return _Utils_Tuple2( - length + 1, - _List_fromArray( - [ - $elm$html$Html$text('}') - ])); - } else { - var field = entries.a; - var rest = entries.b; - var nextLength = (length + $elm$core$String$length(field)) + 1; - if (nextLength > 18) { - return _Utils_Tuple2( - length + 2, - _List_fromArray( - [ - $elm$html$Html$text('…}') - ])); - } else { - var _v1 = A3($elm$browser$Debugger$Expando$viewExtraTinyRecord, nextLength, ',', rest); - var finalLength = _v1.a; - var otherHtmls = _v1.b; - return _Utils_Tuple2( - finalLength, - A2( - $elm$core$List$cons, - $elm$html$Html$text(starter), - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(field) - ])), - otherHtmls))); - } - } - }); -var $elm$browser$Debugger$Expando$viewTinyHelp = function (str) { - return _Utils_Tuple2( - $elm$core$String$length(str), - _List_fromArray( - [ - $elm$html$Html$text(str) - ])); -}; -var $elm$core$Maybe$withDefault = F2( - function (_default, maybe) { - if (maybe.$ === 'Just') { - var value = maybe.a; - return value; - } else { - return _default; - } - }); -var $elm$browser$Debugger$Expando$viewExtraTiny = function (value) { - if (value.$ === 'Record') { - var record = value.b; - return A3( - $elm$browser$Debugger$Expando$viewExtraTinyRecord, - 0, - '{', - $elm$core$Dict$keys(record)); - } else { - return $elm$browser$Debugger$Expando$viewTiny(value); - } -}; -var $elm$browser$Debugger$Expando$viewTiny = function (value) { - switch (value.$) { - case 'S': - var stringRep = value.a; - var str = $elm$browser$Debugger$Expando$elideMiddle(stringRep); - return _Utils_Tuple2( - $elm$core$String$length(str), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$red]), - _List_fromArray( - [ - $elm$html$Html$text(str) - ])) - ])); - case 'Primitive': - var stringRep = value.a; - return _Utils_Tuple2( - $elm$core$String$length(stringRep), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$blue]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ])); - case 'Sequence': - var seqType = value.a; - var valueList = value.c; - return $elm$browser$Debugger$Expando$viewTinyHelp( - A2( - $elm$browser$Debugger$Expando$seqTypeToString, - $elm$core$List$length(valueList), - seqType)); - case 'Dictionary': - var keyValuePairs = value.b; - return $elm$browser$Debugger$Expando$viewTinyHelp( - 'Dict(' + ($elm$core$String$fromInt( - $elm$core$List$length(keyValuePairs)) + ')')); - case 'Record': - var record = value.b; - return $elm$browser$Debugger$Expando$viewTinyRecord(record); - default: - if (!value.c.b) { - var maybeName = value.a; - return $elm$browser$Debugger$Expando$viewTinyHelp( - A2($elm$core$Maybe$withDefault, 'Unit', maybeName)); - } else { - var maybeName = value.a; - var valueList = value.c; - return $elm$browser$Debugger$Expando$viewTinyHelp( - function () { - if (maybeName.$ === 'Nothing') { - return 'Tuple(' + ($elm$core$String$fromInt( - $elm$core$List$length(valueList)) + ')'); - } else { - var name = maybeName.a; - return name + ' …'; - } - }()); - } - } -}; -var $elm$browser$Debugger$Expando$viewTinyRecord = function (record) { - return $elm$core$Dict$isEmpty(record) ? _Utils_Tuple2( - 2, - _List_fromArray( - [ - $elm$html$Html$text('{}') - ])) : A3( - $elm$browser$Debugger$Expando$viewTinyRecordHelp, - 0, - '{ ', - $elm$core$Dict$toList(record)); -}; -var $elm$browser$Debugger$Expando$viewTinyRecordHelp = F3( - function (length, starter, entries) { - if (!entries.b) { - return _Utils_Tuple2( - length + 2, - _List_fromArray( - [ - $elm$html$Html$text(' }') - ])); - } else { - var _v1 = entries.a; - var field = _v1.a; - var value = _v1.b; - var rest = entries.b; - var fieldLen = $elm$core$String$length(field); - var _v2 = $elm$browser$Debugger$Expando$viewExtraTiny(value); - var valueLen = _v2.a; - var valueHtmls = _v2.b; - var newLength = ((length + fieldLen) + valueLen) + 5; - if (newLength > 60) { - return _Utils_Tuple2( - length + 4, - _List_fromArray( - [ - $elm$html$Html$text(', … }') - ])); - } else { - var _v3 = A3($elm$browser$Debugger$Expando$viewTinyRecordHelp, newLength, ', ', rest); - var finalLength = _v3.a; - var otherHtmls = _v3.b; - return _Utils_Tuple2( - finalLength, - A2( - $elm$core$List$cons, - $elm$html$Html$text(starter), - A2( - $elm$core$List$cons, - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$purple]), - _List_fromArray( - [ - $elm$html$Html$text(field) - ])), - A2( - $elm$core$List$cons, - $elm$html$Html$text(' = '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, valueHtmls), - otherHtmls))))); - } - } - }); -var $elm$browser$Debugger$Expando$view = F2( - function (maybeKey, expando) { - switch (expando.$) { - case 'S': - var stringRep = expando.a; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Nothing, - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$red]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ]))); - case 'Primitive': - var stringRep = expando.a; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Nothing, - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [$elm$browser$Debugger$Expando$blue]), - _List_fromArray( - [ - $elm$html$Html$text(stringRep) - ])) - ]))); - case 'Sequence': - var seqType = expando.a; - var isClosed = expando.b; - var valueList = expando.c; - return A4($elm$browser$Debugger$Expando$viewSequence, maybeKey, seqType, isClosed, valueList); - case 'Dictionary': - var isClosed = expando.a; - var keyValuePairs = expando.b; - return A3($elm$browser$Debugger$Expando$viewDictionary, maybeKey, isClosed, keyValuePairs); - case 'Record': - var isClosed = expando.a; - var valueDict = expando.b; - return A3($elm$browser$Debugger$Expando$viewRecord, maybeKey, isClosed, valueDict); - default: - var maybeName = expando.a; - var isClosed = expando.b; - var valueList = expando.c; - return A4($elm$browser$Debugger$Expando$viewConstructor, maybeKey, maybeName, isClosed, valueList); - } - }); -var $elm$browser$Debugger$Expando$viewConstructor = F4( - function (maybeKey, maybeName, isClosed, valueList) { - var tinyArgs = A2( - $elm$core$List$map, - A2($elm$core$Basics$composeL, $elm$core$Tuple$second, $elm$browser$Debugger$Expando$viewExtraTiny), - valueList); - var description = function () { - var _v7 = _Utils_Tuple2(maybeName, tinyArgs); - if (_v7.a.$ === 'Nothing') { - if (!_v7.b.b) { - var _v8 = _v7.a; - return _List_fromArray( - [ - $elm$html$Html$text('()') - ]); - } else { - var _v9 = _v7.a; - var _v10 = _v7.b; - var x = _v10.a; - var xs = _v10.b; - return A2( - $elm$core$List$cons, - $elm$html$Html$text('( '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, x), - A3( - $elm$core$List$foldr, - F2( - function (args, rest) { - return A2( - $elm$core$List$cons, - $elm$html$Html$text(', '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, args), - rest)); - }), - _List_fromArray( - [ - $elm$html$Html$text(' )') - ]), - xs))); - } - } else { - if (!_v7.b.b) { - var name = _v7.a.a; - return _List_fromArray( - [ - $elm$html$Html$text(name) - ]); - } else { - var name = _v7.a.a; - var _v11 = _v7.b; - var x = _v11.a; - var xs = _v11.b; - return A2( - $elm$core$List$cons, - $elm$html$Html$text(name + ' '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, x), - A3( - $elm$core$List$foldr, - F2( - function (args, rest) { - return A2( - $elm$core$List$cons, - $elm$html$Html$text(' '), - A2( - $elm$core$List$cons, - A2($elm$html$Html$span, _List_Nil, args), - rest)); - }), - _List_Nil, - xs))); - } - } - }(); - var _v4 = function () { - if (!valueList.b) { - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - } else { - if (!valueList.b.b) { - var entry = valueList.a; - switch (entry.$) { - case 'S': - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - case 'Primitive': - return _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A2($elm$html$Html$div, _List_Nil, _List_Nil)); - case 'Sequence': - var subValueList = entry.c; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewSequenceOpen(subValueList))); - case 'Dictionary': - var keyValuePairs = entry.b; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewDictionaryOpen(keyValuePairs))); - case 'Record': - var record = entry.b; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewRecordOpen(record))); - default: - var subValueList = entry.c; - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, 0), - $elm$browser$Debugger$Expando$viewConstructorOpen(subValueList))); - } - } else { - return _Utils_Tuple2( - $elm$core$Maybe$Just(isClosed), - isClosed ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : $elm$browser$Debugger$Expando$viewConstructorOpen(valueList)); - } - } - }(); - var maybeIsClosed = _v4.a; - var openHtml = _v4.b; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3($elm$browser$Debugger$Expando$lineStarter, maybeKey, maybeIsClosed, description)), - openHtml - ])); - }); -var $elm$browser$Debugger$Expando$viewConstructorEntry = F2( - function (index, value) { - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$None, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just( - $elm$core$String$fromInt(index)), - value)); - }); -var $elm$browser$Debugger$Expando$viewConstructorOpen = function (valueList) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewConstructorEntry, valueList)); -}; -var $elm$browser$Debugger$Expando$viewDictionary = F3( - function (maybeKey, isClosed, keyValuePairs) { - var starter = 'Dict(' + ($elm$core$String$fromInt( - $elm$core$List$length(keyValuePairs)) + ')'); - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - _List_fromArray( - [ - $elm$html$Html$text(starter) - ]))), - isClosed ? $elm$html$Html$text('') : $elm$browser$Debugger$Expando$viewDictionaryOpen(keyValuePairs) - ])); - }); -var $elm$browser$Debugger$Expando$viewDictionaryEntry = F2( - function (index, _v2) { - var key = _v2.a; - var value = _v2.b; - switch (key.$) { - case 'S': - var stringRep = key.a; - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(stringRep), - value)); - case 'Primitive': - var stringRep = key.a; - return A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(stringRep), - value)); - default: - return A2( - $elm$html$Html$div, - _List_Nil, - _List_fromArray( - [ - A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Key, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just('key'), - key)), - A2( - $elm$html$Html$map, - A2($elm$browser$Debugger$Expando$Index, $elm$browser$Debugger$Expando$Value, index), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just('value'), - value)) - ])); - } - }); -var $elm$browser$Debugger$Expando$viewDictionaryOpen = function (keyValuePairs) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewDictionaryEntry, keyValuePairs)); -}; -var $elm$browser$Debugger$Expando$viewRecord = F3( - function (maybeKey, isClosed, record) { - var _v1 = isClosed ? _Utils_Tuple3( - $elm$browser$Debugger$Expando$viewTinyRecord(record).b, - $elm$html$Html$text(''), - $elm$html$Html$text('')) : _Utils_Tuple3( - _List_fromArray( - [ - $elm$html$Html$text('{') - ]), - $elm$browser$Debugger$Expando$viewRecordOpen(record), - A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad( - $elm$core$Maybe$Just(_Utils_Tuple0)), - _List_fromArray( - [ - $elm$html$Html$text('}') - ]))); - var start = _v1.a; - var middle = _v1.b; - var end = _v1.c; - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - start)), - middle, - end - ])); - }); -var $elm$browser$Debugger$Expando$viewRecordEntry = function (_v0) { - var field = _v0.a; - var value = _v0.b; - return A2( - $elm$html$Html$map, - $elm$browser$Debugger$Expando$Field(field), - A2( - $elm$browser$Debugger$Expando$view, - $elm$core$Maybe$Just(field), - value)); -}; -var $elm$browser$Debugger$Expando$viewRecordOpen = function (record) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$viewRecordEntry, - $elm$core$Dict$toList(record))); -}; -var $elm$browser$Debugger$Expando$viewSequence = F4( - function (maybeKey, seqType, isClosed, valueList) { - var starter = A2( - $elm$browser$Debugger$Expando$seqTypeToString, - $elm$core$List$length(valueList), - seqType); - return A2( - $elm$html$Html$div, - $elm$browser$Debugger$Expando$leftPad(maybeKey), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($elm$browser$Debugger$Expando$Toggle) - ]), - A3( - $elm$browser$Debugger$Expando$lineStarter, - maybeKey, - $elm$core$Maybe$Just(isClosed), - _List_fromArray( - [ - $elm$html$Html$text(starter) - ]))), - isClosed ? $elm$html$Html$text('') : $elm$browser$Debugger$Expando$viewSequenceOpen(valueList) - ])); - }); -var $elm$browser$Debugger$Expando$viewSequenceOpen = function (values) { - return A2( - $elm$html$Html$div, - _List_Nil, - A2($elm$core$List$indexedMap, $elm$browser$Debugger$Expando$viewConstructorEntry, values)); -}; -var $elm$browser$Debugger$Main$viewExpando = F3( - function (expandoMsg, expandoModel, layout) { - var block = $elm$browser$Debugger$Main$toMouseBlocker(layout); - var _v0 = $elm$browser$Debugger$Main$toExpandoPercents(layout); - var w = _v0.a; - var h = _v0.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'block'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(' + (w + ' - 4em)')), - A2($elm$html$Html$Attributes$style, 'height', 'calc(' + (h + ' - 4em)')), - A2($elm$html$Html$Attributes$style, 'padding', '2em'), - A2($elm$html$Html$Attributes$style, 'margin', '0'), - A2($elm$html$Html$Attributes$style, 'overflow', 'auto'), - A2($elm$html$Html$Attributes$style, 'pointer-events', block), - A2($elm$html$Html$Attributes$style, '-webkit-user-select', block), - A2($elm$html$Html$Attributes$style, '-moz-user-select', block), - A2($elm$html$Html$Attributes$style, '-ms-user-select', block), - A2($elm$html$Html$Attributes$style, 'user-select', block) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#ccc'), - A2($elm$html$Html$Attributes$style, 'padding', '0 0 1em 0') - ]), - _List_fromArray( - [ - $elm$html$Html$text('-- MESSAGE') - ])), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$TweakExpandoMsg, - A2($elm$browser$Debugger$Expando$view, $elm$core$Maybe$Nothing, expandoMsg)), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'color', '#ccc'), - A2($elm$html$Html$Attributes$style, 'padding', '1em 0') - ]), - _List_fromArray( - [ - $elm$html$Html$text('-- MODEL') - ])), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$TweakExpandoModel, - A2($elm$browser$Debugger$Expando$view, $elm$core$Maybe$Nothing, expandoModel)) - ])); - }); -var $elm$browser$Debugger$Main$Jump = function (a) { - return {$: 'Jump', a: a}; -}; -var $elm$virtual_dom$VirtualDom$lazy = _VirtualDom_lazy; -var $elm$html$Html$Lazy$lazy = $elm$virtual_dom$VirtualDom$lazy; -var $elm$browser$Debugger$Main$toHistoryPercents = function (layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - return _Utils_Tuple2( - $elm$browser$Debugger$Main$toPercent(x), - '100%'); - } else { - var y = layout.c; - return _Utils_Tuple2( - '100%', - $elm$browser$Debugger$Main$toPercent(1 - y)); - } -}; -var $elm$virtual_dom$VirtualDom$lazy3 = _VirtualDom_lazy3; -var $elm$html$Html$Lazy$lazy3 = $elm$virtual_dom$VirtualDom$lazy3; -var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); -var $elm$browser$Debugger$History$idForMessageIndex = function (index) { - return 'msg-' + $elm$core$String$fromInt(index); -}; -var $elm$html$Html$Attributes$title = $elm$html$Html$Attributes$stringProperty('title'); -var $elm$browser$Debugger$History$viewMessage = F3( - function (currentIndex, index, msg) { - var messageName = _Debugger_messageToString(msg); - var className = _Utils_eq(currentIndex, index) ? 'elm-debugger-entry elm-debugger-entry-selected' : 'elm-debugger-entry'; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id( - $elm$browser$Debugger$History$idForMessageIndex(index)), - $elm$html$Html$Attributes$class(className), - $elm$html$Html$Events$onClick(index) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$title(messageName), - $elm$html$Html$Attributes$class('elm-debugger-entry-content') - ]), - _List_fromArray( - [ - $elm$html$Html$text(messageName) - ])), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry-index') - ]), - _List_fromArray( - [ - $elm$html$Html$text( - $elm$core$String$fromInt(index)) - ])) - ])); - }); -var $elm$browser$Debugger$History$consMsg = F3( - function (currentIndex, msg, _v0) { - var index = _v0.a; - var rest = _v0.b; - return _Utils_Tuple2( - index + 1, - A2( - $elm$core$List$cons, - _Utils_Tuple2( - $elm$core$String$fromInt(index), - A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewMessage, currentIndex, index, msg)), - rest)); - }); -var $elm$core$Array$length = function (_v0) { - var len = _v0.a; - return len; -}; -var $elm$core$Basics$neq = _Utils_notEqual; -var $elm$virtual_dom$VirtualDom$keyedNode = function (tag) { - return _VirtualDom_keyedNode( - _VirtualDom_noScript(tag)); -}; -var $elm$html$Html$Keyed$node = $elm$virtual_dom$VirtualDom$keyedNode; -var $elm$browser$Debugger$History$maxSnapshotSize = 31; -var $elm$browser$Debugger$History$showMoreButton = function (numMessages) { - var nextIndex = (numMessages - 1) - ($elm$browser$Debugger$History$maxSnapshotSize * 2); - var labelText = 'View more messages'; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry'), - $elm$html$Html$Events$onClick(nextIndex) - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$title(labelText), - $elm$html$Html$Attributes$class('elm-debugger-entry-content') - ]), - _List_fromArray( - [ - $elm$html$Html$text(labelText) - ])), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - $elm$html$Html$Attributes$class('elm-debugger-entry-index') - ]), - _List_Nil) - ])); -}; -var $elm$browser$Debugger$History$styles = A3( - $elm$html$Html$node, - 'style', - _List_Nil, - _List_fromArray( - [ - $elm$html$Html$text('\n\n.elm-debugger-entry {\n cursor: pointer;\n width: 100%;\n box-sizing: border-box;\n padding: 8px;\n}\n\n.elm-debugger-entry:hover {\n background-color: rgb(41, 41, 41);\n}\n\n.elm-debugger-entry-selected, .elm-debugger-entry-selected:hover {\n background-color: rgb(10, 10, 10);\n}\n\n.elm-debugger-entry-content {\n width: calc(100% - 40px);\n padding: 0 5px;\n box-sizing: border-box;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n}\n\n.elm-debugger-entry-index {\n color: #666;\n width: 40px;\n text-align: right;\n display: block;\n float: right;\n}\n\n') - ])); -var $elm$core$Basics$ge = _Utils_ge; -var $elm$browser$Debugger$History$viewSnapshot = F3( - function (selectedIndex, index, _v0) { - var messages = _v0.messages; - return A3( - $elm$html$Html$Keyed$node, - 'div', - _List_Nil, - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$consMsg(selectedIndex), - _Utils_Tuple2(index, _List_Nil), - messages).b); - }); -var $elm$browser$Debugger$History$consSnapshot = F3( - function (selectedIndex, snapshot, _v0) { - var index = _v0.a; - var rest = _v0.b; - var nextIndex = index + $elm$core$Array$length(snapshot.messages); - var selectedIndexHelp = ((_Utils_cmp(nextIndex, selectedIndex) > 0) && (_Utils_cmp(selectedIndex, index) > -1)) ? selectedIndex : (-1); - return _Utils_Tuple2( - nextIndex, - A2( - $elm$core$List$cons, - A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewSnapshot, selectedIndexHelp, index, snapshot), - rest)); - }); -var $elm$core$Elm$JsArray$foldl = _JsArray_foldl; -var $elm$core$Array$foldl = F3( - function (func, baseCase, _v0) { - var tree = _v0.c; - var tail = _v0.d; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldl, helper, acc, subTree); - } else { - var values = node.a; - return A3($elm$core$Elm$JsArray$foldl, func, acc, values); - } - }); - return A3( - $elm$core$Elm$JsArray$foldl, - func, - A3($elm$core$Elm$JsArray$foldl, helper, baseCase, tree), - tail); - }); -var $elm$browser$Debugger$History$viewAllSnapshots = F3( - function (selectedIndex, startIndex, snapshots) { - return A2( - $elm$html$Html$div, - _List_Nil, - A3( - $elm$core$Array$foldl, - $elm$browser$Debugger$History$consSnapshot(selectedIndex), - _Utils_Tuple2(startIndex, _List_Nil), - snapshots).b); - }); -var $elm$core$Array$fromListHelp = F3( - function (list, nodeList, nodeListSize) { - fromListHelp: - while (true) { - var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, list); - var jsArray = _v0.a; - var remainingItems = _v0.b; - if (_Utils_cmp( - $elm$core$Elm$JsArray$length(jsArray), - $elm$core$Array$branchFactor) < 0) { - return A2( - $elm$core$Array$builderToArray, - true, - {nodeList: nodeList, nodeListSize: nodeListSize, tail: jsArray}); - } else { - var $temp$list = remainingItems, - $temp$nodeList = A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(jsArray), - nodeList), - $temp$nodeListSize = nodeListSize + 1; - list = $temp$list; - nodeList = $temp$nodeList; - nodeListSize = $temp$nodeListSize; - continue fromListHelp; - } - } - }); -var $elm$core$Array$fromList = function (list) { - if (!list.b) { - return $elm$core$Array$empty; - } else { - return A3($elm$core$Array$fromListHelp, list, _List_Nil, 0); - } -}; -var $elm$core$Bitwise$and = _Bitwise_and; -var $elm$core$Bitwise$shiftRightZfBy = _Bitwise_shiftRightZfBy; -var $elm$core$Array$bitMask = 4294967295 >>> (32 - $elm$core$Array$shiftStep); -var $elm$core$Elm$JsArray$unsafeGet = _JsArray_unsafeGet; -var $elm$core$Array$getHelp = F3( - function (shift, index, tree) { - getHelp: - while (true) { - var pos = $elm$core$Array$bitMask & (index >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { - var subTree = _v0.a; - var $temp$shift = shift - $elm$core$Array$shiftStep, - $temp$index = index, - $temp$tree = subTree; - shift = $temp$shift; - index = $temp$index; - tree = $temp$tree; - continue getHelp; - } else { - var values = _v0.a; - return A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, values); - } - } - }); -var $elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy; -var $elm$core$Array$tailIndex = function (len) { - return (len >>> 5) << 5; -}; -var $elm$core$Array$get = F2( - function (index, _v0) { - var len = _v0.a; - var startShift = _v0.b; - var tree = _v0.c; - var tail = _v0.d; - return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? $elm$core$Maybe$Nothing : ((_Utils_cmp( - index, - $elm$core$Array$tailIndex(len)) > -1) ? $elm$core$Maybe$Just( - A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, tail)) : $elm$core$Maybe$Just( - A3($elm$core$Array$getHelp, startShift, index, tree))); - }); -var $elm$core$Elm$JsArray$appendN = _JsArray_appendN; -var $elm$core$Elm$JsArray$slice = _JsArray_slice; -var $elm$core$Array$appendHelpBuilder = F2( - function (tail, builder) { - var tailLen = $elm$core$Elm$JsArray$length(tail); - var notAppended = ($elm$core$Array$branchFactor - $elm$core$Elm$JsArray$length(builder.tail)) - tailLen; - var appended = A3($elm$core$Elm$JsArray$appendN, $elm$core$Array$branchFactor, builder.tail, tail); - return (notAppended < 0) ? { - nodeList: A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(appended), - builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: A3($elm$core$Elm$JsArray$slice, notAppended, tailLen, tail) - } : ((!notAppended) ? { - nodeList: A2( - $elm$core$List$cons, - $elm$core$Array$Leaf(appended), - builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: $elm$core$Elm$JsArray$empty - } : {nodeList: builder.nodeList, nodeListSize: builder.nodeListSize, tail: appended}); - }); -var $elm$core$List$drop = F2( - function (n, list) { - drop: - while (true) { - if (n <= 0) { - return list; - } else { - if (!list.b) { - return list; - } else { - var x = list.a; - var xs = list.b; - var $temp$n = n - 1, - $temp$list = xs; - n = $temp$n; - list = $temp$list; - continue drop; - } - } - } - }); -var $elm$core$Array$sliceLeft = F2( - function (from, array) { - var len = array.a; - var tree = array.c; - var tail = array.d; - if (!from) { - return array; - } else { - if (_Utils_cmp( - from, - $elm$core$Array$tailIndex(len)) > -1) { - return A4( - $elm$core$Array$Array_elm_builtin, - len - from, - $elm$core$Array$shiftStep, - $elm$core$Elm$JsArray$empty, - A3( - $elm$core$Elm$JsArray$slice, - from - $elm$core$Array$tailIndex(len), - $elm$core$Elm$JsArray$length(tail), - tail)); - } else { - var skipNodes = (from / $elm$core$Array$branchFactor) | 0; - var helper = F2( - function (node, acc) { - if (node.$ === 'SubTree') { - var subTree = node.a; - return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); - } else { - var leaf = node.a; - return A2($elm$core$List$cons, leaf, acc); - } - }); - var leafNodes = A3( - $elm$core$Elm$JsArray$foldr, - helper, - _List_fromArray( - [tail]), - tree); - var nodesToInsert = A2($elm$core$List$drop, skipNodes, leafNodes); - if (!nodesToInsert.b) { - return $elm$core$Array$empty; - } else { - var head = nodesToInsert.a; - var rest = nodesToInsert.b; - var firstSlice = from - (skipNodes * $elm$core$Array$branchFactor); - var initialBuilder = { - nodeList: _List_Nil, - nodeListSize: 0, - tail: A3( - $elm$core$Elm$JsArray$slice, - firstSlice, - $elm$core$Elm$JsArray$length(head), - head) - }; - return A2( - $elm$core$Array$builderToArray, - true, - A3($elm$core$List$foldl, $elm$core$Array$appendHelpBuilder, initialBuilder, rest)); - } - } - } - }); -var $elm$core$Array$fetchNewTail = F4( - function (shift, end, treeEnd, tree) { - fetchNewTail: - while (true) { - var pos = $elm$core$Array$bitMask & (treeEnd >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var $temp$shift = shift - $elm$core$Array$shiftStep, - $temp$end = end, - $temp$treeEnd = treeEnd, - $temp$tree = sub; - shift = $temp$shift; - end = $temp$end; - treeEnd = $temp$treeEnd; - tree = $temp$tree; - continue fetchNewTail; - } else { - var values = _v0.a; - return A3($elm$core$Elm$JsArray$slice, 0, $elm$core$Array$bitMask & end, values); - } - } - }); -var $elm$core$Array$hoistTree = F3( - function (oldShift, newShift, tree) { - hoistTree: - while (true) { - if ((_Utils_cmp(oldShift, newShift) < 1) || (!$elm$core$Elm$JsArray$length(tree))) { - return tree; - } else { - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, 0, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var $temp$oldShift = oldShift - $elm$core$Array$shiftStep, - $temp$newShift = newShift, - $temp$tree = sub; - oldShift = $temp$oldShift; - newShift = $temp$newShift; - tree = $temp$tree; - continue hoistTree; - } else { - return tree; - } - } - } - }); -var $elm$core$Elm$JsArray$unsafeSet = _JsArray_unsafeSet; -var $elm$core$Array$sliceTree = F3( - function (shift, endIdx, tree) { - var lastPos = $elm$core$Array$bitMask & (endIdx >>> shift); - var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, lastPos, tree); - if (_v0.$ === 'SubTree') { - var sub = _v0.a; - var newSub = A3($elm$core$Array$sliceTree, shift - $elm$core$Array$shiftStep, endIdx, sub); - return (!$elm$core$Elm$JsArray$length(newSub)) ? A3($elm$core$Elm$JsArray$slice, 0, lastPos, tree) : A3( - $elm$core$Elm$JsArray$unsafeSet, - lastPos, - $elm$core$Array$SubTree(newSub), - A3($elm$core$Elm$JsArray$slice, 0, lastPos + 1, tree)); - } else { - return A3($elm$core$Elm$JsArray$slice, 0, lastPos, tree); - } - }); -var $elm$core$Array$sliceRight = F2( - function (end, array) { - var len = array.a; - var startShift = array.b; - var tree = array.c; - var tail = array.d; - if (_Utils_eq(end, len)) { - return array; - } else { - if (_Utils_cmp( - end, - $elm$core$Array$tailIndex(len)) > -1) { - return A4( - $elm$core$Array$Array_elm_builtin, - end, - startShift, - tree, - A3($elm$core$Elm$JsArray$slice, 0, $elm$core$Array$bitMask & end, tail)); - } else { - var endIdx = $elm$core$Array$tailIndex(end); - var depth = $elm$core$Basics$floor( - A2( - $elm$core$Basics$logBase, - $elm$core$Array$branchFactor, - A2($elm$core$Basics$max, 1, endIdx - 1))); - var newShift = A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep); - return A4( - $elm$core$Array$Array_elm_builtin, - end, - newShift, - A3( - $elm$core$Array$hoistTree, - startShift, - newShift, - A3($elm$core$Array$sliceTree, startShift, endIdx, tree)), - A4($elm$core$Array$fetchNewTail, startShift, end, endIdx, tree)); - } - } - }); -var $elm$core$Array$translateIndex = F2( - function (index, _v0) { - var len = _v0.a; - var posIndex = (index < 0) ? (len + index) : index; - return (posIndex < 0) ? 0 : ((_Utils_cmp(posIndex, len) > 0) ? len : posIndex); - }); -var $elm$core$Array$slice = F3( - function (from, to, array) { - var correctTo = A2($elm$core$Array$translateIndex, to, array); - var correctFrom = A2($elm$core$Array$translateIndex, from, array); - return (_Utils_cmp(correctFrom, correctTo) > 0) ? $elm$core$Array$empty : A2( - $elm$core$Array$sliceLeft, - correctFrom, - A2($elm$core$Array$sliceRight, correctTo, array)); - }); -var $elm$browser$Debugger$History$viewRecentSnapshots = F3( - function (selectedIndex, recentMessagesNum, snapshots) { - var messagesToFill = $elm$browser$Debugger$History$maxSnapshotSize - recentMessagesNum; - var arrayLength = $elm$core$Array$length(snapshots); - var snapshotsToRender = function () { - var _v0 = _Utils_Tuple2( - A2($elm$core$Array$get, arrayLength - 2, snapshots), - A2($elm$core$Array$get, arrayLength - 1, snapshots)); - if ((_v0.a.$ === 'Just') && (_v0.b.$ === 'Just')) { - var fillerSnapshot = _v0.a.a; - var recentSnapshot = _v0.b.a; - return $elm$core$Array$fromList( - _List_fromArray( - [ - { - messages: A3($elm$core$Array$slice, 0, messagesToFill, fillerSnapshot.messages), - model: fillerSnapshot.model - }, - recentSnapshot - ])); - } else { - return snapshots; - } - }(); - var startingIndex = ((arrayLength * $elm$browser$Debugger$History$maxSnapshotSize) - $elm$browser$Debugger$History$maxSnapshotSize) - messagesToFill; - return A3($elm$browser$Debugger$History$viewAllSnapshots, selectedIndex, startingIndex, snapshotsToRender); - }); -var $elm$browser$Debugger$History$view = F2( - function (maybeIndex, _v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var numMessages = _v0.numMessages; - var recentMessageStartIndex = numMessages - recent.numMessages; - var index = A2($elm$core$Maybe$withDefault, -1, maybeIndex); - var newStuff = A3( - $elm$html$Html$Keyed$node, - 'div', - _List_Nil, - A3( - $elm$core$List$foldr, - $elm$browser$Debugger$History$consMsg(index), - _Utils_Tuple2(recentMessageStartIndex, _List_Nil), - recent.messages).b); - var onlyRenderRecentMessages = (!_Utils_eq(index, -1)) || ($elm$core$Array$length(snapshots) < 2); - var oldStuff = onlyRenderRecentMessages ? A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewAllSnapshots, index, 0, snapshots) : A4($elm$html$Html$Lazy$lazy3, $elm$browser$Debugger$History$viewRecentSnapshots, index, recent.numMessages, snapshots); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - $elm$html$Html$Attributes$id('elm-debugger-sidebar'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'overflow-y', 'auto'), - A2($elm$html$Html$Attributes$style, 'height', 'calc(100% - 72px)') - ]), - A2( - $elm$core$List$cons, - $elm$browser$Debugger$History$styles, - A2( - $elm$core$List$cons, - newStuff, - A2( - $elm$core$List$cons, - oldStuff, - onlyRenderRecentMessages ? _List_Nil : _List_fromArray( - [ - $elm$browser$Debugger$History$showMoreButton(numMessages) - ]))))); - }); -var $elm$browser$Debugger$Main$SwapLayout = {$: 'SwapLayout'}; -var $elm$browser$Debugger$Main$toHistoryIcon = function (layout) { - if (layout.$ === 'Horizontal') { - return 'M13 1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M13 3h-10a1 1 0 0 0-1 1v5h12v-5a1 1 0 0 0-1-1z M14 10h-12v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1z'; - } else { - return 'M0 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3z M2 4v8a1 1 0 0 0 1 1h2v-10h-2a1 1 0 0 0-1 1z M6 3v10h7a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1z'; - } -}; -var $elm$browser$Debugger$Main$icon = function (path) { - return A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'svg', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'viewBox', '0 0 16 16'), - A2($elm$virtual_dom$VirtualDom$attribute, 'xmlns', 'http://www.w3.org/2000/svg'), - A2($elm$virtual_dom$VirtualDom$attribute, 'fill', 'currentColor'), - A2($elm$virtual_dom$VirtualDom$attribute, 'width', '16px'), - A2($elm$virtual_dom$VirtualDom$attribute, 'height', '16px') - ]), - _List_fromArray( - [ - A4( - $elm$virtual_dom$VirtualDom$nodeNS, - 'http://www.w3.org/2000/svg', - 'path', - _List_fromArray( - [ - A2($elm$virtual_dom$VirtualDom$attribute, 'd', path) - ]), - _List_Nil) - ])); -}; -var $elm$browser$Debugger$Main$viewHistoryButton = F3( - function (label, msg, path) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'background', 'none'), - A2($elm$html$Html$Attributes$style, 'border', 'none'), - A2($elm$html$Html$Attributes$style, 'color', 'inherit'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - $elm$html$Html$Events$onClick(msg) - ]), - _List_fromArray( - [ - $elm$browser$Debugger$Main$icon(path), - A2( - $elm$html$Html$span, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'padding-left', '6px') - ]), - _List_fromArray( - [ - $elm$html$Html$text(label) - ])) - ])); - }); -var $elm$browser$Debugger$Main$viewHistoryOptions = function (layout) { - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'space-between'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - _List_fromArray( - [ - A3( - $elm$browser$Debugger$Main$viewHistoryButton, - 'Swap Layout', - $elm$browser$Debugger$Main$SwapLayout, - $elm$browser$Debugger$Main$toHistoryIcon(layout)), - A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'justify-content', 'space-between') - ]), - _List_fromArray( - [ - A3($elm$browser$Debugger$Main$viewHistoryButton, 'Import', $elm$browser$Debugger$Main$Import, 'M5 1a1 1 0 0 1 0 2h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1a1 1 0 0 1 2 0a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M10 2a1 1 0 0 0 -2 0v6a1 1 0 0 0 1 1h6a1 1 0 0 0 0-2h-3.586l4.293-4.293a1 1 0 0 0-1.414-1.414l-4.293 4.293z'), - A3($elm$browser$Debugger$Main$viewHistoryButton, 'Export', $elm$browser$Debugger$Main$Export, 'M5 1a1 1 0 0 1 0 2h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1 a1 1 0 0 1 2 0a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z M9 3a1 1 0 1 1 0-2h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-3.586l-5.293 5.293 a1 1 0 0 1-1.414-1.414l5.293 -5.293z') - ])) - ])); -}; -var $elm$browser$Debugger$Main$SliderJump = function (a) { - return {$: 'SliderJump', a: a}; -}; -var $elm$core$Basics$composeR = F3( - function (f, g, x) { - return g( - f(x)); - }); -var $elm$html$Html$input = _VirtualDom_node('input'); -var $elm$browser$Debugger$Main$isPlaying = function (maybeIndex) { - if (maybeIndex.$ === 'Nothing') { - return true; - } else { - return false; - } -}; -var $elm$html$Html$Attributes$max = $elm$html$Html$Attributes$stringProperty('max'); -var $elm$html$Html$Attributes$min = $elm$html$Html$Attributes$stringProperty('min'); -var $elm$html$Html$Events$alwaysStop = function (x) { - return _Utils_Tuple2(x, true); -}; -var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { - return {$: 'MayStopPropagation', a: a}; -}; -var $elm$html$Html$Events$stopPropagationOn = F2( - function (event, decoder) { - return A2( - $elm$virtual_dom$VirtualDom$on, - event, - $elm$virtual_dom$VirtualDom$MayStopPropagation(decoder)); - }); -var $elm$json$Json$Decode$string = _Json_decodeString; -var $elm$html$Html$Events$targetValue = A2( - $elm$json$Json$Decode$at, - _List_fromArray( - ['target', 'value']), - $elm$json$Json$Decode$string); -var $elm$html$Html$Events$onInput = function (tagger) { - return A2( - $elm$html$Html$Events$stopPropagationOn, - 'input', - A2( - $elm$json$Json$Decode$map, - $elm$html$Html$Events$alwaysStop, - A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); -}; -var $elm$core$String$toInt = _String_toInt; -var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); -var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); -var $elm$browser$Debugger$Main$viewPlayButton = function (playing) { - return A2( - $elm$html$Html$button, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'background', '#1293D8'), - A2($elm$html$Html$Attributes$style, 'border', 'none'), - A2($elm$html$Html$Attributes$style, 'color', 'white'), - A2($elm$html$Html$Attributes$style, 'cursor', 'pointer'), - A2($elm$html$Html$Attributes$style, 'width', '36px'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - $elm$html$Html$Events$onClick($elm$browser$Debugger$Main$Resume) - ]), - _List_fromArray( - [ - playing ? $elm$browser$Debugger$Main$icon('M2 2h4v12h-4v-12z M10 2h4v12h-4v-12z') : $elm$browser$Debugger$Main$icon('M2 2l12 7l-12 7z') - ])); -}; -var $elm$browser$Debugger$Main$viewHistorySlider = F2( - function (history, maybeIndex) { - var lastIndex = $elm$browser$Debugger$History$size(history) - 1; - var selectedIndex = A2($elm$core$Maybe$withDefault, lastIndex, maybeIndex); - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'row'), - A2($elm$html$Html$Attributes$style, 'align-items', 'center'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(50, 50, 50)') - ]), - _List_fromArray( - [ - A2( - $elm$html$Html$Lazy$lazy, - $elm$browser$Debugger$Main$viewPlayButton, - $elm$browser$Debugger$Main$isPlaying(maybeIndex)), - A2( - $elm$html$Html$input, - _List_fromArray( - [ - $elm$html$Html$Attributes$type_('range'), - A2($elm$html$Html$Attributes$style, 'width', 'calc(100% - 56px)'), - A2($elm$html$Html$Attributes$style, 'height', '36px'), - A2($elm$html$Html$Attributes$style, 'margin', '0 10px'), - $elm$html$Html$Attributes$min('0'), - $elm$html$Html$Attributes$max( - $elm$core$String$fromInt(lastIndex)), - $elm$html$Html$Attributes$value( - $elm$core$String$fromInt(selectedIndex)), - $elm$html$Html$Events$onInput( - A2( - $elm$core$Basics$composeR, - $elm$core$String$toInt, - A2( - $elm$core$Basics$composeR, - $elm$core$Maybe$withDefault(lastIndex), - $elm$browser$Debugger$Main$SliderJump))) - ]), - _List_Nil) - ])); - }); -var $elm$browser$Debugger$Main$viewHistory = F3( - function (maybeIndex, history, layout) { - var block = $elm$browser$Debugger$Main$toMouseBlocker(layout); - var _v0 = $elm$browser$Debugger$Main$toHistoryPercents(layout); - var w = _v0.a; - var h = _v0.b; - return A2( - $elm$html$Html$div, - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'width', w), - A2($elm$html$Html$Attributes$style, 'height', h), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2($elm$html$Html$Attributes$style, 'flex-direction', 'column'), - A2($elm$html$Html$Attributes$style, 'color', '#DDDDDD'), - A2($elm$html$Html$Attributes$style, 'background-color', 'rgb(61, 61, 61)'), - A2($elm$html$Html$Attributes$style, 'pointer-events', block), - A2($elm$html$Html$Attributes$style, 'user-select', block) - ]), - _List_fromArray( - [ - A2($elm$browser$Debugger$Main$viewHistorySlider, history, maybeIndex), - A2( - $elm$html$Html$map, - $elm$browser$Debugger$Main$Jump, - A2($elm$browser$Debugger$History$view, maybeIndex, history)), - A2($elm$html$Html$Lazy$lazy, $elm$browser$Debugger$Main$viewHistoryOptions, layout) - ])); - }); -var $elm$browser$Debugger$Main$popoutView = function (model) { - var maybeIndex = function () { - var _v0 = model.state; - if (_v0.$ === 'Running') { - return $elm$core$Maybe$Nothing; - } else { - var index = _v0.a; - return $elm$core$Maybe$Just(index); - } - }(); - var historyToRender = $elm$browser$Debugger$Main$cachedHistory(model); - return A3( - $elm$html$Html$node, - 'body', - _Utils_ap( - $elm$browser$Debugger$Main$toDragListeners(model.layout), - _List_fromArray( - [ - A2($elm$html$Html$Attributes$style, 'margin', '0'), - A2($elm$html$Html$Attributes$style, 'padding', '0'), - A2($elm$html$Html$Attributes$style, 'width', '100%'), - A2($elm$html$Html$Attributes$style, 'height', '100%'), - A2($elm$html$Html$Attributes$style, 'font-family', 'monospace'), - A2($elm$html$Html$Attributes$style, 'display', 'flex'), - A2( - $elm$html$Html$Attributes$style, - 'flex-direction', - $elm$browser$Debugger$Main$toFlexDirection(model.layout)) - ])), - _List_fromArray( - [ - A3($elm$browser$Debugger$Main$viewHistory, maybeIndex, historyToRender, model.layout), - $elm$browser$Debugger$Main$viewDragZone(model.layout), - A3($elm$browser$Debugger$Main$viewExpando, model.expandoMsg, model.expandoModel, model.layout) - ])); -}; -var $elm$browser$Debugger$Overlay$BlockAll = {$: 'BlockAll'}; -var $elm$browser$Debugger$Overlay$toBlockerType = F2( - function (isPaused, state) { - switch (state.$) { - case 'None': - return isPaused ? $elm$browser$Debugger$Overlay$BlockAll : $elm$browser$Debugger$Overlay$BlockNone; - case 'BadMetadata': - return $elm$browser$Debugger$Overlay$BlockMost; - case 'BadImport': - return $elm$browser$Debugger$Overlay$BlockMost; - default: - return $elm$browser$Debugger$Overlay$BlockMost; - } - }); -var $elm$browser$Debugger$Main$toBlockerType = function (model) { - return A2( - $elm$browser$Debugger$Overlay$toBlockerType, - $elm$browser$Debugger$Main$isPaused(model.state), - model.overlay); -}; -var $elm$browser$Debugger$Main$Horizontal = F3( - function (a, b, c) { - return {$: 'Horizontal', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Main$Running = function (a) { - return {$: 'Running', a: a}; -}; -var $elm$browser$Debugger$Main$Static = {$: 'Static'}; -var $elm$browser$Debugger$Metadata$Error = F2( - function (message, problems) { - return {message: message, problems: problems}; - }); -var $elm$json$Json$Decode$decodeValue = _Json_run; -var $elm$browser$Debugger$Metadata$Metadata = F2( - function (versions, types) { - return {types: types, versions: versions}; - }); -var $elm$browser$Debugger$Metadata$Types = F3( - function (message, aliases, unions) { - return {aliases: aliases, message: message, unions: unions}; - }); -var $elm$browser$Debugger$Metadata$Alias = F2( - function (args, tipe) { - return {args: args, tipe: tipe}; - }); -var $elm$json$Json$Decode$list = _Json_decodeList; -var $elm$browser$Debugger$Metadata$decodeAlias = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Alias, - A2( - $elm$json$Json$Decode$field, - 'args', - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)), - A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); -var $elm$browser$Debugger$Metadata$Union = F2( - function (args, tags) { - return {args: args, tags: tags}; - }); -var $elm$core$Dict$fromList = function (assocs) { - return A3( - $elm$core$List$foldl, - F2( - function (_v0, dict) { - var key = _v0.a; - var value = _v0.b; - return A3($elm$core$Dict$insert, key, value, dict); - }), - $elm$core$Dict$empty, - assocs); -}; -var $elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs; -var $elm$json$Json$Decode$dict = function (decoder) { - return A2( - $elm$json$Json$Decode$map, - $elm$core$Dict$fromList, - $elm$json$Json$Decode$keyValuePairs(decoder)); -}; -var $elm$browser$Debugger$Metadata$decodeUnion = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Union, - A2( - $elm$json$Json$Decode$field, - 'args', - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)), - A2( - $elm$json$Json$Decode$field, - 'tags', - $elm$json$Json$Decode$dict( - $elm$json$Json$Decode$list($elm$json$Json$Decode$string)))); -var $elm$json$Json$Decode$map3 = _Json_map3; -var $elm$browser$Debugger$Metadata$decodeTypes = A4( - $elm$json$Json$Decode$map3, - $elm$browser$Debugger$Metadata$Types, - A2($elm$json$Json$Decode$field, 'message', $elm$json$Json$Decode$string), - A2( - $elm$json$Json$Decode$field, - 'aliases', - $elm$json$Json$Decode$dict($elm$browser$Debugger$Metadata$decodeAlias)), - A2( - $elm$json$Json$Decode$field, - 'unions', - $elm$json$Json$Decode$dict($elm$browser$Debugger$Metadata$decodeUnion))); -var $elm$browser$Debugger$Metadata$Versions = function (elm) { - return {elm: elm}; -}; -var $elm$browser$Debugger$Metadata$decodeVersions = A2( - $elm$json$Json$Decode$map, - $elm$browser$Debugger$Metadata$Versions, - A2($elm$json$Json$Decode$field, 'elm', $elm$json$Json$Decode$string)); -var $elm$browser$Debugger$Metadata$decoder = A3( - $elm$json$Json$Decode$map2, - $elm$browser$Debugger$Metadata$Metadata, - A2($elm$json$Json$Decode$field, 'versions', $elm$browser$Debugger$Metadata$decodeVersions), - A2($elm$json$Json$Decode$field, 'types', $elm$browser$Debugger$Metadata$decodeTypes)); -var $elm$browser$Debugger$Metadata$ProblemType = F2( - function (name, problems) { - return {name: name, problems: problems}; - }); -var $elm$core$List$maybeCons = F3( - function (f, mx, xs) { - var _v0 = f(mx); - if (_v0.$ === 'Just') { - var x = _v0.a; - return A2($elm$core$List$cons, x, xs); - } else { - return xs; - } - }); -var $elm$core$List$filterMap = F2( - function (f, xs) { - return A3( - $elm$core$List$foldr, - $elm$core$List$maybeCons(f), - _List_Nil, - xs); - }); -var $elm$core$String$contains = _String_contains; -var $elm$browser$Debugger$Metadata$hasProblem = F2( - function (tipe, _v0) { - var problem = _v0.a; - var token = _v0.b; - return A2($elm$core$String$contains, token, tipe) ? $elm$core$Maybe$Just(problem) : $elm$core$Maybe$Nothing; - }); -var $elm$browser$Debugger$Metadata$Decoder = {$: 'Decoder'}; -var $elm$browser$Debugger$Metadata$Function = {$: 'Function'}; -var $elm$browser$Debugger$Metadata$Process = {$: 'Process'}; -var $elm$browser$Debugger$Metadata$Program = {$: 'Program'}; -var $elm$browser$Debugger$Metadata$Request = {$: 'Request'}; -var $elm$browser$Debugger$Metadata$Socket = {$: 'Socket'}; -var $elm$browser$Debugger$Metadata$Task = {$: 'Task'}; -var $elm$browser$Debugger$Metadata$VirtualDom = {$: 'VirtualDom'}; -var $elm$browser$Debugger$Metadata$problemTable = _List_fromArray( - [ - _Utils_Tuple2($elm$browser$Debugger$Metadata$Function, '->'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Decoder, 'Json.Decode.Decoder'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Task, 'Task.Task'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Process, 'Process.Id'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Socket, 'WebSocket.LowLevel.WebSocket'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Request, 'Http.Request'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$Program, 'Platform.Program'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$VirtualDom, 'VirtualDom.Node'), - _Utils_Tuple2($elm$browser$Debugger$Metadata$VirtualDom, 'VirtualDom.Attribute') - ]); -var $elm$browser$Debugger$Metadata$findProblems = function (tipe) { - return A2( - $elm$core$List$filterMap, - $elm$browser$Debugger$Metadata$hasProblem(tipe), - $elm$browser$Debugger$Metadata$problemTable); -}; -var $elm$browser$Debugger$Metadata$collectBadAliases = F3( - function (name, _v0, list) { - var tipe = _v0.tipe; - var _v1 = $elm$browser$Debugger$Metadata$findProblems(tipe); - if (!_v1.b) { - return list; - } else { - var problems = _v1; - return A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Metadata$ProblemType, name, problems), - list); - } - }); -var $elm$core$List$append = F2( - function (xs, ys) { - if (!ys.b) { - return xs; - } else { - return A3($elm$core$List$foldr, $elm$core$List$cons, ys, xs); - } - }); -var $elm$core$List$concat = function (lists) { - return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); -}; -var $elm$core$List$concatMap = F2( - function (f, list) { - return $elm$core$List$concat( - A2($elm$core$List$map, f, list)); - }); -var $elm$core$Dict$values = function (dict) { - return A3( - $elm$core$Dict$foldr, - F3( - function (key, value, valueList) { - return A2($elm$core$List$cons, value, valueList); - }), - _List_Nil, - dict); -}; -var $elm$browser$Debugger$Metadata$collectBadUnions = F3( - function (name, _v0, list) { - var tags = _v0.tags; - var _v1 = A2( - $elm$core$List$concatMap, - $elm$browser$Debugger$Metadata$findProblems, - $elm$core$List$concat( - $elm$core$Dict$values(tags))); - if (!_v1.b) { - return list; - } else { - var problems = _v1; - return A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Metadata$ProblemType, name, problems), - list); - } - }); -var $elm$core$Dict$foldl = F3( - function (func, acc, dict) { - foldl: - while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return acc; - } else { - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - var $temp$func = func, - $temp$acc = A3( - func, - key, - value, - A3($elm$core$Dict$foldl, func, acc, left)), - $temp$dict = right; - func = $temp$func; - acc = $temp$acc; - dict = $temp$dict; - continue foldl; - } - } - }); -var $elm$browser$Debugger$Metadata$isPortable = function (_v0) { - var types = _v0.types; - var badAliases = A3($elm$core$Dict$foldl, $elm$browser$Debugger$Metadata$collectBadAliases, _List_Nil, types.aliases); - var _v1 = A3($elm$core$Dict$foldl, $elm$browser$Debugger$Metadata$collectBadUnions, badAliases, types.unions); - if (!_v1.b) { - return $elm$core$Maybe$Nothing; - } else { - var problems = _v1; - return $elm$core$Maybe$Just( - A2($elm$browser$Debugger$Metadata$Error, types.message, problems)); - } -}; -var $elm$browser$Debugger$Metadata$decode = function (value) { - var _v0 = A2($elm$json$Json$Decode$decodeValue, $elm$browser$Debugger$Metadata$decoder, value); - if (_v0.$ === 'Err') { - return $elm$core$Result$Err( - A2($elm$browser$Debugger$Metadata$Error, 'The compiler is generating bad metadata. This is a compiler bug!', _List_Nil)); - } else { - var metadata = _v0.a; - var _v1 = $elm$browser$Debugger$Metadata$isPortable(metadata); - if (_v1.$ === 'Nothing') { - return $elm$core$Result$Ok(metadata); - } else { - var error = _v1.a; - return $elm$core$Result$Err(error); - } - } -}; -var $elm$browser$Debugger$History$History = F3( - function (snapshots, recent, numMessages) { - return {numMessages: numMessages, recent: recent, snapshots: snapshots}; - }); -var $elm$browser$Debugger$History$RecentHistory = F3( - function (model, messages, numMessages) { - return {messages: messages, model: model, numMessages: numMessages}; - }); -var $elm$browser$Debugger$History$empty = function (model) { - return A3( - $elm$browser$Debugger$History$History, - $elm$core$Array$empty, - A3($elm$browser$Debugger$History$RecentHistory, model, _List_Nil, 0), - 0); -}; -var $elm$core$Dict$map = F2( - function (func, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Dict$RBEmpty_elm_builtin; - } else { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - A2(func, key, value), - A2($elm$core$Dict$map, func, left), - A2($elm$core$Dict$map, func, right)); - } - }); -var $elm$core$Dict$sizeHelp = F2( - function (n, dict) { - sizeHelp: - while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return n; - } else { - var left = dict.d; - var right = dict.e; - var $temp$n = A2($elm$core$Dict$sizeHelp, n + 1, right), - $temp$dict = left; - n = $temp$n; - dict = $temp$dict; - continue sizeHelp; - } - } - }); -var $elm$core$Dict$size = function (dict) { - return A2($elm$core$Dict$sizeHelp, 0, dict); -}; -var $elm$browser$Debugger$Expando$initHelp = F2( - function (isOuter, expando) { - switch (expando.$) { - case 'S': - return expando; - case 'Primitive': - return expando; - case 'Sequence': - var seqType = expando.a; - var isClosed = expando.b; - var items = expando.c; - return isOuter ? A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - false, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$initHelp(false), - items)) : (($elm$core$List$length(items) <= 8) ? A3($elm$browser$Debugger$Expando$Sequence, seqType, false, items) : expando); - case 'Dictionary': - var isClosed = expando.a; - var keyValuePairs = expando.b; - return isOuter ? A2( - $elm$browser$Debugger$Expando$Dictionary, - false, - A2( - $elm$core$List$map, - function (_v1) { - var k = _v1.a; - var v = _v1.b; - return _Utils_Tuple2( - k, - A2($elm$browser$Debugger$Expando$initHelp, false, v)); - }, - keyValuePairs)) : (($elm$core$List$length(keyValuePairs) <= 8) ? A2($elm$browser$Debugger$Expando$Dictionary, false, keyValuePairs) : expando); - case 'Record': - var isClosed = expando.a; - var entries = expando.b; - return isOuter ? A2( - $elm$browser$Debugger$Expando$Record, - false, - A2( - $elm$core$Dict$map, - F2( - function (_v2, v) { - return A2($elm$browser$Debugger$Expando$initHelp, false, v); - }), - entries)) : (($elm$core$Dict$size(entries) <= 4) ? A2($elm$browser$Debugger$Expando$Record, false, entries) : expando); - default: - var maybeName = expando.a; - var isClosed = expando.b; - var args = expando.c; - return isOuter ? A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - false, - A2( - $elm$core$List$map, - $elm$browser$Debugger$Expando$initHelp(false), - args)) : (($elm$core$List$length(args) <= 4) ? A3($elm$browser$Debugger$Expando$Constructor, maybeName, false, args) : expando); - } - }); -var $elm$browser$Debugger$Expando$init = function (value) { - return A2( - $elm$browser$Debugger$Expando$initHelp, - true, - _Debugger_init(value)); -}; -var $elm$core$Platform$Cmd$map = _Platform_map; -var $elm$browser$Debugger$Overlay$None = {$: 'None'}; -var $elm$browser$Debugger$Overlay$none = $elm$browser$Debugger$Overlay$None; -var $elm$browser$Debugger$Main$wrapInit = F4( - function (metadata, popout, init, flags) { - var _v0 = init(flags); - var userModel = _v0.a; - var userCommands = _v0.b; - return _Utils_Tuple2( - { - expandoModel: $elm$browser$Debugger$Expando$init(userModel), - expandoMsg: $elm$browser$Debugger$Expando$init(_Utils_Tuple0), - history: $elm$browser$Debugger$History$empty(userModel), - layout: A3($elm$browser$Debugger$Main$Horizontal, $elm$browser$Debugger$Main$Static, 0.3, 0.5), - metadata: $elm$browser$Debugger$Metadata$decode(metadata), - overlay: $elm$browser$Debugger$Overlay$none, - popout: popout, - state: $elm$browser$Debugger$Main$Running(userModel) - }, - A2($elm$core$Platform$Cmd$map, $elm$browser$Debugger$Main$UserMsg, userCommands)); - }); -var $elm$browser$Debugger$Main$getLatestModel = function (state) { - if (state.$ === 'Running') { - var model = state.a; - return model; - } else { - var model = state.c; - return model; - } -}; -var $elm$core$Platform$Sub$map = _Platform_map; -var $elm$browser$Debugger$Main$wrapSubs = F2( - function (subscriptions, model) { - return A2( - $elm$core$Platform$Sub$map, - $elm$browser$Debugger$Main$UserMsg, - subscriptions( - $elm$browser$Debugger$Main$getLatestModel(model.state))); - }); -var $elm$browser$Debugger$Main$Moving = {$: 'Moving'}; -var $elm$browser$Debugger$Main$Paused = F5( - function (a, b, c, d, e) { - return {$: 'Paused', a: a, b: b, c: c, d: d, e: e}; - }); -var $elm$browser$Debugger$History$Snapshot = F2( - function (model, messages) { - return {messages: messages, model: model}; - }); -var $elm$browser$Debugger$History$addRecent = F3( - function (msg, newModel, _v0) { - var model = _v0.model; - var messages = _v0.messages; - var numMessages = _v0.numMessages; - return _Utils_eq(numMessages, $elm$browser$Debugger$History$maxSnapshotSize) ? _Utils_Tuple2( - $elm$core$Maybe$Just( - A2( - $elm$browser$Debugger$History$Snapshot, - model, - $elm$core$Array$fromList(messages))), - A3( - $elm$browser$Debugger$History$RecentHistory, - newModel, - _List_fromArray( - [msg]), - 1)) : _Utils_Tuple2( - $elm$core$Maybe$Nothing, - A3( - $elm$browser$Debugger$History$RecentHistory, - model, - A2($elm$core$List$cons, msg, messages), - numMessages + 1)); - }); -var $elm$core$Elm$JsArray$push = _JsArray_push; -var $elm$core$Elm$JsArray$singleton = _JsArray_singleton; -var $elm$core$Array$insertTailInTree = F4( - function (shift, index, tail, tree) { - var pos = $elm$core$Array$bitMask & (index >>> shift); - if (_Utils_cmp( - pos, - $elm$core$Elm$JsArray$length(tree)) > -1) { - if (shift === 5) { - return A2( - $elm$core$Elm$JsArray$push, - $elm$core$Array$Leaf(tail), - tree); - } else { - var newSub = $elm$core$Array$SubTree( - A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, $elm$core$Elm$JsArray$empty)); - return A2($elm$core$Elm$JsArray$push, newSub, tree); - } - } else { - var value = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (value.$ === 'SubTree') { - var subTree = value.a; - var newSub = $elm$core$Array$SubTree( - A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, subTree)); - return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); - } else { - var newSub = $elm$core$Array$SubTree( - A4( - $elm$core$Array$insertTailInTree, - shift - $elm$core$Array$shiftStep, - index, - tail, - $elm$core$Elm$JsArray$singleton(value))); - return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); - } - } - }); -var $elm$core$Array$unsafeReplaceTail = F2( - function (newTail, _v0) { - var len = _v0.a; - var startShift = _v0.b; - var tree = _v0.c; - var tail = _v0.d; - var originalTailLen = $elm$core$Elm$JsArray$length(tail); - var newTailLen = $elm$core$Elm$JsArray$length(newTail); - var newArrayLen = len + (newTailLen - originalTailLen); - if (_Utils_eq(newTailLen, $elm$core$Array$branchFactor)) { - var overflow = _Utils_cmp(newArrayLen >>> $elm$core$Array$shiftStep, 1 << startShift) > 0; - if (overflow) { - var newShift = startShift + $elm$core$Array$shiftStep; - var newTree = A4( - $elm$core$Array$insertTailInTree, - newShift, - len, - newTail, - $elm$core$Elm$JsArray$singleton( - $elm$core$Array$SubTree(tree))); - return A4($elm$core$Array$Array_elm_builtin, newArrayLen, newShift, newTree, $elm$core$Elm$JsArray$empty); - } else { - return A4( - $elm$core$Array$Array_elm_builtin, - newArrayLen, - startShift, - A4($elm$core$Array$insertTailInTree, startShift, len, newTail, tree), - $elm$core$Elm$JsArray$empty); - } - } else { - return A4($elm$core$Array$Array_elm_builtin, newArrayLen, startShift, tree, newTail); - } - }); -var $elm$core$Array$push = F2( - function (a, array) { - var tail = array.d; - return A2( - $elm$core$Array$unsafeReplaceTail, - A2($elm$core$Elm$JsArray$push, a, tail), - array); - }); -var $elm$browser$Debugger$History$add = F3( - function (msg, model, _v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var numMessages = _v0.numMessages; - var _v1 = A3($elm$browser$Debugger$History$addRecent, msg, model, recent); - if (_v1.a.$ === 'Just') { - var snapshot = _v1.a.a; - var newRecent = _v1.b; - return A3( - $elm$browser$Debugger$History$History, - A2($elm$core$Array$push, snapshot, snapshots), - newRecent, - numMessages + 1); - } else { - var _v2 = _v1.a; - var newRecent = _v1.b; - return A3($elm$browser$Debugger$History$History, snapshots, newRecent, numMessages + 1); - } - }); -var $elm$core$Basics$always = F2( - function (a, _v0) { - return a; - }); -var $elm$browser$Debugger$Overlay$BadImport = function (a) { - return {$: 'BadImport', a: a}; -}; -var $elm$browser$Debugger$Overlay$RiskyImport = F2( - function (a, b) { - return {$: 'RiskyImport', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$VersionChanged = F2( - function (a, b) { - return {$: 'VersionChanged', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$MessageChanged = F2( - function (a, b) { - return {$: 'MessageChanged', a: a, b: b}; - }); -var $elm$browser$Debugger$Report$SomethingChanged = function (a) { - return {$: 'SomethingChanged', a: a}; -}; -var $elm$browser$Debugger$Report$AliasChange = function (a) { - return {$: 'AliasChange', a: a}; -}; -var $elm$browser$Debugger$Metadata$checkAlias = F4( - function (name, old, _new, changes) { - return (_Utils_eq(old.tipe, _new.tipe) && _Utils_eq(old.args, _new.args)) ? changes : A2( - $elm$core$List$cons, - $elm$browser$Debugger$Report$AliasChange(name), - changes); - }); -var $elm$browser$Debugger$Report$UnionChange = F2( - function (a, b) { - return {$: 'UnionChange', a: a, b: b}; - }); -var $elm$browser$Debugger$Metadata$addTag = F3( - function (tag, _v0, changes) { - return _Utils_update( - changes, - { - added: A2($elm$core$List$cons, tag, changes.added) - }); - }); -var $elm$browser$Debugger$Metadata$checkTag = F4( - function (tag, old, _new, changes) { - return _Utils_eq(old, _new) ? changes : _Utils_update( - changes, - { - changed: A2($elm$core$List$cons, tag, changes.changed) - }); - }); -var $elm$browser$Debugger$Report$TagChanges = F4( - function (removed, changed, added, argsMatch) { - return {added: added, argsMatch: argsMatch, changed: changed, removed: removed}; - }); -var $elm$browser$Debugger$Report$emptyTagChanges = function (argsMatch) { - return A4($elm$browser$Debugger$Report$TagChanges, _List_Nil, _List_Nil, _List_Nil, argsMatch); -}; -var $elm$browser$Debugger$Report$hasTagChanges = function (tagChanges) { - return _Utils_eq( - tagChanges, - A4($elm$browser$Debugger$Report$TagChanges, _List_Nil, _List_Nil, _List_Nil, true)); -}; -var $elm$core$Dict$merge = F6( - function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { - var stepState = F3( - function (rKey, rValue, _v0) { - stepState: - while (true) { - var list = _v0.a; - var result = _v0.b; - if (!list.b) { - return _Utils_Tuple2( - list, - A3(rightStep, rKey, rValue, result)); - } else { - var _v2 = list.a; - var lKey = _v2.a; - var lValue = _v2.b; - var rest = list.b; - if (_Utils_cmp(lKey, rKey) < 0) { - var $temp$rKey = rKey, - $temp$rValue = rValue, - $temp$_v0 = _Utils_Tuple2( - rest, - A3(leftStep, lKey, lValue, result)); - rKey = $temp$rKey; - rValue = $temp$rValue; - _v0 = $temp$_v0; - continue stepState; - } else { - if (_Utils_cmp(lKey, rKey) > 0) { - return _Utils_Tuple2( - list, - A3(rightStep, rKey, rValue, result)); - } else { - return _Utils_Tuple2( - rest, - A4(bothStep, lKey, lValue, rValue, result)); - } - } - } - } - }); - var _v3 = A3( - $elm$core$Dict$foldl, - stepState, - _Utils_Tuple2( - $elm$core$Dict$toList(leftDict), - initialResult), - rightDict); - var leftovers = _v3.a; - var intermediateResult = _v3.b; - return A3( - $elm$core$List$foldl, - F2( - function (_v4, result) { - var k = _v4.a; - var v = _v4.b; - return A3(leftStep, k, v, result); - }), - intermediateResult, - leftovers); - }); -var $elm$browser$Debugger$Metadata$removeTag = F3( - function (tag, _v0, changes) { - return _Utils_update( - changes, - { - removed: A2($elm$core$List$cons, tag, changes.removed) - }); - }); -var $elm$browser$Debugger$Metadata$checkUnion = F4( - function (name, old, _new, changes) { - var tagChanges = A6( - $elm$core$Dict$merge, - $elm$browser$Debugger$Metadata$removeTag, - $elm$browser$Debugger$Metadata$checkTag, - $elm$browser$Debugger$Metadata$addTag, - old.tags, - _new.tags, - $elm$browser$Debugger$Report$emptyTagChanges( - _Utils_eq(old.args, _new.args))); - return $elm$browser$Debugger$Report$hasTagChanges(tagChanges) ? changes : A2( - $elm$core$List$cons, - A2($elm$browser$Debugger$Report$UnionChange, name, tagChanges), - changes); - }); -var $elm$browser$Debugger$Metadata$ignore = F3( - function (key, value, report) { - return report; - }); -var $elm$browser$Debugger$Metadata$checkTypes = F2( - function (old, _new) { - return (!_Utils_eq(old.message, _new.message)) ? A2($elm$browser$Debugger$Report$MessageChanged, old.message, _new.message) : $elm$browser$Debugger$Report$SomethingChanged( - A6( - $elm$core$Dict$merge, - $elm$browser$Debugger$Metadata$ignore, - $elm$browser$Debugger$Metadata$checkUnion, - $elm$browser$Debugger$Metadata$ignore, - old.unions, - _new.unions, - A6($elm$core$Dict$merge, $elm$browser$Debugger$Metadata$ignore, $elm$browser$Debugger$Metadata$checkAlias, $elm$browser$Debugger$Metadata$ignore, old.aliases, _new.aliases, _List_Nil))); - }); -var $elm$browser$Debugger$Metadata$check = F2( - function (old, _new) { - return (!_Utils_eq(old.versions.elm, _new.versions.elm)) ? A2($elm$browser$Debugger$Report$VersionChanged, old.versions.elm, _new.versions.elm) : A2($elm$browser$Debugger$Metadata$checkTypes, old.types, _new.types); - }); -var $elm$browser$Debugger$Report$CorruptHistory = {$: 'CorruptHistory'}; -var $elm$browser$Debugger$Overlay$corruptImport = $elm$browser$Debugger$Overlay$BadImport($elm$browser$Debugger$Report$CorruptHistory); -var $elm$json$Json$Decode$decodeString = _Json_runOnString; -var $elm$browser$Debugger$Report$Fine = {$: 'Fine'}; -var $elm$browser$Debugger$Report$Impossible = {$: 'Impossible'}; -var $elm$browser$Debugger$Report$Risky = {$: 'Risky'}; -var $elm$core$Basics$not = _Basics_not; -var $elm$core$List$isEmpty = function (xs) { - if (!xs.b) { - return true; - } else { - return false; - } -}; -var $elm$browser$Debugger$Report$some = function (list) { - return !$elm$core$List$isEmpty(list); -}; -var $elm$browser$Debugger$Report$evaluateChange = function (change) { - if (change.$ === 'AliasChange') { - return $elm$browser$Debugger$Report$Impossible; - } else { - var removed = change.b.removed; - var changed = change.b.changed; - var added = change.b.added; - var argsMatch = change.b.argsMatch; - return ((!argsMatch) || ($elm$browser$Debugger$Report$some(changed) || $elm$browser$Debugger$Report$some(removed))) ? $elm$browser$Debugger$Report$Impossible : ($elm$browser$Debugger$Report$some(added) ? $elm$browser$Debugger$Report$Risky : $elm$browser$Debugger$Report$Fine); - } -}; -var $elm$browser$Debugger$Report$worstCase = F2( - function (status, statusList) { - worstCase: - while (true) { - if (!statusList.b) { - return status; - } else { - switch (statusList.a.$) { - case 'Impossible': - var _v1 = statusList.a; - return $elm$browser$Debugger$Report$Impossible; - case 'Risky': - var _v2 = statusList.a; - var rest = statusList.b; - var $temp$status = $elm$browser$Debugger$Report$Risky, - $temp$statusList = rest; - status = $temp$status; - statusList = $temp$statusList; - continue worstCase; - default: - var _v3 = statusList.a; - var rest = statusList.b; - var $temp$status = status, - $temp$statusList = rest; - status = $temp$status; - statusList = $temp$statusList; - continue worstCase; - } - } - } - }); -var $elm$browser$Debugger$Report$evaluate = function (report) { - switch (report.$) { - case 'CorruptHistory': - return $elm$browser$Debugger$Report$Impossible; - case 'VersionChanged': - return $elm$browser$Debugger$Report$Impossible; - case 'MessageChanged': - return $elm$browser$Debugger$Report$Impossible; - default: - var changes = report.a; - return A2( - $elm$browser$Debugger$Report$worstCase, - $elm$browser$Debugger$Report$Fine, - A2($elm$core$List$map, $elm$browser$Debugger$Report$evaluateChange, changes)); - } -}; -var $elm$json$Json$Decode$value = _Json_decodeValue; -var $elm$browser$Debugger$Overlay$uploadDecoder = A3( - $elm$json$Json$Decode$map2, - F2( - function (x, y) { - return _Utils_Tuple2(x, y); - }), - A2($elm$json$Json$Decode$field, 'metadata', $elm$browser$Debugger$Metadata$decoder), - A2($elm$json$Json$Decode$field, 'history', $elm$json$Json$Decode$value)); -var $elm$browser$Debugger$Overlay$assessImport = F2( - function (metadata, jsonString) { - var _v0 = A2($elm$json$Json$Decode$decodeString, $elm$browser$Debugger$Overlay$uploadDecoder, jsonString); - if (_v0.$ === 'Err') { - return $elm$core$Result$Err($elm$browser$Debugger$Overlay$corruptImport); - } else { - var _v1 = _v0.a; - var foreignMetadata = _v1.a; - var rawHistory = _v1.b; - var report = A2($elm$browser$Debugger$Metadata$check, foreignMetadata, metadata); - var _v2 = $elm$browser$Debugger$Report$evaluate(report); - switch (_v2.$) { - case 'Impossible': - return $elm$core$Result$Err( - $elm$browser$Debugger$Overlay$BadImport(report)); - case 'Risky': - return $elm$core$Result$Err( - A2($elm$browser$Debugger$Overlay$RiskyImport, report, rawHistory)); - default: - return $elm$core$Result$Ok(rawHistory); - } - } - }); -var $elm$core$Platform$Cmd$batch = _Platform_batch; -var $elm$browser$Debugger$Overlay$close = F2( - function (msg, state) { - switch (state.$) { - case 'None': - return $elm$core$Maybe$Nothing; - case 'BadMetadata': - return $elm$core$Maybe$Nothing; - case 'BadImport': - return $elm$core$Maybe$Nothing; - default: - var rawHistory = state.b; - if (msg.$ === 'Cancel') { - return $elm$core$Maybe$Nothing; - } else { - return $elm$core$Maybe$Just(rawHistory); - } - } - }); -var $elm$browser$Debugger$History$elmToJs = A2($elm$core$Basics$composeR, _Json_wrap, _Debugger_unsafeCoerce); -var $elm$browser$Debugger$History$encodeHelp = F2( - function (snapshot, allMessages) { - return A3($elm$core$Array$foldl, $elm$core$List$cons, allMessages, snapshot.messages); - }); -var $elm$json$Json$Encode$list = F2( - function (func, entries) { - return _Json_wrap( - A3( - $elm$core$List$foldl, - _Json_addEntry(func), - _Json_emptyArray(_Utils_Tuple0), - entries)); - }); -var $elm$browser$Debugger$History$encode = function (_v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - return A2( - $elm$json$Json$Encode$list, - $elm$browser$Debugger$History$elmToJs, - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$encodeHelp, - $elm$core$List$reverse(recent.messages), - snapshots)); -}; -var $elm$json$Json$Encode$object = function (pairs) { - return _Json_wrap( - A3( - $elm$core$List$foldl, - F2( - function (_v0, obj) { - var k = _v0.a; - var v = _v0.b; - return A3(_Json_addField, k, v, obj); - }), - _Json_emptyObject(_Utils_Tuple0), - pairs)); -}; -var $elm$browser$Debugger$Metadata$encodeAlias = function (_v0) { - var args = _v0.args; - var tipe = _v0.tipe; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'args', - A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, args)), - _Utils_Tuple2( - 'type', - $elm$json$Json$Encode$string(tipe)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeDict = F2( - function (f, dict) { - return $elm$json$Json$Encode$object( - $elm$core$Dict$toList( - A2( - $elm$core$Dict$map, - F2( - function (key, value) { - return f(value); - }), - dict))); - }); -var $elm$browser$Debugger$Metadata$encodeUnion = function (_v0) { - var args = _v0.args; - var tags = _v0.tags; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'args', - A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$string, args)), - _Utils_Tuple2( - 'tags', - A2( - $elm$browser$Debugger$Metadata$encodeDict, - $elm$json$Json$Encode$list($elm$json$Json$Encode$string), - tags)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeTypes = function (_v0) { - var message = _v0.message; - var unions = _v0.unions; - var aliases = _v0.aliases; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'message', - $elm$json$Json$Encode$string(message)), - _Utils_Tuple2( - 'aliases', - A2($elm$browser$Debugger$Metadata$encodeDict, $elm$browser$Debugger$Metadata$encodeAlias, aliases)), - _Utils_Tuple2( - 'unions', - A2($elm$browser$Debugger$Metadata$encodeDict, $elm$browser$Debugger$Metadata$encodeUnion, unions)) - ])); -}; -var $elm$browser$Debugger$Metadata$encodeVersions = function (_v0) { - var elm = _v0.elm; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'elm', - $elm$json$Json$Encode$string(elm)) - ])); -}; -var $elm$browser$Debugger$Metadata$encode = function (_v0) { - var versions = _v0.versions; - var types = _v0.types; - return $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'versions', - $elm$browser$Debugger$Metadata$encodeVersions(versions)), - _Utils_Tuple2( - 'types', - $elm$browser$Debugger$Metadata$encodeTypes(types)) - ])); -}; -var $elm$core$Basics$identity = function (x) { - return x; -}; -var $elm$core$Task$Perform = function (a) { - return {$: 'Perform', a: a}; -}; -var $elm$core$Task$succeed = _Scheduler_succeed; -var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0); -var $elm$core$Task$andThen = _Scheduler_andThen; -var $elm$core$Task$map = F2( - function (func, taskA) { - return A2( - $elm$core$Task$andThen, - function (a) { - return $elm$core$Task$succeed( - func(a)); - }, - taskA); - }); -var $elm$core$Task$map2 = F3( - function (func, taskA, taskB) { - return A2( - $elm$core$Task$andThen, - function (a) { - return A2( - $elm$core$Task$andThen, - function (b) { - return $elm$core$Task$succeed( - A2(func, a, b)); - }, - taskB); - }, - taskA); - }); -var $elm$core$Task$sequence = function (tasks) { - return A3( - $elm$core$List$foldr, - $elm$core$Task$map2($elm$core$List$cons), - $elm$core$Task$succeed(_List_Nil), - tasks); -}; -var $elm$core$Platform$sendToApp = _Platform_sendToApp; -var $elm$core$Task$spawnCmd = F2( - function (router, _v0) { - var task = _v0.a; - return _Scheduler_spawn( - A2( - $elm$core$Task$andThen, - $elm$core$Platform$sendToApp(router), - task)); - }); -var $elm$core$Task$onEffects = F3( - function (router, commands, state) { - return A2( - $elm$core$Task$map, - function (_v0) { - return _Utils_Tuple0; - }, - $elm$core$Task$sequence( - A2( - $elm$core$List$map, - $elm$core$Task$spawnCmd(router), - commands))); - }); -var $elm$core$Task$onSelfMsg = F3( - function (_v0, _v1, _v2) { - return $elm$core$Task$succeed(_Utils_Tuple0); - }); -var $elm$core$Task$cmdMap = F2( - function (tagger, _v0) { - var task = _v0.a; - return $elm$core$Task$Perform( - A2($elm$core$Task$map, tagger, task)); - }); -_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); -var $elm$core$Task$command = _Platform_leaf('Task'); -var $elm$core$Task$perform = F2( - function (toMessage, task) { - return $elm$core$Task$command( - $elm$core$Task$Perform( - A2($elm$core$Task$map, toMessage, task))); - }); -var $elm$browser$Debugger$Main$download = F2( - function (metadata, history) { - var historyLength = $elm$browser$Debugger$History$size(history); - return A2( - $elm$core$Task$perform, - function (_v0) { - return $elm$browser$Debugger$Main$NoOp; - }, - A2( - _Debugger_download, - historyLength, - _Json_unwrap( - $elm$json$Json$Encode$object( - _List_fromArray( - [ - _Utils_Tuple2( - 'metadata', - $elm$browser$Debugger$Metadata$encode(metadata)), - _Utils_Tuple2( - 'history', - $elm$browser$Debugger$History$encode(history)) - ]))))); - }); -var $elm$browser$Debugger$Main$Vertical = F3( - function (a, b, c) { - return {$: 'Vertical', a: a, b: b, c: c}; - }); -var $elm$browser$Debugger$Main$drag = F2( - function (info, layout) { - if (layout.$ === 'Horizontal') { - var status = layout.a; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, status, info.x / info.width, y); - } else { - var status = layout.a; - var x = layout.b; - return A3($elm$browser$Debugger$Main$Vertical, status, x, info.y / info.height); - } - }); -var $elm$browser$Debugger$History$Stepping = F2( - function (a, b) { - return {$: 'Stepping', a: a, b: b}; - }); -var $elm$browser$Debugger$History$Done = F2( - function (a, b) { - return {$: 'Done', a: a, b: b}; - }); -var $elm$browser$Debugger$History$getHelp = F3( - function (update, msg, getResult) { - if (getResult.$ === 'Done') { - return getResult; - } else { - var n = getResult.a; - var model = getResult.b; - return (!n) ? A2( - $elm$browser$Debugger$History$Done, - msg, - A2(update, msg, model).a) : A2( - $elm$browser$Debugger$History$Stepping, - n - 1, - A2(update, msg, model).a); - } - }); -var $elm$browser$Debugger$History$undone = function (getResult) { - undone: - while (true) { - if (getResult.$ === 'Done') { - var msg = getResult.a; - var model = getResult.b; - return _Utils_Tuple2(model, msg); - } else { - var $temp$getResult = getResult; - getResult = $temp$getResult; - continue undone; - } - } -}; -var $elm$browser$Debugger$History$get = F3( - function (update, index, history) { - get: - while (true) { - var recent = history.recent; - var snapshotMax = history.numMessages - recent.numMessages; - if (_Utils_cmp(index, snapshotMax) > -1) { - return $elm$browser$Debugger$History$undone( - A3( - $elm$core$List$foldr, - $elm$browser$Debugger$History$getHelp(update), - A2($elm$browser$Debugger$History$Stepping, index - snapshotMax, recent.model), - recent.messages)); - } else { - var _v0 = A2($elm$core$Array$get, (index / $elm$browser$Debugger$History$maxSnapshotSize) | 0, history.snapshots); - if (_v0.$ === 'Nothing') { - var $temp$update = update, - $temp$index = index, - $temp$history = history; - update = $temp$update; - index = $temp$index; - history = $temp$history; - continue get; - } else { - var model = _v0.a.model; - var messages = _v0.a.messages; - return $elm$browser$Debugger$History$undone( - A3( - $elm$core$Array$foldr, - $elm$browser$Debugger$History$getHelp(update), - A2($elm$browser$Debugger$History$Stepping, index % $elm$browser$Debugger$History$maxSnapshotSize, model), - messages)); - } - } - } - }); -var $elm$browser$Debugger$History$getRecentMsg = function (history) { - getRecentMsg: - while (true) { - var _v0 = history.recent.messages; - if (!_v0.b) { - var $temp$history = history; - history = $temp$history; - continue getRecentMsg; - } else { - var first = _v0.a; - return first; - } - } -}; -var $elm$core$Dict$get = F2( - function (targetKey, dict) { - get: + return a >>> offset; +}); +var $elm$core$Basics$EQ = 1; +var $elm$core$Basics$GT = 2; +var $elm$core$Basics$LT = 0; +var $elm$core$List$cons = _List_cons; +var $elm$core$Dict$foldr = F3( + function (func, acc, t) { + foldr: while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Maybe$Nothing; + if (t.$ === -2) { + return acc; } else { - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1.$) { - case 'LT': - var $temp$targetKey = targetKey, - $temp$dict = left; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - case 'EQ': - return $elm$core$Maybe$Just(value); - default: - var $temp$targetKey = targetKey, - $temp$dict = right; - targetKey = $temp$targetKey; - dict = $temp$dict; - continue get; - } - } - } - }); -var $elm$browser$Debugger$Expando$mergeDictHelp = F3( - function (oldDict, key, value) { - var _v12 = A2($elm$core$Dict$get, key, oldDict); - if (_v12.$ === 'Nothing') { - return value; - } else { - var oldValue = _v12.a; - return A2($elm$browser$Debugger$Expando$mergeHelp, oldValue, value); - } - }); -var $elm$browser$Debugger$Expando$mergeHelp = F2( - function (old, _new) { - var _v3 = _Utils_Tuple2(old, _new); - _v3$6: - while (true) { - switch (_v3.b.$) { - case 'S': - return _new; - case 'Primitive': - return _new; - case 'Sequence': - if (_v3.a.$ === 'Sequence') { - var _v4 = _v3.a; - var isClosed = _v4.b; - var oldValues = _v4.c; - var _v5 = _v3.b; - var seqType = _v5.a; - var newValues = _v5.c; - return A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - isClosed, - A2($elm$browser$Debugger$Expando$mergeListHelp, oldValues, newValues)); - } else { - break _v3$6; - } - case 'Dictionary': - if (_v3.a.$ === 'Dictionary') { - var _v6 = _v3.a; - var isClosed = _v6.a; - var _v7 = _v3.b; - var keyValuePairs = _v7.b; - return A2($elm$browser$Debugger$Expando$Dictionary, isClosed, keyValuePairs); - } else { - break _v3$6; - } - case 'Record': - if (_v3.a.$ === 'Record') { - var _v8 = _v3.a; - var isClosed = _v8.a; - var oldDict = _v8.b; - var _v9 = _v3.b; - var newDict = _v9.b; - return A2( - $elm$browser$Debugger$Expando$Record, - isClosed, - A2( - $elm$core$Dict$map, - $elm$browser$Debugger$Expando$mergeDictHelp(oldDict), - newDict)); - } else { - break _v3$6; - } - default: - if (_v3.a.$ === 'Constructor') { - var _v10 = _v3.a; - var isClosed = _v10.b; - var oldValues = _v10.c; - var _v11 = _v3.b; - var maybeName = _v11.a; - var newValues = _v11.c; - return A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - isClosed, - A2($elm$browser$Debugger$Expando$mergeListHelp, oldValues, newValues)); - } else { - break _v3$6; - } + var key = t.b; + var value = t.c; + var left = t.d; + var right = t.e; + var $temp$func = func, + $temp$acc = A3( + func, + key, + value, + A3($elm$core$Dict$foldr, func, acc, right)), + $temp$t = left; + func = $temp$func; + acc = $temp$acc; + t = $temp$t; + continue foldr; } } - return _new; }); -var $elm$browser$Debugger$Expando$mergeListHelp = F2( - function (olds, news) { - var _v0 = _Utils_Tuple2(olds, news); - if (!_v0.a.b) { - return news; - } else { - if (!_v0.b.b) { - return news; - } else { - var _v1 = _v0.a; - var x = _v1.a; - var xs = _v1.b; - var _v2 = _v0.b; - var y = _v2.a; - var ys = _v2.b; +var $elm$core$Dict$toList = function (dict) { + return A3( + $elm$core$Dict$foldr, + F3( + function (key, value, list) { return A2( $elm$core$List$cons, - A2($elm$browser$Debugger$Expando$mergeHelp, x, y), - A2($elm$browser$Debugger$Expando$mergeListHelp, xs, ys)); - } - } - }); -var $elm$browser$Debugger$Expando$merge = F2( - function (value, expando) { - return A2( - $elm$browser$Debugger$Expando$mergeHelp, - expando, - _Debugger_init(value)); - }); -var $elm$browser$Debugger$Main$jumpUpdate = F3( - function (update, index, model) { - var history = $elm$browser$Debugger$Main$cachedHistory(model); - var currentMsg = $elm$browser$Debugger$History$getRecentMsg(history); - var currentModel = $elm$browser$Debugger$Main$getLatestModel(model.state); - var _v0 = A3($elm$browser$Debugger$History$get, update, index, history); - var indexModel = _v0.a; - var indexMsg = _v0.b; - return _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, indexModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, indexMsg, model.expandoMsg), - state: A5($elm$browser$Debugger$Main$Paused, index, indexModel, currentModel, currentMsg, history) - }); - }); -var $elm$browser$Debugger$History$jsToElm = A2($elm$core$Basics$composeR, _Json_unwrap, _Debugger_unsafeCoerce); -var $elm$browser$Debugger$History$decoder = F2( - function (initialModel, update) { - var addMessage = F2( - function (rawMsg, _v0) { - var model = _v0.a; - var history = _v0.b; - var msg = $elm$browser$Debugger$History$jsToElm(rawMsg); - return _Utils_Tuple2( - A2(update, msg, model), - A3($elm$browser$Debugger$History$add, msg, model, history)); - }); - var updateModel = function (rawMsgs) { - return A3( - $elm$core$List$foldl, - addMessage, - _Utils_Tuple2( - initialModel, - $elm$browser$Debugger$History$empty(initialModel)), - rawMsgs); - }; - return A2( - $elm$json$Json$Decode$map, - updateModel, - $elm$json$Json$Decode$list($elm$json$Json$Decode$value)); - }); -var $elm$browser$Debugger$History$getInitialModel = function (_v0) { - var snapshots = _v0.snapshots; - var recent = _v0.recent; - var _v1 = A2($elm$core$Array$get, 0, snapshots); - if (_v1.$ === 'Just') { - var model = _v1.a.model; - return model; - } else { - return recent.model; - } + _Utils_Tuple2(key, value), + list); + }), + _List_Nil, + dict); }; -var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); -var $elm$browser$Debugger$Main$loadNewHistory = F3( - function (rawHistory, update, model) { - var pureUserUpdate = F2( - function (msg, userModel) { - return A2(update, msg, userModel).a; +var $elm$core$Dict$keys = function (dict) { + return A3( + $elm$core$Dict$foldr, + F3( + function (key, value, keyList) { + return A2($elm$core$List$cons, key, keyList); + }), + _List_Nil, + dict); +}; +var $elm$core$Set$toList = function (_v0) { + var dict = _v0; + return $elm$core$Dict$keys(dict); +}; +var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; +var $elm$core$Array$foldr = F3( + function (func, baseCase, _v0) { + var tree = _v0.c; + var tail = _v0.d; + var helper = F2( + function (node, acc) { + if (!node.$) { + var subTree = node.a; + return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); + } else { + var values = node.a; + return A3($elm$core$Elm$JsArray$foldr, func, acc, values); + } }); - var initialUserModel = $elm$browser$Debugger$History$getInitialModel(model.history); - var decoder = A2($elm$browser$Debugger$History$decoder, initialUserModel, pureUserUpdate); - var _v0 = A2($elm$json$Json$Decode$decodeValue, decoder, rawHistory); - if (_v0.$ === 'Err') { - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: $elm$browser$Debugger$Overlay$corruptImport}), - $elm$core$Platform$Cmd$none); - } else { - var _v1 = _v0.a; - var latestUserModel = _v1.a; - var newHistory = _v1.b; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: $elm$browser$Debugger$Expando$init(latestUserModel), - expandoMsg: $elm$browser$Debugger$Expando$init( - $elm$browser$Debugger$History$getRecentMsg(newHistory)), - history: newHistory, - overlay: $elm$browser$Debugger$Overlay$none, - state: $elm$browser$Debugger$Main$Running(latestUserModel) - }), - $elm$core$Platform$Cmd$none); - } + return A3( + $elm$core$Elm$JsArray$foldr, + helper, + A3($elm$core$Elm$JsArray$foldr, func, baseCase, tail), + tree); }); -var $elm$browser$Debugger$Main$scroll = function (popout) { - return A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - _Debugger_scroll(popout)); +var $elm$core$Array$toList = function (array) { + return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); }; -var $elm$browser$Debugger$Main$scrollTo = F2( - function (id, popout) { - return A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - A2(_Debugger_scrollTo, id, popout)); +var $elm$core$Result$Err = function (a) { + return {$: 1, a: a}; +}; +var $elm$json$Json$Decode$Failure = F2( + function (a, b) { + return {$: 3, a: a, b: b}; }); -var $elm$browser$Debugger$Main$setDragStatus = F2( - function (status, layout) { - if (layout.$ === 'Horizontal') { - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, status, x, y); - } else { - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Vertical, status, x, y); - } +var $elm$json$Json$Decode$Field = F2( + function (a, b) { + return {$: 0, a: a, b: b}; }); -var $elm$browser$Debugger$Main$swapLayout = function (layout) { - if (layout.$ === 'Horizontal') { - var s = layout.a; - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Vertical, s, x, y); - } else { - var s = layout.a; - var x = layout.b; - var y = layout.c; - return A3($elm$browser$Debugger$Main$Horizontal, s, x, y); - } -}; -var $elm$core$Dict$getMin = function (dict) { - getMin: - while (true) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { - var left = dict.d; - var $temp$dict = left; - dict = $temp$dict; - continue getMin; - } else { - return dict; - } - } +var $elm$json$Json$Decode$Index = F2( + function (a, b) { + return {$: 1, a: a, b: b}; + }); +var $elm$core$Result$Ok = function (a) { + return {$: 0, a: a}; }; -var $elm$core$Dict$moveRedLeft = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.e.d.$ === 'RBNode_elm_builtin') && (dict.e.d.a.$ === 'Red')) { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v1 = dict.d; - var lClr = _v1.a; - var lK = _v1.b; - var lV = _v1.c; - var lLeft = _v1.d; - var lRight = _v1.e; - var _v2 = dict.e; - var rClr = _v2.a; - var rK = _v2.b; - var rV = _v2.c; - var rLeft = _v2.d; - var _v3 = rLeft.a; - var rlK = rLeft.b; - var rlV = rLeft.c; - var rlL = rLeft.d; - var rlR = rLeft.e; - var rRight = _v2.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - rlK, - rlV, - A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - rlL), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rlR, rRight)); - } else { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v4 = dict.d; - var lClr = _v4.a; - var lK = _v4.b; - var lV = _v4.c; - var lLeft = _v4.d; - var lRight = _v4.e; - var _v5 = dict.e; - var rClr = _v5.a; - var rK = _v5.b; - var rV = _v5.c; - var rLeft = _v5.d; - var rRight = _v5.e; - if (clr.$ === 'Black') { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } - } - } else { - return dict; - } +var $elm$json$Json$Decode$OneOf = function (a) { + return {$: 2, a: a}; }; -var $elm$core$Dict$moveRedRight = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.d.d.$ === 'RBNode_elm_builtin') && (dict.d.d.a.$ === 'Red')) { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v1 = dict.d; - var lClr = _v1.a; - var lK = _v1.b; - var lV = _v1.c; - var _v2 = _v1.d; - var _v3 = _v2.a; - var llK = _v2.b; - var llV = _v2.c; - var llLeft = _v2.d; - var llRight = _v2.e; - var lRight = _v1.e; - var _v4 = dict.e; - var rClr = _v4.a; - var rK = _v4.b; - var rV = _v4.c; - var rLeft = _v4.d; - var rRight = _v4.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, - lK, - lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - lRight, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight))); - } else { - var clr = dict.a; - var k = dict.b; - var v = dict.c; - var _v5 = dict.d; - var lClr = _v5.a; - var lK = _v5.b; - var lV = _v5.c; - var lLeft = _v5.d; - var lRight = _v5.e; - var _v6 = dict.e; - var rClr = _v6.a; - var rK = _v6.b; - var rV = _v6.c; - var rLeft = _v6.d; - var rRight = _v6.e; - if (clr.$ === 'Black') { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, - k, - v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); - } - } - } else { - return dict; - } +var $elm$core$Basics$False = 1; +var $elm$core$Basics$add = _Basics_add; +var $elm$core$Maybe$Just = function (a) { + return {$: 0, a: a}; }; -var $elm$core$Dict$removeHelpPrepEQGT = F7( - function (targetKey, dict, color, key, value, left, right) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { - var _v1 = left.a; - var lK = left.b; - var lV = left.c; - var lLeft = left.d; - var lRight = left.e; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - lK, - lV, - lLeft, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, lRight, right)); - } else { - _v2$2: - while (true) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Black')) { - if (right.d.$ === 'RBNode_elm_builtin') { - if (right.d.a.$ === 'Black') { - var _v3 = right.a; - var _v4 = right.d; - var _v5 = _v4.a; - return $elm$core$Dict$moveRedRight(dict); - } else { - break _v2$2; - } - } else { - var _v6 = right.a; - var _v7 = right.d; - return $elm$core$Dict$moveRedRight(dict); - } - } else { - break _v2$2; - } - } - return dict; - } +var $elm$core$Maybe$Nothing = {$: 1}; +var $elm$core$String$all = _String_all; +var $elm$core$Basics$and = _Basics_and; +var $elm$core$Basics$append = _Utils_append; +var $elm$json$Json$Encode$encode = _Json_encode; +var $elm$core$String$fromInt = _String_fromNumber; +var $elm$core$String$join = F2( + function (sep, chunks) { + return A2( + _String_join, + sep, + _List_toArray(chunks)); }); -var $elm$core$Dict$removeMin = function (dict) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var lColor = left.a; - var lLeft = left.d; - var right = dict.e; - if (lColor.$ === 'Black') { - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { - var _v3 = lLeft.a; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - $elm$core$Dict$removeMin(left), - right); - } else { - var _v4 = $elm$core$Dict$moveRedLeft(dict); - if (_v4.$ === 'RBNode_elm_builtin') { - var nColor = _v4.a; - var nKey = _v4.b; - var nValue = _v4.c; - var nLeft = _v4.d; - var nRight = _v4.e; - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - $elm$core$Dict$removeMin(nLeft), - nRight); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - } - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - $elm$core$Dict$removeMin(left), - right); - } - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } +var $elm$core$String$split = F2( + function (sep, string) { + return _List_fromArray( + A2(_String_split, sep, string)); + }); +var $elm$json$Json$Decode$indent = function (str) { + return A2( + $elm$core$String$join, + '\n ', + A2($elm$core$String$split, '\n', str)); }; -var $elm$core$Dict$removeHelp = F2( - function (targetKey, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return $elm$core$Dict$RBEmpty_elm_builtin; - } else { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - if (_Utils_cmp(targetKey, key) < 0) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Black')) { - var _v4 = left.a; - var lLeft = left.d; - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { - var _v6 = lLeft.a; - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - A2($elm$core$Dict$removeHelp, targetKey, left), - right); - } else { - var _v7 = $elm$core$Dict$moveRedLeft(dict); - if (_v7.$ === 'RBNode_elm_builtin') { - var nColor = _v7.a; - var nKey = _v7.b; - var nValue = _v7.c; - var nLeft = _v7.d; - var nRight = _v7.e; - return A5( - $elm$core$Dict$balance, - nColor, - nKey, - nValue, - A2($elm$core$Dict$removeHelp, targetKey, nLeft), - nRight); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - } - } else { - return A5( - $elm$core$Dict$RBNode_elm_builtin, - color, - key, - value, - A2($elm$core$Dict$removeHelp, targetKey, left), - right); - } +var $elm$core$List$foldl = F3( + function (func, acc, list) { + foldl: + while (true) { + if (!list.b) { + return acc; } else { - return A2( - $elm$core$Dict$removeHelpEQGT, - targetKey, - A7($elm$core$Dict$removeHelpPrepEQGT, targetKey, dict, color, key, value, left, right)); + var x = list.a; + var xs = list.b; + var $temp$func = func, + $temp$acc = A2(func, x, acc), + $temp$list = xs; + func = $temp$func; + acc = $temp$acc; + list = $temp$list; + continue foldl; } } }); -var $elm$core$Dict$removeHelpEQGT = F2( - function (targetKey, dict) { - if (dict.$ === 'RBNode_elm_builtin') { - var color = dict.a; - var key = dict.b; - var value = dict.c; - var left = dict.d; - var right = dict.e; - if (_Utils_eq(targetKey, key)) { - var _v1 = $elm$core$Dict$getMin(right); - if (_v1.$ === 'RBNode_elm_builtin') { - var minKey = _v1.b; - var minValue = _v1.c; - return A5( - $elm$core$Dict$balance, - color, - minKey, - minValue, - left, - $elm$core$Dict$removeMin(right)); - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } +var $elm$core$List$length = function (xs) { + return A3( + $elm$core$List$foldl, + F2( + function (_v0, i) { + return i + 1; + }), + 0, + xs); +}; +var $elm$core$List$map2 = _List_map2; +var $elm$core$Basics$le = _Utils_le; +var $elm$core$Basics$sub = _Basics_sub; +var $elm$core$List$rangeHelp = F3( + function (lo, hi, list) { + rangeHelp: + while (true) { + if (_Utils_cmp(lo, hi) < 1) { + var $temp$lo = lo, + $temp$hi = hi - 1, + $temp$list = A2($elm$core$List$cons, hi, list); + lo = $temp$lo; + hi = $temp$hi; + list = $temp$list; + continue rangeHelp; } else { - return A5( - $elm$core$Dict$balance, - color, - key, - value, - left, - A2($elm$core$Dict$removeHelp, targetKey, right)); + return list; } - } else { - return $elm$core$Dict$RBEmpty_elm_builtin; - } - }); -var $elm$core$Dict$remove = F2( - function (key, dict) { - var _v0 = A2($elm$core$Dict$removeHelp, key, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { - var _v1 = _v0.a; - var k = _v0.b; - var v = _v0.c; - var l = _v0.d; - var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); - } else { - var x = _v0; - return x; - } - }); -var $elm$core$Dict$update = F3( - function (targetKey, alter, dictionary) { - var _v0 = alter( - A2($elm$core$Dict$get, targetKey, dictionary)); - if (_v0.$ === 'Just') { - var value = _v0.a; - return A3($elm$core$Dict$insert, targetKey, value, dictionary); - } else { - return A2($elm$core$Dict$remove, targetKey, dictionary); - } - }); -var $elm$browser$Debugger$Expando$updateIndex = F3( - function (n, func, list) { - if (!list.b) { - return _List_Nil; - } else { - var x = list.a; - var xs = list.b; - return (n <= 0) ? A2( - $elm$core$List$cons, - func(x), - xs) : A2( - $elm$core$List$cons, - x, - A3($elm$browser$Debugger$Expando$updateIndex, n - 1, func, xs)); } }); -var $elm$browser$Debugger$Expando$update = F2( - function (msg, value) { - switch (value.$) { - case 'S': - return value; - case 'Primitive': - return value; - case 'Sequence': - var seqType = value.a; - var isClosed = value.b; - var valueList = value.c; - switch (msg.$) { - case 'Toggle': - return A3($elm$browser$Debugger$Expando$Sequence, seqType, !isClosed, valueList); - case 'Index': - if (msg.a.$ === 'None') { - var _v3 = msg.a; - var index = msg.b; - var subMsg = msg.c; - return A3( - $elm$browser$Debugger$Expando$Sequence, - seqType, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - $elm$browser$Debugger$Expando$update(subMsg), - valueList)); - } else { - return value; - } - default: - return value; - } - case 'Dictionary': - var isClosed = value.a; - var keyValuePairs = value.b; - switch (msg.$) { - case 'Toggle': - return A2($elm$browser$Debugger$Expando$Dictionary, !isClosed, keyValuePairs); - case 'Index': - var redirect = msg.a; - var index = msg.b; - var subMsg = msg.c; - switch (redirect.$) { - case 'None': - return value; - case 'Key': - return A2( - $elm$browser$Debugger$Expando$Dictionary, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - function (_v6) { - var k = _v6.a; - var v = _v6.b; - return _Utils_Tuple2( - A2($elm$browser$Debugger$Expando$update, subMsg, k), - v); - }, - keyValuePairs)); - default: - return A2( - $elm$browser$Debugger$Expando$Dictionary, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - function (_v7) { - var k = _v7.a; - var v = _v7.b; - return _Utils_Tuple2( - k, - A2($elm$browser$Debugger$Expando$update, subMsg, v)); - }, - keyValuePairs)); - } - default: - return value; - } - case 'Record': - var isClosed = value.a; - var valueDict = value.b; - switch (msg.$) { - case 'Toggle': - return A2($elm$browser$Debugger$Expando$Record, !isClosed, valueDict); - case 'Index': - return value; - default: - var field = msg.a; - var subMsg = msg.b; - return A2( - $elm$browser$Debugger$Expando$Record, - isClosed, - A3( - $elm$core$Dict$update, - field, - $elm$browser$Debugger$Expando$updateField(subMsg), - valueDict)); - } - default: - var maybeName = value.a; - var isClosed = value.b; - var valueList = value.c; - switch (msg.$) { - case 'Toggle': - return A3($elm$browser$Debugger$Expando$Constructor, maybeName, !isClosed, valueList); - case 'Index': - if (msg.a.$ === 'None') { - var _v10 = msg.a; - var index = msg.b; - var subMsg = msg.c; - return A3( - $elm$browser$Debugger$Expando$Constructor, - maybeName, - isClosed, - A3( - $elm$browser$Debugger$Expando$updateIndex, - index, - $elm$browser$Debugger$Expando$update(subMsg), - valueList)); - } else { - return value; - } - default: - return value; - } - } +var $elm$core$List$range = F2( + function (lo, hi) { + return A3($elm$core$List$rangeHelp, lo, hi, _List_Nil); }); -var $elm$browser$Debugger$Expando$updateField = F2( - function (msg, maybeExpando) { - if (maybeExpando.$ === 'Nothing') { - return maybeExpando; - } else { - var expando = maybeExpando.a; - return $elm$core$Maybe$Just( - A2($elm$browser$Debugger$Expando$update, msg, expando)); - } +var $elm$core$List$indexedMap = F2( + function (f, xs) { + return A3( + $elm$core$List$map2, + f, + A2( + $elm$core$List$range, + 0, + $elm$core$List$length(xs) - 1), + xs); }); -var $elm$browser$Debugger$Main$Upload = function (a) { - return {$: 'Upload', a: a}; +var $elm$core$Char$toCode = _Char_toCode; +var $elm$core$Char$isLower = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (97 <= code) && (code <= 122); +}; +var $elm$core$Char$isUpper = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (code <= 90) && (65 <= code); +}; +var $elm$core$Basics$or = _Basics_or; +var $elm$core$Char$isAlpha = function (_char) { + return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); +}; +var $elm$core$Char$isDigit = function (_char) { + var code = $elm$core$Char$toCode(_char); + return (code <= 57) && (48 <= code); }; -var $elm$browser$Debugger$Main$upload = function (popout) { - return A2( - $elm$core$Task$perform, - $elm$browser$Debugger$Main$Upload, - _Debugger_upload(popout)); +var $elm$core$Char$isAlphaNum = function (_char) { + return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); }; -var $elm$browser$Debugger$Overlay$BadMetadata = function (a) { - return {$: 'BadMetadata', a: a}; +var $elm$core$List$reverse = function (list) { + return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); }; -var $elm$browser$Debugger$Overlay$badMetadata = $elm$browser$Debugger$Overlay$BadMetadata; -var $elm$browser$Debugger$Main$withGoodMetadata = F2( - function (model, func) { - var _v0 = model.metadata; - if (_v0.$ === 'Ok') { - var metadata = _v0.a; - return func(metadata); - } else { - var error = _v0.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - overlay: $elm$browser$Debugger$Overlay$badMetadata(error) - }), - $elm$core$Platform$Cmd$none); - } +var $elm$core$String$uncons = _String_uncons; +var $elm$json$Json$Decode$errorOneOf = F2( + function (i, error) { + return '\n\n(' + ($elm$core$String$fromInt(i + 1) + (') ' + $elm$json$Json$Decode$indent( + $elm$json$Json$Decode$errorToString(error)))); }); -var $elm$browser$Debugger$Main$wrapUpdate = F3( - function (update, msg, model) { - wrapUpdate: +var $elm$json$Json$Decode$errorToString = function (error) { + return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); +}; +var $elm$json$Json$Decode$errorToStringHelp = F2( + function (error, context) { + errorToStringHelp: while (true) { - switch (msg.$) { - case 'NoOp': - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'UserMsg': - var userMsg = msg.a; - var userModel = $elm$browser$Debugger$Main$getLatestModel(model.state); - var newHistory = A3($elm$browser$Debugger$History$add, userMsg, userModel, model.history); - var _v1 = A2(update, userMsg, userModel); - var newUserModel = _v1.a; - var userCmds = _v1.b; - var commands = A2($elm$core$Platform$Cmd$map, $elm$browser$Debugger$Main$UserMsg, userCmds); - var _v2 = model.state; - if (_v2.$ === 'Running') { - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, newUserModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, userMsg, model.expandoMsg), - history: newHistory, - state: $elm$browser$Debugger$Main$Running(newUserModel) - }), - $elm$core$Platform$Cmd$batch( - _List_fromArray( - [ - commands, - $elm$browser$Debugger$Main$scroll(model.popout) - ]))); - } else { - var index = _v2.a; - var indexModel = _v2.b; - var history = _v2.e; - return _Utils_Tuple2( - _Utils_update( - model, - { - history: newHistory, - state: A5($elm$browser$Debugger$Main$Paused, index, indexModel, newUserModel, userMsg, history) - }), - commands); - } - case 'TweakExpandoMsg': - var eMsg = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoMsg: A2($elm$browser$Debugger$Expando$update, eMsg, model.expandoMsg) - }), - $elm$core$Platform$Cmd$none); - case 'TweakExpandoModel': - var eMsg = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$update, eMsg, model.expandoModel) - }), - $elm$core$Platform$Cmd$none); - case 'Resume': - var _v3 = model.state; - if (_v3.$ === 'Running') { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } else { - var userModel = _v3.c; - var userMsg = _v3.d; - return _Utils_Tuple2( - _Utils_update( - model, - { - expandoModel: A2($elm$browser$Debugger$Expando$merge, userModel, model.expandoModel), - expandoMsg: A2($elm$browser$Debugger$Expando$merge, userMsg, model.expandoMsg), - state: $elm$browser$Debugger$Main$Running(userModel) - }), - $elm$browser$Debugger$Main$scroll(model.popout)); - } - case 'Jump': - var index = msg.a; - return _Utils_Tuple2( - A3($elm$browser$Debugger$Main$jumpUpdate, update, index, model), - $elm$core$Platform$Cmd$none); - case 'SliderJump': - var index = msg.a; - return _Utils_Tuple2( - A3($elm$browser$Debugger$Main$jumpUpdate, update, index, model), - A2( - $elm$browser$Debugger$Main$scrollTo, - $elm$browser$Debugger$History$idForMessageIndex(index), - model.popout)); - case 'Open': - return _Utils_Tuple2( - model, - A2( - $elm$core$Task$perform, - $elm$core$Basics$always($elm$browser$Debugger$Main$NoOp), - _Debugger_open(model.popout))); - case 'Up': - var _v4 = model.state; - if (_v4.$ === 'Running') { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } else { - var i = _v4.a; - var history = _v4.e; - var targetIndex = i + 1; - if (_Utils_cmp( - targetIndex, - $elm$browser$Debugger$History$size(history)) < 0) { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$SliderJump(targetIndex), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } else { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$Resume, - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } - } - case 'Down': - var _v5 = model.state; - if (_v5.$ === 'Running') { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$Jump( - $elm$browser$Debugger$History$size(model.history) - 1), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; - } else { - var index = _v5.a; - if (index > 0) { - var $temp$update = update, - $temp$msg = $elm$browser$Debugger$Main$SliderJump(index - 1), - $temp$model = model; - update = $temp$update; - msg = $temp$msg; - model = $temp$model; - continue wrapUpdate; + switch (error.$) { + case 0: + var f = error.a; + var err = error.b; + var isSimple = function () { + var _v1 = $elm$core$String$uncons(f); + if (_v1.$ === 1) { + return false; } else { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + var _v2 = _v1.a; + var _char = _v2.a; + var rest = _v2.b; + return $elm$core$Char$isAlpha(_char) && A2($elm$core$String$all, $elm$core$Char$isAlphaNum, rest); } - } - case 'Import': - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (_v6) { - return _Utils_Tuple2( - model, - $elm$browser$Debugger$Main$upload(model.popout)); - }); - case 'Export': - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (metadata) { - return _Utils_Tuple2( - model, - A2($elm$browser$Debugger$Main$download, metadata, model.history)); - }); - case 'Upload': - var jsonString = msg.a; - return A2( - $elm$browser$Debugger$Main$withGoodMetadata, - model, - function (metadata) { - var _v7 = A2($elm$browser$Debugger$Overlay$assessImport, metadata, jsonString); - if (_v7.$ === 'Err') { - var newOverlay = _v7.a; - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: newOverlay}), - $elm$core$Platform$Cmd$none); + }(); + var fieldName = isSimple ? ('.' + f) : ('[\'' + (f + '\']')); + var $temp$error = err, + $temp$context = A2($elm$core$List$cons, fieldName, context); + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + case 1: + var i = error.a; + var err = error.b; + var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); + var $temp$error = err, + $temp$context = A2($elm$core$List$cons, indexName, context); + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + case 2: + var errors = error.a; + if (!errors.b) { + return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { + if (!context.b) { + return '!'; } else { - var rawHistory = _v7.a; - return A3($elm$browser$Debugger$Main$loadNewHistory, rawHistory, update, model); + return ' at json' + A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)); } - }); - case 'OverlayMsg': - var overlayMsg = msg.a; - var _v8 = A2($elm$browser$Debugger$Overlay$close, overlayMsg, model.overlay); - if (_v8.$ === 'Nothing') { - return _Utils_Tuple2( - _Utils_update( - model, - {overlay: $elm$browser$Debugger$Overlay$none}), - $elm$core$Platform$Cmd$none); + }(); } else { - var rawHistory = _v8.a; - return A3($elm$browser$Debugger$Main$loadNewHistory, rawHistory, update, model); + if (!errors.b.b) { + var err = errors.a; + var $temp$error = err, + $temp$context = context; + error = $temp$error; + context = $temp$context; + continue errorToStringHelp; + } else { + var starter = function () { + if (!context.b) { + return 'Json.Decode.oneOf'; + } else { + return 'The Json.Decode.oneOf at json' + A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)); + } + }(); + var introduction = starter + (' failed in the following ' + ($elm$core$String$fromInt( + $elm$core$List$length(errors)) + ' ways:')); + return A2( + $elm$core$String$join, + '\n\n', + A2( + $elm$core$List$cons, + introduction, + A2($elm$core$List$indexedMap, $elm$json$Json$Decode$errorOneOf, errors))); + } } - case 'SwapLayout': - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: $elm$browser$Debugger$Main$swapLayout(model.layout) - }), - $elm$core$Platform$Cmd$none); - case 'DragStart': - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$setDragStatus, $elm$browser$Debugger$Main$Moving, model.layout) - }), - $elm$core$Platform$Cmd$none); - case 'Drag': - var info = msg.a; - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$drag, info, model.layout) - }), - $elm$core$Platform$Cmd$none); default: - return _Utils_Tuple2( - _Utils_update( - model, - { - layout: A2($elm$browser$Debugger$Main$setDragStatus, $elm$browser$Debugger$Main$Static, model.layout) - }), - $elm$core$Platform$Cmd$none); + var msg = error.a; + var json = error.b; + var introduction = function () { + if (!context.b) { + return 'Problem with the given value:\n\n'; + } else { + return 'Problem with the value at json' + (A2( + $elm$core$String$join, + '', + $elm$core$List$reverse(context)) + ':\n\n '); + } + }(); + return introduction + ($elm$json$Json$Decode$indent( + A2($elm$json$Json$Encode$encode, 4, json)) + ('\n\n' + msg)); + } + } + }); +var $elm$core$Array$branchFactor = 32; +var $elm$core$Array$Array_elm_builtin = F4( + function (a, b, c, d) { + return {$: 0, a: a, b: b, c: c, d: d}; + }); +var $elm$core$Elm$JsArray$empty = _JsArray_empty; +var $elm$core$Basics$ceiling = _Basics_ceiling; +var $elm$core$Basics$fdiv = _Basics_fdiv; +var $elm$core$Basics$logBase = F2( + function (base, number) { + return _Basics_log(number) / _Basics_log(base); + }); +var $elm$core$Basics$toFloat = _Basics_toFloat; +var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( + A2($elm$core$Basics$logBase, 2, $elm$core$Array$branchFactor)); +var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty); +var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; +var $elm$core$Array$Leaf = function (a) { + return {$: 1, a: a}; +}; +var $elm$core$Basics$apL = F2( + function (f, x) { + return f(x); + }); +var $elm$core$Basics$apR = F2( + function (x, f) { + return f(x); + }); +var $elm$core$Basics$eq = _Utils_equal; +var $elm$core$Basics$floor = _Basics_floor; +var $elm$core$Elm$JsArray$length = _JsArray_length; +var $elm$core$Basics$gt = _Utils_gt; +var $elm$core$Basics$max = F2( + function (x, y) { + return (_Utils_cmp(x, y) > 0) ? x : y; + }); +var $elm$core$Basics$mul = _Basics_mul; +var $elm$core$Array$SubTree = function (a) { + return {$: 0, a: a}; +}; +var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; +var $elm$core$Array$compressNodes = F2( + function (nodes, acc) { + compressNodes: + while (true) { + var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodes); + var node = _v0.a; + var remainingNodes = _v0.b; + var newAcc = A2( + $elm$core$List$cons, + $elm$core$Array$SubTree(node), + acc); + if (!remainingNodes.b) { + return $elm$core$List$reverse(newAcc); + } else { + var $temp$nodes = remainingNodes, + $temp$acc = newAcc; + nodes = $temp$nodes; + acc = $temp$acc; + continue compressNodes; + } + } + }); +var $elm$core$Tuple$first = function (_v0) { + var x = _v0.a; + return x; +}; +var $elm$core$Array$treeFromBuilder = F2( + function (nodeList, nodeListSize) { + treeFromBuilder: + while (true) { + var newNodeSize = $elm$core$Basics$ceiling(nodeListSize / $elm$core$Array$branchFactor); + if (newNodeSize === 1) { + return A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, nodeList).a; + } else { + var $temp$nodeList = A2($elm$core$Array$compressNodes, nodeList, _List_Nil), + $temp$nodeListSize = newNodeSize; + nodeList = $temp$nodeList; + nodeListSize = $temp$nodeListSize; + continue treeFromBuilder; + } + } + }); +var $elm$core$Array$builderToArray = F2( + function (reverseNodeList, builder) { + if (!builder.s) { + return A4( + $elm$core$Array$Array_elm_builtin, + $elm$core$Elm$JsArray$length(builder.x), + $elm$core$Array$shiftStep, + $elm$core$Elm$JsArray$empty, + builder.x); + } else { + var treeLen = builder.s * $elm$core$Array$branchFactor; + var depth = $elm$core$Basics$floor( + A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.y) : builder.y; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.s); + return A4( + $elm$core$Array$Array_elm_builtin, + $elm$core$Elm$JsArray$length(builder.x) + treeLen, + A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), + tree, + builder.x); + } + }); +var $elm$core$Basics$idiv = _Basics_idiv; +var $elm$core$Basics$lt = _Utils_lt; +var $elm$core$Array$initializeHelp = F5( + function (fn, fromIndex, len, nodeList, tail) { + initializeHelp: + while (true) { + if (fromIndex < 0) { + return A2( + $elm$core$Array$builderToArray, + false, + {y: nodeList, s: (len / $elm$core$Array$branchFactor) | 0, x: tail}); + } else { + var leaf = $elm$core$Array$Leaf( + A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); + var $temp$fn = fn, + $temp$fromIndex = fromIndex - $elm$core$Array$branchFactor, + $temp$len = len, + $temp$nodeList = A2($elm$core$List$cons, leaf, nodeList), + $temp$tail = tail; + fn = $temp$fn; + fromIndex = $temp$fromIndex; + len = $temp$len; + nodeList = $temp$nodeList; + tail = $temp$tail; + continue initializeHelp; } } }); +var $elm$core$Basics$remainderBy = _Basics_remainderBy; +var $elm$core$Array$initialize = F2( + function (len, fn) { + if (len <= 0) { + return $elm$core$Array$empty; + } else { + var tailLen = len % $elm$core$Array$branchFactor; + var tail = A3($elm$core$Elm$JsArray$initialize, tailLen, len - tailLen, fn); + var initialFromIndex = (len - tailLen) - $elm$core$Array$branchFactor; + return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); + } + }); +var $elm$core$Basics$True = 0; +var $elm$core$Result$isOk = function (result) { + if (!result.$) { + return true; + } else { + return false; + } +}; +var $elm$json$Json$Decode$map = _Json_map1; +var $elm$json$Json$Decode$map2 = _Json_map2; +var $elm$json$Json$Decode$succeed = _Json_succeed; +var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { + switch (handler.$) { + case 0: + return 0; + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } +}; var $elm$browser$Browser$External = function (a) { - return {$: 'External', a: a}; + return {$: 1, a: a}; }; var $elm$browser$Browser$Internal = function (a) { - return {$: 'Internal', a: a}; + return {$: 0, a: a}; }; -var $elm$browser$Browser$Dom$NotFound = function (a) { - return {$: 'NotFound', a: a}; +var $elm$core$Basics$identity = function (x) { + return x; }; -var $elm$url$Url$Http = {$: 'Http'}; -var $elm$url$Url$Https = {$: 'Https'}; +var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; +var $elm$url$Url$Http = 0; +var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query}; + return {bX: fragment, b1: host, z: path, cw: port_, cC: protocol, cD: query}; }); +var $elm$core$String$contains = _String_contains; +var $elm$core$String$length = _String_length; +var $elm$core$String$slice = _String_slice; var $elm$core$String$dropLeft = F2( function (n, string) { return (n < 1) ? string : A3( @@ -10441,6 +4928,11 @@ var $elm$core$String$indexes = _String_indexes; var $elm$core$String$isEmpty = function (string) { return string === ''; }; +var $elm$core$String$left = F2( + function (n, string) { + return (n < 1) ? '' : A3($elm$core$String$slice, 0, n, string); + }); +var $elm$core$String$toInt = _String_toInt; var $elm$url$Url$chompBeforePath = F5( function (protocol, path, params, frag, str) { if ($elm$core$String$isEmpty(str) || A2($elm$core$String$contains, '@', str)) { @@ -10455,7 +4947,7 @@ var $elm$url$Url$chompBeforePath = F5( var i = _v0.a; var _v1 = $elm$core$String$toInt( A2($elm$core$String$dropLeft, i + 1, str)); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return $elm$core$Maybe$Nothing; } else { var port_ = _v1; @@ -10534,46 +5026,196 @@ var $elm$url$Url$chompAfterProtocol = F2( } } }); -var $elm$core$String$startsWith = _String_startsWith; -var $elm$url$Url$fromString = function (str) { - return A2($elm$core$String$startsWith, 'http://', str) ? A2( - $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Http, - A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( - $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Https, - A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); -}; -var $elm$core$Basics$never = function (_v0) { - never: - while (true) { - var nvr = _v0.a; - var $temp$_v0 = nvr; - _v0 = $temp$_v0; - continue never; - } -}; +var $elm$core$String$startsWith = _String_startsWith; +var $elm$url$Url$fromString = function (str) { + return A2($elm$core$String$startsWith, 'http://', str) ? A2( + $elm$url$Url$chompAfterProtocol, + 0, + A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( + $elm$url$Url$chompAfterProtocol, + 1, + A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); +}; +var $elm$core$Basics$never = function (_v0) { + never: + while (true) { + var nvr = _v0; + var $temp$_v0 = nvr; + _v0 = $temp$_v0; + continue never; + } +}; +var $elm$core$Task$Perform = $elm$core$Basics$identity; +var $elm$core$Task$succeed = _Scheduler_succeed; +var $elm$core$Task$init = $elm$core$Task$succeed(0); +var $elm$core$List$foldrHelper = F4( + function (fn, acc, ctr, ls) { + if (!ls.b) { + return acc; + } else { + var a = ls.a; + var r1 = ls.b; + if (!r1.b) { + return A2(fn, a, acc); + } else { + var b = r1.a; + var r2 = r1.b; + if (!r2.b) { + return A2( + fn, + a, + A2(fn, b, acc)); + } else { + var c = r2.a; + var r3 = r2.b; + if (!r3.b) { + return A2( + fn, + a, + A2( + fn, + b, + A2(fn, c, acc))); + } else { + var d = r3.a; + var r4 = r3.b; + var res = (ctr > 500) ? A3( + $elm$core$List$foldl, + fn, + acc, + $elm$core$List$reverse(r4)) : A4($elm$core$List$foldrHelper, fn, acc, ctr + 1, r4); + return A2( + fn, + a, + A2( + fn, + b, + A2( + fn, + c, + A2(fn, d, res)))); + } + } + } + } + }); +var $elm$core$List$foldr = F3( + function (fn, acc, ls) { + return A4($elm$core$List$foldrHelper, fn, acc, 0, ls); + }); +var $elm$core$List$map = F2( + function (f, xs) { + return A3( + $elm$core$List$foldr, + F2( + function (x, acc) { + return A2( + $elm$core$List$cons, + f(x), + acc); + }), + _List_Nil, + xs); + }); +var $elm$core$Task$andThen = _Scheduler_andThen; +var $elm$core$Task$map = F2( + function (func, taskA) { + return A2( + $elm$core$Task$andThen, + function (a) { + return $elm$core$Task$succeed( + func(a)); + }, + taskA); + }); +var $elm$core$Task$map2 = F3( + function (func, taskA, taskB) { + return A2( + $elm$core$Task$andThen, + function (a) { + return A2( + $elm$core$Task$andThen, + function (b) { + return $elm$core$Task$succeed( + A2(func, a, b)); + }, + taskB); + }, + taskA); + }); +var $elm$core$Task$sequence = function (tasks) { + return A3( + $elm$core$List$foldr, + $elm$core$Task$map2($elm$core$List$cons), + $elm$core$Task$succeed(_List_Nil), + tasks); +}; +var $elm$core$Platform$sendToApp = _Platform_sendToApp; +var $elm$core$Task$spawnCmd = F2( + function (router, _v0) { + var task = _v0; + return _Scheduler_spawn( + A2( + $elm$core$Task$andThen, + $elm$core$Platform$sendToApp(router), + task)); + }); +var $elm$core$Task$onEffects = F3( + function (router, commands, state) { + return A2( + $elm$core$Task$map, + function (_v0) { + return 0; + }, + $elm$core$Task$sequence( + A2( + $elm$core$List$map, + $elm$core$Task$spawnCmd(router), + commands))); + }); +var $elm$core$Task$onSelfMsg = F3( + function (_v0, _v1, _v2) { + return $elm$core$Task$succeed(0); + }); +var $elm$core$Task$cmdMap = F2( + function (tagger, _v0) { + var task = _v0; + return A2($elm$core$Task$map, tagger, task); + }); +_Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); +var $elm$core$Task$command = _Platform_leaf('Task'); +var $elm$core$Task$perform = F2( + function (toMessage, task) { + return $elm$core$Task$command( + A2($elm$core$Task$map, toMessage, task)); + }); var $elm$browser$Browser$element = _Browser_element; var $author$project$Main$Editor = function (a) { - return {$: 'Editor', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$PortOutgoingFormFields = function (a) { - return {$: 'PortOutgoingFormFields', a: a}; + return {$: 0, a: a}; }; +var $elm$core$Platform$Cmd$batch = _Platform_batch; var $author$project$Main$Config = F4( function (viewMode, formFields, formValues, shortTextTypeList) { - return {formFields: formFields, formValues: formValues, shortTextTypeList: shortTextTypeList, viewMode: viewMode}; + return {g: formFields, a7: formValues, al: shortTextTypeList, ac: viewMode}; }); var $elm_community$json_extra$Json$Decode$Extra$andMap = $elm$json$Json$Decode$map2($elm$core$Basics$apR); var $author$project$Main$FormField = F6( function (label, name, presence, description, type_, visibilityRule) { - return {description: description, label: label, name: name, presence: presence, type_: type_, visibilityRule: visibilityRule}; + return {S: description, d: label, Q: name, w: presence, a: type_, m: visibilityRule}; }); var $author$project$Main$AttributeNotNeeded = function (a) { - return {$: 'AttributeNotNeeded', a: a}; + return {$: 0, a: a}; }; +var $elm$json$Json$Decode$field = _Json_decodeField; +var $elm$json$Json$Decode$at = F2( + function (fields, decoder) { + return A3($elm$core$List$foldr, $elm$json$Json$Decode$field, decoder, fields); + }); var $author$project$Main$AttributeGiven = function (a) { - return {$: 'AttributeGiven', a: a}; + return {$: 2, a: a}; }; var $elm$json$Json$Decode$null = _Json_decodeNull; var $elm$json$Json$Decode$oneOf = _Json_oneOf; @@ -10594,6 +5236,7 @@ var $author$project$Main$decodeAttributeOptional = F2( decodeValue) ])); }); +var $elm$json$Json$Decode$string = _Json_decodeString; var $author$project$Main$decodeFormFieldDescription = $elm$json$Json$Decode$oneOf( _List_fromArray( [ @@ -10633,19 +5276,19 @@ var $author$project$Main$decodeFormFieldMaybeName = $elm$json$Json$Decode$oneOf( $elm$json$Json$Decode$succeed($elm$core$Maybe$Nothing) ])); var $author$project$Main$ChooseMultiple = function (a) { - return {$: 'ChooseMultiple', a: a}; + return {$: 4, a: a}; }; var $author$project$Main$ChooseOne = function (a) { - return {$: 'ChooseOne', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$Dropdown = function (a) { - return {$: 'Dropdown', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$LongText = function (a) { - return {$: 'LongText', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$ShortText = function (a) { - return {$: 'ShortText', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$andThen = _Json_andThen; var $author$project$Main$choiceDelimiter = ' | '; @@ -10656,8 +5299,8 @@ var $author$project$Main$choiceFromString = function (s) { if (!_v0.b.b) { var value = _v0.a; return { - label: value, - value: $elm$core$String$trim(value) + d: value, + j: $elm$core$String$trim(value) }; } else { if (!_v0.b.b.b) { @@ -10665,31 +5308,31 @@ var $author$project$Main$choiceFromString = function (s) { var _v1 = _v0.b; var label = _v1.a; return { - label: label, - value: $elm$core$String$trim(value) + d: label, + j: $elm$core$String$trim(value) }; } else { var value = _v0.a; var labels = _v0.b; return { - label: A2($elm$core$String$join, $author$project$Main$choiceDelimiter, labels), - value: $elm$core$String$trim(value) + d: A2($elm$core$String$join, $author$project$Main$choiceDelimiter, labels), + j: $elm$core$String$trim(value) }; } } } else { return { - label: s, - value: $elm$core$String$trim(s) + d: s, + j: $elm$core$String$trim(s) }; } }; var $author$project$Main$decodeChoice = A2($elm$json$Json$Decode$map, $author$project$Main$choiceFromString, $elm$json$Json$Decode$string); var $author$project$Main$FilterContainsFieldValueOf = function (a) { - return {$: 'FilterContainsFieldValueOf', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$FilterStartsWithFieldValueOf = function (a) { - return {$: 'FilterStartsWithFieldValueOf', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$fail = _Json_fail; var $author$project$Main$decodeChoiceFilter = A2( @@ -10713,12 +5356,160 @@ var $author$project$Main$decodeChoiceFilter = A2( A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); var $author$project$Main$RawCustomElement = F3( function (inputType, inputTag, attributes) { - return {attributes: attributes, inputTag: inputTag, inputType: inputType}; + return {p: attributes, N: inputTag, B: inputType}; }); var $author$project$Main$defaultInputTag = 'input'; +var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; +var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; +var $elm$core$Dict$Black = 1; +var $elm$core$Dict$RBNode_elm_builtin = F5( + function (a, b, c, d, e) { + return {$: -1, a: a, b: b, c: c, d: d, e: e}; + }); +var $elm$core$Dict$Red = 0; +var $elm$core$Dict$balance = F5( + function (color, key, value, left, right) { + if ((right.$ === -1) && (!right.a)) { + var _v1 = right.a; + var rK = right.b; + var rV = right.c; + var rLeft = right.d; + var rRight = right.e; + if ((left.$ === -1) && (!left.a)) { + var _v3 = left.a; + var lK = left.b; + var lV = left.c; + var lLeft = left.d; + var lRight = left.e; + return A5( + $elm$core$Dict$RBNode_elm_builtin, + 0, + key, + value, + A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); + } else { + return A5( + $elm$core$Dict$RBNode_elm_builtin, + color, + rK, + rV, + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), + rRight); + } + } else { + if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { + var _v5 = left.a; + var lK = left.b; + var lV = left.c; + var _v6 = left.d; + var _v7 = _v6.a; + var llK = _v6.b; + var llV = _v6.c; + var llLeft = _v6.d; + var llRight = _v6.e; + var lRight = left.e; + return A5( + $elm$core$Dict$RBNode_elm_builtin, + 0, + lK, + lV, + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); + } else { + return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); + } + } + }); +var $elm$core$Basics$compare = _Utils_compare; +var $elm$core$Dict$insertHelp = F3( + function (key, value, dict) { + if (dict.$ === -2) { + return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); + } else { + var nColor = dict.a; + var nKey = dict.b; + var nValue = dict.c; + var nLeft = dict.d; + var nRight = dict.e; + var _v1 = A2($elm$core$Basics$compare, key, nKey); + switch (_v1) { + case 0: + return A5( + $elm$core$Dict$balance, + nColor, + nKey, + nValue, + A3($elm$core$Dict$insertHelp, key, value, nLeft), + nRight); + case 1: + return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); + default: + return A5( + $elm$core$Dict$balance, + nColor, + nKey, + nValue, + nLeft, + A3($elm$core$Dict$insertHelp, key, value, nRight)); + } + } + }); +var $elm$core$Dict$insert = F3( + function (key, value, dict) { + var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); + if ((_v0.$ === -1) && (!_v0.a)) { + var _v1 = _v0.a; + var k = _v0.b; + var v = _v0.c; + var l = _v0.d; + var r = _v0.e; + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); + } else { + var x = _v0; + return x; + } + }); +var $elm$core$Dict$fromList = function (assocs) { + return A3( + $elm$core$List$foldl, + F2( + function (_v0, dict) { + var key = _v0.a; + var value = _v0.b; + return A3($elm$core$Dict$insert, key, value, dict); + }), + $elm$core$Dict$empty, + assocs); +}; var $author$project$Main$AttributeInvalid = function (a) { - return {$: 'AttributeInvalid', a: a}; + return {$: 1, a: a}; }; +var $elm$core$Dict$foldl = F3( + function (func, acc, dict) { + foldl: + while (true) { + if (dict.$ === -2) { + return acc; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var $temp$func = func, + $temp$acc = A3( + func, + key, + value, + A3($elm$core$Dict$foldl, func, acc, left)), + $temp$dict = right; + func = $temp$func; + acc = $temp$acc; + dict = $temp$dict; + continue foldl; + } + } + }); var $elm$core$Dict$filter = F2( function (isGood, dict) { return A3( @@ -10730,18 +5521,50 @@ var $elm$core$Dict$filter = F2( $elm$core$Dict$empty, dict); }); +var $elm$core$Dict$get = F2( + function (targetKey, dict) { + get: + while (true) { + if (dict.$ === -2) { + return $elm$core$Maybe$Nothing; + } else { + var key = dict.b; + var value = dict.c; + var left = dict.d; + var right = dict.e; + var _v1 = A2($elm$core$Basics$compare, targetKey, key); + switch (_v1) { + case 0: + var $temp$targetKey = targetKey, + $temp$dict = left; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + case 1: + return $elm$core$Maybe$Just(value); + default: + var $temp$targetKey = targetKey, + $temp$dict = right; + targetKey = $temp$targetKey; + dict = $temp$dict; + continue get; + } + } + } + }); +var $elm$core$Basics$neq = _Utils_notEqual; var $author$project$Main$fromRawCustomElement = function (ele) { return { - attributes: A2( + p: A2( $elm$core$Dict$filter, F2( function (k, _v0) { return k !== 'list'; }), - ele.attributes), - datalist: function () { - var _v1 = A2($elm$core$Dict$get, 'list', ele.attributes); - if (_v1.$ === 'Just') { + ele.p), + ae: function () { + var _v1 = A2($elm$core$Dict$get, 'list', ele.p); + if (!_v1.$) { var s = _v1.a; var _v2 = A2( $elm$core$String$split, @@ -10758,11 +5581,11 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - inputTag: ele.inputTag, - inputType: ele.inputType, - max: function () { - var _v3 = A2($elm$core$Dict$get, 'max', ele.attributes); - if (_v3.$ === 'Just') { + N: ele.N, + B: ele.B, + aq: function () { + var _v3 = A2($elm$core$Dict$get, 'max', ele.p); + if (!_v3.$) { if (_v3.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { @@ -10773,15 +5596,15 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - maxlength: function () { - var _v4 = A2($elm$core$Dict$get, 'maxlength', ele.attributes); - if (_v4.$ === 'Just') { + ah: function () { + var _v4 = A2($elm$core$Dict$get, 'maxlength', ele.p); + if (!_v4.$) { if (_v4.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { var value = _v4.a; var _v5 = $elm$core$String$toInt(value); - if (_v5.$ === 'Just') { + if (!_v5.$) { var _int = _v5.a; return $author$project$Main$AttributeGiven(_int); } else { @@ -10792,9 +5615,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - min: function () { - var _v6 = A2($elm$core$Dict$get, 'min', ele.attributes); - if (_v6.$ === 'Just') { + ar: function () { + var _v6 = A2($elm$core$Dict$get, 'min', ele.p); + if (!_v6.$) { if (_v6.a === '') { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } else { @@ -10805,9 +5628,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); } }(), - multiple: function () { - var _v7 = A2($elm$core$Dict$get, 'multiple', ele.attributes); - if (_v7.$ === 'Just') { + aM: function () { + var _v7 = A2($elm$core$Dict$get, 'multiple', ele.p); + if (!_v7.$) { switch (_v7.a) { case '': return $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); @@ -10825,6 +5648,9 @@ var $author$project$Main$fromRawCustomElement = function (ele) { }() }; }; +var $elm$json$Json$Decode$keyValuePairs = _Json_decodeKeyValuePairs; +var $elm$json$Json$Decode$decodeValue = _Json_run; +var $elm$json$Json$Decode$value = _Json_decodeValue; var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( function (fieldName, decoder) { var finishDecoding = function (json) { @@ -10832,7 +5658,7 @@ var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( $elm$json$Json$Decode$decodeValue, A2($elm$json$Json$Decode$field, fieldName, $elm$json$Json$Decode$value), json); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var val = _v0.a; return A2( $elm$json$Json$Decode$map, @@ -10844,6 +5670,15 @@ var $elm_community$json_extra$Json$Decode$Extra$optionalField = F2( }; return A2($elm$json$Json$Decode$andThen, finishDecoding, $elm$json$Json$Decode$value); }); +var $elm$core$Maybe$withDefault = F2( + function (_default, maybe) { + if (!maybe.$) { + var value = maybe.a; + return value; + } else { + return _default; + } + }); var $author$project$Main$decodeCustomElement = A2( $elm$json$Json$Decode$map, $author$project$Main$fromRawCustomElement, @@ -10869,6 +5704,8 @@ var $author$project$Main$decodeCustomElement = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'inputType', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$RawCustomElement))))); +var $elm$json$Json$Decode$int = _Json_decodeInt; +var $elm$json$Json$Decode$list = _Json_decodeList; var $elm$json$Json$Decode$maybe = function (decoder) { return $elm$json$Json$Decode$oneOf( _List_fromArray( @@ -10906,7 +5743,7 @@ var $author$project$Main$decodeInputField = A2( F2( function (choices, filter) { return $author$project$Main$Dropdown( - {choices: choices, filter: filter}); + {k: choices, e: filter}); })))); case 'ChooseOne': return A2( @@ -10923,7 +5760,7 @@ var $author$project$Main$decodeInputField = A2( F2( function (choices, filter) { return $author$project$Main$ChooseOne( - {choices: choices, filter: filter}); + {k: choices, e: filter}); })))); case 'ChooseMultiple': return A2( @@ -10948,26 +5785,26 @@ var $author$project$Main$decodeInputField = A2( F4( function (choices, minRequired, maxAllowed, filter) { return $author$project$Main$ChooseMultiple( - {choices: choices, filter: filter, maxAllowed: maxAllowed, minRequired: minRequired}); + {k: choices, e: filter, T: maxAllowed, P: minRequired}); })))))); default: return $elm$json$Json$Decode$fail('Unknown input field type: ' + type_); } }, A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); -var $author$project$Main$Optional = {$: 'Optional'}; -var $author$project$Main$System = {$: 'System'}; -var $author$project$Main$Required = {$: 'Required'}; +var $author$project$Main$Optional = 1; +var $author$project$Main$System = 2; +var $author$project$Main$Required = 0; var $author$project$Main$decodePresenceString = A2( $elm$json$Json$Decode$andThen, function (str) { switch (str) { case 'Required': - return $elm$json$Json$Decode$succeed($author$project$Main$Required); + return $elm$json$Json$Decode$succeed(0); case 'Optional': - return $elm$json$Json$Decode$succeed($author$project$Main$Optional); + return $elm$json$Json$Decode$succeed(1); case 'System': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); default: return $elm$json$Json$Decode$fail('Unknown presence: ' + str); } @@ -10982,11 +5819,11 @@ var $author$project$Main$decodePresence = $elm$json$Json$Decode$oneOf( function (type_) { switch (type_) { case 'System': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); case 'SystemRequired': - return $elm$json$Json$Decode$succeed($author$project$Main$System); + return $elm$json$Json$Decode$succeed(2); case 'SystemOptional': - return $elm$json$Json$Decode$succeed($author$project$Main$Optional); + return $elm$json$Json$Decode$succeed(1); default: return $elm$json$Json$Decode$fail('Unknown presence type: ' + type_); } @@ -10997,30 +5834,33 @@ var $elm$json$Json$Decode$bool = _Json_decodeBool; var $author$project$Main$decodeRequired = A2( $elm$json$Json$Decode$map, function (b) { - return b ? $author$project$Main$Required : $author$project$Main$Optional; + return b ? 0 : 1; }, A2($elm$json$Json$Decode$field, 'required', $elm$json$Json$Decode$bool)); var $author$project$Main$HideWhen = function (a) { - return {$: 'HideWhen', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$ShowWhen = function (a) { - return {$: 'ShowWhen', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$Field = F2( function (a, b) { - return {$: 'Field', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $author$project$Main$EndsWith = function (a) { - return {$: 'EndsWith', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$Equals = function (a) { - return {$: 'Equals', a: a}; + return {$: 0, a: a}; +}; +var $author$project$Main$EqualsField = function (a) { + return {$: 4, a: a}; }; var $author$project$Main$GreaterThan = function (a) { - return {$: 'GreaterThan', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$StringContains = function (a) { - return {$: 'StringContains', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$decodeComparison = A2( $elm$json$Json$Decode$andThen, @@ -11046,6 +5886,11 @@ var $author$project$Main$decodeComparison = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$GreaterThan)); + case 'EqualsField': + return A2( + $elm_community$json_extra$Json$Decode$Extra$andMap, + A2($elm$json$Json$Decode$field, 'value', $elm$json$Json$Decode$string), + $elm$json$Json$Decode$succeed($author$project$Main$EqualsField)); default: return $elm$json$Json$Decode$fail('Unknown comparison type: ' + str); } @@ -11094,7 +5939,7 @@ var $author$project$Main$decodeVisibilityRule = A2( A2($elm$json$Json$Decode$field, 'type', $elm$json$Json$Decode$string)); var $elm$core$Maybe$andThen = F2( function (callback, maybeValue) { - if (maybeValue.$ === 'Just') { + if (!maybeValue.$) { var value = maybeValue.a; return callback(value); } else { @@ -11149,10 +5994,67 @@ var $author$project$Main$decodeFormField = A2( $elm_community$json_extra$Json$Decode$Extra$andMap, A2($elm$json$Json$Decode$field, 'label', $elm$json$Json$Decode$string), $elm$json$Json$Decode$succeed($author$project$Main$FormField))))))); +var $elm$core$Array$fromListHelp = F3( + function (list, nodeList, nodeListSize) { + fromListHelp: + while (true) { + var _v0 = A2($elm$core$Elm$JsArray$initializeFromList, $elm$core$Array$branchFactor, list); + var jsArray = _v0.a; + var remainingItems = _v0.b; + if (_Utils_cmp( + $elm$core$Elm$JsArray$length(jsArray), + $elm$core$Array$branchFactor) < 0) { + return A2( + $elm$core$Array$builderToArray, + true, + {y: nodeList, s: nodeListSize, x: jsArray}); + } else { + var $temp$list = remainingItems, + $temp$nodeList = A2( + $elm$core$List$cons, + $elm$core$Array$Leaf(jsArray), + nodeList), + $temp$nodeListSize = nodeListSize + 1; + list = $temp$list; + nodeList = $temp$nodeList; + nodeListSize = $temp$nodeListSize; + continue fromListHelp; + } + } + }); +var $elm$core$Array$fromList = function (list) { + if (!list.b) { + return $elm$core$Array$empty; + } else { + return A3($elm$core$Array$fromListHelp, list, _List_Nil, 0); + } +}; var $author$project$Main$decodeFormFields = A2( $elm$json$Json$Decode$map, $elm$core$Array$fromList, $elm$json$Json$Decode$list($author$project$Main$decodeFormField)); +var $elm$core$List$append = F2( + function (xs, ys) { + if (!ys.b) { + return xs; + } else { + return A3($elm$core$List$foldr, $elm$core$List$cons, ys, xs); + } + }); +var $elm$core$List$concat = function (lists) { + return A3($elm$core$List$foldr, $elm$core$List$append, _List_Nil, lists); +}; +var $elm$core$List$concatMap = F2( + function (f, list) { + return $elm$core$List$concat( + A2($elm$core$List$map, f, list)); + }); +var $elm$json$Json$Decode$dict = function (decoder) { + return A2( + $elm$json$Json$Decode$map, + $elm$core$Dict$fromList, + $elm$json$Json$Decode$keyValuePairs(decoder)); +}; var $elm$core$Tuple$pair = F2( function (a, b) { return _Utils_Tuple2(a, b); @@ -11189,7 +6091,7 @@ var $author$project$Main$decodeShortTextTypeList = function () { var inputTag = _v1.a; var attributes = _v1.b; return $author$project$Main$fromRawCustomElement( - {attributes: attributes, inputTag: inputTag, inputType: inputType}); + {p: attributes, N: inputTag, B: inputType}); }, $elm$core$Dict$toList(dict)); }; @@ -11204,20 +6106,20 @@ var $author$project$Main$decodeShortTextTypeList = function () { }(); var $elm_community$json_extra$Json$Decode$Extra$fromMaybe = F2( function (error, val) { - if (val.$ === 'Just') { + if (!val.$) { var v = val.a; return $elm$json$Json$Decode$succeed(v); } else { return $elm$json$Json$Decode$fail(error); } }); -var $author$project$Main$CollectData = {$: 'CollectData'}; +var $author$project$Main$CollectData = {$: 1}; var $author$project$Main$viewModeFromString = function (str) { switch (str) { case 'Editor': return $elm$core$Maybe$Just( $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing})); + {aB: $elm$core$Maybe$Nothing})); case 'CollectData': return $elm$core$Maybe$Just($author$project$Main$CollectData); default: @@ -11238,13 +6140,13 @@ var $author$project$Main$decodeConfig = A2( [ $author$project$Main$fromRawCustomElement( { - attributes: $elm$core$Dict$fromList( + p: $elm$core$Dict$fromList( _List_fromArray( [ _Utils_Tuple2('type', 'text') ])), - inputTag: $author$project$Main$defaultInputTag, - inputType: 'Single-line free text' + N: $author$project$Main$defaultInputTag, + B: 'Single-line free text' }) ])), A2($elm_community$json_extra$Json$Decode$Extra$optionalNullableField, 'shortTextTypeList', $author$project$Main$decodeShortTextTypeList)), @@ -11266,7 +6168,7 @@ var $author$project$Main$decodeConfig = A2( $elm$json$Json$Decode$map, $elm$core$Maybe$withDefault( $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing})), + {aB: $elm$core$Maybe$Nothing})), A2($elm_community$json_extra$Json$Decode$Extra$optionalNullableField, 'viewMode', $author$project$Main$decodeViewMode)), $elm$json$Json$Decode$succeed($author$project$Main$Config))))); var $elm$core$List$singleton = function (value) { @@ -11284,9 +6186,9 @@ var $author$project$Main$decodeListOrSingleton = function (decoder) { var $author$project$Main$encodeAttributeOptional = F2( function (encodeValue, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': + case 0: return $elm$json$Json$Encode$null; - case 'AttributeInvalid': + case 1: return $elm$json$Json$Encode$null; default: var value = attributeOptional.a; @@ -11295,17 +6197,31 @@ var $author$project$Main$encodeAttributeOptional = F2( }); var $author$project$Main$choiceToString = function (choice) { return _Utils_eq( - $elm$core$String$trim(choice.label), - $elm$core$String$trim(choice.value)) ? choice.label : _Utils_ap( - choice.value, - _Utils_ap($author$project$Main$choiceDelimiter, choice.label)); + $elm$core$String$trim(choice.d), + $elm$core$String$trim(choice.j)) ? choice.d : _Utils_ap( + choice.j, + _Utils_ap($author$project$Main$choiceDelimiter, choice.d)); }; +var $elm$json$Json$Encode$string = _Json_wrap; var $author$project$Main$encodeChoice = function (choice) { return $elm$json$Json$Encode$string( $author$project$Main$choiceToString(choice)); }; +var $elm$json$Json$Encode$object = function (pairs) { + return _Json_wrap( + A3( + $elm$core$List$foldl, + F2( + function (_v0, obj) { + var k = _v0.a; + var v = _v0.b; + return A3(_Json_addField, k, v, obj); + }), + _Json_emptyObject(0), + pairs)); +}; var $author$project$Main$encodeChoiceFilter = function (filter) { - if (filter.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { var fieldName = filter.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11340,17 +6256,17 @@ var $elm$core$Tuple$mapSecond = F2( func(y)); }); var $author$project$Main$encodePairsFromRawCustomElements = function (customElement) { - var inputTagAttrs = _Utils_eq(customElement.inputTag, $author$project$Main$defaultInputTag) ? _List_Nil : _List_fromArray( + var inputTagAttrs = _Utils_eq(customElement.N, $author$project$Main$defaultInputTag) ? _List_Nil : _List_fromArray( [ _Utils_Tuple2( 'inputTag', - $elm$json$Json$Encode$string(customElement.inputTag)) + $elm$json$Json$Encode$string(customElement.N)) ]); var encodedAttrs = function () { var _v0 = A2( $elm$core$List$map, $elm$core$Tuple$mapSecond($elm$json$Json$Encode$string), - $elm$core$Dict$toList(customElement.attributes)); + $elm$core$Dict$toList(customElement.p)); if (!_v0.b) { return _List_Nil; } else { @@ -11367,13 +6283,13 @@ var $author$project$Main$encodePairsFromRawCustomElements = function (customElem $elm$core$List$cons, _Utils_Tuple2( 'inputType', - $elm$json$Json$Encode$string(customElement.inputType)), + $elm$json$Json$Encode$string(customElement.B)), _Utils_ap(inputTagAttrs, encodedAttrs)); }; var $author$project$Main$toRawCustomElement = function (ele) { var addMultipleIfGiven = function (dict) { - var _v7 = ele.multiple; - if (_v7.$ === 'AttributeGiven') { + var _v7 = ele.aM; + if (_v7.$ === 2) { if (_v7.a) { return A3($elm$core$Dict$insert, 'multiple', 'true', dict); } else { @@ -11390,8 +6306,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMinIfGiven = function (dict) { - var _v5 = ele.min; - if (_v5.$ === 'AttributeGiven') { + var _v5 = ele.ar; + if (_v5.$ === 2) { var value = _v5.a; return A3($elm$core$Dict$insert, 'min', value, dict); } else { @@ -11405,8 +6321,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMaxLengthIfGiven = function (dict) { - var _v3 = ele.maxlength; - if (_v3.$ === 'AttributeGiven') { + var _v3 = ele.ah; + if (_v3.$ === 2) { var _int = _v3.a; return A3( $elm$core$Dict$insert, @@ -11424,8 +6340,8 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addMaxIfGiven = function (dict) { - var _v1 = ele.max; - if (_v1.$ === 'AttributeGiven') { + var _v1 = ele.aq; + if (_v1.$ === 2) { var value = _v1.a; return A3($elm$core$Dict$insert, 'max', value, dict); } else { @@ -11439,9 +6355,9 @@ var $author$project$Main$toRawCustomElement = function (ele) { } }; var addDatalistIfGiven = function (dict) { - var _v0 = ele.datalist; + var _v0 = ele.ae; switch (_v0.$) { - case 'AttributeGiven': + case 2: var list = _v0.a; return A3( $elm$core$Dict$insert, @@ -11451,20 +6367,20 @@ var $author$project$Main$toRawCustomElement = function (ele) { '\n', A2($elm$core$List$map, $author$project$Main$choiceToString, list)), dict); - case 'AttributeInvalid': + case 1: return dict; default: return dict; } }; return { - attributes: addMaxIfGiven( + p: addMaxIfGiven( addMinIfGiven( addDatalistIfGiven( addMultipleIfGiven( - addMaxLengthIfGiven(ele.attributes))))), - inputTag: ele.inputTag, - inputType: ele.inputType + addMaxLengthIfGiven(ele.p))))), + N: ele.N, + B: ele.B }; }; var $author$project$Main$encodePairsFromCustomElement = function (customElement) { @@ -11483,9 +6399,18 @@ var $elm$core$List$filter = F2( list); }); var $elm$json$Json$Encode$int = _Json_wrap; +var $elm$json$Json$Encode$list = F2( + function (func, entries) { + return _Json_wrap( + A3( + $elm$core$List$foldl, + _Json_addEntry(func), + _Json_emptyArray(0), + entries)); + }); var $author$project$Main$encodeInputField = function (inputField) { switch (inputField.$) { - case 'ShortText': + case 0: var customElement = inputField.a; return $elm$json$Json$Encode$object( A2( @@ -11494,7 +6419,7 @@ var $author$project$Main$encodeInputField = function (inputField) { 'type', $elm$json$Json$Encode$string('ShortText')), $author$project$Main$encodePairsFromCustomElement(customElement))); - case 'LongText': + case 1: var optionalMaxLength = inputField.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11506,9 +6431,9 @@ var $author$project$Main$encodeInputField = function (inputField) { 'maxLength', A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$int, optionalMaxLength)) ])); - case 'Dropdown': - var choices = inputField.a.choices; - var filter = inputField.a.filter; + case 2: + var choices = inputField.a.k; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11524,13 +6449,13 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v1) { - var value = _v1.value; + var value = _v1.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11542,9 +6467,9 @@ var $author$project$Main$encodeInputField = function (inputField) { return _List_Nil; } }())); - case 'ChooseOne': - var choices = inputField.a.choices; - var filter = inputField.a.filter; + case 3: + var choices = inputField.a.k; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11560,13 +6485,13 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v3) { - var value = _v3.value; + var value = _v3.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11579,10 +6504,10 @@ var $author$project$Main$encodeInputField = function (inputField) { } }())); default: - var choices = inputField.a.choices; - var minRequired = inputField.a.minRequired; - var maxAllowed = inputField.a.maxAllowed; - var filter = inputField.a.filter; + var choices = inputField.a.k; + var minRequired = inputField.a.P; + var maxAllowed = inputField.a.T; + var filter = inputField.a.e; return $elm$json$Json$Encode$object( _Utils_ap( _List_fromArray( @@ -11598,14 +6523,14 @@ var $author$project$Main$encodeInputField = function (inputField) { A2( $elm$core$List$filter, function (_v5) { - var value = _v5.value; + var value = _v5.j; return $elm$core$String$trim(value) !== ''; }, choices))) ]), _Utils_ap( function () { - if (minRequired.$ === 'Just') { + if (!minRequired.$) { var min = minRequired.a; return _List_fromArray( [ @@ -11619,7 +6544,7 @@ var $author$project$Main$encodeInputField = function (inputField) { }(), _Utils_ap( function () { - if (maxAllowed.$ === 'Just') { + if (!maxAllowed.$) { var max = maxAllowed.a; return _List_fromArray( [ @@ -11632,7 +6557,7 @@ var $author$project$Main$encodeInputField = function (inputField) { } }(), function () { - if (filter.$ === 'Just') { + if (!filter.$) { var f = filter.a; return _List_fromArray( [ @@ -11647,10 +6572,10 @@ var $author$project$Main$encodeInputField = function (inputField) { } }; var $author$project$Main$encodePresence = function (presence) { - switch (presence.$) { - case 'Required': + switch (presence) { + case 0: return $elm$json$Json$Encode$string('Required'); - case 'Optional': + case 1: return $elm$json$Json$Encode$string('Optional'); default: return $elm$json$Json$Encode$string('System'); @@ -11658,7 +6583,7 @@ var $author$project$Main$encodePresence = function (presence) { }; var $author$project$Main$encodeComparison = function (comparison) { switch (comparison.$) { - case 'Equals': + case 0: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11670,7 +6595,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - case 'StringContains': + case 1: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11682,7 +6607,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - case 'EndsWith': + case 2: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11694,7 +6619,7 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); - default: + case 3: var value = comparison.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11706,6 +6631,18 @@ var $author$project$Main$encodeComparison = function (comparison) { 'value', $elm$json$Json$Encode$string(value)) ])); + default: + var fieldName = comparison.a; + return $elm$json$Json$Encode$object( + _List_fromArray( + [ + _Utils_Tuple2( + 'type', + $elm$json$Json$Encode$string('EqualsField')), + _Utils_Tuple2( + 'value', + $elm$json$Json$Encode$string(fieldName)) + ])); } }; var $author$project$Main$encodeCondition = function (condition) { @@ -11726,7 +6663,7 @@ var $author$project$Main$encodeCondition = function (condition) { ])); }; var $author$project$Main$encodeVisibilityRule = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11770,12 +6707,12 @@ var $author$project$Main$encodeFormFields = function (formFields) { [ _Utils_Tuple2( 'label', - $elm$json$Json$Encode$string(formField.label)), + $elm$json$Json$Encode$string(formField.d)), _Utils_Tuple2( 'name', function () { - var _v0 = formField.name; - if (_v0.$ === 'Just') { + var _v0 = formField.Q; + if (!_v0.$) { var name = _v0.a; return $elm$json$Json$Encode$string(name); } else { @@ -11784,22 +6721,22 @@ var $author$project$Main$encodeFormFields = function (formFields) { }()), _Utils_Tuple2( 'presence', - $author$project$Main$encodePresence(formField.presence)), + $author$project$Main$encodePresence(formField.w)), _Utils_Tuple2( 'description', - A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$string, formField.description)), + A2($author$project$Main$encodeAttributeOptional, $elm$json$Json$Encode$string, formField.S)), _Utils_Tuple2( 'type', - $author$project$Main$encodeInputField(formField.type_)), + $author$project$Main$encodeInputField(formField.a)), _Utils_Tuple2( 'visibilityRule', - A2($elm$json$Json$Encode$list, $author$project$Main$encodeVisibilityRule, formField.visibilityRule)) + A2($elm$json$Json$Encode$list, $author$project$Main$encodeVisibilityRule, formField.m)) ]))); }, $elm$core$Array$toList(formFields))); }; var $author$project$Main$encodePortOutgoingValue = function (value) { - if (value.$ === 'PortOutgoingFormFields') { + if (!value.$) { var formFields = value.a; return $elm$json$Json$Encode$object( _List_fromArray( @@ -11824,7 +6761,7 @@ var $author$project$Main$encodePortOutgoingValue = function (value) { } }; var $author$project$Main$fieldNameOf = function (formField) { - return A2($elm$core$Maybe$withDefault, formField.label, formField.name); + return A2($elm$core$Maybe$withDefault, formField.d, formField.Q); }; var $elm$core$Array$filter = F2( function (isGood, array) { @@ -11870,14 +6807,14 @@ var $elm$core$List$member = F2( }); var $author$project$Main$filterValuesByFieldChoices = F2( function (field, values) { - var _v0 = field.type_; + var _v0 = field.a; switch (_v0.$) { - case 'Dropdown': - var choices = _v0.a.choices; + case 2: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11886,12 +6823,12 @@ var $author$project$Main$filterValuesByFieldChoices = F2( return A2($elm$core$List$member, value, validChoiceValues); }, values); - case 'ChooseOne': - var choices = _v0.a.choices; + case 3: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11900,12 +6837,12 @@ var $author$project$Main$filterValuesByFieldChoices = F2( return A2($elm$core$List$member, value, validChoiceValues); }, values); - case 'ChooseMultiple': - var choices = _v0.a.choices; + case 4: + var choices = _v0.a.k; var validChoiceValues = A2( $elm$core$List$map, function ($) { - return $.value; + return $.j; }, choices); return A2( @@ -11922,27 +6859,38 @@ var $elm$core$Array$isEmpty = function (_v0) { var len = _v0.a; return !len; }; +var $elm$core$List$isEmpty = function (xs) { + if (!xs.b) { + return true; + } else { + return false; + } +}; var $author$project$Main$isUsingFilter = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'ChooseMultiple': - var filter = _v0.a.filter; + case 4: + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseOne': - var filter = _v0.a.filter; + case 3: + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); default: - var filter = _v0.a.filter; + var filter = _v0.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); } }; +var $elm$core$Array$length = function (_v0) { + var len = _v0.a; + return len; +}; var $elm$core$Maybe$map = F2( function (f, maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { var value = maybe.a; return $elm$core$Maybe$Just( f(value)); @@ -11951,7 +6899,7 @@ var $elm$core$Maybe$map = F2( } }); var $elm$core$Result$toMaybe = function (result) { - if (result.$ === 'Ok') { + if (!result.$) { var v = result.a; return $elm$core$Maybe$Just(v); } else { @@ -11969,19 +6917,21 @@ var $author$project$Main$maybeDecode = F3( A2($elm_community$json_extra$Json$Decode$Extra$optionalField, key, decoder), jsonValue))); }); +var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); +var $elm$core$Basics$not = _Basics_not; var $author$project$Main$outgoing = _Platform_outgoingPort('outgoing', $elm$core$Basics$identity); var $author$project$Main$init = function (flags) { var defaultShortTextTypeList = _List_fromArray( [ $author$project$Main$fromRawCustomElement( { - attributes: $elm$core$Dict$fromList( + p: $elm$core$Dict$fromList( _List_fromArray( [ _Utils_Tuple2('type', 'text') ])), - inputTag: $author$project$Main$defaultInputTag, - inputType: 'Single-line free text' + N: $author$project$Main$defaultInputTag, + B: 'Single-line free text' }) ]); var defaultShortTextTypeListWithout = function (shortTextTypeList) { @@ -11993,7 +6943,7 @@ var $author$project$Main$init = function (flags) { defaultShortTextTypeList); }; var _v0 = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$decodeConfig, flags); - if (_v0.$ === 'Ok') { + if (!_v0.$) { var config = _v0.a; var initialTrackedFormValues = $elm$core$Dict$fromList( A2( @@ -12001,8 +6951,8 @@ var $author$project$Main$init = function (flags) { function (field) { var fieldName = $author$project$Main$fieldNameOf(field); var rawValues = function () { - var _v1 = field.type_; - if (_v1.$ === 'ChooseMultiple') { + var _v1 = field.a; + if (_v1.$ === 4) { return A2( $elm$core$Maybe$withDefault, _List_Nil, @@ -12010,7 +6960,7 @@ var $author$project$Main$init = function (flags) { $author$project$Main$maybeDecode, fieldName, $author$project$Main$decodeListOrSingleton($elm$json$Json$Decode$string), - config.formValues)); + config.a7)); } else { return A2( $elm$core$Maybe$withDefault, @@ -12018,95 +6968,99 @@ var $author$project$Main$init = function (flags) { A2( $elm$core$Maybe$map, $elm$core$List$singleton, - A3($author$project$Main$maybeDecode, fieldName, $elm$json$Json$Decode$string, config.formValues))); + A3($author$project$Main$maybeDecode, fieldName, $elm$json$Json$Decode$string, config.a7))); } }(); var filteredValues = A2($author$project$Main$filterValuesByFieldChoices, field, rawValues); return _Utils_Tuple2(fieldName, filteredValues); }, - $elm$core$Array$toList(config.formFields))); + $elm$core$Array$toList(config.g))); var effectiveShortTextTypeList = _Utils_ap( - defaultShortTextTypeListWithout(config.shortTextTypeList), - config.shortTextTypeList); + defaultShortTextTypeListWithout(config.al), + config.al); return _Utils_Tuple2( { - dragged: $elm$core$Maybe$Nothing, - formFields: config.formFields, - initError: $elm$core$Maybe$Nothing, - needsFormLogic: !$elm$core$Array$isEmpty( + q: $elm$core$Maybe$Nothing, + g: config.g, + aW: $elm$core$Maybe$Nothing, + _: !$elm$core$Array$isEmpty( A2( $elm$core$Array$filter, function (f) { - return $author$project$Main$isUsingFilter(f) || (!$elm$core$List$isEmpty(f.visibilityRule)); + return $author$project$Main$isUsingFilter(f) || (!$elm$core$List$isEmpty(f.m)); }, - config.formFields)), - nextQuestionNumber: $elm$core$Array$length(config.formFields) + 1, - selectedFieldIndex: $elm$core$Maybe$Nothing, - shortTextTypeDict: $elm$core$Dict$fromList( + config.g)), + aa: $elm$core$Array$length(config.g) + 1, + F: $elm$core$Maybe$Nothing, + ak: $elm$core$Dict$fromList( A2( $elm$core$List$map, function (customElement) { - return _Utils_Tuple2(customElement.inputType, customElement); + return _Utils_Tuple2(customElement.B, customElement); }, effectiveShortTextTypeList)), - shortTextTypeList: effectiveShortTextTypeList, - trackedFormValues: initialTrackedFormValues, - viewMode: config.viewMode + al: effectiveShortTextTypeList, + u: initialTrackedFormValues, + ac: config.ac }, $elm$core$Platform$Cmd$batch( _List_fromArray( [ $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( - $author$project$Main$PortOutgoingFormFields(config.formFields))) + $author$project$Main$PortOutgoingFormFields(config.g))) ]))); } else { var err = _v0.a; return _Utils_Tuple2( { - dragged: $elm$core$Maybe$Nothing, - formFields: $elm$core$Array$empty, - initError: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Nothing, + g: $elm$core$Array$empty, + aW: $elm$core$Maybe$Just( $elm$json$Json$Decode$errorToString(err)), - needsFormLogic: false, - nextQuestionNumber: 1, - selectedFieldIndex: $elm$core$Maybe$Nothing, - shortTextTypeDict: $elm$core$Dict$empty, - shortTextTypeList: _List_Nil, - trackedFormValues: $elm$core$Dict$empty, - viewMode: $author$project$Main$Editor( - {maybeAnimate: $elm$core$Maybe$Nothing}) + _: false, + aa: 1, + F: $elm$core$Maybe$Nothing, + ak: $elm$core$Dict$empty, + al: _List_Nil, + u: $elm$core$Dict$empty, + ac: $author$project$Main$Editor( + {aB: $elm$core$Maybe$Nothing}) }, $elm$core$Platform$Cmd$none); } }; var $author$project$Main$OnPortIncoming = function (a) { - return {$: 'OnPortIncoming', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$incoming = _Platform_incomingPort('incoming', $elm$json$Json$Decode$value); var $author$project$Main$subscriptions = function (_v0) { return $author$project$Main$incoming($author$project$Main$OnPortIncoming); }; -var $author$project$Main$AnimateYellowFade = {$: 'AnimateYellowFade'}; +var $author$project$Main$AnimateYellowFade = 0; var $author$project$Main$DoSleepDo = F2( function (a, b) { - return {$: 'DoSleepDo', a: a, b: b}; + return {$: 14, a: a, b: b}; }); var $author$project$Main$DragExisting = function (a) { - return {$: 'DragExisting', a: a}; + return {$: 0, a: a}; }; var $author$project$Main$DragNew = function (a) { - return {$: 'DragNew', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$Drop = function (a) { - return {$: 'Drop', a: a}; + return {$: 13, a: a}; }; var $author$project$Main$PortOutgoingFormValues = function (a) { - return {$: 'PortOutgoingFormValues', a: a}; + return {$: 1, a: a}; }; var $author$project$Main$SetEditorAnimate = function (a) { - return {$: 'SetEditorAnimate', a: a}; + return {$: 7, a: a}; }; +var $elm$core$Basics$always = F2( + function (a, _v0) { + return a; + }); var $author$project$Main$animateFadeDuration = 500; var $author$project$Main$decodePortIncomingValue = A2( $elm$json$Json$Decode$andThen, @@ -12127,7 +7081,7 @@ var $elm$json$Json$Encode$dict = F3( toValue(value), obj); }), - _Json_emptyObject(_Utils_Tuple0), + _Json_emptyObject(0), dictionary)); }); var $elm$core$List$head = function (list) { @@ -12139,16 +7093,22 @@ var $elm$core$List$head = function (list) { return $elm$core$Maybe$Nothing; } }; +var $elm$core$Elm$JsArray$foldl = _JsArray_foldl; var $elm$core$Elm$JsArray$indexedMap = _JsArray_indexedMap; +var $elm$core$Bitwise$shiftLeftBy = _Bitwise_shiftLeftBy; +var $elm$core$Bitwise$shiftRightZfBy = _Bitwise_shiftRightZfBy; +var $elm$core$Array$tailIndex = function (len) { + return (len >>> 5) << 5; +}; var $elm$core$Array$indexedMap = F2( function (func, _v0) { var len = _v0.a; var tree = _v0.c; var tail = _v0.d; var initialBuilder = { - nodeList: _List_Nil, - nodeListSize: 0, - tail: A3( + y: _List_Nil, + s: 0, + x: A3( $elm$core$Elm$JsArray$indexedMap, func, $elm$core$Array$tailIndex(len), @@ -12156,18 +7116,18 @@ var $elm$core$Array$indexedMap = F2( }; var helper = F2( function (node, builder) { - if (node.$ === 'SubTree') { + if (!node.$) { var subTree = node.a; return A3($elm$core$Elm$JsArray$foldl, helper, builder, subTree); } else { var leaf = node.a; - var offset = builder.nodeListSize * $elm$core$Array$branchFactor; + var offset = builder.s * $elm$core$Array$branchFactor; var mappedLeaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$indexedMap, func, offset, leaf)); return { - nodeList: A2($elm$core$List$cons, mappedLeaf, builder.nodeList), - nodeListSize: builder.nodeListSize + 1, - tail: builder.tail + y: A2($elm$core$List$cons, mappedLeaf, builder.y), + s: builder.s + 1, + x: builder.x }; } }); @@ -12178,18 +7138,80 @@ var $elm$core$Array$indexedMap = F2( }); var $author$project$Main$mustBeOptional = function (inputField) { switch (inputField.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'Dropdown': + case 2: return false; - case 'ChooseOne': + case 3: return false; default: return true; } }; +var $elm$core$Bitwise$and = _Bitwise_and; +var $elm$core$Array$bitMask = 4294967295 >>> (32 - $elm$core$Array$shiftStep); +var $elm$core$Basics$ge = _Utils_ge; +var $elm$core$Elm$JsArray$unsafeGet = _JsArray_unsafeGet; +var $elm$core$Array$getHelp = F3( + function (shift, index, tree) { + getHelp: + while (true) { + var pos = $elm$core$Array$bitMask & (index >>> shift); + var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); + if (!_v0.$) { + var subTree = _v0.a; + var $temp$shift = shift - $elm$core$Array$shiftStep, + $temp$index = index, + $temp$tree = subTree; + shift = $temp$shift; + index = $temp$index; + tree = $temp$tree; + continue getHelp; + } else { + var values = _v0.a; + return A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, values); + } + } + }); +var $elm$core$Array$get = F2( + function (index, _v0) { + var len = _v0.a; + var startShift = _v0.b; + var tree = _v0.c; + var tail = _v0.d; + return ((index < 0) || (_Utils_cmp(index, len) > -1)) ? $elm$core$Maybe$Nothing : ((_Utils_cmp( + index, + $elm$core$Array$tailIndex(len)) > -1) ? $elm$core$Maybe$Just( + A2($elm$core$Elm$JsArray$unsafeGet, $elm$core$Array$bitMask & index, tail)) : $elm$core$Maybe$Just( + A3($elm$core$Array$getHelp, startShift, index, tree))); + }); +var $elm$core$Tuple$second = function (_v0) { + var y = _v0.b; + return y; +}; +var $elm$core$List$drop = F2( + function (n, list) { + drop: + while (true) { + if (n <= 0) { + return list; + } else { + if (!list.b) { + return list; + } else { + var x = list.a; + var xs = list.b; + var $temp$n = n - 1, + $temp$list = xs; + n = $temp$n; + list = $temp$list; + continue drop; + } + } + } + }); var $elm$core$List$takeReverse = F3( function (n, list, kept) { takeReverse: @@ -12324,32 +7346,32 @@ var $elm_community$list_extra$List$Extra$splitAt = F2( }); var $author$project$Main$onDropped = F2( function (targetIndex, model) { - var _v0 = model.dragged; - if (_v0.$ === 'Just') { - if (_v0.a.$ === 'DragExisting') { - var dragIndex = _v0.a.a.dragIndex; - var dropIndex = _v0.a.a.dropIndex; - if (targetIndex.$ === 'Nothing') { + var _v0 = model.q; + if (!_v0.$) { + if (!_v0.a.$) { + var dragIndex = _v0.a.a.a6; + var dropIndex = _v0.a.a.G; + if (targetIndex.$ === 1) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var index = targetIndex.a; - if (dropIndex.$ === 'Just') { + if (!dropIndex.$) { var _v3 = dropIndex.a; var dropTargetIndex = _v3.a; if (_Utils_eq(dragIndex, index) || (!_Utils_eq(index, dropTargetIndex))) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var newFormFields = $elm$core$Array$fromList( function (list) { - var draggedField = A2($elm$core$Array$get, dragIndex, model.formFields); + var draggedField = A2($elm$core$Array$get, dragIndex, model.g); var _v5 = A2($elm_community$list_extra$List$Extra$splitAt, index, list); var before = _v5.a; var after = _v5.b; - if (draggedField.$ === 'Just') { + if (!draggedField.$) { var field = draggedField.a; return $elm$core$List$concat( _List_fromArray( @@ -12375,33 +7397,33 @@ var $author$project$Main$onDropped = F2( A2( $elm$core$List$indexedMap, $elm$core$Tuple$pair, - $elm$core$Array$toList(model.formFields)))))); + $elm$core$Array$toList(model.g)))))); return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing, formFields: newFormFields}); + {q: $elm$core$Maybe$Nothing, g: newFormFields}); } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } } } else { - var field = _v0.a.a.field; - var dropIndex = _v0.a.a.dropIndex; - if (targetIndex.$ === 'Nothing') { + var field = _v0.a.a.bU; + var dropIndex = _v0.a.a.G; + if (targetIndex.$ === 1) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var index = targetIndex.a; - if (dropIndex.$ === 'Just') { + if (!dropIndex.$) { var _v9 = dropIndex.a; var dropTargetIndex = _v9.a; if (!_Utils_eq(index, dropTargetIndex)) { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } else { var newFormFields = $elm$core$Array$fromList( function (list) { @@ -12412,35 +7434,114 @@ var $author$project$Main$onDropped = F2( before, A2($elm$core$List$cons, field, after)); }( - $elm$core$Array$toList(model.formFields))); + $elm$core$Array$toList(model.g))); return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing, formFields: newFormFields, nextQuestionNumber: model.nextQuestionNumber + 1}); + {q: $elm$core$Maybe$Nothing, g: newFormFields, aa: model.aa + 1}); } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); } } } } else { return _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}); + {q: $elm$core$Maybe$Nothing}); + } + }); +var $elm$core$Elm$JsArray$push = _JsArray_push; +var $elm$core$Elm$JsArray$singleton = _JsArray_singleton; +var $elm$core$Elm$JsArray$unsafeSet = _JsArray_unsafeSet; +var $elm$core$Array$insertTailInTree = F4( + function (shift, index, tail, tree) { + var pos = $elm$core$Array$bitMask & (index >>> shift); + if (_Utils_cmp( + pos, + $elm$core$Elm$JsArray$length(tree)) > -1) { + if (shift === 5) { + return A2( + $elm$core$Elm$JsArray$push, + $elm$core$Array$Leaf(tail), + tree); + } else { + var newSub = $elm$core$Array$SubTree( + A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, $elm$core$Elm$JsArray$empty)); + return A2($elm$core$Elm$JsArray$push, newSub, tree); + } + } else { + var value = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); + if (!value.$) { + var subTree = value.a; + var newSub = $elm$core$Array$SubTree( + A4($elm$core$Array$insertTailInTree, shift - $elm$core$Array$shiftStep, index, tail, subTree)); + return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); + } else { + var newSub = $elm$core$Array$SubTree( + A4( + $elm$core$Array$insertTailInTree, + shift - $elm$core$Array$shiftStep, + index, + tail, + $elm$core$Elm$JsArray$singleton(value))); + return A3($elm$core$Elm$JsArray$unsafeSet, pos, newSub, tree); + } + } + }); +var $elm$core$Array$unsafeReplaceTail = F2( + function (newTail, _v0) { + var len = _v0.a; + var startShift = _v0.b; + var tree = _v0.c; + var tail = _v0.d; + var originalTailLen = $elm$core$Elm$JsArray$length(tail); + var newTailLen = $elm$core$Elm$JsArray$length(newTail); + var newArrayLen = len + (newTailLen - originalTailLen); + if (_Utils_eq(newTailLen, $elm$core$Array$branchFactor)) { + var overflow = _Utils_cmp(newArrayLen >>> $elm$core$Array$shiftStep, 1 << startShift) > 0; + if (overflow) { + var newShift = startShift + $elm$core$Array$shiftStep; + var newTree = A4( + $elm$core$Array$insertTailInTree, + newShift, + len, + newTail, + $elm$core$Elm$JsArray$singleton( + $elm$core$Array$SubTree(tree))); + return A4($elm$core$Array$Array_elm_builtin, newArrayLen, newShift, newTree, $elm$core$Elm$JsArray$empty); + } else { + return A4( + $elm$core$Array$Array_elm_builtin, + newArrayLen, + startShift, + A4($elm$core$Array$insertTailInTree, startShift, len, newTail, tree), + $elm$core$Elm$JsArray$empty); + } + } else { + return A4($elm$core$Array$Array_elm_builtin, newArrayLen, startShift, tree, newTail); } }); +var $elm$core$Array$push = F2( + function (a, array) { + var tail = array.d; + return A2( + $elm$core$Array$unsafeReplaceTail, + A2($elm$core$Elm$JsArray$push, a, tail), + array); + }); var $elm$core$Process$sleep = _Process_sleep; var $author$project$Main$stringFromInputField = function (inputField) { switch (inputField.$) { - case 'ShortText': - var inputType = inputField.a.inputType; + case 0: + var inputType = inputField.a.B; return inputType; - case 'LongText': + case 1: return 'Multi-line description'; - case 'Dropdown': + case 2: return 'Dropdown'; - case 'ChooseOne': + case 3: return 'Radio buttons'; default: return 'Checkboxes'; @@ -12450,7 +7551,7 @@ var $elm$core$Array$setHelp = F4( function (shift, index, value, tree) { var pos = $elm$core$Array$bitMask & (index >>> shift); var _v0 = A2($elm$core$Elm$JsArray$unsafeGet, pos, tree); - if (_v0.$ === 'SubTree') { + if (!_v0.$) { var subTree = _v0.a; var newSub = A4($elm$core$Array$setHelp, shift - $elm$core$Array$shiftStep, index, value, subTree); return A3( @@ -12493,7 +7594,7 @@ var $author$project$Main$swapArrayIndex = F3( var maybeJ = A2($elm$core$Array$get, j, arr); var maybeI = A2($elm$core$Array$get, i, arr); var _v0 = _Utils_Tuple2(maybeI, maybeJ); - if ((_v0.a.$ === 'Just') && (_v0.b.$ === 'Just')) { + if ((!_v0.a.$) && (!_v0.b.$)) { var iVal = _v0.a.a; var jVal = _v0.b.a; return A3( @@ -12526,42 +7627,42 @@ var $elm$core$Array$toIndexedList = function (array) { }; var $author$project$Main$updateDragged = F2( function (maybeDroppable, dragged) { - if (maybeDroppable.$ === 'Nothing') { + if (maybeDroppable.$ === 1) { return dragged; } else { var _v1 = maybeDroppable.a; var targetField = _v1.b; - if (dragged.$ === 'DragExisting') { + if (!dragged.$) { var details = dragged.a; - var _v3 = details.dropIndex; - if (_v3.$ === 'Just') { + var _v3 = details.G; + if (!_v3.$) { var _v4 = _v3.a; var existingField = _v4.b; return _Utils_eq(existingField, targetField) ? dragged : $author$project$Main$DragExisting( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } else { return $author$project$Main$DragExisting( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } } else { var details = dragged.a; - var _v5 = details.dropIndex; - if (_v5.$ === 'Just') { + var _v5 = details.G; + if (!_v5.$) { var _v6 = _v5.a; var existingField = _v6.b; return _Utils_eq(existingField, targetField) ? dragged : $author$project$Main$DragNew( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } else { return $author$project$Main$DragNew( _Utils_update( details, - {dropIndex: maybeDroppable})); + {G: maybeDroppable})); } } } @@ -12596,15 +7697,15 @@ var $elm_community$list_extra$List$Extra$removeAt = F2( var $author$project$Main$toggleAttributeOptional = F2( function (toggle, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': - if (attributeOptional.a.$ === 'Nothing') { + case 0: + if (attributeOptional.a.$ === 1) { var _v1 = attributeOptional.a; return toggle ? $author$project$Main$AttributeInvalid('') : attributeOptional; } else { var a = attributeOptional.a.a; return toggle ? $author$project$Main$AttributeGiven(a) : attributeOptional; } - case 'AttributeInvalid': + case 1: return toggle ? attributeOptional : $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing); default: var a = attributeOptional.a; @@ -12617,13 +7718,16 @@ var $author$project$Main$updateComparison = F2( switch (comparisonType) { case 'Equals': switch (comparison.$) { - case 'Equals': + case 0: + var str = comparison.a; + return $author$project$Main$Equals(str); + case 1: var str = comparison.a; return $author$project$Main$Equals(str); - case 'StringContains': + case 2: var str = comparison.a; return $author$project$Main$Equals(str); - case 'EndsWith': + case 3: var str = comparison.a; return $author$project$Main$Equals(str); default: @@ -12632,13 +7736,16 @@ var $author$project$Main$updateComparison = F2( } case 'StringContains': switch (comparison.$) { - case 'Equals': + case 0: var str = comparison.a; return $author$project$Main$StringContains(str); - case 'StringContains': + case 1: var str = comparison.a; return $author$project$Main$StringContains(str); - case 'EndsWith': + case 2: + var str = comparison.a; + return $author$project$Main$StringContains(str); + case 3: var str = comparison.a; return $author$project$Main$StringContains(str); default: @@ -12647,13 +7754,16 @@ var $author$project$Main$updateComparison = F2( } case 'EndsWith': switch (comparison.$) { - case 'Equals': + case 0: + var str = comparison.a; + return $author$project$Main$EndsWith(str); + case 1: var str = comparison.a; return $author$project$Main$EndsWith(str); - case 'StringContains': + case 2: var str = comparison.a; return $author$project$Main$EndsWith(str); - case 'EndsWith': + case 3: var str = comparison.a; return $author$project$Main$EndsWith(str); default: @@ -12662,19 +7772,40 @@ var $author$project$Main$updateComparison = F2( } case 'GreaterThan': switch (comparison.$) { - case 'Equals': + case 0: var str = comparison.a; return $author$project$Main$GreaterThan(str); - case 'StringContains': + case 1: var str = comparison.a; return $author$project$Main$GreaterThan(str); - case 'EndsWith': + case 2: + var str = comparison.a; + return $author$project$Main$GreaterThan(str); + case 3: var str = comparison.a; return $author$project$Main$GreaterThan(str); default: var str = comparison.a; return $author$project$Main$GreaterThan(str); } + case 'EqualsField': + switch (comparison.$) { + case 0: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 1: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 2: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + case 3: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + default: + var str = comparison.a; + return $author$project$Main$EqualsField(str); + } default: return comparison; } @@ -12691,14 +7822,16 @@ var $author$project$Main$updateComparisonInCondition = F2( var $author$project$Main$updateComparisonValue = F2( function (newValue, comparison) { switch (comparison.$) { - case 'Equals': + case 0: return $author$project$Main$Equals(newValue); - case 'StringContains': + case 1: return $author$project$Main$StringContains(newValue); - case 'EndsWith': + case 2: return $author$project$Main$EndsWith(newValue); - default: + case 3: return $author$project$Main$GreaterThan(newValue); + default: + return $author$project$Main$EqualsField(newValue); } }); var $author$project$Main$updateConditions = F3( @@ -12713,7 +7846,7 @@ var $author$project$Main$updateConditions = F3( }); var $author$project$Main$updateConditionsInRule = F2( function (updater, rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $author$project$Main$ShowWhen( updater(conditions)); @@ -12743,7 +7876,7 @@ var $author$project$Main$updateVisibilityRuleAt = F3( rules); }); var $author$project$Main$visibilityRuleCondition = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return conditions; } else { @@ -12754,43 +7887,43 @@ var $author$project$Main$visibilityRuleCondition = function (rule) { var $author$project$Main$updateFormField = F5( function (msg, fieldIndex, string, formFields, formField) { switch (msg.$) { - case 'OnLabelInput': + case 0: return _Utils_update( formField, - {label: string}); - case 'OnDescriptionInput': + {d: string}); + case 1: return (string === '') ? _Utils_update( formField, { - description: $author$project$Main$AttributeInvalid('') + S: $author$project$Main$AttributeInvalid('') }) : _Utils_update( formField, { - description: $author$project$Main$AttributeGiven(string) + S: $author$project$Main$AttributeGiven(string) }); - case 'OnDescriptionToggle': + case 2: var bool = msg.a; return _Utils_update( formField, { - description: A2($author$project$Main$toggleAttributeOptional, bool, formField.description) + S: A2($author$project$Main$toggleAttributeOptional, bool, formField.S) }); - case 'OnRequiredInput': + case 3: var bool = msg.a; return bool ? _Utils_update( formField, - {presence: $author$project$Main$Required}) : _Utils_update( + {w: 0}) : _Utils_update( formField, - {presence: $author$project$Main$Optional}); - case 'OnCheckboxMinRequiredInput': + {w: 1}); + case 16: var minStr = msg.a; - var _v1 = formField.type_; - if (_v1.$ === 'ChooseMultiple') { + var _v1 = formField.a; + if (_v1.$ === 4) { var settings = _v1.a; var newMinRequired = $elm$core$String$isEmpty(minStr) ? $elm$core$Maybe$Nothing : $elm$core$String$toInt(minStr); var adjustedMinRequired = function () { - var _v3 = _Utils_Tuple2(newMinRequired, settings.maxAllowed); - if ((_v3.a.$ === 'Just') && (_v3.b.$ === 'Just')) { + var _v3 = _Utils_Tuple2(newMinRequired, settings.T); + if ((!_v3.a.$) && (!_v3.b.$)) { var min = _v3.a.a; var max = _v3.b.a; return (_Utils_cmp(min, max) > 0) ? $elm$core$Maybe$Just(max) : $elm$core$Maybe$Just(min); @@ -12800,12 +7933,12 @@ var $author$project$Main$updateFormField = F5( } }(); var finalMinRequired = function () { - if (adjustedMinRequired.$ === 'Just') { + if (!adjustedMinRequired.$) { var min = adjustedMinRequired.a; return (_Utils_cmp( min, - $elm$core$List$length(settings.choices)) > 0) ? $elm$core$Maybe$Just( - $elm$core$List$length(settings.choices)) : $elm$core$Maybe$Just(min); + $elm$core$List$length(settings.k)) > 0) ? $elm$core$Maybe$Just( + $elm$core$List$length(settings.k)) : $elm$core$Maybe$Just(min); } else { return $elm$core$Maybe$Nothing; } @@ -12813,23 +7946,23 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {minRequired: finalMinRequired})) + {P: finalMinRequired})) }); } else { return formField; } - case 'OnCheckboxMaxAllowedInput': + case 17: var maxStr = msg.a; - var _v4 = formField.type_; - if (_v4.$ === 'ChooseMultiple') { + var _v4 = formField.a; + if (_v4.$ === 4) { var settings = _v4.a; var newMaxAllowed = $elm$core$String$isEmpty(maxStr) ? $elm$core$Maybe$Nothing : $elm$core$String$toInt(maxStr); var adjustedMaxAllowed = function () { - var _v6 = _Utils_Tuple2(newMaxAllowed, settings.minRequired); - if ((_v6.a.$ === 'Just') && (_v6.b.$ === 'Just')) { + var _v6 = _Utils_Tuple2(newMaxAllowed, settings.P); + if ((!_v6.a.$) && (!_v6.b.$)) { var max = _v6.a.a; var min = _v6.b.a; return (_Utils_cmp(max, min) < 0) ? $elm$core$Maybe$Just(min) : $elm$core$Maybe$Just(max); @@ -12839,12 +7972,12 @@ var $author$project$Main$updateFormField = F5( } }(); var finalMaxAllowed = function () { - if (adjustedMaxAllowed.$ === 'Just') { + if (!adjustedMaxAllowed.$) { var max = adjustedMaxAllowed.a; return (_Utils_cmp( max, - $elm$core$List$length(settings.choices)) > 0) ? $elm$core$Maybe$Just( - $elm$core$List$length(settings.choices)) : $elm$core$Maybe$Just(max); + $elm$core$List$length(settings.k)) > 0) ? $elm$core$Maybe$Just( + $elm$core$List$length(settings.k)) : $elm$core$Maybe$Just(max); } else { return $elm$core$Maybe$Nothing; } @@ -12852,82 +7985,82 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {maxAllowed: finalMaxAllowed})) + {T: finalMaxAllowed})) }); } else { return formField; } - case 'OnDateMinInput': + case 20: var minStr = msg.a; - var _v7 = formField.type_; - if (_v7.$ === 'ShortText') { + var _v7 = formField.a; + if (!_v7.$) { var customElement = _v7.a; var newCustomElement = _Utils_update( customElement, { - min: $elm$core$String$isEmpty(minStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(minStr) + ar: $elm$core$String$isEmpty(minStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(minStr) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDateMaxInput': + case 21: var maxStr = msg.a; - var _v8 = formField.type_; - if (_v8.$ === 'ShortText') { + var _v8 = formField.a; + if (!_v8.$) { var customElement = _v8.a; var newCustomElement = _Utils_update( customElement, { - max: $elm$core$String$isEmpty(maxStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(maxStr) + aq: $elm$core$String$isEmpty(maxStr) ? $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing) : $author$project$Main$AttributeGiven(maxStr) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnChoicesInput': - var _v9 = formField.type_; + case 4: + var _v9 = formField.a; switch (_v9.$) { - case 'ShortText': + case 0: return formField; - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: var settings = _v9.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, $elm$core$String$lines(string)) })) }); - case 'ChooseOne': + case 3: var settings = _v9.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, $elm$core$String$lines(string)) @@ -12941,8 +8074,8 @@ var $author$project$Main$updateFormField = F5( $elm$core$String$lines(string)); var newChoicesCount = $elm$core$List$length(newChoices); var newMaxAllowed = function () { - var _v11 = settings.maxAllowed; - if (_v11.$ === 'Just') { + var _v11 = settings.T; + if (!_v11.$) { var max = _v11.a; return (_Utils_cmp(max, newChoicesCount) > 0) ? ((newChoicesCount > 0) ? $elm$core$Maybe$Just(newChoicesCount) : $elm$core$Maybe$Nothing) : $elm$core$Maybe$Just(max); } else { @@ -12950,8 +8083,8 @@ var $author$project$Main$updateFormField = F5( } }(); var newMinRequired = function () { - var _v10 = settings.minRequired; - if (_v10.$ === 'Just') { + var _v10 = settings.P; + if (!_v10.$) { var min = _v10.a; return (_Utils_cmp(min, newChoicesCount) > 0) ? ((newChoicesCount > 0) ? $elm$core$Maybe$Just(newChoicesCount) : $elm$core$Maybe$Nothing) : $elm$core$Maybe$Just(min); } else { @@ -12961,79 +8094,79 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {choices: newChoices, maxAllowed: newMaxAllowed, minRequired: newMinRequired})) + {k: newChoices, T: newMaxAllowed, P: newMinRequired})) }); } - case 'OnMultipleToggle': + case 5: var bool = msg.a; - var _v12 = formField.type_; + var _v12 = formField.a; switch (_v12.$) { - case 'ShortText': + case 0: var customElement = _v12.a; var newCustomElement = _Utils_update( customElement, { - multiple: $author$project$Main$AttributeGiven(bool) + aM: $author$project$Main$AttributeGiven(bool) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnMaxLengthToggle': + case 6: var bool = msg.a; - var _v13 = formField.type_; + var _v13 = formField.a; switch (_v13.$) { - case 'ShortText': + case 0: var customElement = _v13.a; var newCustomElement = _Utils_update( customElement, { - maxlength: A2($author$project$Main$toggleAttributeOptional, bool, customElement.maxlength) + ah: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ah) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: var maxlength = _v13.a; return _Utils_update( formField, { - type_: $author$project$Main$LongText( + a: $author$project$Main$LongText( A2($author$project$Main$toggleAttributeOptional, bool, maxlength)) }); - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnMaxLengthInput': - var _v14 = formField.type_; + case 7: + var _v14 = formField.a; switch (_v14.$) { - case 'ShortText': + case 0: var customElement = _v14.a; var newCustomElement = _Utils_update( customElement, { - maxlength: function () { + ah: function () { var _v15 = $elm$core$String$toInt(string); - if (_v15.$ === 'Just') { + if (!_v15.$) { var i = _v15.a; return $author$project$Main$AttributeGiven(i); } else { @@ -13044,12 +8177,12 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: var newMaxlength = function () { var _v16 = $elm$core$String$toInt(string); - if (_v16.$ === 'Just') { + if (!_v16.$) { var i = _v16.a; return $author$project$Main$AttributeGiven(i); } else { @@ -13059,85 +8192,85 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$LongText(newMaxlength) + a: $author$project$Main$LongText(newMaxlength) }); - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnDateMinToggle': + case 18: var bool = msg.a; - var _v17 = formField.type_; - if (_v17.$ === 'ShortText') { + var _v17 = formField.a; + if (!_v17.$) { var customElement = _v17.a; var newCustomElement = _Utils_update( customElement, { - min: A2($author$project$Main$toggleAttributeOptional, bool, customElement.min) + ar: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ar) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDateMaxToggle': + case 19: var bool = msg.a; - var _v18 = formField.type_; - if (_v18.$ === 'ShortText') { + var _v18 = formField.a; + if (!_v18.$) { var customElement = _v18.a; var newCustomElement = _Utils_update( customElement, { - max: A2($author$project$Main$toggleAttributeOptional, bool, customElement.max) + aq: A2($author$project$Main$toggleAttributeOptional, bool, customElement.aq) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); } else { return formField; } - case 'OnDatalistToggle': + case 8: var bool = msg.a; - var _v19 = formField.type_; + var _v19 = formField.a; switch (_v19.$) { - case 'ShortText': + case 0: var customElement = _v19.a; var newCustomElement = _Utils_update( customElement, { - datalist: A2($author$project$Main$toggleAttributeOptional, bool, customElement.datalist) + ae: A2($author$project$Main$toggleAttributeOptional, bool, customElement.ae) }); return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnDatalistInput': - var _v20 = formField.type_; + case 9: + var _v20 = formField.a; switch (_v20.$) { - case 'ShortText': + case 0: var customElement = _v20.a; var newCustomElement = _Utils_update( customElement, { - datalist: function () { + ae: function () { var _v21 = A2($elm$core$String$split, '\n', string); if (!_v21.b) { return $author$project$Main$AttributeInvalid(string); @@ -13151,24 +8284,24 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - type_: $author$project$Main$ShortText(newCustomElement) + a: $author$project$Main$ShortText(newCustomElement) }); - case 'LongText': + case 1: return formField; - case 'Dropdown': + case 2: return formField; - case 'ChooseOne': + case 3: return formField; default: return formField; } - case 'OnVisibilityRuleTypeInput': + case 10: if (msg.b === '\n') { var ruleIndex = msg.a; return _Utils_update( formField, { - visibilityRule: A2($elm_community$list_extra$List$Extra$removeAt, ruleIndex, formField.visibilityRule) + m: A2($elm_community$list_extra$List$Extra$removeAt, ruleIndex, formField.m) }); } else { var ruleIndex = msg.a; @@ -13176,7 +8309,7 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, function (rule) { @@ -13191,17 +8324,17 @@ var $author$project$Main$updateFormField = F5( return rule; } }, - formField.visibilityRule) + formField.m) }); } - case 'OnVisibilityConditionTypeInput': + case 11: var ruleIndex = msg.a; var conditionIndex = msg.b; var str = msg.c; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13210,21 +8343,21 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateComparisonInCondition( $author$project$Main$updateComparison(str)))), - formField.visibilityRule) + formField.m) }); - case 'OnVisibilityConditionFieldInput': + case 12: if (msg.c === '\n') { var ruleIndex = msg.a; var conditionIndex = msg.b; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( $elm_community$list_extra$List$Extra$removeAt(conditionIndex)), - formField.visibilityRule) + formField.m) }); } else { var ruleIndex = msg.a; @@ -13233,7 +8366,7 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13242,17 +8375,17 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateFieldnameInCondition( $elm$core$Basics$always(newFieldName)))), - formField.visibilityRule) + formField.m) }); } - case 'OnVisibilityConditionValueInput': + case 13: var ruleIndex = msg.a; var conditionIndex = msg.b; var newValue = msg.c; return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, $author$project$Main$updateConditionsInRule( @@ -13261,14 +8394,14 @@ var $author$project$Main$updateFormField = F5( conditionIndex, $author$project$Main$updateComparisonInCondition( $author$project$Main$updateComparisonValue(newValue)))), - formField.visibilityRule) + formField.m) }); - case 'OnAddVisibilityRule': + case 14: return _Utils_update( formField, { - visibilityRule: _Utils_ap( - formField.visibilityRule, + m: _Utils_ap( + formField.m, _List_fromArray( [ $author$project$Main$ShowWhen( @@ -13281,7 +8414,7 @@ var $author$project$Main$updateFormField = F5( ])) ])) }); - case 'OnVisibilityConditionDuplicate': + case 15: var ruleIndex = msg.a; var newCondition = function (conditions) { var _v24 = $elm$core$List$reverse(conditions); @@ -13301,11 +8434,11 @@ var $author$project$Main$updateFormField = F5( return _Utils_update( formField, { - visibilityRule: A3( + m: A3( $author$project$Main$updateVisibilityRuleAt, ruleIndex, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return $author$project$Main$ShowWhen( _Utils_ap( @@ -13325,56 +8458,56 @@ var $author$project$Main$updateFormField = F5( ]))); } }, - formField.visibilityRule) + formField.m) }); - case 'OnFilterToggle': + case 22: var checked = msg.a; - var _v25 = formField.type_; + var _v25 = formField.a; switch (_v25.$) { - case 'Dropdown': + case 2: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); - case 'ChooseOne': + case 3: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); - case 'ChooseMultiple': + case 4: var settings = _v25.a; var newFilter = checked ? $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf('')) : $elm$core$Maybe$Nothing; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, - {filter: newFilter})) + {e: newFilter})) }); default: return formField; } - case 'OnFilterTypeSelect': + case 23: var filterType = msg.a; var updateFilter = function (existingFilter) { - if (existingFilter.$ === 'Just') { - if (existingFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!existingFilter.$) { + if (!existingFilter.a.$) { var fieldName = existingFilter.a.a; return (filterType === 'contains') ? $elm$core$Maybe$Just( $author$project$Main$FilterContainsFieldValueOf(fieldName)) : existingFilter; @@ -13389,42 +8522,42 @@ var $author$project$Main$updateFormField = F5( $author$project$Main$FilterContainsFieldValueOf('')) : $elm$core$Maybe$Nothing); } }; - var _v26 = formField.type_; + var _v26 = formField.a; switch (_v26.$) { - case 'Dropdown': + case 2: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); - case 'ChooseOne': + case 3: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); - case 'ChooseMultiple': + case 4: var settings = _v26.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, { - filter: updateFilter(settings.filter) + e: updateFilter(settings.e) })) }); default: @@ -13433,8 +8566,8 @@ var $author$project$Main$updateFormField = F5( default: var fieldName = msg.a; var updateSourceField = function (existingFilter) { - if (existingFilter.$ === 'Just') { - if (existingFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!existingFilter.$) { + if (!existingFilter.a.$) { return $elm$core$Maybe$Just( $author$project$Main$FilterStartsWithFieldValueOf(fieldName)); } else { @@ -13446,42 +8579,42 @@ var $author$project$Main$updateFormField = F5( $author$project$Main$FilterStartsWithFieldValueOf(fieldName)); } }; - var _v28 = formField.type_; + var _v28 = formField.a; switch (_v28.$) { - case 'Dropdown': + case 2: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$Dropdown( + a: $author$project$Main$Dropdown( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); - case 'ChooseOne': + case 3: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseOne( + a: $author$project$Main$ChooseOne( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); - case 'ChooseMultiple': + case 4: var settings = _v28.a; return _Utils_update( formField, { - type_: $author$project$Main$ChooseMultiple( + a: $author$project$Main$ChooseMultiple( _Utils_update( settings, { - filter: updateSourceField(settings.filter) + e: updateSourceField(settings.e) })) }); default: @@ -13491,43 +8624,43 @@ var $author$project$Main$updateFormField = F5( }); var $author$project$Main$when = F2( function (bool, condition) { - return bool ? condition._true : condition._false; + return bool ? condition.a1 : condition.aV; }); var $author$project$Main$update = F2( function (msg, model) { update: while (true) { switch (msg.$) { - case 'NoOp': + case 0: return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'OnPortIncoming': + case 1: var value = msg.a; var _v1 = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$decodePortIncomingValue, value); - if (_v1.$ === 'Ok') { + if (!_v1.$) { var _v2 = _v1.a; return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'AddFormField': + case 2: var fieldType = msg.a; var newFormField = { - description: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), - label: $author$project$Main$stringFromInputField(fieldType) + (' question ' + $elm$core$String$fromInt(model.nextQuestionNumber)), - name: $elm$core$Maybe$Nothing, - presence: A2( + S: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), + d: $author$project$Main$stringFromInputField(fieldType) + (' question ' + $elm$core$String$fromInt(model.aa)), + Q: $elm$core$Maybe$Nothing, + w: A2( $author$project$Main$when, $author$project$Main$mustBeOptional(fieldType), - {_false: $author$project$Main$Required, _true: $author$project$Main$Optional}), - type_: fieldType, - visibilityRule: _List_Nil + {aV: 0, a1: 1}), + a: fieldType, + m: _List_Nil }; - var newFormFields = A2($elm$core$Array$push, newFormField, model.formFields); + var newFormFields = A2($elm$core$Array$push, newFormField, model.g); var newIndex = $elm$core$Array$length(newFormFields) - 1; return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields, nextQuestionNumber: model.nextQuestionNumber + 1}), + {g: newFormFields, aa: model.aa + 1}), $elm$core$Platform$Cmd$batch( _List_fromArray( [ @@ -13545,11 +8678,11 @@ var $author$project$Main$update = F2( [ $author$project$Main$SetEditorAnimate( $elm$core$Maybe$Just( - _Utils_Tuple2(newIndex, $author$project$Main$AnimateYellowFade))), + _Utils_Tuple2(newIndex, 0))), $author$project$Main$SetEditorAnimate($elm$core$Maybe$Nothing) ])))) ]))); - case 'DeleteFormField': + case 3: var fieldIndex = msg.a; var newFormFields = $elm$core$Array$fromList( A2( @@ -13561,41 +8694,41 @@ var $author$project$Main$update = F2( var i = _v3.a; return !_Utils_eq(i, fieldIndex); }, - $elm$core$Array$toIndexedList(model.formFields)))); + $elm$core$Array$toIndexedList(model.g)))); return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields, selectedFieldIndex: $elm$core$Maybe$Nothing}), + {g: newFormFields, F: $elm$core$Maybe$Nothing}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'MoveFormFieldUp': + case 4: var fieldIndex = msg.a; - var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex - 1, model.formFields); + var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex - 1, model.g); return _Utils_Tuple2( _Utils_update( model, { - formFields: newFormFields, - selectedFieldIndex: $elm$core$Maybe$Just(fieldIndex - 1) + g: newFormFields, + F: $elm$core$Maybe$Just(fieldIndex - 1) }), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'MoveFormFieldDown': + case 5: var fieldIndex = msg.a; - var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex + 1, model.formFields); + var newFormFields = A3($author$project$Main$swapArrayIndex, fieldIndex, fieldIndex + 1, model.g); return _Utils_Tuple2( _Utils_update( model, { - formFields: newFormFields, - selectedFieldIndex: $elm$core$Maybe$Just(fieldIndex + 1) + g: newFormFields, + F: $elm$core$Maybe$Just(fieldIndex + 1) }), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'OnFormField': + case 6: var fmsg = msg.a; var fieldIndex = msg.b; var string = msg.c; @@ -13603,41 +8736,41 @@ var $author$project$Main$update = F2( $elm$core$Array$indexedMap, F2( function (i, formField) { - return _Utils_eq(i, fieldIndex) ? A5($author$project$Main$updateFormField, fmsg, fieldIndex, string, model.formFields, formField) : formField; + return _Utils_eq(i, fieldIndex) ? A5($author$project$Main$updateFormField, fmsg, fieldIndex, string, model.g, formField) : formField; }), - model.formFields); + model.g); return _Utils_Tuple2( _Utils_update( model, - {formFields: newFormFields}), + {g: newFormFields}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormFields(newFormFields)))); - case 'SetEditorAnimate': + case 7: var maybeAnimate = msg.a; return _Utils_Tuple2( _Utils_update( model, { - viewMode: $author$project$Main$Editor( - {maybeAnimate: maybeAnimate}) + ac: $author$project$Main$Editor( + {aB: maybeAnimate}) }), $elm$core$Platform$Cmd$none); - case 'SelectField': + case 8: var fieldIndex = msg.a; - var _v4 = _Utils_Tuple2(model.selectedFieldIndex, fieldIndex); - if ((_v4.a.$ === 'Just') && (_v4.b.$ === 'Nothing')) { + var _v4 = _Utils_Tuple2(model.F, fieldIndex); + if ((!_v4.a.$) && (_v4.b.$ === 1)) { var prevIndex = _v4.a.a; var _v5 = _v4.b; return _Utils_Tuple2( _Utils_update( model, { - selectedFieldIndex: $elm$core$Maybe$Nothing, - viewMode: $author$project$Main$Editor( + F: $elm$core$Maybe$Nothing, + ac: $author$project$Main$Editor( { - maybeAnimate: $elm$core$Maybe$Just( - _Utils_Tuple2(prevIndex, $author$project$Main$AnimateYellowFade)) + aB: $elm$core$Maybe$Just( + _Utils_Tuple2(prevIndex, 0)) }) }), $elm$core$Platform$Cmd$none); @@ -13645,41 +8778,41 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {selectedFieldIndex: fieldIndex}), + {F: fieldIndex}), $elm$core$Platform$Cmd$none); } - case 'DragStart': + case 9: var fieldIndex = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Just( $author$project$Main$DragExisting( - {dragIndex: fieldIndex, dropIndex: $elm$core$Maybe$Nothing})), - selectedFieldIndex: $elm$core$Maybe$Nothing + {a6: fieldIndex, G: $elm$core$Maybe$Nothing})), + F: $elm$core$Maybe$Nothing }), $elm$core$Platform$Cmd$none); - case 'DragStartNew': + case 10: var fieldIndex = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: $elm$core$Maybe$Just( + q: $elm$core$Maybe$Just( $author$project$Main$DragNew( { - dropIndex: $elm$core$Maybe$Just( + G: $elm$core$Maybe$Just( _Utils_Tuple2(0, $elm$core$Maybe$Nothing)), - field: fieldIndex + bU: fieldIndex })) }), $elm$core$Platform$Cmd$none); - case 'DragEnd': - var _v6 = model.dragged; - if (_v6.$ === 'Just') { - if (_v6.a.$ === 'DragExisting') { - var dropIndex = _v6.a.a.dropIndex; + case 11: + var _v6 = model.q; + if (!_v6.$) { + if (!_v6.a.$) { + var dropIndex = _v6.a.a.G; var $temp$msg = $author$project$Main$Drop( A2($elm$core$Maybe$map, $elm$core$Tuple$first, dropIndex)), $temp$model = model; @@ -13687,7 +8820,7 @@ var $author$project$Main$update = F2( model = $temp$model; continue update; } else { - var dropIndex = _v6.a.a.dropIndex; + var dropIndex = _v6.a.a.G; var $temp$msg = $author$project$Main$Drop( A2($elm$core$Maybe$map, $elm$core$Tuple$first, dropIndex)), $temp$model = model; @@ -13699,30 +8832,30 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {dragged: $elm$core$Maybe$Nothing}), + {q: $elm$core$Maybe$Nothing}), $elm$core$Platform$Cmd$none); } - case 'DragOver': + case 12: var maybeDroppable = msg.a; return _Utils_Tuple2( _Utils_update( model, { - dragged: A2( + q: A2( $elm$core$Maybe$map, $author$project$Main$updateDragged(maybeDroppable), - model.dragged) + model.q) }), $elm$core$Platform$Cmd$none); - case 'Drop': + case 13: var targetFieldIndex = msg.a; var newModel = A2($author$project$Main$onDropped, targetFieldIndex, model); return _Utils_Tuple2( newModel, - (!_Utils_eq(newModel.formFields, model.formFields)) ? $author$project$Main$outgoing( + (!_Utils_eq(newModel.g, model.g)) ? $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( - $author$project$Main$PortOutgoingFormFields(newModel.formFields))) : $elm$core$Platform$Cmd$none); - case 'DoSleepDo': + $author$project$Main$PortOutgoingFormFields(newModel.g))) : $elm$core$Platform$Cmd$none); + case 14: if (!msg.b.b) { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } else { @@ -13757,16 +8890,16 @@ var $author$project$Main$update = F2( $author$project$Main$fieldNameOf(f), fieldName); }, - $elm$core$Array$toList(model.formFields))); + $elm$core$Array$toList(model.g))); var currentValues = A2( $elm$core$Maybe$withDefault, _List_Nil, - A2($elm$core$Dict$get, fieldName, model.trackedFormValues)); + A2($elm$core$Dict$get, fieldName, model.u)); var newValues = function () { - if (formField.$ === 'Just') { + if (!formField.$) { var field = formField.a; - var _v11 = field.type_; - if (_v11.$ === 'ChooseMultiple') { + var _v11 = field.a; + if (_v11.$ === 4) { return A2($elm$core$List$member, value, currentValues) ? A2( $elm$core$List$filter, $elm$core$Basics$neq(value), @@ -13780,7 +8913,7 @@ var $author$project$Main$update = F2( [value]); } }(); - var newTrackedFormValues = A3($elm$core$Dict$insert, fieldName, newValues, model.trackedFormValues); + var newTrackedFormValues = A3($elm$core$Dict$insert, fieldName, newValues, model.u); var formValues = A3( $elm$json$Json$Encode$dict, $elm$core$Basics$identity, @@ -13799,58 +8932,72 @@ var $author$project$Main$update = F2( return _Utils_Tuple2( _Utils_update( model, - {trackedFormValues: newTrackedFormValues}), + {u: newTrackedFormValues}), $author$project$Main$outgoing( $author$project$Main$encodePortOutgoingValue( $author$project$Main$PortOutgoingFormValues(formValues)))); } } }); +var $elm$html$Html$Attributes$stringProperty = F2( + function (key, string) { + return A2( + _VirtualDom_property, + key, + $elm$json$Json$Encode$string(string)); + }); +var $elm$html$Html$Attributes$class = $elm$html$Html$Attributes$stringProperty('className'); +var $elm$html$Html$div = _VirtualDom_node('div'); var $elm$html$Html$h3 = _VirtualDom_node('h3'); var $elm$html$Html$pre = _VirtualDom_node('pre'); +var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; +var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; +var $elm$html$Html$input = _VirtualDom_node('input'); var $elm$html$Html$Attributes$name = $elm$html$Html$Attributes$stringProperty('name'); var $author$project$Main$stringFromViewMode = function (viewMode) { - if (viewMode.$ === 'Editor') { + if (!viewMode.$) { return 'Editor'; } else { return 'CollectData'; } }; -var $author$project$Main$DragEnd = {$: 'DragEnd'}; -var $author$project$Main$NoOp = {$: 'NoOp'}; +var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); +var $elm$html$Html$Attributes$value = $elm$html$Html$Attributes$stringProperty('value'); +var $author$project$Main$DragEnd = {$: 11}; +var $author$project$Main$NoOp = {$: 0}; var $author$project$Main$SelectField = function (a) { - return {$: 'SelectField', a: a}; + return {$: 8, a: a}; }; var $author$project$Main$allInputField = _List_fromArray( [ $author$project$Main$Dropdown( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'])), - filter: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing }), $author$project$Main$ChooseOne( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Yes', 'No'])), - filter: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing }), $author$project$Main$ChooseMultiple( { - choices: A2( + k: A2( $elm$core$List$map, $author$project$Main$choiceFromString, _List_fromArray( ['Apple', 'Banana', 'Cantaloupe', 'Durian'])), - filter: $elm$core$Maybe$Nothing, - maxAllowed: $elm$core$Maybe$Nothing, - minRequired: $elm$core$Maybe$Nothing + e: $elm$core$Maybe$Nothing, + T: $elm$core$Maybe$Nothing, + P: $elm$core$Maybe$Nothing }), $author$project$Main$LongText( $author$project$Main$AttributeGiven(160)) @@ -13865,15 +9012,33 @@ var $elm$html$Html$Attributes$classList = function (classes) { $elm$core$Tuple$first, A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); }; +var $elm$core$List$maybeCons = F3( + function (f, mx, xs) { + var _v0 = f(mx); + if (!_v0.$) { + var x = _v0.a; + return A2($elm$core$List$cons, x, xs); + } else { + return xs; + } + }); +var $elm$core$List$filterMap = F2( + function (f, xs) { + return A3( + $elm$core$List$foldr, + $elm$core$List$maybeCons(f), + _List_Nil, + xs); + }); var $author$project$Main$fieldsWithPlaceholder = F2( function (fields, dragged) { - if (dragged.$ === 'Nothing') { + if (dragged.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { - if (dragged.a.$ === 'DragExisting') { - var dragIndex = dragged.a.a.dragIndex; - var dropIndex = dragged.a.a.dropIndex; - if (dropIndex.$ === 'Nothing') { + if (!dragged.a.$) { + var dragIndex = dragged.a.a.a6; + var dropIndex = dragged.a.a.G; + if (dropIndex.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { var _v2 = dropIndex.a; @@ -13904,8 +9069,8 @@ var $author$project$Main$fieldsWithPlaceholder = F2( ])); } } else { - var dropIndex = dragged.a.a.dropIndex; - if (dropIndex.$ === 'Nothing') { + var dropIndex = dragged.a.a.G; + if (dropIndex.$ === 1) { return A2($elm$core$List$map, $elm$core$Maybe$Just, fields); } else { var _v4 = dropIndex.a; @@ -13924,8 +9089,25 @@ var $author$project$Main$fieldsWithPlaceholder = F2( } }); var $elm$html$Html$h2 = _VirtualDom_node('h2'); +var $elm$virtual_dom$VirtualDom$Normal = function (a) { + return {$: 0, a: a}; +}; +var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; +var $elm$html$Html$Events$on = F2( + function (event, decoder) { + return A2( + $elm$virtual_dom$VirtualDom$on, + event, + $elm$virtual_dom$VirtualDom$Normal(decoder)); + }); +var $elm$html$Html$Events$onClick = function (msg) { + return A2( + $elm$html$Html$Events$on, + 'click', + $elm$json$Json$Decode$succeed(msg)); +}; var $elm$virtual_dom$VirtualDom$MayPreventDefault = function (a) { - return {$: 'MayPreventDefault', a: a}; + return {$: 2, a: a}; }; var $elm$html$Html$Events$preventDefaultOn = F2( function (event, decoder) { @@ -13935,8 +9117,15 @@ var $elm$html$Html$Events$preventDefaultOn = F2( $elm$virtual_dom$VirtualDom$MayPreventDefault(decoder)); }); var $author$project$Main$DragStart = function (a) { - return {$: 'DragStart', a: a}; + return {$: 9, a: a}; }; +var $elm$virtual_dom$VirtualDom$attribute = F2( + function (key, value) { + return A2( + _VirtualDom_attribute, + _VirtualDom_noOnOrFormAction(key), + _VirtualDom_noJavaScriptOrHtmlUri(value)); + }); var $elm$html$Html$Attributes$attribute = $elm$virtual_dom$VirtualDom$attribute; var $elm$svg$Svg$Attributes$class = _VirtualDom_attribute('class'); var $elm$svg$Svg$Attributes$fill = _VirtualDom_attribute('fill'); @@ -13991,7 +9180,7 @@ var $author$project$Main$dragHandleIcon = A2( _List_Nil) ])); var $author$project$Main$DragOver = function (a) { - return {$: 'DragOver', a: a}; + return {$: 12, a: a}; }; var $author$project$Main$dragOverDecoder = F2( function (index, maybeFormField) { @@ -14009,8 +9198,8 @@ var $author$project$Main$isConditionReferencingField = F2( }); var $author$project$Main$isFieldUsedInChoiceFilter = F2( function (fieldName, maybeFilter) { - if (maybeFilter.$ === 'Just') { - if (maybeFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!maybeFilter.$) { + if (!maybeFilter.a.$) { var sourceField = maybeFilter.a.a; return _Utils_eq(sourceField, fieldName); } else { @@ -14024,14 +9213,14 @@ var $author$project$Main$isFieldUsedInChoiceFilter = F2( var $author$project$Main$isFieldUsedInFilter = F2( function (fieldName, inputField) { switch (inputField.$) { - case 'Dropdown': - var filter = inputField.a.filter; + case 2: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); - case 'ChooseOne': - var filter = inputField.a.filter; + case 3: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); - case 'ChooseMultiple': - var filter = inputField.a.filter; + case 4: + var filter = inputField.a.e; return A2($author$project$Main$isFieldUsedInChoiceFilter, fieldName, filter); default: return false; @@ -14043,7 +9232,7 @@ var $author$project$Main$isFieldReferencedBy = F2( var isUsedInChoiceFilters = A2( $elm$core$List$any, function (field) { - return A2($author$project$Main$isFieldUsedInFilter, fieldName, field.type_); + return A2($author$project$Main$isFieldUsedInFilter, fieldName, field.a); }, fieldList); var isUsedInVisibilityRules = A2( @@ -14052,7 +9241,7 @@ var $author$project$Main$isFieldReferencedBy = F2( return A2( $elm$core$List$any, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return A2( $elm$core$List$any, @@ -14066,51 +9255,62 @@ var $author$project$Main$isFieldReferencedBy = F2( conditions); } }, - field.visibilityRule); + field.m); }, fieldList); - return {usedInChoiceFilters: isUsedInChoiceFilters, usedInVisibilityRules: isUsedInVisibilityRules}; + return {a3: isUsedInChoiceFilters, a4: isUsedInVisibilityRules}; + }); +var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { + return {$: 1, a: a}; +}; +var $elm$html$Html$Events$stopPropagationOn = F2( + function (event, decoder) { + return A2( + $elm$virtual_dom$VirtualDom$on, + event, + $elm$virtual_dom$VirtualDom$MayStopPropagation(decoder)); }); +var $elm$html$Html$Attributes$title = $elm$html$Html$Attributes$stringProperty('title'); var $elm$html$Html$Attributes$for = $elm$html$Html$Attributes$stringProperty('htmlFor'); var $elm$html$Html$label = _VirtualDom_node('label'); var $author$project$Main$maybeMaxLengthOf = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': - var maxlength = _v0.a.maxlength; + case 0: + var maxlength = _v0.a.ah; switch (maxlength.$) { - case 'AttributeGiven': + case 2: var i = maxlength.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'LongText': + case 1: var maxlength = _v0.a; switch (maxlength.$) { - case 'AttributeGiven': + case 2: var i = maxlength.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'Dropdown': + case 2: return $elm$core$Maybe$Nothing; - case 'ChooseOne': + case 3: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } }; var $author$project$Main$requiredData = function (presence) { - switch (presence.$) { - case 'Required': + switch (presence) { + case 0: return true; - case 'Optional': + case 1: return false; default: return true; @@ -14149,14 +9349,14 @@ var $author$project$Main$attributesFromTuple = function (_v0) { A2($elm$html$Html$Attributes$attribute, k, v)); }; var $author$project$Main$isOptionalTemporalInput = function (formField) { - var _v0 = _Utils_Tuple2(formField.presence, formField.type_); - if ((_v0.a.$ === 'Optional') && (_v0.b.$ === 'ShortText')) { + var _v0 = _Utils_Tuple2(formField.w, formField.a); + if ((_v0.a === 1) && (!_v0.b.$)) { var _v1 = _v0.a; var customElement = _v0.b.a; var inputType = A2( $elm$core$Maybe$withDefault, '', - A2($elm$core$Dict$get, 'type', customElement.attributes)); + A2($elm$core$Dict$get, 'type', customElement.p)); return A2( $elm$core$List$member, inputType, @@ -14194,14 +9394,14 @@ var $author$project$Main$defaultValue = function (str) { var $elm$core$String$toLower = _String_toLower; var $author$project$Main$filterChoices = F3( function (maybeFilter, formValues, choices) { - if (maybeFilter.$ === 'Just') { - if (maybeFilter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!maybeFilter.$) { + if (!maybeFilter.a.$) { var fieldName = maybeFilter.a.a; var _v1 = A2( $elm$core$Maybe$andThen, $elm$core$List$head, A2($elm$core$Dict$get, fieldName, formValues)); - if (_v1.$ === 'Just') { + if (!_v1.$) { var filterValue = _v1.a; return $elm$core$String$isEmpty(filterValue) ? _List_Nil : A2( $elm$core$List$filter, @@ -14209,10 +9409,10 @@ var $author$project$Main$filterChoices = F3( return A2( $elm$core$String$startsWith, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.value)) || A2( + $elm$core$String$toLower(choice.j)) || A2( $elm$core$String$startsWith, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.label)); + $elm$core$String$toLower(choice.d)); }, choices); } else { @@ -14224,7 +9424,7 @@ var $author$project$Main$filterChoices = F3( $elm$core$Maybe$andThen, $elm$core$List$head, A2($elm$core$Dict$get, fieldName, formValues)); - if (_v2.$ === 'Just') { + if (!_v2.$) { var filterValue = _v2.a; return $elm$core$String$isEmpty(filterValue) ? _List_Nil : A2( $elm$core$List$filter, @@ -14232,10 +9432,10 @@ var $author$project$Main$filterChoices = F3( return A2( $elm$core$String$contains, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.value)) || A2( + $elm$core$String$toLower(choice.j)) || A2( $elm$core$String$contains, $elm$core$String$toLower(filterValue), - $elm$core$String$toLower(choice.label)); + $elm$core$String$toLower(choice.d)); }, choices); } else { @@ -14246,12 +9446,18 @@ var $author$project$Main$filterChoices = F3( return choices; } }); +var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id'); var $elm$html$Html$Attributes$maxlength = function (n) { return A2( _VirtualDom_attribute, 'maxlength', $elm$core$String$fromInt(n)); }; +var $elm$virtual_dom$VirtualDom$node = function (tag) { + return _VirtualDom_node( + _VirtualDom_noScript(tag)); +}; +var $elm$html$Html$node = $elm$virtual_dom$VirtualDom$node; var $elm$html$Html$option = _VirtualDom_node('option'); var $elm$html$Html$Attributes$placeholder = $elm$html$Html$Attributes$stringProperty('placeholder'); var $elm$html$Html$Attributes$required = $elm$html$Html$Attributes$boolProperty('required'); @@ -14308,21 +9514,21 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( var disabledMode = A2( $elm$core$List$member, A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled'), - config.customAttrs); + config.Y); var chosenForYou = function (choices) { - var _v10 = formField.presence; - switch (_v10.$) { - case 'Optional': + var _v10 = formField.w; + switch (_v10) { + case 1: return false; - case 'Required': + case 0: return $elm$core$List$length(choices) === 1; default: return $elm$core$List$length(choices) === 1; } }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: var customElement = _v0.a; var extraAttrs = A2( $elm$core$List$filterMap, @@ -14337,12 +9543,12 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))), + A2($elm$core$Dict$get, fieldName, config.u))), A2( $elm$core$List$map, $author$project$Main$attributesFromTuple, - $elm$core$Dict$toList(customElement.attributes)))); - var extraAttrKeys = $elm$core$Dict$keys(customElement.attributes); + $elm$core$Dict$toList(customElement.p)))); + var extraAttrKeys = $elm$core$Dict$keys(customElement.p); var shortTextAttrs = A2( $elm$core$List$filterMap, $author$project$Main$attributesFromTuple, @@ -14359,13 +9565,13 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$map, function ($) { - return $.attributes; + return $.p; }, - A2($elm$core$Dict$get, customElement.inputType, config.shortTextTypeDict)))))); + A2($elm$core$Dict$get, customElement.B, config.ak)))))); var _v1 = function () { - var _v2 = customElement.datalist; + var _v2 = customElement.ae; switch (_v2.$) { - case 'AttributeGiven': + case 2: var list = _v2.a; return _Utils_Tuple2( _List_fromArray( @@ -14385,15 +9591,15 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(choice.value) + $elm$html$Html$Attributes$value(choice.j) ]), _List_fromArray( [ - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])); }, list))); - case 'AttributeNotNeeded': + case 0: return _Utils_Tuple2( _List_Nil, $elm$html$Html$text('')); @@ -14412,18 +9618,18 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( [ A3( $elm$html$Html$node, - customElement.inputTag, + customElement.N, _Utils_ap( _List_fromArray( [ A2( $elm$html$Html$Attributes$attribute, 'class', - A3($author$project$Main$buildInputClassString, formField, fieldName, config.trackedFormValues)), + A3($author$project$Main$buildInputClassString, formField, fieldName, config.u)), $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), _Utils_ap( dataListAttrs, @@ -14432,12 +9638,12 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( _Utils_ap( extraAttrs, _Utils_ap( - config.customAttrs, - config.onInput(fieldName)))))), + config.Y, + config.aO(fieldName)))))), _List_Nil), dataListElement ])); - case 'LongText': + case 1: var extraAttrs = A2( $elm$core$List$filterMap, $elm$core$Basics$identity, @@ -14457,7 +9663,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))) + A2($elm$core$Dict$get, fieldName, config.u))) ])); return A2( $author$project$Main$textarea, @@ -14468,28 +9674,28 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)), + $author$project$Main$requiredData(formField.w)), $elm$html$Html$Attributes$placeholder(' ') ]), _Utils_ap( extraAttrs, _Utils_ap( - config.customAttrs, - config.onInput(fieldName)))), + config.Y, + config.aO(fieldName)))), _List_Nil); - case 'Dropdown': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 2: + var choices = _v0.a.k; + var filter = _v0.a.e; var valueString = A2( $elm$core$Maybe$withDefault, '', A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + A2($elm$core$Dict$get, fieldName, config.u))); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14506,9 +9712,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$name(fieldName), $elm$html$Html$Attributes$id(fieldID), disabledMode ? $elm$html$Html$Attributes$class('tff-select-disabled') : $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), - config.onChange(fieldName)), + config.bf(fieldName)), A2( $elm$core$List$cons, A2( @@ -14521,7 +9727,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( (valueString === '') && (!chosenForYou(filteredChoices))), A2($elm$html$Html$Attributes$attribute, 'value', '') ]), - config.customAttrs), + config.Y), _List_fromArray( [ $elm$html$Html$text('-- Select an option --') @@ -14533,32 +9739,32 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$option, A2( $elm$core$List$cons, - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), A2( $elm$core$List$cons, $author$project$Main$defaultSelected( - _Utils_eq(valueString, choice.value) || chosenForYou(filteredChoices)), - config.customAttrs)), + _Utils_eq(valueString, choice.j) || chosenForYou(filteredChoices)), + config.Y)), _List_fromArray( [ - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])); }, filteredChoices))) ])); - case 'ChooseOne': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 3: + var choices = _v0.a.k; + var filter = _v0.a.e; var valueString = A2( $elm$core$Maybe$withDefault, '', A2( $elm$core$Maybe$andThen, $elm$core$List$head, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues))); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + A2($elm$core$Dict$get, fieldName, config.u))); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14599,32 +9805,32 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$type_('radio'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$name(fieldName), - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), $elm$html$Html$Attributes$checked( - _Utils_eq(valueString, choice.value) || chosenForYou(filteredChoices)), + _Utils_eq(valueString, choice.j) || chosenForYou(filteredChoices)), $elm$html$Html$Attributes$required( - $author$project$Main$requiredData(formField.presence)) + $author$project$Main$requiredData(formField.w)) ]), _Utils_ap( - config.customAttrs, - config.onInput(fieldName))), + config.Y, + config.aO(fieldName))), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])) ])); }, filteredChoices)) ])); default: - var choices = _v0.a.choices; - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; - var filter = _v0.a.filter; + var choices = _v0.a.k; + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; + var filter = _v0.a.e; var values = A2( $elm$core$Maybe$withDefault, _List_Nil, - A2($elm$core$Dict$get, fieldName, config.trackedFormValues)); + A2($elm$core$Dict$get, fieldName, config.u)); var selectedCount = $elm$core$List$length(values); var validationElement = ((!disabledMode) && ((!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) || (!_Utils_eq(maxAllowed, $elm$core$Maybe$Nothing)))) ? _List_fromArray( [ @@ -14658,8 +9864,8 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( ]) : _List_Nil; var isValid = function () { var _v5 = _Utils_Tuple2(minRequired, maxAllowed); - if (_v5.a.$ === 'Just') { - if (_v5.b.$ === 'Just') { + if (!_v5.a.$) { + if (!_v5.b.$) { var min = _v5.a.a; var max = _v5.b.a; return (_Utils_cmp(selectedCount, min) > -1) && (_Utils_cmp(selectedCount, max) < 1); @@ -14669,7 +9875,7 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( return _Utils_cmp(selectedCount, min) > -1; } } else { - if (_v5.b.$ === 'Just') { + if (!_v5.b.$) { var _v7 = _v5.a; var max = _v5.b.a; return _Utils_cmp(selectedCount, max) < 1; @@ -14680,9 +9886,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( } } }(); - var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.trackedFormValues, choices); + var filteredChoices = disabledMode ? choices : A3($author$project$Main$filterChoices, filter, config.u, choices); var noChoicesAfterFiltering = (!$elm$core$List$isEmpty(choices)) && $elm$core$List$isEmpty(filteredChoices); - return (noChoicesAfterFiltering && config.needsFormLogic) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( + return (noChoicesAfterFiltering && config._) ? A2($elm$html$Html$div, _List_Nil, _List_Nil) : A2( $elm$html$Html$div, _List_fromArray( [ @@ -14703,14 +9909,14 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$core$List$map, function (choice) { var alreadyFull = function () { - if (maxAllowed.$ === 'Just') { + if (!maxAllowed.$) { var m = maxAllowed.a; return _Utils_cmp(selectedCount, m) > -1; } else { return false; } }(); - var shouldDisable = alreadyFull && (!A2($elm$core$List$member, choice.value, values)); + var shouldDisable = alreadyFull && (!A2($elm$core$List$member, choice.j, values)); return A2( $elm$html$Html$div, _List_fromArray( @@ -14735,9 +9941,9 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$name(fieldName), - $elm$html$Html$Attributes$value(choice.value), + $elm$html$Html$Attributes$value(choice.j), $elm$html$Html$Attributes$checked( - A2($elm$core$List$member, choice.value, values) || chosenForYou(filteredChoices)) + A2($elm$core$List$member, choice.j, values) || chosenForYou(filteredChoices)) ]), _Utils_ap( shouldDisable ? _List_fromArray( @@ -14745,11 +9951,11 @@ var $author$project$Main$viewFormFieldOptionsPreview = F3( A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled') ]) : _List_Nil, _Utils_ap( - config.customAttrs, - A2(config.onChooseMany, fieldName, choice)))), + config.Y, + A2(config.bg, fieldName, choice)))), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(choice.label) + $elm$html$Html$text(choice.d) ])) ])); }, @@ -14772,8 +9978,8 @@ var $author$project$Main$viewFormFieldPreview = F3( $elm$html$Html$Attributes$class( 'tff-field-group' + A2( $author$project$Main$when, - $author$project$Main$requiredData(formField.presence), - {_false: '', _true: ' tff-required'})) + $author$project$Main$requiredData(formField.w), + {aV: '', a1: ' tff-required'})) ]), _List_fromArray( [ @@ -14786,16 +9992,16 @@ var $author$project$Main$viewFormFieldPreview = F3( ]), _List_fromArray( [ - $elm$html$Html$text(formField.label), + $elm$html$Html$text(formField.d), function () { - var _v0 = formField.presence; - switch (_v0.$) { - case 'Required': + var _v0 = formField.w; + switch (_v0) { + case 0: return $elm$html$Html$text(''); - case 'Optional': - var _v1 = formField.type_; - if (_v1.$ === 'ChooseMultiple') { - var minRequired = _v1.a.minRequired; + case 1: + var _v1 = formField.a; + if (_v1.$ === 4) { + var minRequired = _v1.a.P; return (!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) ? $elm$html$Html$text('') : $elm$html$Html$text(' (optional)'); } else { return $elm$html$Html$text(' (optional)'); @@ -14816,11 +10022,11 @@ var $author$project$Main$viewFormFieldPreview = F3( [ $elm$html$Html$text( function () { - var _v2 = formField.description; + var _v2 = formField.S; switch (_v2.$) { - case 'AttributeNotNeeded': + case 0: return ''; - case 'AttributeInvalid': + case 1: var s = _v2.a; return s; default: @@ -14830,7 +10036,7 @@ var $author$project$Main$viewFormFieldPreview = F3( }()), function () { var _v3 = $author$project$Main$maybeMaxLengthOf(formField); - if (_v3.$ === 'Just') { + if (!_v3.$) { var maxLength = _v3.a; return $elm$html$Html$text( ' (max ' + ($elm$core$String$fromInt(maxLength) + ' characters)')); @@ -14844,7 +10050,7 @@ var $author$project$Main$viewFormFieldPreview = F3( }); var $author$project$Main$renderFormBuilderField = F4( function (maybeAnimate, model, index, maybeFormField) { - if (maybeFormField.$ === 'Nothing') { + if (maybeFormField.$ === 1) { return A2( $elm$html$Html$div, _List_fromArray( @@ -14879,7 +10085,7 @@ var $author$project$Main$renderFormBuilderField = F4( A2( $elm$html$Html$Attributes$attribute, 'data-input-field', - $author$project$Main$stringFromInputField(formField.type_)), + $author$project$Main$stringFromInputField(formField.a)), A2( $elm$html$Html$Events$preventDefaultOn, 'dragover', @@ -14909,7 +10115,7 @@ var $author$project$Main$renderFormBuilderField = F4( _Utils_Tuple2( 'tff-animate-fadeOut', function () { - if ((maybeAnimate.$ === 'Just') && (maybeAnimate.a.b.$ === 'AnimateFadeOut')) { + if ((!maybeAnimate.$) && (maybeAnimate.a.b === 1)) { var _v2 = maybeAnimate.a; var i = _v2.a; var _v3 = _v2.b; @@ -14921,7 +10127,7 @@ var $author$project$Main$renderFormBuilderField = F4( _Utils_Tuple2( 'tff-animate-yellowFade', function () { - if ((maybeAnimate.$ === 'Just') && (maybeAnimate.a.b.$ === 'AnimateYellowFade')) { + if ((!maybeAnimate.$) && (!maybeAnimate.a.b)) { var _v5 = maybeAnimate.a; var i = _v5.a; var _v6 = _v5.b; @@ -14943,7 +10149,7 @@ var $author$project$Main$renderFormBuilderField = F4( $elm$html$Html$Attributes$attribute, 'data-selected', _Utils_eq( - model.selectedFieldIndex, + model.F, $elm$core$Maybe$Just(index)) ? 'true' : 'false'), A2($elm$html$Html$Attributes$attribute, 'draggable', 'true'), A2( @@ -14967,25 +10173,25 @@ var $author$project$Main$renderFormBuilderField = F4( _List_fromArray( [$author$project$Main$dragHandleIcon])), function () { - var hasVisibilityRules = !$elm$core$List$isEmpty(formField.visibilityRule); + var hasVisibilityRules = !$elm$core$List$isEmpty(formField.m); var hasFilterChoices = function () { - var _v7 = formField.type_; + var _v7 = formField.a; switch (_v7.$) { - case 'Dropdown': - var filter = _v7.a.filter; + case 2: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseOne': - var filter = _v7.a.filter; + case 3: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); - case 'ChooseMultiple': - var filter = _v7.a.filter; + case 4: + var filter = _v7.a.e; return !_Utils_eq(filter, $elm$core$Maybe$Nothing); default: return false; } }(); var fieldName = $author$project$Main$fieldNameOf(formField); - var referencedInfo = A2($author$project$Main$isFieldReferencedBy, fieldName, model.formFields); + var referencedInfo = A2($author$project$Main$isFieldReferencedBy, fieldName, model.g); return A2( $elm$html$Html$div, _List_fromArray( @@ -14994,57 +10200,57 @@ var $author$project$Main$renderFormBuilderField = F4( ]), _List_fromArray( [ - (hasVisibilityRules || referencedInfo.usedInVisibilityRules) ? A2( + (hasVisibilityRules || referencedInfo.a4) ? A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class( hasVisibilityRules ? 'tff-logic-indicator tff-logic-indicator-blue' : 'tff-logic-indicator tff-logic-indicator-gray'), $elm$html$Html$Attributes$title( - (hasVisibilityRules && referencedInfo.usedInVisibilityRules) ? 'This field has visibility logic and other fields\' visibility depends on it' : (hasVisibilityRules ? 'This field has visibility logic' : 'Other fields\' visibility depends on this field\'s value')) + (hasVisibilityRules && referencedInfo.a4) ? 'This field has visibility logic and other fields\' visibility depends on it' : (hasVisibilityRules ? 'This field has visibility logic' : 'Other fields\' visibility depends on this field\'s value')) ]), _List_fromArray( [ $elm$html$Html$text( - (hasVisibilityRules && referencedInfo.usedInVisibilityRules) ? 'Contains & affects logic' : (hasVisibilityRules ? 'Contains logic' : 'Affects logic')) + (hasVisibilityRules && referencedInfo.a4) ? 'Contains & affects logic' : (hasVisibilityRules ? 'Contains logic' : 'Affects logic')) ])) : $elm$html$Html$text(''), - (hasFilterChoices || referencedInfo.usedInChoiceFilters) ? A2( + (hasFilterChoices || referencedInfo.a3) ? A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class( hasFilterChoices ? 'tff-logic-indicator tff-logic-indicator-orange' : 'tff-logic-indicator tff-logic-indicator-gray'), $elm$html$Html$Attributes$title( - (hasFilterChoices && referencedInfo.usedInChoiceFilters) ? 'This field filters choices and other fields\' choices depend on it' : (hasFilterChoices ? 'This field filters choices based on another field' : 'Other fields\' choices depend on this field\'s value')) + (hasFilterChoices && referencedInfo.a3) ? 'This field filters choices and other fields\' choices depend on it' : (hasFilterChoices ? 'This field filters choices based on another field' : 'Other fields\' choices depend on this field\'s value')) ]), _List_fromArray( [ $elm$html$Html$text( - (hasFilterChoices && referencedInfo.usedInChoiceFilters) ? 'Filters & affects choices' : (hasFilterChoices ? 'Filters choices' : 'Affects choices')) + (hasFilterChoices && referencedInfo.a3) ? 'Filters & affects choices' : (hasFilterChoices ? 'Filters choices' : 'Affects choices')) ])) : $elm$html$Html$text('') ])); }(), A3( $author$project$Main$viewFormFieldPreview, { - customAttrs: _List_fromArray( + Y: _List_fromArray( [ A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled') ]), - formFields: model.formFields, - needsFormLogic: false, - onChange: function (_v8) { + g: model.g, + _: false, + bf: function (_v8) { return _List_Nil; }, - onChooseMany: F2( + bg: F2( function (_v9, _v10) { return _List_Nil; }), - onInput: function (_v11) { + aO: function (_v11) { return _List_Nil; }, - shortTextTypeDict: model.shortTextTypeDict, - trackedFormValues: model.trackedFormValues + ak: model.ak, + u: model.u }, index, formField) @@ -15054,10 +10260,10 @@ var $author$project$Main$renderFormBuilderField = F4( } }); var $author$project$Main$AddFormField = function (a) { - return {$: 'AddFormField', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$DragStartNew = function (a) { - return {$: 'DragStartNew', a: a}; + return {$: 10, a: a}; }; var $author$project$Main$viewAddQuestionsList = F2( function (nextQuestionNumber, inputFields) { @@ -15085,15 +10291,15 @@ var $author$project$Main$viewAddQuestionsList = F2( $elm$json$Json$Decode$succeed( $author$project$Main$DragStartNew( { - description: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), - label: $author$project$Main$stringFromInputField(inputField) + (' question ' + $elm$core$String$fromInt(nextQuestionNumber)), - name: $elm$core$Maybe$Nothing, - presence: A2( + S: $author$project$Main$AttributeNotNeeded($elm$core$Maybe$Nothing), + d: $author$project$Main$stringFromInputField(inputField) + (' question ' + $elm$core$String$fromInt(nextQuestionNumber)), + Q: $elm$core$Maybe$Nothing, + w: A2( $author$project$Main$when, $author$project$Main$mustBeOptional(inputField), - {_false: $author$project$Main$Required, _true: $author$project$Main$Optional}), - type_: inputField, - visibilityRule: _List_Nil + {aV: 0, a1: 1}), + a: inputField, + m: _List_Nil }))), A2( $elm$html$Html$Events$on, @@ -15108,35 +10314,36 @@ var $author$project$Main$viewAddQuestionsList = F2( }, inputFields)); }); -var $author$project$Main$AnimateFadeOut = {$: 'AnimateFadeOut'}; +var $elm$html$Html$button = _VirtualDom_node('button'); +var $author$project$Main$AnimateFadeOut = 1; var $author$project$Main$DeleteFormField = function (a) { - return {$: 'DeleteFormField', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$MoveFormFieldDown = function (a) { - return {$: 'MoveFormFieldDown', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$MoveFormFieldUp = function (a) { - return {$: 'MoveFormFieldUp', a: a}; + return {$: 4, a: a}; }; -var $author$project$Main$OnDescriptionInput = {$: 'OnDescriptionInput'}; +var $author$project$Main$OnDescriptionInput = {$: 1}; var $author$project$Main$OnDescriptionToggle = function (a) { - return {$: 'OnDescriptionToggle', a: a}; + return {$: 2, a: a}; }; var $author$project$Main$OnFormField = F3( function (a, b, c) { - return {$: 'OnFormField', a: a, b: b, c: c}; + return {$: 6, a: a, b: b, c: c}; }); -var $author$project$Main$OnLabelInput = {$: 'OnLabelInput'}; +var $author$project$Main$OnLabelInput = {$: 0}; var $author$project$Main$OnMultipleToggle = function (a) { - return {$: 'OnMultipleToggle', a: a}; + return {$: 5, a: a}; }; var $author$project$Main$OnRequiredInput = function (a) { - return {$: 'OnRequiredInput', a: a}; + return {$: 3, a: a}; }; var $author$project$Main$allowsTogglingMultiple = function (inputField) { switch (inputField.$) { - case 'ShortText': - var attributes = inputField.a.attributes; + case 0: + var attributes = inputField.a.p; return A2( $elm$core$List$member, A2($elm$core$Dict$get, 'multiple', attributes), @@ -15145,11 +10352,11 @@ var $author$project$Main$allowsTogglingMultiple = function (inputField) { $elm$core$Maybe$Just('true'), $elm$core$Maybe$Just('false') ])); - case 'LongText': + case 1: return false; - case 'Dropdown': + case 2: return false; - case 'ChooseOne': + case 3: return false; default: return false; @@ -15161,7 +10368,7 @@ var $author$project$Main$hasDuplicateLabel = F3( $elm$core$List$any, function (_v1) { var f = _v1.b; - return _Utils_eq(f.label, newLabel); + return _Utils_eq(f.d, newLabel); }, A2( $elm$core$List$filter, @@ -15191,7 +10398,7 @@ var $elm$html$Html$Events$onCheck = function (tagger) { var $author$project$Main$inputAttributeOptional = F2( function (options, attributeOptional) { switch (attributeOptional.$) { - case 'AttributeNotNeeded': + case 0: return A2( $elm$html$Html$div, _List_fromArray( @@ -15215,14 +10422,14 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(false), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])) ])); - case 'AttributeInvalid': + case 1: var str = attributeOptional.a; return A2( $elm$html$Html$div, @@ -15247,13 +10454,13 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(true), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])), - options.htmlNode( + options.af( $elm$core$Result$Err(str)) ])); default: @@ -15281,78 +10488,97 @@ var $author$project$Main$inputAttributeOptional = F2( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked(true), - $elm$html$Html$Events$onCheck(options.onCheck) + $elm$html$Html$Events$onCheck(options.ab) ]), _List_Nil), $elm$html$Html$text(' '), - $elm$html$Html$text(options.label) + $elm$html$Html$text(options.d) ])), - options.htmlNode( + options.af( $elm$core$Result$Ok(a)) ])); } }); var $author$project$Main$maybeMultipleOf = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': - var multiple = _v0.a.multiple; + case 0: + var multiple = _v0.a.aM; switch (multiple.$) { - case 'AttributeGiven': + case 2: var i = multiple.a; return $elm$core$Maybe$Just(i); - case 'AttributeInvalid': + case 1: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } - case 'LongText': + case 1: return $elm$core$Maybe$Nothing; - case 'Dropdown': + case 2: return $elm$core$Maybe$Nothing; - case 'ChooseOne': + case 3: return $elm$core$Maybe$Nothing; default: return $elm$core$Maybe$Nothing; } }; +var $elm$html$Html$Events$alwaysStop = function (x) { + return _Utils_Tuple2(x, true); +}; +var $elm$html$Html$Events$targetValue = A2( + $elm$json$Json$Decode$at, + _List_fromArray( + ['target', 'value']), + $elm$json$Json$Decode$string); +var $elm$html$Html$Events$onInput = function (tagger) { + return A2( + $elm$html$Html$Events$stopPropagationOn, + 'input', + A2( + $elm$json$Json$Decode$map, + $elm$html$Html$Events$alwaysStop, + A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); +}; var $elm$html$Html$Attributes$pattern = $elm$html$Html$Attributes$stringProperty('pattern'); var $author$project$Main$OnCheckboxMaxAllowedInput = function (a) { - return {$: 'OnCheckboxMaxAllowedInput', a: a}; + return {$: 17, a: a}; }; var $author$project$Main$OnCheckboxMinRequiredInput = function (a) { - return {$: 'OnCheckboxMinRequiredInput', a: a}; + return {$: 16, a: a}; }; -var $author$project$Main$OnChoicesInput = {$: 'OnChoicesInput'}; -var $author$project$Main$OnDatalistInput = {$: 'OnDatalistInput'}; +var $author$project$Main$OnChoicesInput = {$: 4}; +var $author$project$Main$OnDatalistInput = {$: 9}; var $author$project$Main$OnDatalistToggle = function (a) { - return {$: 'OnDatalistToggle', a: a}; + return {$: 8, a: a}; }; var $author$project$Main$OnDateMaxInput = function (a) { - return {$: 'OnDateMaxInput', a: a}; + return {$: 21, a: a}; }; var $author$project$Main$OnDateMaxToggle = function (a) { - return {$: 'OnDateMaxToggle', a: a}; + return {$: 19, a: a}; }; var $author$project$Main$OnDateMinInput = function (a) { - return {$: 'OnDateMinInput', a: a}; + return {$: 20, a: a}; }; var $author$project$Main$OnDateMinToggle = function (a) { - return {$: 'OnDateMinToggle', a: a}; + return {$: 18, a: a}; }; var $author$project$Main$OnFilterSourceFieldSelect = function (a) { - return {$: 'OnFilterSourceFieldSelect', a: a}; + return {$: 24, a: a}; }; var $author$project$Main$OnFilterToggle = function (a) { - return {$: 'OnFilterToggle', a: a}; + return {$: 22, a: a}; }; var $author$project$Main$OnFilterTypeSelect = function (a) { - return {$: 'OnFilterTypeSelect', a: a}; + return {$: 23, a: a}; }; -var $author$project$Main$OnMaxLengthInput = {$: 'OnMaxLengthInput'}; +var $author$project$Main$OnMaxLengthInput = {$: 7}; var $author$project$Main$OnMaxLengthToggle = function (a) { - return {$: 'OnMaxLengthToggle', a: a}; + return {$: 6, a: a}; }; +var $elm$html$Html$Attributes$max = $elm$html$Html$Attributes$stringProperty('max'); +var $elm$html$Html$Attributes$min = $elm$html$Html$Attributes$stringProperty('min'); var $elm$html$Html$Attributes$minlength = function (n) { return A2( _VirtualDom_attribute, @@ -15371,7 +10597,7 @@ var $author$project$Main$otherQuestionTitles = F2( $elm$core$List$map, function (_v1) { var f = _v1.b; - return {label: f.label, name: f.name}; + return {d: f.d, Q: f.Q}; }, A2( $elm$core$List$filter, @@ -15394,8 +10620,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( var filterSettings = function (filter) { if (!_Utils_eq(filter, $elm$core$Maybe$Nothing)) { var sourceFieldName = function () { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { var name = filter.a.a; return name; } else { @@ -15408,8 +10634,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( }(); var otherFields = A2($author$project$Main$otherQuestionTitles, formFields, index); var filterType = function () { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { return 'startswith'; } else { return 'contains'; @@ -15534,7 +10760,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $elm$core$List$map, function (field) { - var fieldValue = A2($elm$core$Maybe$withDefault, field.label, field.name); + var fieldValue = A2($elm$core$Maybe$withDefault, field.d, field.Q); var isSelected = _Utils_eq(fieldValue, sourceFieldName); return A2( $elm$html$Html$option, @@ -15549,7 +10775,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( 'value of ' + A2( $elm$json$Json$Encode$encode, 0, - $elm$json$Json$Encode$string(field.label))) + $elm$json$Json$Encode$string(field.d))) ])); }, otherFields))) @@ -15636,11 +10862,11 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( $elm$html$Html$Attributes$required(true), $elm$html$Html$Attributes$readonly( function () { - var _v8 = formField.presence; - switch (_v8.$) { - case 'Required': + var _v8 = formField.w; + switch (_v8) { + case 0: return false; - case 'Optional': + case 1: return false; default: return true; @@ -15655,9 +10881,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil) ])); }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: var customElement = _v0.a; var maybeShortTextTypeMaxLength = A2( $elm$core$Maybe$andThen, @@ -15668,27 +10894,27 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $elm$core$Maybe$map, function ($) { - return $.attributes; + return $.p; }, $elm$core$List$head( A2( $elm$core$List$filter, function (_v6) { - var inputType = _v6.inputType; - return _Utils_eq(inputType, customElement.inputType); + var inputType = _v6.B; + return _Utils_eq(inputType, customElement.B); }, shortTextTypeList))))); return _Utils_ap( _List_fromArray( [ function () { - if (maybeShortTextTypeMaxLength.$ === 'Nothing') { + if (maybeShortTextTypeMaxLength.$ === 1) { return A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { + af: function (result) { var valueString = function () { - if (result.$ === 'Ok') { + if (!result.$) { var i = result.a; return $elm$core$String$fromInt(i); } else { @@ -15710,8 +10936,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]), _List_Nil); }, - label: 'Limit number of characters', - onCheck: function (b) { + d: 'Limit number of characters', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnMaxLengthToggle(b), @@ -15719,7 +10945,7 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.maxlength); + customElement.ah); } else { var i = maybeShortTextTypeMaxLength.a; return A2( @@ -15737,8 +10963,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var a = result.a; return A2( $author$project$Main$textarea, @@ -15774,8 +11000,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Suggested values', - onCheck: function (b) { + d: 'Suggested values', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDatalistToggle(b), @@ -15783,18 +11009,18 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.datalist) + customElement.ae) ]), - ((customElement.inputType === 'date') || (A2( + ((customElement.B === 'date') || (A2( $elm$core$Maybe$withDefault, '', - A2($elm$core$Dict$get, 'type', customElement.attributes)) === 'date')) ? _List_fromArray( + A2($elm$core$Dict$get, 'type', customElement.p)) === 'date')) ? _List_fromArray( [ A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var dateStr = result.a; return A2( $elm$html$Html$input, @@ -15836,8 +11062,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Minimum date', - onCheck: function (b) { + d: 'Minimum date', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDateMinToggle(b), @@ -15845,12 +11071,12 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.min), + customElement.ar), A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var dateStr = result.a; return A2( $elm$html$Html$input, @@ -15892,8 +11118,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Maximum date', - onCheck: function (b) { + d: 'Maximum date', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDateMaxToggle(b), @@ -15901,17 +11127,17 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ''); } }, - customElement.max) + customElement.aq) ]) : _List_Nil); - case 'LongText': + case 1: var optionalMaxLength = _v0.a; return _List_fromArray( [ A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { - if (result.$ === 'Ok') { + af: function (result) { + if (!result.$) { var i = result.a; return A2( $elm$html$Html$input, @@ -15944,8 +11170,8 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( _List_Nil); } }, - label: 'Limit number of characters', - onCheck: function (b) { + d: 'Limit number of characters', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnMaxLengthToggle(b), @@ -15955,9 +11181,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( }, optionalMaxLength) ]); - case 'Dropdown': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 2: + var choices = _v0.a.k; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -15965,9 +11191,9 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( filterCheckbox(filter) ]), filterSettings(filter)); - case 'ChooseOne': - var choices = _v0.a.choices; - var filter = _v0.a.filter; + case 3: + var choices = _v0.a.k; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -15976,10 +11202,10 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]), filterSettings(filter)); default: - var choices = _v0.a.choices; - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; - var filter = _v0.a.filter; + var choices = _v0.a.k; + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; + var filter = _v0.a.e; return _Utils_ap( _List_fromArray( [ @@ -16099,25 +11325,43 @@ var $author$project$Main$viewFormFieldOptionsBuilder = F4( ]))); } }); -var $author$project$Main$OnAddVisibilityRule = {$: 'OnAddVisibilityRule'}; +var $author$project$Main$OnAddVisibilityRule = {$: 14}; +var $elm$core$List$intersperse = F2( + function (sep, xs) { + if (!xs.b) { + return _List_Nil; + } else { + var hd = xs.a; + var tl = xs.b; + var step = F2( + function (x, rest) { + return A2( + $elm$core$List$cons, + sep, + A2($elm$core$List$cons, x, rest)); + }); + var spersed = A3($elm$core$List$foldr, step, _List_Nil, tl); + return A2($elm$core$List$cons, hd, spersed); + } + }); var $author$project$Main$OnVisibilityConditionDuplicate = function (a) { - return {$: 'OnVisibilityConditionDuplicate', a: a}; + return {$: 15, a: a}; }; var $author$project$Main$OnVisibilityConditionFieldInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionFieldInput', a: a, b: b, c: c}; + return {$: 12, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityConditionTypeInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionTypeInput', a: a, b: b, c: c}; + return {$: 11, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityConditionValueInput = F3( function (a, b, c) { - return {$: 'OnVisibilityConditionValueInput', a: a, b: b, c: c}; + return {$: 13, a: a, b: b, c: c}; }); var $author$project$Main$OnVisibilityRuleTypeInput = F2( function (a, b) { - return {$: 'OnVisibilityRuleTypeInput', a: a, b: b}; + return {$: 10, a: a, b: b}; }); var $author$project$Main$comparisonOf = function (condition) { var comparison = condition.b; @@ -16126,26 +11370,32 @@ var $author$project$Main$comparisonOf = function (condition) { var $author$project$Main$isComparingWith = F2( function (expected, given) { switch (expected.$) { - case 'Equals': - if (given.$ === 'Equals') { + case 0: + if (!given.$) { return true; } else { return false; } - case 'StringContains': - if (given.$ === 'StringContains') { + case 1: + if (given.$ === 1) { return true; } else { return false; } - case 'EndsWith': - if (given.$ === 'EndsWith') { + case 2: + if (given.$ === 2) { + return true; + } else { + return false; + } + case 3: + if (given.$ === 3) { return true; } else { return false; } default: - if (given.$ === 'GreaterThan') { + if (given.$ === 4) { return true; } else { return false; @@ -16153,24 +11403,48 @@ var $author$project$Main$isComparingWith = F2( } }); var $author$project$Main$isHideWhen = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { return false; } else { return true; } }; var $author$project$Main$isShowWhen = function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { return true; } else { return false; } }; +var $elm$core$Basics$composeR = F3( + function (f, g, x) { + return g( + f(x)); + }); var $author$project$Main$selectInputGroup = function (_v0) { - var selectAttrs = _v0.selectAttrs; - var options = _v0.options; - var inputAttrs = _v0.inputAttrs; - var children = _v0.children; + var selectAttrs = _v0.cN; + var options = _v0.cs; + var inputNode = _v0.b5; + var optionToNode = function (opt) { + return A2( + $elm$html$Html$option, + A2( + $elm$core$List$filterMap, + $elm$core$Basics$identity, + _List_fromArray( + [ + $elm$core$Maybe$Just( + $elm$html$Html$Attributes$value(opt.j)), + opt.bi ? $elm$core$Maybe$Just( + $elm$html$Html$Attributes$selected(true)) : $elm$core$Maybe$Nothing, + opt.bL ? $elm$core$Maybe$Just( + A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled')) : $elm$core$Maybe$Nothing + ])), + _List_fromArray( + [ + $elm$html$Html$text(opt.d) + ])); + }; var calculatedAttrs = A2( $elm$core$List$append, _List_fromArray( @@ -16179,15 +11453,16 @@ var $author$project$Main$selectInputGroup = function (_v0) { ]), A2( $elm$core$List$map, - function (_v3) { - var value = _v3.a; - return $elm$html$Html$Attributes$value(value); - }, + A2( + $elm$core$Basics$composeR, + function ($) { + return $.j; + }, + $elm$html$Html$Attributes$value), A2( $elm$core$List$filter, - function (_v2) { - var selected = _v2.c; - return selected; + function ($) { + return $.bi; }, options))); return A2( @@ -16217,34 +11492,10 @@ var $author$project$Main$selectInputGroup = function (_v0) { A2( $elm$html$Html$select, _Utils_ap(calculatedAttrs, selectAttrs), - A2( - $elm$core$List$map, - function (_v1) { - var value = _v1.a; - var label = _v1.b; - var selected = _v1.c; - return A2( - $elm$html$Html$option, - _List_fromArray( - [ - $elm$html$Html$Attributes$value(value), - $elm$html$Html$Attributes$selected(selected) - ]), - _List_fromArray( - [ - $elm$html$Html$text(label) - ])); - }, - options)), + A2($elm$core$List$map, optionToNode, options)), $author$project$Main$selectArrowDown ])), - A2( - $elm$html$Html$input, - A2( - $elm$core$List$cons, - $elm$html$Html$Attributes$class('tff-selectinput-input'), - inputAttrs), - children) + inputNode ])) ])); }; @@ -16267,12 +11518,12 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$core$Array$toList(formFields))); var datalistId = 'datalist-' + ($elm$core$String$fromInt(fieldIndex) + ('-' + ($elm$core$String$fromInt(ruleIndex) + ('-' + $elm$core$String$fromInt(conditionIndex))))); var datalistElement = function () { - if (selectedField.$ === 'Just') { + if (!selectedField.$) { var field = selectedField.a; - var _v7 = field.type_; + var _v7 = field.a; switch (_v7.$) { - case 'Dropdown': - var choices = _v7.a.choices; + case 2: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16287,13 +11538,13 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, choices))); - case 'ChooseOne': - var choices = _v7.a.choices; + case 3: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16308,13 +11559,13 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, choices))); - case 'ChooseMultiple': - var choices = _v7.a.choices; + case 4: + var choices = _v7.a.k; return $elm$core$Maybe$Just( A2( $elm$html$Html$datalist, @@ -16329,7 +11580,7 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$option, _List_fromArray( [ - $elm$html$Html$Attributes$value(c.value) + $elm$html$Html$Attributes$value(c.j) ]), _List_Nil); }, @@ -16342,7 +11593,7 @@ var $author$project$Main$visibilityRuleSection = F4( } }(); var datalistAttr = function () { - if (datalistElement.$ === 'Just') { + if (!datalistElement.$) { return _List_fromArray( [ A2($elm$html$Html$Attributes$attribute, 'list', datalistId) @@ -16424,43 +11675,42 @@ var $author$project$Main$visibilityRuleSection = F4( 'value of ' + A2( $elm$json$Json$Encode$encode, 0, - $elm$json$Json$Encode$string(field.label))) + $elm$json$Json$Encode$string(field.d))) ])); }, A2($author$project$Main$otherQuestionTitles, formFields, fieldIndex)))) ])), - $author$project$Main$selectInputGroup( - { - children: function () { - if (datalistElement.$ === 'Just') { - var element = datalistElement.a; - return _List_fromArray( - [element]); - } else { - return _List_Nil; - } - }(), - inputAttrs: _Utils_ap( + function () { + var optionRecord = F4( + function (value, label, selected, disabled) { + return {bL: disabled, d: label, bi: selected, j: value}; + }); + var comparisonValueString = function () { + switch (rule.b.$) { + case 0: + var v = rule.b.a; + return v; + case 1: + var v = rule.b.a; + return v; + case 2: + var v = rule.b.a; + return v; + case 3: + var v = rule.b.a; + return v; + default: + var v = rule.b.a; + return v; + } + }(); + var textInputNode = A2( + $elm$html$Html$input, + _Utils_ap( _List_fromArray( [ $elm$html$Html$Attributes$type_('text'), - $elm$html$Html$Attributes$value( - function () { - switch (rule.b.$) { - case 'Equals': - var v = rule.b.a; - return v; - case 'StringContains': - var v = rule.b.a; - return v; - case 'EndsWith': - var v = rule.b.a; - return v; - default: - var v = rule.b.a; - return v; - } - }()), + $elm$html$Html$Attributes$value(comparisonValueString), $elm$html$Html$Events$onInput( function (str) { return A3( @@ -16473,50 +11723,155 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$Attributes$class('tff-comparison-value') ]), datalistAttr), - options: _List_fromArray( - [ - _Utils_Tuple3( - 'Equals', - 'Equals', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$Equals('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'StringContains', - 'Contains', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$StringContains('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'EndsWith', - 'Ends with', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$EndsWith('something'), - $author$project$Main$comparisonOf(rule))), - _Utils_Tuple3( - 'GreaterThan', - 'Greater than', - A2( - $author$project$Main$isComparingWith, - $author$project$Main$GreaterThan('something'), - $author$project$Main$comparisonOf(rule))) - ]), - selectAttrs: _List_fromArray( + _List_Nil); + var candidateFields = A2($author$project$Main$otherQuestionTitles, formFields, fieldIndex); + var candidateFieldsExceptSelf = A2( + $elm$core$List$filter, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return !_Utils_eq(fn, selectedFieldName); + }, + candidateFields); + var equalsFieldDisabled = $elm$core$List$isEmpty(candidateFieldsExceptSelf); + var optionsList = _List_fromArray( + [ + A4( + optionRecord, + 'Equals', + 'Equals', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$Equals('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'StringContains', + 'Contains', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$StringContains('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'EndsWith', + 'Ends with', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$EndsWith('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'GreaterThan', + 'Greater than', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$GreaterThan('something'), + $author$project$Main$comparisonOf(rule)), + false), + A4( + optionRecord, + 'EqualsField', + 'Equals (field)', + A2( + $author$project$Main$isComparingWith, + $author$project$Main$EqualsField('something'), + $author$project$Main$comparisonOf(rule)), + equalsFieldDisabled) + ]); + var otherFields = A2( + $elm$core$List$filter, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return !_Utils_eq(fn, selectedFieldName); + }, + candidateFields); + var fieldSelectNode = A2( + $elm$html$Html$select, + _List_fromArray( [ + $elm$html$Html$Attributes$class('tff-text-field tff-question-title'), $author$project$Main$onChange( function (str) { return A3( $author$project$Main$OnFormField, - A3($author$project$Main$OnVisibilityConditionTypeInput, ruleIndex, conditionIndex, str), + A3($author$project$Main$OnVisibilityConditionValueInput, ruleIndex, conditionIndex, str), fieldIndex, ''); }), - $elm$html$Html$Attributes$class('tff-comparison-type') - ]) - }) + $elm$html$Html$Attributes$value(comparisonValueString) + ]), + A2( + $elm$core$List$cons, + A2( + $elm$html$Html$option, + _List_fromArray( + [ + $elm$html$Html$Attributes$value('') + ]), + _List_fromArray( + [ + $elm$html$Html$text('-- Select a field --') + ])), + A2( + $elm$core$List$map, + function (f) { + var fn = A2($elm$core$Maybe$withDefault, f.d, f.Q); + return A2( + $elm$html$Html$option, + _List_fromArray( + [ + $elm$html$Html$Attributes$value(fn), + $elm$html$Html$Attributes$selected( + _Utils_eq(fn, comparisonValueString)) + ]), + _List_fromArray( + [ + $elm$html$Html$text( + 'value of ' + A2( + $elm$json$Json$Encode$encode, + 0, + $elm$json$Json$Encode$string(f.d))) + ])); + }, + otherFields))); + var inputNode = function () { + var _v3 = $author$project$Main$comparisonOf(rule); + if (_v3.$ === 4) { + return equalsFieldDisabled ? A2( + $elm$html$Html$input, + _List_fromArray( + [ + $elm$html$Html$Attributes$type_('text'), + $elm$html$Html$Attributes$value(''), + A2($elm$html$Html$Attributes$attribute, 'disabled', 'disabled'), + $elm$html$Html$Attributes$class('tff-comparison-value') + ]), + _List_Nil) : fieldSelectNode; + } else { + return textInputNode; + } + }(); + return $author$project$Main$selectInputGroup( + { + b5: inputNode, + cs: optionsList, + cN: _List_fromArray( + [ + $author$project$Main$onChange( + function (str) { + return A3( + $author$project$Main$OnFormField, + A3($author$project$Main$OnVisibilityConditionTypeInput, ruleIndex, conditionIndex, str), + fieldIndex, + ''); + }), + $elm$html$Html$Attributes$class('tff-comparison-type') + ]) + }); + }() ])); }); var rulesHtml = A2( @@ -16564,7 +11919,7 @@ var $author$project$Main$visibilityRuleSection = F4( $elm$html$Html$Attributes$required(true), $elm$html$Html$Attributes$value( function () { - if (visibilityRule.$ === 'ShowWhen') { + if (!visibilityRule.$) { return 'ShowWhen'; } else { return 'HideWhen'; @@ -16690,7 +12045,7 @@ var $author$project$Main$visibilityRulesSection = F3( A2( $elm$core$List$indexedMap, A2($author$project$Main$visibilityRuleSection, index, formFields), - formField.visibilityRule))), + formField.m))), A2( $elm$html$Html$div, _List_fromArray( @@ -16717,7 +12072,7 @@ var $author$project$Main$visibilityRulesSection = F3( }); var $author$project$Main$viewFormFieldBuilder = F5( function (shortTextTypeList, index, totalLength, formFields, formField) { - var isDuplicateLabel = A3($author$project$Main$hasDuplicateLabel, index, formField.label, formFields); + var isDuplicateLabel = A3($author$project$Main$hasDuplicateLabel, index, formField.d, formFields); var patternAttr = isDuplicateLabel ? _List_fromArray( [ $elm$html$Html$Attributes$pattern('^$') @@ -16742,7 +12097,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( [ $author$project$Main$SetEditorAnimate( $elm$core$Maybe$Just( - _Utils_Tuple2(index, $author$project$Main$AnimateFadeOut))), + _Utils_Tuple2(index, 1))), $author$project$Main$DeleteFormField(index) ]))) ]), @@ -16775,7 +12130,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$tabindex(0), $elm$html$Html$Attributes$checked( - $author$project$Main$requiredData(formField.presence)), + $author$project$Main$requiredData(formField.w)), $elm$html$Html$Events$onCheck( function (b) { return A3( @@ -16831,7 +12186,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( $elm$html$Html$text(' '), $elm$html$Html$text( 'Accept multiple ' + $elm$core$String$toLower( - $author$project$Main$stringFromInputField(formField.type_))) + $author$project$Main$stringFromInputField(formField.a))) ])) ])); var buildFieldClass = 'tff-build-field'; @@ -16862,7 +12217,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( _List_fromArray( [ $elm$html$Html$text( - $author$project$Main$stringFromInputField(formField.type_) + ' question title') + $author$project$Main$stringFromInputField(formField.a) + ' question title') ])), A2( $elm$html$Html$input, @@ -16871,7 +12226,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( [ $elm$html$Html$Attributes$type_('text'), $elm$html$Html$Attributes$id('label-' + idSuffix), - $elm$html$Html$Attributes$value(formField.label), + $elm$html$Html$Attributes$value(formField.d), $elm$html$Html$Attributes$required(true), $elm$html$Html$Events$onInput( A2($author$project$Main$OnFormField, $author$project$Main$OnLabelInput, index)), @@ -16891,27 +12246,27 @@ var $author$project$Main$viewFormFieldBuilder = F5( ])) : $elm$html$Html$text('') ])), function () { - if ($author$project$Main$mustBeOptional(formField.type_)) { + if ($author$project$Main$mustBeOptional(formField.a)) { return $elm$html$Html$text(''); } else { - var _v0 = formField.presence; - switch (_v0.$) { - case 'Required': + var _v0 = formField.w; + switch (_v0) { + case 0: return configureRequiredCheckbox; - case 'Optional': + case 1: return configureRequiredCheckbox; default: return $elm$html$Html$text(''); } } }(), - $author$project$Main$allowsTogglingMultiple(formField.type_) ? configureMultipleCheckbox : $elm$html$Html$text(''), + $author$project$Main$allowsTogglingMultiple(formField.a) ? configureMultipleCheckbox : $elm$html$Html$text(''), A2( $author$project$Main$inputAttributeOptional, { - htmlNode: function (result) { + af: function (result) { var valueString = function () { - if (result.$ === 'Ok') { + if (!result.$) { var a = result.a; return a; } else { @@ -16931,8 +12286,8 @@ var $author$project$Main$viewFormFieldBuilder = F5( ]), _List_Nil); }, - label: 'Question description', - onCheck: function (b) { + d: 'Question description', + ab: function (b) { return A3( $author$project$Main$OnFormField, $author$project$Main$OnDescriptionToggle(b), @@ -16940,7 +12295,7 @@ var $author$project$Main$viewFormFieldBuilder = F5( ''); } }, - formField.description) + formField.S) ]), _Utils_ap( A4($author$project$Main$viewFormFieldOptionsBuilder, shortTextTypeList, index, formFields, formField), @@ -16993,11 +12348,11 @@ var $author$project$Main$viewFormFieldBuilder = F5( ])) ])), function () { - var _v2 = formField.presence; - switch (_v2.$) { - case 'Required': + var _v2 = formField.w; + switch (_v2) { + case 0: return deleteFieldButton; - case 'Optional': + case 1: return deleteFieldButton; default: return $elm$html$Html$text(''); @@ -17013,7 +12368,7 @@ var $author$project$Main$viewRightPanel = function (modelData) { A2( $elm$core$List$cons, 'tff-right-panel', - (!_Utils_eq(modelData.selectedFieldIndex, $elm$core$Maybe$Nothing)) ? _List_fromArray( + (!_Utils_eq(modelData.F, $elm$core$Maybe$Nothing)) ? _List_fromArray( ['tff-panel-visible']) : _List_Nil)); return A2( $elm$html$Html$div, @@ -17061,18 +12416,18 @@ var $author$project$Main$viewRightPanel = function (modelData) { _List_fromArray( [ function () { - var _v0 = modelData.selectedFieldIndex; - if (_v0.$ === 'Just') { + var _v0 = modelData.F; + if (!_v0.$) { var index = _v0.a; - var _v1 = A2($elm$core$Array$get, index, modelData.formFields); - if (_v1.$ === 'Just') { + var _v1 = A2($elm$core$Array$get, index, modelData.g); + if (!_v1.$) { var formField = _v1.a; return A5( $author$project$Main$viewFormFieldBuilder, - modelData.shortTextTypeList, + modelData.al, index, - $elm$core$Array$length(modelData.formFields), - modelData.formFields, + $elm$core$Array$length(modelData.g), + modelData.g, formField); } else { return $elm$html$Html$text('Select a field to edit its settings'); @@ -17088,14 +12443,14 @@ var $author$project$Main$viewFormBuilder = F2( function (maybeAnimate, model) { var maybeFieldsList = A2( $author$project$Main$fieldsWithPlaceholder, - $elm$core$Array$toList(model.formFields), - model.dragged); + $elm$core$Array$toList(model.g), + model.q); var extraOptions = A2( $elm$core$List$map, function (customElement) { return $author$project$Main$ShortText(customElement); }, - model.shortTextTypeList); + model.al); return _List_fromArray( [ A2( @@ -17121,7 +12476,7 @@ var $author$project$Main$viewFormBuilder = F2( [ _Utils_Tuple2( 'tff-panel-hidden', - !_Utils_eq(model.selectedFieldIndex, $elm$core$Maybe$Nothing)) + !_Utils_eq(model.F, $elm$core$Maybe$Nothing)) ])) ]), _List_fromArray( @@ -17138,7 +12493,7 @@ var $author$project$Main$viewFormBuilder = F2( ])), A2( $author$project$Main$viewAddQuestionsList, - model.nextQuestionNumber, + model.aa, _Utils_ap($author$project$Main$allInputField, extraOptions)) ])), A2( @@ -17151,7 +12506,7 @@ var $author$project$Main$viewFormBuilder = F2( [ _Utils_Tuple2( 'tff-panel-hidden', - !_Utils_eq(model.selectedFieldIndex, $elm$core$Maybe$Nothing)) + !_Utils_eq(model.F, $elm$core$Maybe$Nothing)) ])), $elm$html$Html$Events$onClick( $author$project$Main$SelectField($elm$core$Maybe$Nothing)) @@ -17179,7 +12534,7 @@ var $author$project$Main$viewFormBuilder = F2( }); var $author$project$Main$OnFormValuesUpdated = F2( function (a, b) { - return {$: 'OnFormValuesUpdated', a: a, b: b}; + return {$: 15, a: a, b: b}; }); var $author$project$Main$fieldHasEmptyFilter = F2( function (formField, trackedFormValues) { @@ -17196,8 +12551,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( A2($elm$core$Dict$get, fieldName, trackedFormValues)))); }; var getFilterField = function (filter) { - if (filter.$ === 'Just') { - if (filter.a.$ === 'FilterStartsWithFieldValueOf') { + if (!filter.$) { + if (!filter.a.$) { var fieldName = filter.a.a; return $elm$core$Maybe$Just(fieldName); } else { @@ -17208,10 +12563,10 @@ var $author$project$Main$fieldHasEmptyFilter = F2( return $elm$core$Maybe$Nothing; } }; - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'Dropdown': - var filter = _v0.a.filter; + case 2: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17219,8 +12574,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( $elm$core$Maybe$map, isFilterFieldEmpty, getFilterField(filter))); - case 'ChooseOne': - var filter = _v0.a.filter; + case 3: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17228,8 +12583,8 @@ var $author$project$Main$fieldHasEmptyFilter = F2( $elm$core$Maybe$map, isFilterFieldEmpty, getFilterField(filter))); - case 'ChooseMultiple': - var filter = _v0.a.filter; + case 4: + var filter = _v0.a.e; return A2( $elm$core$Maybe$withDefault, false, @@ -17242,22 +12597,27 @@ var $author$project$Main$fieldHasEmptyFilter = F2( } }); var $author$project$Main$isChooseManyUsingMinMax = function (formField) { - var _v0 = formField.type_; + var _v0 = formField.a; switch (_v0.$) { - case 'ShortText': + case 0: return false; - case 'LongText': + case 1: return false; - case 'ChooseMultiple': - var minRequired = _v0.a.minRequired; - var maxAllowed = _v0.a.maxAllowed; + case 4: + var minRequired = _v0.a.P; + var maxAllowed = _v0.a.T; return (!_Utils_eq(minRequired, $elm$core$Maybe$Nothing)) || (!_Utils_eq(maxAllowed, $elm$core$Maybe$Nothing)); - case 'ChooseOne': + case 3: return false; default: return false; } }; +var $elm$core$Basics$composeL = F3( + function (g, f, x) { + return g( + f(x)); + }); var $elm$core$List$all = F2( function (isOkay, list) { return !A2( @@ -17272,7 +12632,7 @@ var $author$project$Main$evaluateCondition = F2( var fieldName = condition.a; var comparison = condition.b; switch (comparison.$) { - case 'Equals': + case 0: var givenValue = comparison.a; return A2( $elm$core$List$member, @@ -17281,7 +12641,7 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - case 'StringContains': + case 1: var givenValue = comparison.a; return A2( $elm$core$List$any, @@ -17290,7 +12650,7 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - case 'EndsWith': + case 2: var givenValue = comparison.a; return A2( $elm$core$List$any, @@ -17299,13 +12659,13 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); - default: + case 3: var givenValue = comparison.a; return A2( $elm$core$List$any, function (formValue) { var _v2 = $elm$core$String$toFloat(givenValue); - if (_v2.$ === 'Just') { + if (!_v2.$) { var givenFloat = _v2.a; return A2( $elm$core$Maybe$withDefault, @@ -17324,6 +12684,21 @@ var $author$project$Main$evaluateCondition = F2( $elm$core$Maybe$withDefault, _List_Nil, A2($elm$core$Dict$get, fieldName, trackedFormValues))); + default: + var otherFieldName = comparison.a; + var otherValues = A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, otherFieldName, trackedFormValues)); + return A2( + $elm$core$List$any, + function (v) { + return A2($elm$core$List$member, v, otherValues); + }, + A2( + $elm$core$Maybe$withDefault, + _List_Nil, + A2($elm$core$Dict$get, fieldName, trackedFormValues))); } }); var $author$project$Main$isVisibilityRuleSatisfied = F2( @@ -17331,7 +12706,7 @@ var $author$project$Main$isVisibilityRuleSatisfied = F2( return $elm$core$List$isEmpty(rules) || A2( $elm$core$List$any, function (rule) { - if (rule.$ === 'ShowWhen') { + if (!rule.$) { var conditions = rule.a; return A2( $elm$core$List$all, @@ -17349,10 +12724,10 @@ var $author$project$Main$isVisibilityRuleSatisfied = F2( }); var $author$project$Main$viewFormPreview = F2( function (customAttrs, _v0) { - var formFields = _v0.formFields; - var needsFormLogic = _v0.needsFormLogic; - var trackedFormValues = _v0.trackedFormValues; - var shortTextTypeDict = _v0.shortTextTypeDict; + var formFields = _v0.g; + var needsFormLogic = _v0._; + var trackedFormValues = _v0.u; + var shortTextTypeDict = _v0.ak; var onInputAttrs = function (fieldName) { return _List_fromArray( [ @@ -17371,7 +12746,7 @@ var $author$project$Main$viewFormPreview = F2( [ $elm$html$Html$Events$onCheck( function (_v5) { - return A2($author$project$Main$OnFormValuesUpdated, fieldName, choice.value); + return A2($author$project$Main$OnFormValuesUpdated, fieldName, choice.j); }) ]); }); @@ -17392,21 +12767,21 @@ var $author$project$Main$viewFormPreview = F2( $elm$core$Array$toList(formFields)); var needsEventHandlers = needsFormLogic || (isAnyChooseManyUsingMinMax || hasOptionalTemporalInputs); var config = { - customAttrs: customAttrs, - formFields: formFields, - needsFormLogic: needsFormLogic, - onChange: needsEventHandlers ? onChangeAttrs : function (_v1) { + Y: customAttrs, + g: formFields, + _: needsFormLogic, + bf: needsEventHandlers ? onChangeAttrs : function (_v1) { return _List_Nil; }, - onChooseMany: needsEventHandlers ? onChooseManyAttrs : F2( + bg: needsEventHandlers ? onChooseManyAttrs : F2( function (_v2, _v3) { return _List_Nil; }), - onInput: needsEventHandlers ? onInputAttrs : function (_v4) { + aO: needsEventHandlers ? onInputAttrs : function (_v4) { return _List_Nil; }, - shortTextTypeDict: shortTextTypeDict, - trackedFormValues: trackedFormValues + ak: shortTextTypeDict, + u: trackedFormValues }; return $elm$core$Array$toList( A2( @@ -17415,7 +12790,7 @@ var $author$project$Main$viewFormPreview = F2( A2( $elm$core$Array$filter, function (formField) { - return A2($author$project$Main$isVisibilityRuleSatisfied, formField.visibilityRule, trackedFormValues) && (!A2($author$project$Main$fieldHasEmptyFilter, formField, trackedFormValues)); + return A2($author$project$Main$isVisibilityRuleSatisfied, formField.m, trackedFormValues) && (!A2($author$project$Main$fieldHasEmptyFilter, formField, trackedFormValues)); }, formFields))); }); @@ -17425,11 +12800,11 @@ var $author$project$Main$viewMain = function (model) { _List_fromArray( [ $elm$html$Html$Attributes$class( - 'tff tff-container tff-mode-' + $author$project$Main$stringFromViewMode(model.viewMode)) + 'tff tff-container tff-mode-' + $author$project$Main$stringFromViewMode(model.ac)) ]), function () { - var _v0 = model.viewMode; - if (_v0.$ === 'Editor') { + var _v0 = model.ac; + if (!_v0.$) { var editorAttr = _v0.a; return A2( $elm$core$List$cons, @@ -17443,18 +12818,18 @@ var $author$project$Main$viewMain = function (model) { A2( $elm$json$Json$Encode$encode, 0, - $author$project$Main$encodeFormFields(model.formFields))) + $author$project$Main$encodeFormFields(model.g))) ]), _List_Nil), - A2($author$project$Main$viewFormBuilder, editorAttr.maybeAnimate, model)); + A2($author$project$Main$viewFormBuilder, editorAttr.aB, model)); } else { return A2($author$project$Main$viewFormPreview, _List_Nil, model); } }()); }; var $author$project$Main$view = function (model) { - var _v0 = model.initError; - if (_v0.$ === 'Just') { + var _v0 = model.aW; + if (!_v0.$) { var errString = _v0.a; return A2( $elm$html$Html$div, @@ -17484,5 +12859,5 @@ var $author$project$Main$view = function (model) { } }; var $author$project$Main$main = $elm$browser$Browser$element( - {init: $author$project$Main$init, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view}); -_Platform_export({'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)({"versions":{"elm":"0.19.1"},"types":{"message":"Main.Msg","aliases":{"Main.Droppable":{"args":[],"type":"( Basics.Int, Maybe.Maybe Main.FormField )"},"Main.FormField":{"args":[],"type":"{ label : String.String, name : Maybe.Maybe String.String, presence : Main.Presence, description : Main.AttributeOptional String.String, type_ : Main.InputField, visibilityRule : List.List Main.VisibilityRule }"},"Main.Choice":{"args":[],"type":"{ label : String.String, value : String.String }"},"Main.CustomElement":{"args":[],"type":"{ inputType : String.String, inputTag : String.String, attributes : Dict.Dict String.String String.String, multiple : Main.AttributeOptional Basics.Bool, maxlength : Main.AttributeOptional Basics.Int, datalist : Main.AttributeOptional (List.List Main.Choice), min : Main.AttributeOptional String.String, max : Main.AttributeOptional String.String }"}},"unions":{"Main.Msg":{"args":[],"tags":{"NoOp":[],"OnPortIncoming":["Json.Encode.Value"],"AddFormField":["Main.InputField"],"DeleteFormField":["Basics.Int"],"MoveFormFieldUp":["Basics.Int"],"MoveFormFieldDown":["Basics.Int"],"OnFormField":["Main.FormFieldMsg","Basics.Int","String.String"],"SetEditorAnimate":["Maybe.Maybe ( Basics.Int, Main.Animate )"],"SelectField":["Maybe.Maybe Basics.Int"],"DragStart":["Basics.Int"],"DragStartNew":["Main.FormField"],"DragEnd":[],"DragOver":["Maybe.Maybe Main.Droppable"],"Drop":["Maybe.Maybe Basics.Int"],"DoSleepDo":["Basics.Float","List.List Main.Msg"],"OnFormValuesUpdated":["String.String","String.String"]}},"Main.Animate":{"args":[],"tags":{"AnimateYellowFade":[],"AnimateFadeOut":[]}},"Main.AttributeOptional":{"args":["a"],"tags":{"AttributeNotNeeded":["Maybe.Maybe a"],"AttributeInvalid":["String.String"],"AttributeGiven":["a"]}},"Basics.Float":{"args":[],"tags":{"Float":[]}},"Main.FormFieldMsg":{"args":[],"tags":{"OnLabelInput":[],"OnDescriptionInput":[],"OnDescriptionToggle":["Basics.Bool"],"OnRequiredInput":["Basics.Bool"],"OnChoicesInput":[],"OnMultipleToggle":["Basics.Bool"],"OnMaxLengthToggle":["Basics.Bool"],"OnMaxLengthInput":[],"OnDatalistToggle":["Basics.Bool"],"OnDatalistInput":[],"OnVisibilityRuleTypeInput":["Basics.Int","String.String"],"OnVisibilityConditionTypeInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionFieldInput":["Basics.Int","Basics.Int","String.String"],"OnVisibilityConditionValueInput":["Basics.Int","Basics.Int","String.String"],"OnAddVisibilityRule":[],"OnVisibilityConditionDuplicate":["Basics.Int"],"OnCheckboxMinRequiredInput":["String.String"],"OnCheckboxMaxAllowedInput":["String.String"],"OnDateMinToggle":["Basics.Bool"],"OnDateMaxToggle":["Basics.Bool"],"OnDateMinInput":["String.String"],"OnDateMaxInput":["String.String"],"OnFilterToggle":["Basics.Bool"],"OnFilterTypeSelect":["String.String"],"OnFilterSourceFieldSelect":["String.String"]}},"Main.InputField":{"args":[],"tags":{"ShortText":["Main.CustomElement"],"LongText":["Main.AttributeOptional Basics.Int"],"Dropdown":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseOne":["{ choices : List.List Main.Choice, filter : Maybe.Maybe Main.ChoiceFilter }"],"ChooseMultiple":["{ choices : List.List Main.Choice, minRequired : Maybe.Maybe Basics.Int, maxAllowed : Maybe.Maybe Basics.Int, filter : Maybe.Maybe Main.ChoiceFilter }"]}},"Basics.Int":{"args":[],"tags":{"Int":[]}},"List.List":{"args":["a"],"tags":{}},"Maybe.Maybe":{"args":["a"],"tags":{"Just":["a"],"Nothing":[]}},"Main.Presence":{"args":[],"tags":{"Required":[],"Optional":[],"System":[]}},"String.String":{"args":[],"tags":{"String":[]}},"Json.Encode.Value":{"args":[],"tags":{"Value":[]}},"Main.VisibilityRule":{"args":[],"tags":{"ShowWhen":["List.List Main.Condition"],"HideWhen":["List.List Main.Condition"]}},"Basics.Bool":{"args":[],"tags":{"True":[],"False":[]}},"Main.ChoiceFilter":{"args":[],"tags":{"FilterStartsWithFieldValueOf":["String.String"],"FilterContainsFieldValueOf":["String.String"]}},"Main.Condition":{"args":[],"tags":{"Field":["String.String","Main.Comparison"]}},"Dict.Dict":{"args":["k","v"],"tags":{"RBNode_elm_builtin":["Dict.NColor","k","v","Dict.Dict k v","Dict.Dict k v"],"RBEmpty_elm_builtin":[]}},"Main.Comparison":{"args":[],"tags":{"Equals":["String.String"],"StringContains":["String.String"],"EndsWith":["String.String"],"GreaterThan":["String.String"]}},"Dict.NColor":{"args":[],"tags":{"Red":[],"Black":[]}}}}})}});}(this)); \ No newline at end of file + {ds: $author$project$Main$init, dS: $author$project$Main$subscriptions, dV: $author$project$Main$update, dW: $author$project$Main$view}); +_Platform_export({'Main':{'init':$author$project$Main$main($elm$json$Json$Decode$value)(0)}});}(this)); \ No newline at end of file diff --git a/dist/tiny-form-fields.min.css b/dist/tiny-form-fields.min.css index 2a8cf3b..9faa98c 100644 --- a/dist/tiny-form-fields.min.css +++ b/dist/tiny-form-fields.min.css @@ -55,4 +55,4 @@ .tff-center-panel input[type=time]:not(:valid)::-webkit-datetime-edit-minute-field,.tff-editor-layout .tff-center-panel - input[type=time]:not(:valid)::-webkit-datetime-edit-second-field,.tff-editor-layout .tff-center-panel input[type=date]:not(:valid)::-webkit-datetime-edit-text,.tff-editor-layout .tff-center-panel input[type=time]:not(:valid)::-webkit-datetime-edit-text{color:transparent!important;opacity:0!important}.tff-editor-layout .tff-center-panel input[type=date].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=date]:not(:valid),.tff-editor-layout .tff-center-panel input[type=datetime-local].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=datetime-local]:not(:valid),.tff-editor-layout .tff-center-panel input[type=time].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=time]:not(:valid){color:inherit!important;opacity:1!important}.tff-dropdown-group{display:grid}.tff-dropdown-group select{-webkit-appearance:none;-moz-appearance:none;appearance:none}@media (forced-colors:active){.tff-dropdown-group select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}.tff-dropdown-group select{border-width:1px;grid-row-start:1;grid-column-start:1;--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.tff-dropdown-group select:hover{--tw-border-opacity:1;border-color:rgb(6 182 212/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.tff-dropdown-group select{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1));--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1));padding:.5rem;border-radius:.25rem}.tff-dropdown-group select.tff-select-disabled{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.tff-dropdown-group svg{pointer-events:none;z-index:10;right:.25rem;position:relative;grid-column-start:1;grid-row-start:1;height:1rem;width:1rem;margin-right:.5rem;align-self:center;justify-self:end}@media (forced-colors:active){.tff-dropdown-group svg{display:none}}.tff-choosemany-group,.tff-chooseone-group{display:grid}.tff-choosemany-group .tff-choosemany-checkboxes,.tff-chooseone-group .tff-chooseone-radiobuttons{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:.5rem}.tff-checkbox-group,.tff-radiobuttons-group{display:flex}.tff-checkbox-group .tff-field-label input,.tff-field-group .tff-field-label input,.tff-radiobuttons-group .tff-field-label input,.tff-toggle-group .tff-field-label input{border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));vertical-align:middle;margin-bottom:.125rem}.tff-build-field{display:grid;grid-template-rows:auto auto 1fr auto;gap:0}.tff-build-field-buttons{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:4rem}.tff-build-field-buttons .tff-move{display:flex}.tff-build-field-buttons .tff-move>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.tff-settings-content button{font-size:.75rem;line-height:1rem;--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.tff-settings-content button:hover{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.tff-settings-content button{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1));padding:.5rem 1rem;border-radius:.25rem}.tff-build-field-buttons button.tff-delete{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.tff-dropdown-button{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1));--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.tff-dropdown-button:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.tff-dropdown-button:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);outline:2px solid transparent;outline-offset:2px;--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity,1))}.tff-dropdown-button{font-weight:500;border-radius:.5rem;font-size:.875rem;line-height:1.25rem;padding:.625rem 1.25rem;text-align:center;display:inline-flex;align-items:center}.tff-dropdown-open{display:block;position:absolute}.tff-dropdown-closed{display:none}.tff-selectinput-wrapper{margin-top:.5rem}.tff-selectinput-group{display:flex;align-items:center;border-radius:.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));outline-style:solid;outline-width:1px;outline-offset:-1px;outline-color:#d1d5db}.tff-selectinput-group:has(input:focus-within){outline-style:solid;outline-width:2px;outline-offset:-2px;outline-color:#4f46e5}.tff-selectinput-input{display:block;min-width:0;flex-grow:1;padding:.375rem .75rem .375rem .25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.tff-selectinput-input::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-input::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-input:focus{outline-style:solid;outline-width:0}@media (min-width:640px){.tff-selectinput-input{font-size:.875rem;line-height:1.5rem}}.tff-selectinput-select-wrapper{display:grid;flex-shrink:0;grid-template-columns:repeat(1,minmax(0,1fr))}.tff-selectinput-select-wrapper:focus-within{position:relative}.tff-selectinput-select{grid-column-start:1;grid-row-start:1;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.375rem;padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-selectinput-select::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-select::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-select:focus{outline-style:solid;outline-width:2px;outline-offset:-2px;outline-color:#4f46e5}@media (min-width:640px){.tff-selectinput-select{font-size:.875rem;line-height:1.5rem}}.tff-selectarrow-icon{pointer-events:none;grid-column-start:1;grid-row-start:1;margin-right:.5rem;width:1.25rem;height:1.25rem;align-self:center;justify-self:end;--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}@media (min-width:640px){.tff-selectarrow-icon{width:1rem;height:1rem}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes yellowFade{0%{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}to{background-color:transparent}}.tff-animate-fadeOut{animation:fadeOut .5s ease-in-out}.tff-animate-yellowFade{animation:yellowFade .5s ease-in-out}.tff-field-preview{position:relative;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.5rem;padding:1rem;margin-bottom:.5rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;border-width:1px;--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1));cursor:pointer}.tff-field-preview:hover{border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.tff-field-preview:hover,.tff-field-preview[data-selected=true]{--tw-border-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-field-preview[data-selected=true]{border-color:rgb(59 130 246/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.tff-field-preview[data-selected=true] .tff-drag-handle{opacity:1}.tff-field-preview[data-selected=true]:hover{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.tff-field-preview[data-dragging=true]{opacity:.5;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-drag-handle{position:absolute;top:0;left:50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:move;display:flex;align-items:center;justify-content:center;width:1.5rem;margin-top:.25rem;opacity:0;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.tff-drag-handle-icon{height:1rem;width:1rem;--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-logic-indicators-container{position:absolute;top:.25rem;right:.25rem;display:flex;flex-direction:row;gap:.25rem}.tff-logic-indicator{border-radius:.75rem;height:1.25rem;padding-left:.5rem;padding-right:.5rem;display:flex;align-items:center;justify-content:center;font-size:.75rem;line-height:1rem;cursor:help;white-space:nowrap}.tff-logic-indicator-blue{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.tff-logic-indicator-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:#999fa8}.tff-logic-indicator-orange{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.tff-field-preview:hover .tff-drag-handle,.tff-field-preview[data-selected=true] .tff-drag-handle{opacity:1}.tff-settings-content{overflow-y:auto;flex-grow:1}.tff-field-placeholder{height:8rem;border-width:2px;border-style:dashed;--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1));border-radius:.5rem;--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.tff-field-wrapper{display:flex;flex-direction:column;gap:0;cursor:move}.tff-field-container{position:relative;min-height:40px}.tff-field-preview>div:last-child{flex-grow:1}.tff-editor-layout{display:flex;flex-direction:column;min-height:100vh;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));position:relative}.tff-center-panel{flex-grow:1;padding:1rem;width:100%;min-height:50vh;order:1}.tff-left-panel{--tw-bg-opacity:1;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1));order:2}.tff-left-panel,.tff-right-panel{width:100%;background-color:rgb(249 250 251/var(--tw-bg-opacity,1));padding:1rem}.tff-right-panel{--tw-bg-opacity:1;position:fixed;inset:0;z-index:50;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-translate-x:100%}.tff-right-panel,.tff-right-panel.tff-panel-visible{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.tff-right-panel.tff-panel-visible{--tw-translate-x:0px}.tff-container{container-type:inline-size}.tff-container :disabled{cursor:not-allowed}@container (min-width: 640px) and (max-width: 1024px){.tff-editor-layout{flex-direction:row;height:100vh;overflow:hidden;position:relative}.tff-left-panel{width:20rem;border-top-width:0;border-right-width:1px;flex-shrink:0;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.tff-center-panel,.tff-left-panel{order:0;overflow-y:auto;position:relative}.tff-center-panel{flex:1 1 0%;min-width:0}.tff-right-panel{width:20rem;position:absolute;top:0;left:0;height:100%;transform:none;order:0;overflow-y:auto;border-right-width:1px;flex-shrink:0;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-translate-x:-100%;z-index:50;--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.tff-right-panel,.tff-right-panel.tff-panel-visible{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.tff-right-panel.tff-panel-visible{--tw-translate-x:0px}.tff-right-panel.tff-panel-visible~.tff-left-panel{opacity:0;pointer-events:none}}@container (min-width: 1024px){.tff-editor-layout{flex-direction:row;height:100vh;overflow:hidden}.tff-left-panel{width:16rem;border-top-width:0;border-right-width:1px;flex-shrink:0}.tff-center-panel,.tff-left-panel{order:0;overflow-y:auto;position:relative}.tff-center-panel{flex:1 1 0%;min-width:0}.tff-right-panel{width:20rem;position:static;transform:none;--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));order:0;overflow-y:auto;border-left-width:1px;flex-shrink:0;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.tff-right-panel:not(.tff-panel-visible){width:0;border-left-width:0;padding:0;overflow:hidden}.tff-panel-hidden{display:block}}.tff-panel-header{margin-bottom:1rem}.tff-close-button{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-close-button:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.tff-close-button{font-size:1.5rem;line-height:2rem;font-weight:700;padding:.5rem;margin-right:-.5rem}.tff-panel-header{font-weight:700;font-size:1.125rem;line-height:1.75rem;padding:.75rem 1rem;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));display:flex;align-items:center;justify-content:space-between}.tff-panel-header .tff-close-button{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-panel-header .tff-close-button:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.tff-panel-header .tff-close-button{font-size:1.25rem;line-height:1.75rem;font-weight:500;margin-left:.5rem}.tff-field-list,.tff-right-panel>div:last-child{overflow-y:auto}.tff-center-panel{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));padding:1rem 1rem 6rem;overflow-y:auto}.tff-field-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.tff-field-list-item{padding:.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.25rem;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.tff-field-list-item,.tff-field-list-item:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-field-list-item:hover{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.tff-field-list-item{cursor:pointer;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.tff-fields-container{min-height:200px}.tff-button{display:inline-flex;align-items:center;justify-content:center;border-radius:.375rem;padding:.5rem .75rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-button:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px}.tff-button-secondary{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1));--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);--tw-ring-inset:inset;--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.tff-button-secondary:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}@media (min-width:768px){.md\:w-11\/12{width:91.666667%}.md\:p-3{padding:.75rem}} \ No newline at end of file + input[type=time]:not(:valid)::-webkit-datetime-edit-second-field,.tff-editor-layout .tff-center-panel input[type=date]:not(:valid)::-webkit-datetime-edit-text,.tff-editor-layout .tff-center-panel input[type=time]:not(:valid)::-webkit-datetime-edit-text{color:transparent!important;opacity:0!important}.tff-editor-layout .tff-center-panel input[type=date].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=date]:not(:valid),.tff-editor-layout .tff-center-panel input[type=datetime-local].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=datetime-local]:not(:valid),.tff-editor-layout .tff-center-panel input[type=time].tff-empty-optional,.tff-editor-layout .tff-center-panel input[type=time]:not(:valid){color:inherit!important;opacity:1!important}.tff-dropdown-group{display:grid}.tff-dropdown-group select{-webkit-appearance:none;-moz-appearance:none;appearance:none}@media (forced-colors:active){.tff-dropdown-group select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}.tff-dropdown-group select{border-width:1px;grid-row-start:1;grid-column-start:1;--tw-bg-opacity:1;background-color:rgb(248 250 252/var(--tw-bg-opacity,1))}.tff-dropdown-group select:hover{--tw-border-opacity:1;border-color:rgb(6 182 212/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.tff-dropdown-group select{--tw-border-opacity:1;border-color:rgb(203 213 225/var(--tw-border-opacity,1));--tw-text-opacity:1;color:rgb(51 65 85/var(--tw-text-opacity,1));padding:.5rem;border-radius:.25rem}.tff-dropdown-group select.tff-select-disabled{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.tff-dropdown-group svg{pointer-events:none;z-index:10;right:.25rem;position:relative;grid-column-start:1;grid-row-start:1;height:1rem;width:1rem;margin-right:.5rem;align-self:center;justify-self:end}@media (forced-colors:active){.tff-dropdown-group svg{display:none}}.tff-choosemany-group,.tff-chooseone-group{display:grid}.tff-choosemany-group .tff-choosemany-checkboxes,.tff-chooseone-group .tff-chooseone-radiobuttons{display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:.5rem}.tff-checkbox-group,.tff-radiobuttons-group{display:flex}.tff-checkbox-group .tff-field-label input,.tff-field-group .tff-field-label input,.tff-radiobuttons-group .tff-field-label input,.tff-toggle-group .tff-field-label input{border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1));vertical-align:middle;margin-bottom:.125rem}.tff-build-field{display:grid;grid-template-rows:auto auto 1fr auto;gap:0}.tff-build-field-buttons{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:4rem}.tff-build-field-buttons .tff-move{display:flex}.tff-build-field-buttons .tff-move>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)))}.tff-settings-content button{font-size:.75rem;line-height:1rem;--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.tff-settings-content button:hover{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.tff-settings-content button{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1));padding:.5rem 1rem;border-radius:.25rem}.tff-build-field-buttons button.tff-delete{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.tff-dropdown-button{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1));--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.tff-dropdown-button:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.tff-dropdown-button:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);outline:2px solid transparent;outline-offset:2px;--tw-ring-opacity:1;--tw-ring-color:rgb(147 197 253/var(--tw-ring-opacity,1))}.tff-dropdown-button{font-weight:500;border-radius:.5rem;font-size:.875rem;line-height:1.25rem;padding:.625rem 1.25rem;text-align:center;display:inline-flex;align-items:center}.tff-dropdown-open{display:block;position:absolute}.tff-dropdown-closed{display:none}.tff-selectinput-wrapper{margin-top:.5rem}.tff-selectinput-group{display:flex;align-items:center;border-radius:.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));outline-style:solid;outline-width:1px;outline-offset:-1px;outline-color:#d1d5db}.tff-selectinput-group:has(input:focus-within){outline-style:solid;outline-width:2px;outline-offset:-2px;outline-color:#4f46e5}.tff-selectinput-input{display:block;min-width:0;flex-grow:1;padding:.375rem .75rem .375rem .25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.tff-selectinput-input::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-input::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-input:focus{outline-style:solid;outline-width:0}@media (min-width:640px){.tff-selectinput-input{font-size:.875rem;line-height:1.5rem}}.tff-selectinput-select-wrapper{display:grid;flex-shrink:0;grid-template-columns:repeat(1,minmax(0,1fr))}.tff-selectinput-select-wrapper:focus-within{position:relative}.tff-selectinput-select{grid-column-start:1;grid-row-start:1;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.375rem;padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-selectinput-select::-moz-placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-select::placeholder{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-selectinput-select:focus{outline-style:solid;outline-width:2px;outline-offset:-2px;outline-color:#4f46e5}@media (min-width:640px){.tff-selectinput-select{font-size:.875rem;line-height:1.5rem}}.tff-selectarrow-icon{pointer-events:none;grid-column-start:1;grid-row-start:1;margin-right:.5rem;width:1.25rem;height:1.25rem;align-self:center;justify-self:end;--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}@media (min-width:640px){.tff-selectarrow-icon{width:1rem;height:1rem}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes yellowFade{0%{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}to{background-color:transparent}}.tff-animate-fadeOut{animation:fadeOut .5s ease-in-out}.tff-animate-yellowFade{animation:yellowFade .5s ease-in-out}.tff-field-preview{position:relative;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.5rem;padding:1rem;margin-bottom:.5rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s;border-width:1px;--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1));cursor:pointer}.tff-field-preview:hover{border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.tff-field-preview:hover,.tff-field-preview[data-selected=true]{--tw-border-opacity:1;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-field-preview[data-selected=true]{border-color:rgb(59 130 246/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.tff-field-preview[data-selected=true] .tff-drag-handle{opacity:1}.tff-field-preview[data-selected=true]:hover{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.tff-field-preview[data-dragging=true]{opacity:.5;--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-drag-handle{position:absolute;top:0;left:50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));cursor:move;display:flex;align-items:center;justify-content:center;width:1.5rem;margin-top:.25rem;opacity:0;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.tff-drag-handle-icon{height:1rem;width:1rem;--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.tff-logic-indicators-container{position:absolute;top:.25rem;right:.25rem;display:flex;flex-direction:row;gap:.25rem}.tff-logic-indicator{border-radius:.75rem;height:1.25rem;padding-left:.5rem;padding-right:.5rem;display:flex;align-items:center;justify-content:center;font-size:.75rem;line-height:1rem;cursor:help;white-space:nowrap}.tff-logic-indicator-blue{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.tff-logic-indicator-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1));color:#999fa8}.tff-logic-indicator-orange{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.tff-field-preview:hover .tff-drag-handle,.tff-field-preview[data-selected=true] .tff-drag-handle{opacity:1}.tff-settings-content{overflow-y:auto;flex-grow:1}.tff-field-placeholder{height:8rem;border-width:2px;border-style:dashed;--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1));border-radius:.5rem;--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.tff-field-wrapper{display:flex;flex-direction:column;gap:0;cursor:move}.tff-field-container{position:relative;min-height:40px}.tff-field-preview>div:last-child{flex-grow:1}.tff-editor-layout{display:flex;flex-direction:column;min-height:100vh;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));position:relative}.tff-center-panel{flex-grow:1;padding:1rem;width:100%;min-height:50vh;order:1}.tff-left-panel{--tw-bg-opacity:1;border-top-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1));order:2}.tff-left-panel,.tff-right-panel{width:100%;background-color:rgb(249 250 251/var(--tw-bg-opacity,1));padding:1rem}.tff-right-panel{--tw-bg-opacity:1;position:fixed;inset:0;z-index:50;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-translate-x:100%}.tff-right-panel,.tff-right-panel.tff-panel-visible{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.tff-right-panel.tff-panel-visible{--tw-translate-x:0px}.tff-container{container-type:inline-size}.tff-container :disabled{cursor:not-allowed}@container (min-width: 640px) and (max-width: 1024px){.tff-editor-layout{flex-direction:row;height:100vh;overflow:hidden;position:relative}.tff-left-panel{width:20rem;border-top-width:0;border-right-width:1px;flex-shrink:0;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.tff-center-panel,.tff-left-panel{order:0;overflow-y:auto;position:relative}.tff-center-panel{flex:1 1 0%;min-width:0}.tff-right-panel{width:20rem;position:absolute;top:0;left:0;height:100%;transform:none;order:0;overflow-y:auto;border-right-width:1px;flex-shrink:0;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;--tw-translate-x:-100%;z-index:50;--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.tff-right-panel,.tff-right-panel.tff-panel-visible{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.tff-right-panel.tff-panel-visible{--tw-translate-x:0px}.tff-right-panel.tff-panel-visible~.tff-left-panel{opacity:0;pointer-events:none}}@container (min-width: 1024px){.tff-editor-layout{flex-direction:row;height:100vh;overflow:hidden}.tff-left-panel{width:16rem;border-top-width:0;border-right-width:1px;flex-shrink:0}.tff-center-panel,.tff-left-panel{order:0;overflow-y:auto;position:relative}.tff-center-panel{flex:1 1 0%;min-width:0}.tff-right-panel{width:20rem;position:static;transform:none;--tw-translate-x:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));order:0;overflow-y:auto;border-left-width:1px;flex-shrink:0;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.tff-right-panel:not(.tff-panel-visible){width:0;border-left-width:0;padding:0;overflow:hidden}.tff-panel-hidden{display:block}}.tff-panel-header{margin-bottom:1rem}.tff-close-button{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-close-button:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.tff-close-button{font-size:1.5rem;line-height:2rem;font-weight:700;padding:.5rem;margin-right:-.5rem}.tff-panel-header{font-weight:700;font-size:1.125rem;line-height:1.75rem;padding:.75rem 1rem;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1));--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));display:flex;align-items:center;justify-content:space-between}.tff-panel-header .tff-close-button{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.tff-panel-header .tff-close-button:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.tff-panel-header .tff-close-button{font-size:1.25rem;line-height:1.75rem;font-weight:500;margin-left:.5rem}.tff-field-list,.tff-right-panel>div:last-child{overflow-y:auto}.tff-center-panel{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));padding:1rem 1rem 6rem;overflow-y:auto}.tff-field-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.tff-field-list-item{padding:.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));border-radius:.25rem;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.tff-field-list-item,.tff-field-list-item:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-field-list-item:hover{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.tff-field-list-item{cursor:pointer;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.tff-fields-container{min-height:200px}.tff-button{display:inline-flex;align-items:center;justify-content:center;border-radius:.375rem;padding:.5rem .75rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.tff-button:focus-visible{outline-style:solid;outline-width:2px;outline-offset:2px}.tff-button-secondary{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1));--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);--tw-ring-inset:inset;--tw-ring-opacity:1;--tw-ring-color:rgb(209 213 219/var(--tw-ring-opacity,1))}.tff-button-secondary:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.tff-comparison-value:focus,.tff-comparison-value:focus-visible{outline:none!important;box-shadow:none!important}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity,1))}.hover\:bg-red-700:hover{--tw-bg-opacity:1;background-color:rgb(185 28 28/var(--tw-bg-opacity,1))}@media (min-width:768px){.md\:w-11\/12{width:91.666667%}.md\:p-3{padding:.75rem}} \ No newline at end of file diff --git a/e2e/equals-field.spec.ts b/e2e/equals-field.spec.ts new file mode 100644 index 0000000..136842a --- /dev/null +++ b/e2e/equals-field.spec.ts @@ -0,0 +1,102 @@ +import { test, expect } from '@playwright/test'; +import { addField } from './test-utils'; + +const fieldHandle = '.tff-field-container .tff-drag-handle-icon'; + +test('Equals(field) dropdown disabled when no other fields and excludes self', async ({ page }) => { + await page.goto(''); + + // Set a desktop viewport + await page.setViewportSize({ width: 2048, height: 800 }); + await page.goto(''); + + await test.step('Create an email field', async () => { + await addField(page, 'Email', undefined, { + link: 'Email', + label: 'Enter email', + }); + }); + + await test.step('Check EqualsField disabled with no other fields', async () => { + // Reopen field settings to configure + await page.locator(fieldHandle).last().click(); + await expect(page.getByText('Email question title')).toHaveCount(1); + + // Add field logic (field rule) + await page.getByRole('button', { name: 'Add field logic' }).click(); + const fieldRule = page.locator('.tff-field-rule').last(); + + // EqualsField option should be disabled because there are no other fields + const equalsOption = fieldRule.locator( + 'select.tff-comparison-type option[value="EqualsField"]' + ); + await expect(equalsOption).toBeDisabled(); + + // Remove logic + await fieldRule.locator('.tff-show-or-hide').selectOption({ index: 0 }); + await expect(fieldRule).not.toBeVisible(); + + // Close editor + await page.locator('.tff-close-button').click(); + }); + + await test.step('Add another email field', async () => { + await addField(page, 'Email', undefined, { + link: 'Email', + label: 'Confirm email', + }); + }); + + await test.step('Verify EqualsField dropdown excludes self', async () => { + await page.locator(fieldHandle).last().click(); + await expect(page.getByText('Email question title')).toHaveCount(1); + await page.getByRole('button', { name: 'Add field logic' }).click(); + const fieldRule = page.locator('.tff-field-rule').last(); + + // Add a condition and set its comparison to EqualsField + await fieldRule.locator('.tff-comparison-type').last().selectOption('EqualsField'); + await expect(fieldRule.locator('.tff-comparison-value')).toBeDisabled(); + + // Remove logic + await fieldRule.locator('.tff-show-or-hide').selectOption({ index: 0 }); + await expect(fieldRule).not.toBeVisible(); + }); + + await test.step('Add a field that only shows when both email fields are equal', async () => { + await addField(page, 'Single-line free text', undefined, { + link: 'Single-line free text', + label: 'Show if emails match', + description: 'Show if emails match', + }); + + await page.locator(fieldHandle).last().click(); + await expect(page.getByText('Single-line free text question title')).toHaveCount(1); + await page.getByRole('button', { name: 'Add field logic' }).click(); + const fieldRule = page.locator('.tff-field-rule').last(); + + const equalsOption = fieldRule.locator( + 'select.tff-comparison-type option[value="EqualsField"]' + ); + await expect(equalsOption).toBeEnabled(); + await fieldRule.locator('.tff-comparison-type').last().selectOption('EqualsField'); + + page.locator('select.tff-text-field.tff-question-title').last().selectOption('Enter email'); + }); + + await test.step('Verify form field logic works', async () => { + const pagePromise = page.waitForEvent('popup'); + await page.getByRole('link', { name: 'View form' }).click(); + const newPage = await pagePromise; + + await expect(newPage.getByLabel('Enter email')).toBeVisible(); + await expect(newPage.getByLabel('Confirm email')).toBeVisible(); + await expect(newPage.getByLabel('Show if emails match')).not.toBeVisible(); + + await newPage.getByLabel('Enter email').fill('test@example.com'); + await newPage.getByLabel('Confirm email').fill('test@example.com'); + await expect(newPage.getByLabel('Show if emails match')).toBeVisible(); + }); + + // Close editor + await page.locator('.tff-close-button').click(); +}); diff --git a/go/validate.go b/go/validate.go index 58b3d44..29e071a 100644 --- a/go/validate.go +++ b/go/validate.go @@ -600,6 +600,10 @@ func isVisibilityRuleSatisfied(rule VisibilityRule, values url.Values) bool { conditionMet = strings.Contains(fieldValue, condition.Comparison.Value) case "EndsWith": conditionMet = strings.HasSuffix(fieldValue, condition.Comparison.Value) + case "EqualsField": + // the value stored in Comparison.Value is the name of another field + comparisonValue := values.Get(condition.Comparison.Value) + conditionMet = fieldValue == comparisonValue case "GreaterThan": // Try to parse comparison value as float64 comparisonValue, comparisonErr := strconv.ParseFloat(condition.Comparison.Value, 64) diff --git a/go/validate_test.go b/go/validate_test.go index b04aaac..c777ae5 100644 --- a/go/validate_test.go +++ b/go/validate_test.go @@ -1395,6 +1395,142 @@ func TestVisibilityRules(t *testing.T) { }, expectedError: nil, }, + { + name: "HideWhen rule - email and confirm_email fields are equal - should pass", + formFields: ` + [ + { + "name": "email", + "type": { + "type": "ShortText", + "inputType": "Email", + "attributes": { + "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", + "multiple": "true", + "inputmode": "text" + } + }, + "label": "Email", + "presence": "Required" + }, + { + "name": "confirm_email", + "type": { + "type": "ShortText", + "inputType": "Email", + "attributes": { + "type": "email", + "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", + "multiple": "true" + } + }, + "label": "Confirm Email", + "presence": "Required" + }, + { + "type": { + "type": "ShortText", + "inputType": "Disable form submit", + "attributes": { + "type": "text", + "class": "size-0-invisible", + "value": "form-invalid", + "pattern": "form-ok" + } + }, + "label": " ", + "presence": "Required", + "visibilityRule": [ + { + "type": "HideWhen", + "conditions": [ + { + "type": "Field", + "fieldName": "email", + "comparison": { + "type": "EqualsField", + "value": "confirm_email" + } + } + ] + } + ] + } + ]`, + values: url.Values{ + "email": []string{"email@example.com"}, + "confirm_email": []string{"email@example.com"}, + }, + expectedError: nil, + }, + { + name: "HideWhen rule - email and confirm_email fields are NOT equal - should fail", + formFields: ` + [ + { + "name": "email", + "type": { + "type": "ShortText", + "inputType": "Email", + "attributes": { + "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", + "multiple": "true", + "inputmode": "text" + } + }, + "label": "Email", + "presence": "Required" + }, + { + "name": "confirm_email", + "type": { + "type": "ShortText", + "inputType": "Email", + "attributes": { + "type": "email", + "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", + "multiple": "true" + } + }, + "label": "Confirm Email", + "presence": "Required" + }, + { + "type": { + "type": "ShortText", + "inputType": "Disable form submit", + "attributes": { + "type": "text", + "class": "size-0-invisible", + "value": "form-invalid", + "pattern": "form-ok" + } + }, + "label": " ", + "presence": "Required", + "visibilityRule": [ + { + "type": "HideWhen", + "conditions": [ + { + "type": "Field", + "fieldName": "email", + "comparison": { + "type": "EqualsField", + "value": "confirm_email" + } + } + ] + } + ] + } + ]`, + values: url.Values{ + "email": []string{"email@example.com"}, + "confirm_email": []string{"different@example.com"}, + }, + expectedError: ErrRequiredFieldMissing, + }, } for _, tt := range scenarios { diff --git a/input.css b/input.css index 761df2d..f6f3e4a 100644 --- a/input.css +++ b/input.css @@ -875,3 +875,9 @@ .tff-button-secondary { @apply bg-white text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50; } + +.tff-comparison-value:focus, +.tff-comparison-value:focus-visible { + outline: none !important; + box-shadow: none !important; +} diff --git a/src/Main.elm b/src/Main.elm index c47b537..54378b2 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -163,6 +163,7 @@ type Comparison | StringContains String | EndsWith String | GreaterThan String + | EqualsField String type Condition @@ -2742,45 +2743,118 @@ visibilityRuleSection fieldIndex formFields ruleIndex visibilityRule = (otherQuestionTitles formFields fieldIndex) ) ] - , selectInputGroup - { selectAttrs = - [ onChange (\str -> OnFormField (OnVisibilityConditionTypeInput ruleIndex conditionIndex str) fieldIndex "") - , class "tff-comparison-type" - ] - , options = - [ ( "Equals", "Equals", isComparingWith (Equals "something") (comparisonOf rule) ) - , ( "StringContains", "Contains", isComparingWith (StringContains "something") (comparisonOf rule) ) - , ( "EndsWith", "Ends with", isComparingWith (EndsWith "something") (comparisonOf rule) ) - , ( "GreaterThan", "Greater than", isComparingWith (GreaterThan "something") (comparisonOf rule) ) - ] - , inputAttrs = - [ type_ "text" - , value - (case rule of - Field _ (Equals v) -> - v + , let + optionRecord value label selected disabled = + { value = value, label = label, selected = selected, disabled = disabled } - Field _ (StringContains v) -> - v + -- Start with other fields (exclude the field being edited) + candidateFields = + otherQuestionTitles formFields fieldIndex - Field _ (EndsWith v) -> - v + -- Available fields are candidate fields excluding only the current/source field. + -- the dropdown will list all other fields (except the field itself). + otherFields = + List.filter + (\f -> + let + fn = + f.name |> Maybe.withDefault f.label + in + fn /= selectedFieldName + ) + candidateFields - Field _ (GreaterThan v) -> - v + -- The Equals(field) option should only be disabled when there are no other + -- fields at all (excluding the current/source field) + candidateFieldsExceptSelf = + List.filter + (\f -> + let + fn = + f.name |> Maybe.withDefault f.label + in + fn /= selectedFieldName ) - , onInput (\str -> OnFormField (OnVisibilityConditionValueInput ruleIndex conditionIndex str) fieldIndex "") - , required True - , class "tff-comparison-value" - ] - ++ datalistAttr - , children = - case datalistElement of - Just element -> - [ element ] + candidateFields - Nothing -> - [] + equalsFieldDisabled = + List.isEmpty candidateFieldsExceptSelf + + comparisonValueString = + case rule of + Field _ (Equals v) -> + v + + Field _ (StringContains v) -> + v + + Field _ (EndsWith v) -> + v + + Field _ (GreaterThan v) -> + v + + Field _ (EqualsField v) -> + v + + textInputNode = + input + ([ type_ "text" + , value comparisonValueString + , onInput (\str -> OnFormField (OnVisibilityConditionValueInput ruleIndex conditionIndex str) fieldIndex "") + , required True + , class "tff-comparison-value" + ] + ++ datalistAttr + ) + [] + + fieldSelectNode = + select + [ class "tff-text-field tff-question-title" + , onChange (\str -> OnFormField (OnVisibilityConditionValueInput ruleIndex conditionIndex str) fieldIndex "") + , value comparisonValueString + ] + (option [ value "" ] [ text "-- Select a field --" ] + :: List.map + (\f -> + let + fn = + f.name |> Maybe.withDefault f.label + in + option [ value fn, selected (fn == comparisonValueString) ] [ text ("value of " ++ Json.Encode.encode 0 (Json.Encode.string f.label)) ] + ) + otherFields + ) + + inputNode = + case comparisonOf rule of + EqualsField _ -> + -- render select of other fields (disabled if none) + if equalsFieldDisabled then + -- render a disabled text input to keep layout + input + [ type_ "text", value "", Attr.attribute "disabled" "disabled", class "tff-comparison-value" ] + [] + + else + fieldSelectNode + + _ -> + textInputNode + + optionsList = + [ optionRecord "Equals" "Equals" (isComparingWith (Equals "something") (comparisonOf rule)) False + , optionRecord "StringContains" "Contains" (isComparingWith (StringContains "something") (comparisonOf rule)) False + , optionRecord "EndsWith" "Ends with" (isComparingWith (EndsWith "something") (comparisonOf rule)) False + , optionRecord "GreaterThan" "Greater than" (isComparingWith (GreaterThan "something") (comparisonOf rule)) False + , optionRecord "EqualsField" "Equals (field)" (isComparingWith (EqualsField "something") (comparisonOf rule)) equalsFieldDisabled + ] + in + selectInputGroup + { selectAttrs = [ onChange (\str -> OnFormField (OnVisibilityConditionTypeInput ruleIndex conditionIndex str) fieldIndex ""), class "tff-comparison-type" ] + , options = optionsList + , inputNode = inputNode } ] @@ -3794,6 +3868,12 @@ encodeComparison comparison = , ( "value", Json.Encode.string value ) ] + EqualsField fieldName -> + Json.Encode.object + [ ( "type", Json.Encode.string "EqualsField" ) + , ( "value", Json.Encode.string fieldName ) + ] + decodeFormFields : Json.Decode.Decoder (Array FormField) decodeFormFields = @@ -4351,6 +4431,10 @@ decodeComparison = Json.Decode.succeed GreaterThan |> andMap (Json.Decode.field "value" Json.Decode.string) + "EqualsField" -> + Json.Decode.succeed EqualsField + |> andMap (Json.Decode.field "value" Json.Decode.string) + _ -> Json.Decode.fail ("Unknown comparison type: " ++ str) ) @@ -4393,6 +4477,15 @@ evaluateCondition trackedFormValues condition = formValue > givenValue ) + EqualsField otherFieldName -> + let + otherValues = + Dict.get otherFieldName trackedFormValues |> Maybe.withDefault [] + in + Dict.get fieldName trackedFormValues + |> Maybe.withDefault [] + |> List.any (\v -> List.member v otherValues) + isVisibilityRuleSatisfied : List VisibilityRule -> Dict String (List String) -> Bool isVisibilityRuleSatisfied rules trackedFormValues = @@ -4473,6 +4566,14 @@ isComparingWith expected given = _ -> False + EqualsField _ -> + case given of + EqualsField _ -> + True + + _ -> + False + {- Helper to update a comparison -} @@ -4495,6 +4596,9 @@ updateComparison comparisonType comparison = GreaterThan str -> Equals str + EqualsField str -> + Equals str + "StringContains" -> case comparison of Equals str -> @@ -4509,6 +4613,9 @@ updateComparison comparisonType comparison = GreaterThan str -> StringContains str + EqualsField str -> + StringContains str + "EndsWith" -> case comparison of Equals str -> @@ -4523,6 +4630,9 @@ updateComparison comparisonType comparison = GreaterThan str -> EndsWith str + EqualsField str -> + EndsWith str + "GreaterThan" -> case comparison of Equals str -> @@ -4537,6 +4647,26 @@ updateComparison comparisonType comparison = GreaterThan str -> GreaterThan str + EqualsField str -> + GreaterThan str + + "EqualsField" -> + case comparison of + Equals str -> + EqualsField str + + StringContains str -> + EqualsField str + + EndsWith str -> + EqualsField str + + GreaterThan str -> + EqualsField str + + EqualsField str -> + EqualsField str + _ -> comparison @@ -4556,6 +4686,9 @@ updateComparisonValue newValue comparison = GreaterThan _ -> GreaterThan newValue + EqualsField _ -> + EqualsField newValue + {- VISIBILITY RULE HELPERS -} @@ -4615,13 +4748,32 @@ updateComparisonInCondition updater condition = -- UI HELPER -selectInputGroup : { selectAttrs : List (Html.Attribute msg), options : List ( String, String, Bool ), inputAttrs : List (Html.Attribute msg), children : List (Html.Html msg) } -> Html msg -selectInputGroup { selectAttrs, options, inputAttrs, children } = +selectInputGroup : { selectAttrs : List (Html.Attribute msg), options : List { value : String, label : String, selected : Bool, disabled : Bool }, inputNode : Html msg } -> Html msg +selectInputGroup { selectAttrs, options, inputNode } = let calculatedAttrs = - List.filter (\( _, _, selected ) -> selected) options - |> List.map (\( value, _, _ ) -> Attr.value value) + options + |> List.filter .selected + |> List.map (.value >> Attr.value) |> List.append [ class "tff-selectinput-select" ] + + optionToNode opt = + option + (List.filterMap identity + [ Just (Attr.value opt.value) + , if opt.selected then + Just (Attr.selected True) + + else + Nothing + , if opt.disabled then + Just (Attr.attribute "disabled" "disabled") + + else + Nothing + ] + ) + [ text opt.label ] in div [ Attr.class "tff-selectinput-wrapper" @@ -4633,19 +4785,10 @@ selectInputGroup { selectAttrs, options, inputAttrs, children } = [ Attr.class "tff-selectinput-select-wrapper" ] [ select (calculatedAttrs ++ selectAttrs) - (List.map - (\( value, label, selected ) -> - option - [ Attr.value value - , Attr.selected selected - ] - [ text label ] - ) - options - ) + (List.map optionToNode options) , selectArrowDown ] - , input (class "tff-selectinput-input" :: inputAttrs) children + , inputNode ] ] diff --git a/tests/GoElmCrossValidationTest.elm b/tests/GoElmCrossValidationTest.elm index 1a3a0ad..2b39ef3 100644 --- a/tests/GoElmCrossValidationTest.elm +++ b/tests/GoElmCrossValidationTest.elm @@ -201,3 +201,7 @@ isValidComparison comparison = Main.GreaterThan _ -> True + + -- Added to account for the EqualsField variant introduced in src/Main.elm + Main.EqualsField _ -> + True diff --git a/tests/MainTest.elm b/tests/MainTest.elm index 1a65697..3064830 100644 --- a/tests/MainTest.elm +++ b/tests/MainTest.elm @@ -560,6 +560,59 @@ suite = () ] ] + , describe "EqualsField behavior" + [ test "EqualsField matches when any value overlaps" <| + \_ -> + let + values = + Dict.fromList [ ( "a", [ "x", "y" ] ), ( "b", [ "y", "z" ] ) ] + in + Expect.all + [ \_ -> + Main.evaluateCondition values (Main.Field "a" (Main.EqualsField "b")) + |> Expect.equal True + , \_ -> + Main.evaluateCondition values (Main.Field "b" (Main.EqualsField "a")) + |> Expect.equal True + ] + () + , test "EqualsField does not match when no overlap" <| + \_ -> + let + values = + Dict.fromList [ ( "a", [ "x" ] ), ( "b", [ "y" ] ) ] + in + Main.evaluateCondition values (Main.Field "a" (Main.EqualsField "b")) + |> Expect.equal False + , test "isVisibilityRuleSatisfied with EqualsField in ShowWhen" <| + \_ -> + let + rules = + [ Main.ShowWhen [ Main.Field "a" (Main.EqualsField "b") ] ] + + values = + Dict.fromList [ ( "a", [ "x" ] ), ( "b", [ "x" ] ) ] + in + Main.isVisibilityRuleSatisfied rules values + |> Expect.equal True + , test "EqualsField handles empty lists gracefully" <| + \_ -> + let + values = + Dict.fromList [ ( "a", [] ), ( "b", [] ) ] + in + Main.evaluateCondition values (Main.Field "a" (Main.EqualsField "b")) + |> Expect.equal False + , test "EqualsField matches with duplicates and whitespace preserved" <| + \_ -> + let + values = + Dict.fromList [ ( "a", [ "x", "x" ] ), ( "b", [ " x", "x" ] ) ] + in + -- Comparison is as-is: whitespace and duplicates are not normalized + Main.evaluateCondition values (Main.Field "a" (Main.EqualsField "b")) + |> Expect.equal True + ] , describe "list attribute handling" [ test "fromRawCustomElement removes list attribute" <| \_ ->