/* ")):D.match("DOCTYPE",!0,!0)?(D.eatWhile(/[\w\._\-]/),te(N(1))):null:D.eat("?")?(D.eatWhile(/[\w\._\-]/),z.tokenize=W("meta","?>"),"meta"):(A=D.eat("/")?"closeTag":"openTag",z.tokenize=R,"tag bracket");if(ue=="&"){var de;return D.eat("#")?D.eat("x")?de=D.eatWhile(/[a-fA-F\d]/)&&D.eat(";"):de=D.eatWhile(/[\d]/)&&D.eat(";"):de=D.eatWhile(/[\w\.\-:]/)&&D.eat(";"),de?"atom":"error"}else return D.eatWhile(/[^&<]/),null}_.isInText=!0;function R(D,z){var te=D.next();if(te==">"||te=="/"&&D.eat(">"))return z.tokenize=_,A=te==">"?"endTag":"selfcloseTag","tag bracket";if(te=="=")return A="equals",null;if(te=="<"){z.tokenize=_,z.state=w,z.tagName=z.tagStart=null;var ue=z.tokenize(D,z);return ue?ue+" tag error":"tag error"}else return/[\'\"]/.test(te)?(z.tokenize=I(te),z.stringStartCol=D.column(),z.tokenize(D,z)):(D.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function I(D){var z=function(te,ue){for(;!te.eol();)if(te.next()==D){ue.tokenize=R;break}return"string"};return z.isInAttribute=!0,z}function W(D,z){return function(te,ue){for(;!te.eol();){if(te.match(z)){ue.tokenize=_;break}te.next()}return D}}function N(D){return function(z,te){for(var ue;(ue=z.next())!=null;){if(ue=="<")return te.tokenize=N(D+1),te.tokenize(z,te);if(ue==">")if(D==1){te.tokenize=_;break}else return te.tokenize=N(D-1),te.tokenize(z,te)}return"meta"}}function T(D,z,te){this.prev=D.context,this.tagName=z||"",this.indent=D.indented,this.startOfLine=te,(g.doNotIndent.hasOwnProperty(z)||D.context&&D.context.noIndent)&&(this.noIndent=!0)}function E(D){D.context&&(D.context=D.context.prev)}function c(D,z){for(var te;;){if(!D.context||(te=D.context.tagName,!g.contextGrabbers.hasOwnProperty(te)||!g.contextGrabbers[te].hasOwnProperty(z)))return;E(D)}}function w(D,z,te){return D=="openTag"?(te.tagStart=z.column(),k):D=="closeTag"?O:w}function k(D,z,te){return D=="word"?(te.tagName=z.current(),m="tag",B):g.allowMissingTagName&&D=="endTag"?(m="tag bracket",B(D,z,te)):(m="error",k)}function O(D,z,te){if(D=="word"){var ue=z.current();return te.context&&te.context.tagName!=ue&&g.implicitlyClosed.hasOwnProperty(te.context.tagName)&&E(te),te.context&&te.context.tagName==ue||g.matchClosing===!1?(m="tag",L):(m="tag error",j)}else return g.allowMissingTagName&&D=="endTag"?(m="tag bracket",L(D,z,te)):(m="error",j)}function L(D,z,te){return D!="endTag"?(m="error",L):(E(te),w)}function j(D,z,te){return m="error",L(D,z,te)}function B(D,z,te){if(D=="word")return m="attribute",U;if(D=="endTag"||D=="selfcloseTag"){var ue=te.tagName,de=te.tagStart;return te.tagName=te.tagStart=null,D=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(ue)?c(te,ue):(c(te,ue),te.context=new T(te,ue,de==te.indented)),w}return m="error",B}function U(D,z,te){return D=="equals"?Q:(g.allowMissing||(m="error"),B(D,z,te))}function Q(D,z,te){return D=="string"?X:D=="word"&&g.allowUnquoted?(m="string",B):(m="error",B(D,z,te))}function X(D,z,te){return D=="string"?X:B(D,z,te)}return{startState:function(D){var z={tokenize:_,state:w,indented:D||0,tagName:null,tagStart:null,context:null};return D!=null&&(z.baseIndent=D),z},token:function(D,z){if(!z.tagName&&D.sol()&&(z.indented=D.indentation()),D.eatSpace())return null;A=null;var te=z.tokenize(D,z);return(te||A)&&te!="comment"&&(m=null,z.state=z.state(A||te,D,z),m&&(te=m=="error"?te+" error":m)),te},indent:function(D,z,te){var ue=D.context;if(D.tokenize.isInAttribute)return D.tagStart==D.indented?D.stringStartCol+1:D.indented+b;if(ue&&ue.noIndent)return l.Pass;if(D.tokenize!=R&&D.tokenize!=_)return te?te.match(/^(\s*)/)[0].length:0;if(D.tagName)return g.multilineTagIndentPastTag!==!1?D.tagStart+D.tagName.length+2:D.tagStart+b*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/$/,blockCommentStart:"",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(D){D.state==Q&&(D.state=B)},xmlCurrentTag:function(D){return D.tagName?{name:D.tagName,close:D.type=="closeTag"}:null},xmlCurrentContext:function(D){for(var z=[],te=D.context;te;te=te.prev)z.push(te.tagName);return z.reverse()}}}),l.defineMIME("text/xml","xml"),l.defineMIME("application/xml","xml"),l.mimeModes.hasOwnProperty("text/html")||l.defineMIME("text/html",{name:"xml",htmlMode:!0})})})(),function(o,a){(function(l){l(ct.exports,Fc.exports,Ic.exports,Rc.exports)})(function(l){var u={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function h(A,m,_){var R=A.current(),I=R.search(m);return I>-1?A.backUp(R.length-I):R.match(/<\/?$/)&&(A.backUp(R.length),A.match(m,!1)||A.match(R)),_}var p={};function S(A){var m=p[A];return m||(p[A]=new RegExp("\\s+"+A+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function b(A,m){var _=A.match(S(m));return _?/^\s*(.*?)\s*$/.exec(_[2])[1]:""}function g(A,m){return new RegExp((m?"^":"")+"","i")}function x(A,m){for(var _ in A)for(var R=m[_]||(m[_]=[]),I=A[_],W=I.length-1;W>=0;W--)R.unshift(I[W])}function y(A,m){for(var _=0;_=0;N--)R.script.unshift(["type",W[N].matches,W[N].mode]);function T(E,c){var w=_.token(E,c.htmlState),k=/\btag\b/.test(w),O;if(k&&!/[<>\s\/]/.test(E.current())&&(O=c.htmlState.tagName&&c.htmlState.tagName.toLowerCase())&&R.hasOwnProperty(O))c.inTag=O+" ";else if(c.inTag&&k&&/>$/.test(E.current())){var L=/^([\S]+) (.*)/.exec(c.inTag);c.inTag=null;var j=E.current()==">"&&y(R[L[1]],L[2]),B=l.getMode(A,j),U=g(L[1],!0),Q=g(L[1],!1);c.token=function(X,D){return X.match(U,!1)?(D.token=T,D.localState=D.localMode=null,null):h(X,Q,D.localMode.token(X,D.localState))},c.localMode=B,c.localState=l.startState(B,_.indent(c.htmlState,"",""))}else c.inTag&&(c.inTag+=E.current(),E.eol()&&(c.inTag+=" "));return w}return{startState:function(){var E=l.startState(_);return{token:T,inTag:null,localMode:null,localState:null,htmlState:E}},copyState:function(E){var c;return E.localState&&(c=l.copyState(E.localMode,E.localState)),{token:E.token,inTag:E.inTag,localMode:E.localMode,localState:c,htmlState:l.copyState(_,E.htmlState)}},token:function(E,c){return c.token(E,c)},indent:function(E,c,w){return!E.localMode||/^\s*<\//.test(c)?_.indent(E.htmlState,c,w):E.localMode.indent?E.localMode.indent(E.localState,c,w):l.Pass},innerMode:function(E){return{state:E.localState||E.htmlState,mode:E.localMode||_}}}},"xml","javascript","css"),l.defineMIME("text/html","htmlmixed")})}();var Fa={exports:{}};(function(o,a){(function(l){l(ct.exports)})(function(l){var u=l.Pos;function h(T){var E=T.flags;return E!=null?E:(T.ignoreCase?"i":"")+(T.global?"g":"")+(T.multiline?"m":"")}function p(T,E){for(var c=h(T),w=c,k=0;kL);j++){var B=T.getLine(O++);w=w==null?B:w+` `+B}k=k*2,E.lastIndex=c.ch;var U=E.exec(w);if(U){var Q=w.slice(0,U.index).split(` `),X=U[0].split(` `),D=c.line+Q.length-1,z=Q[Q.length-1].length;return{from:u(D,z),to:u(D+X.length-1,X.length==1?z+X[0].length:X[X.length-1].length),match:U}}}}function x(T,E,c){for(var w,k=0;k<=T.length;){E.lastIndex=k;var O=E.exec(T);if(!O)break;var L=O.index+O[0].length;if(L>T.length-c)break;(!w||L>w.index+w[0].length)&&(w=O),k=O.index+1}return w}function y(T,E,c){E=p(E,"g");for(var w=c.line,k=c.ch,O=T.firstLine();w>=O;w--,k=-1){var L=T.getLine(w),j=x(L,E,k<0?0:L.length-k);if(j)return{from:u(w,j.index),to:u(w,j.index+j[0].length),match:j}}}function A(T,E,c){if(!S(E))return y(T,E,c);E=p(E,"gm");for(var w,k=1,O=T.getLine(c.line).length-c.ch,L=c.line,j=T.firstLine();L>=j;){for(var B=0;B=j;B++){var U=T.getLine(L--);w=w==null?U:U+` `+w}k*=2;var Q=x(w,E,O);if(Q){var X=w.slice(0,Q.index).split(` `),D=Q[0].split(` `),z=L+X.length,te=X[X.length-1].length;return{from:u(z,te),to:u(z+D.length-1,D.length==1?te+D[0].length:D[D.length-1].length),match:Q}}}}var m,_;String.prototype.normalize?(m=function(T){return T.normalize("NFD").toLowerCase()},_=function(T){return T.normalize("NFD")}):(m=function(T){return T.toLowerCase()},_=function(T){return T});function R(T,E,c,w){if(T.length==E.length)return c;for(var k=0,O=c+Math.max(0,T.length-E.length);;){if(k==O)return k;var L=k+O>>1,j=w(T.slice(0,L)).length;if(j==c)return L;j>c?O=L:k=L+1}}function I(T,E,c,w){if(!E.length)return null;var k=w?m:_,O=k(E).split(/\r|\n\r?/);e:for(var L=c.line,j=c.ch,B=T.lastLine()+1-O.length;L<=B;L++,j=0){var U=T.getLine(L).slice(j),Q=k(U);if(O.length==1){var X=Q.indexOf(O[0]);if(X==-1)continue e;var c=R(U,Q,X,k)+j;return{from:u(L,R(U,Q,X,k)+j),to:u(L,R(U,Q,X+O[0].length,k)+j)}}else{var D=Q.length-O[0].length;if(Q.slice(D)!=O[0])continue e;for(var z=1;z=B;L--,j=-1){var U=T.getLine(L);j>-1&&(U=U.slice(0,j));var Q=k(U);if(O.length==1){var X=Q.lastIndexOf(O[0]);if(X==-1)continue e;return{from:u(L,R(U,Q,X,k)),to:u(L,R(U,Q,X+O[0].length,k))}}else{var D=O[O.length-1];if(Q.slice(0,D.length)!=D)continue e;for(var z=1,c=L-O.length+1;z0);)c.push({anchor:w.from(),head:w.to()});c.length&&this.setSelections(c,0)})})})();var Bc={exports:{}};(function(o,a){(function(l){l(ct.exports)})(function(l){var u=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),h=l.Pos,p={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function S(m){return m&&m.bracketRegex||/[(){}[\]]/}function b(m,_,R){var I=m.getLineHandle(_.line),W=_.ch-1,N=R&&R.afterCursor;N==null&&(N=/(^| )cm-fat-cursor($| )/.test(m.getWrapperElement().className));var T=S(R),E=!N&&W>=0&&T.test(I.text.charAt(W))&&p[I.text.charAt(W)]||T.test(I.text.charAt(W+1))&&p[I.text.charAt(++W)];if(!E)return null;var c=E.charAt(1)==">"?1:-1;if(R&&R.strict&&c>0!=(W==_.ch))return null;var w=m.getTokenTypeAt(h(_.line,W+1)),k=g(m,h(_.line,W+(c>0?1:0)),c,w,R);return k==null?null:{from:h(_.line,W),to:k&&k.pos,match:k&&k.ch==E.charAt(0),forward:c>0}}function g(m,_,R,I,W){for(var N=W&&W.maxScanLineLength||1e4,T=W&&W.maxScanLines||1e3,E=[],c=S(W),w=R>0?Math.min(_.line+T,m.lastLine()+1):Math.max(m.firstLine()-1,_.line-T),k=_.line;k!=w;k+=R){var O=m.getLine(k);if(!!O){var L=R>0?0:O.length-1,j=R>0?O.length:-1;if(!(O.length>N))for(k==_.line&&(L=_.ch-(R<0?1:0));L!=j;L+=R){var B=O.charAt(L);if(c.test(B)&&(I===void 0||(m.getTokenTypeAt(h(k,L+1))||"")==(I||""))){var U=p[B];if(U&&U.charAt(1)==">"==R>0)E.push(B);else if(E.length)E.pop();else return{pos:h(k,L),ch:B}}}}}return k-R==(R>0?m.lastLine():m.firstLine())?!1:null}function x(m,_,R){for(var I=m.state.matchBrackets.maxHighlightLineLength||1e3,W=R&&R.highlightNonMatching,N=[],T=m.listSelections(),E=0;E0&&w.ch>=O.length)return c.clipPos(h(w.line+1,0));for(var L="start",j,B=w.ch,U=B,Q=k<0?0:O.length,X=0;U!=Q;U+=k,X++){var D=O.charAt(k<0?U-1:U),z=D!="_"&&l.isWordChar(D)?"w":"o";if(z=="w"&&D.toUpperCase()==D&&(z="W"),L=="start")z!="o"?(L="in",j=z):B=U+k;else if(L=="in"&&j!=z){if(j=="w"&&z=="W"&&k<0&&U--,j=="W"&&z=="w"&&k>0)if(U==B+1){j="w";continue}else U--;break}}return h(w.line,U)}function S(c,w){c.extendSelectionsBy(function(k){return c.display.shift||c.doc.extend||k.empty()?p(c.doc,k.head,w):w<0?k.from():k.to()})}u.goSubwordLeft=function(c){S(c,-1)},u.goSubwordRight=function(c){S(c,1)},u.scrollLineUp=function(c){var w=c.getScrollInfo();if(!c.somethingSelected()){var k=c.lineAtHeight(w.top+w.clientHeight,"local");c.getCursor().line>=k&&c.execCommand("goLineUp")}c.scrollTo(null,w.top-c.defaultTextHeight())},u.scrollLineDown=function(c){var w=c.getScrollInfo();if(!c.somethingSelected()){var k=c.lineAtHeight(w.top,"local")+1;c.getCursor().line<=k&&c.execCommand("goLineDown")}c.scrollTo(null,w.top+c.defaultTextHeight())},u.splitSelectionByLine=function(c){for(var w=c.listSelections(),k=[],O=0;OL.line&&B==j.line&&j.ch==0||k.push({anchor:B==L.line?L:h(B,0),head:B==j.line?j:h(B)});c.setSelections(k,0)},u.singleSelectionTop=function(c){var w=c.listSelections()[0];c.setSelection(w.anchor,w.head,{scroll:!1})},u.selectLine=function(c){for(var w=c.listSelections(),k=[],O=0;OO?k.push(U,Q):k.length&&(k[k.length-1]=Q),O=Q}c.operation(function(){for(var X=0;Xc.lastLine()?c.replaceRange(` `+te,h(c.lastLine()),null,"+swapLine"):c.replaceRange(te+` `,h(z,0),null,"+swapLine")}c.setSelections(L),c.scrollIntoView()})},u.swapLineDown=function(c){if(c.isReadOnly())return l.Pass;for(var w=c.listSelections(),k=[],O=c.lastLine()+1,L=w.length-1;L>=0;L--){var j=w[L],B=j.to().line+1,U=j.from().line;j.to().ch==0&&!j.empty()&&B--,B=0;Q-=2){var X=k[Q],D=k[Q+1],z=c.getLine(X);X==c.lastLine()?c.replaceRange("",h(X-1),h(X),"+swapLine"):c.replaceRange("",h(X,0),h(X+1,0),"+swapLine"),c.replaceRange(z+` `,h(D,0),null,"+swapLine")}c.scrollIntoView()})},u.toggleCommentIndented=function(c){c.toggleComment({indent:!0})},u.joinLines=function(c){for(var w=c.listSelections(),k=[],O=0;O=0;j--){var B=k[O[j]];if(!(U&&l.cmpPos(B.head,U)>0)){var Q=g(c,B.head);U=Q.from,c.replaceRange(w(Q.word),Q.from,Q.to)}}})}u.smartBackspace=function(c){if(c.somethingSelected())return l.Pass;c.operation(function(){for(var w=c.listSelections(),k=c.getOption("indentUnit"),O=w.length-1;O>=0;O--){var L=w[O].head,j=c.getRange({line:L.line,ch:0},L),B=l.countColumn(j,null,c.getOption("tabSize")),U=c.findPosH(L,-1,"char",!1);if(j&&!/\S/.test(j)&&B%k==0){var Q=new h(L.line,l.findColumn(j,B-k,k));Q.ch!=L.ch&&(U=Q)}c.replaceRange("",U,L,"+delete")}})},u.delLineRight=function(c){c.operation(function(){for(var w=c.listSelections(),k=w.length-1;k>=0;k--)c.replaceRange("",w[k].anchor,h(w[k].to().line),"+delete");c.scrollIntoView()})},u.upcaseAtCursor=function(c){I(c,function(w){return w.toUpperCase()})},u.downcaseAtCursor=function(c){I(c,function(w){return w.toLowerCase()})},u.setSublimeMark=function(c){c.state.sublimeMark&&c.state.sublimeMark.clear(),c.state.sublimeMark=c.setBookmark(c.getCursor())},u.selectToSublimeMark=function(c){var w=c.state.sublimeMark&&c.state.sublimeMark.find();w&&c.setSelection(c.getCursor(),w)},u.deleteToSublimeMark=function(c){var w=c.state.sublimeMark&&c.state.sublimeMark.find();if(w){var k=c.getCursor(),O=w;if(l.cmpPos(k,O)>0){var L=O;O=k,k=L}c.state.sublimeKilled=c.getRange(k,O),c.replaceRange("",k,O)}},u.swapWithSublimeMark=function(c){var w=c.state.sublimeMark&&c.state.sublimeMark.find();w&&(c.state.sublimeMark.clear(),c.state.sublimeMark=c.setBookmark(c.getCursor()),c.setCursor(w))},u.sublimeYank=function(c){c.state.sublimeKilled!=null&&c.replaceSelection(c.state.sublimeKilled,null,"paste")},u.showInCenter=function(c){var w=c.cursorCoords(null,"local");c.scrollTo(null,(w.top+w.bottom)/2-c.getScrollInfo().clientHeight/2)};function W(c){var w=c.getCursor("from"),k=c.getCursor("to");if(l.cmpPos(w,k)==0){var O=g(c,w);if(!O.word)return;w=O.from,k=O.to}return{from:w,to:k,query:c.getRange(w,k),word:O}}function N(c,w){var k=W(c);if(!!k){var O=k.query,L=c.getSearchCursor(O,w?k.to:k.from);(w?L.findNext():L.findPrevious())?c.setSelection(L.from(),L.to()):(L=c.getSearchCursor(O,w?h(c.firstLine(),0):c.clipPos(h(c.lastLine()))),(w?L.findNext():L.findPrevious())?c.setSelection(L.from(),L.to()):k.word&&c.setSelection(k.from,k.to))}}u.findUnder=function(c){N(c,!0)},u.findUnderPrevious=function(c){N(c,!1)},u.findAllUnder=function(c){var w=W(c);if(!!w){for(var k=c.getSearchCursor(w.query),O=[],L=-1;k.findNext();)O.push({anchor:k.from(),head:k.to()}),k.from().line<=w.from.line&&k.from().ch<=w.from.ch&&L++;c.setSelections(O,L)}};var T=l.keyMap;T.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},l.normalizeKeyMap(T.macSublime),T.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},l.normalizeKeyMap(T.pcSublime);var E=T.default==T.macDefault;T.sublime=E?T.macSublime:T.pcSublime})}(),function(o,a){(function(l){l(ct.exports)})(function(l){var u={},h=/[^\s\u00a0]/,p=l.Pos,S=l.cmpPos;function b(y){var A=y.search(h);return A==-1?0:A}l.commands.toggleComment=function(y){y.toggleComment()},l.defineExtension("toggleComment",function(y){y||(y=u);for(var A=this,m=1/0,_=this.listSelections(),R=null,I=_.length-1;I>=0;I--){var W=_[I].from(),N=_[I].to();W.line>=m||(N.line>=m&&(N=p(m,0)),m=W.line,R==null?A.uncomment(W,N,y)?R="un":(A.lineComment(W,N,y),R="line"):R=="un"?A.uncomment(W,N,y):A.lineComment(W,N,y))}});function g(y,A,m){return/\bstring\b/.test(y.getTokenTypeAt(p(A.line,0)))&&!/^[\'\"\`]/.test(m)}function x(y,A){var m=y.getMode();return m.useInnerComments===!1||!m.innerMode?m:y.getModeAt(A)}l.defineExtension("lineComment",function(y,A,m){m||(m=u);var _=this,R=x(_,y),I=_.getLine(y.line);if(!(I==null||g(_,y,I))){var W=m.lineComment||R.lineComment;if(!W){(m.blockCommentStart||R.blockCommentStart)&&(m.fullLines=!0,_.blockComment(y,A,m));return}var N=Math.min(A.ch!=0||A.line==y.line?A.line+1:A.line,_.lastLine()+1),T=m.padding==null?" ":m.padding,E=m.commentBlankLines||y.line==A.line;_.operation(function(){if(m.indent){for(var c=null,w=y.line;wO.length)&&(c=O)}for(var w=y.line;wN||_.operation(function(){if(m.fullLines!=!1){var E=h.test(_.getLine(N));_.replaceRange(T+W,p(N)),_.replaceRange(I+T,p(y.line,0));var c=m.blockCommentLead||R.blockCommentLead;if(c!=null)for(var w=y.line+1;w<=N;++w)(w!=N||E)&&_.replaceRange(c+T,p(w,0))}else{var k=S(_.getCursor("to"),A)==0,O=!_.somethingSelected();_.replaceRange(W,A),k&&_.setSelection(O?A:_.getCursor("from"),A),_.replaceRange(I,y)}})}}),l.defineExtension("uncomment",function(y,A,m){m||(m=u);var _=this,R=x(_,y),I=Math.min(A.ch!=0||A.line==y.line?A.line:A.line-1,_.lastLine()),W=Math.min(y.line,I),N=m.lineComment||R.lineComment,T=[],E=m.padding==null?" ":m.padding,c;e:{if(!N)break e;for(var w=W;w<=I;++w){var k=_.getLine(w),O=k.indexOf(N);if(O>-1&&!/comment/.test(_.getTokenTypeAt(p(w,O+1)))&&(O=-1),O==-1&&h.test(k)||O>-1&&h.test(k.slice(0,O)))break e;T.push(k)}if(_.operation(function(){for(var V=W;V<=I;++V){var pe=T[V-W],Ne=pe.indexOf(N),Ke=Ne+N.length;Ne<0||(pe.slice(Ke,Ke+E.length)==E&&(Ke+=E.length),c=!0,_.replaceRange("",p(V,Ne),p(V,Ke)))}}),c)return!0}var L=m.blockCommentStart||R.blockCommentStart,j=m.blockCommentEnd||R.blockCommentEnd;if(!L||!j)return!1;var B=m.blockCommentLead||R.blockCommentLead,U=_.getLine(W),Q=U.indexOf(L);if(Q==-1)return!1;var X=I==W?U:_.getLine(I),D=X.indexOf(j,I==W?Q+L.length:0),z=p(W,Q+1),te=p(I,D+1);if(D==-1||!/comment/.test(_.getTokenTypeAt(z))||!/comment/.test(_.getTokenTypeAt(te))||_.getRange(z,te,` `).indexOf(j)>-1)return!1;var ue=U.lastIndexOf(L,y.ch),de=ue==-1?-1:U.slice(0,y.ch).indexOf(j,ue+L.length);if(ue!=-1&&de!=-1&&de+j.length!=y.ch)return!1;de=X.indexOf(j,A.ch);var Me=X.slice(A.ch).lastIndexOf(L,de-A.ch);return ue=de==-1||Me==-1?-1:A.ch+Me,de!=-1&&ue!=-1&&ue!=A.ch?!1:(_.operation(function(){_.replaceRange("",p(I,D-(E&&X.slice(D-E.length,D)==E?E.length:0)),p(I,D+j.length));var V=Q+L.length;if(E&&U.slice(V,V+E.length)==E&&(V+=E.length),_.replaceRange("",p(W,Q),p(W,V)),B)for(var pe=W+1;pe<=I;++pe){var Ne=_.getLine(pe),Ke=Ne.indexOf(B);if(!(Ke==-1||h.test(Ne.slice(0,Ke)))){var je=Ke+B.length;E&&Ne.slice(je,je+E.length)==E&&(je+=E.length),_.replaceRange("",p(pe,Ke),p(pe,je))}}}),!0)})})}(),function(o,a){(function(l){l(ct.exports)})(function(l){var u={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},h=l.Pos;l.defineOption("autoCloseBrackets",!1,function(N,T,E){E&&E!=l.Init&&(N.removeKeyMap(S),N.state.closeBrackets=null),T&&(b(p(T,"pairs")),N.state.closeBrackets=T,N.addKeyMap(S))});function p(N,T){return T=="pairs"&&typeof N=="string"?N:typeof N=="object"&&N[T]!=null?N[T]:u[T]}var S={Backspace:y,Enter:A};function b(N){for(var T=0;T=0;w--){var O=c[w].head;N.replaceRange("",h(O.line,O.ch-1),h(O.line,O.ch+1),"+delete")}}function A(N){var T=x(N),E=T&&p(T,"explode");if(!E||N.getOption("disableInput"))return l.Pass;for(var c=N.listSelections(),w=0;w0?{line:O.head.line,ch:O.head.ch+T}:{line:O.head.line-1};E.push({anchor:L,head:L})}N.setSelections(E,w)}function _(N){var T=l.cmpPos(N.anchor,N.head)>0;return{anchor:new h(N.anchor.line,N.anchor.ch+(T?-1:1)),head:new h(N.head.line,N.head.ch+(T?1:-1))}}function R(N,T){var E=x(N);if(!E||N.getOption("disableInput"))return l.Pass;var c=p(E,"pairs"),w=c.indexOf(T);if(w==-1)return l.Pass;for(var k=p(E,"closeBefore"),O=p(E,"triples"),L=c.charAt(w+1)==T,j=N.listSelections(),B=w%2==0,U,Q=0;Q=0&&N.getRange(D,h(D.line,D.ch+3))==T+T+T?z="skipThree":z="skip";else if(L&&D.ch>1&&O.indexOf(T)>=0&&N.getRange(h(D.line,D.ch-2),D)==T+T){if(D.ch>2&&/\bstring/.test(N.getTokenTypeAt(h(D.line,D.ch-2))))return l.Pass;z="addFour"}else if(L){var ue=D.ch==0?" ":N.getRange(h(D.line,D.ch-1),D);if(!l.isWordChar(te)&&ue!=T&&!l.isWordChar(ue))z="both";else return l.Pass}else if(B&&(te.length===0||/\s/.test(te)||k.indexOf(te)>-1))z="both";else return l.Pass;if(!U)U=z;else if(U!=z)return l.Pass}var de=w%2?c.charAt(w-1):T,Me=w%2?T:c.charAt(w+1);N.operation(function(){if(U=="skip")m(N,1);else if(U=="skipThree")m(N,3);else if(U=="surround"){for(var V=N.getSelections(),pe=0;pe=T.max))return T.ch=0,T.text=T.cm.getLine(++T.line),!0}function A(T){if(!(T.line<=T.min))return T.text=T.cm.getLine(--T.line),T.ch=T.text.length,!0}function m(T){for(;;){var E=T.text.indexOf(">",T.ch);if(E==-1){if(y(T))continue;return}if(!x(T,E+1)){T.ch=E+1;continue}var c=T.text.lastIndexOf("/",E),w=c>-1&&!/\S/.test(T.text.slice(c+1,E));return T.ch=E+1,w?"selfClose":"regular"}}function _(T){for(;;){var E=T.ch?T.text.lastIndexOf("<",T.ch-1):-1;if(E==-1){if(A(T))continue;return}if(!x(T,E+1)){T.ch=E;continue}b.lastIndex=E,T.ch=E;var c=b.exec(T.text);if(c&&c.index==E)return c}}function R(T){for(;;){b.lastIndex=T.ch;var E=b.exec(T.text);if(!E){if(y(T))continue;return}if(!x(T,E.index+1)){T.ch=E.index+1;continue}return T.ch=E.index+E[0].length,E}}function I(T){for(;;){var E=T.ch?T.text.lastIndexOf(">",T.ch-1):-1;if(E==-1){if(A(T))continue;return}if(!x(T,E+1)){T.ch=E;continue}var c=T.text.lastIndexOf("/",E),w=c>-1&&!/\S/.test(T.text.slice(c+1,E));return T.ch=E+1,w?"selfClose":"regular"}}function W(T,E){for(var c=[];;){var w=R(T),k,O=T.line,L=T.ch-(w?w[0].length:0);if(!w||!(k=m(T)))return;if(k!="selfClose")if(w[1]){for(var j=c.length-1;j>=0;--j)if(c[j]==w[2]){c.length=j;break}if(j<0&&(!E||E==w[2]))return{tag:w[2],from:u(O,L),to:u(T.line,T.ch)}}else c.push(w[2])}}function N(T,E){for(var c=[];;){var w=I(T);if(!w)return;if(w=="selfClose"){_(T);continue}var k=T.line,O=T.ch,L=_(T);if(!L)return;if(L[1])c.push(L[2]);else{for(var j=c.length-1;j>=0;--j)if(c[j]==L[2]){c.length=j;break}if(j<0&&(!E||E==L[2]))return{tag:L[2],from:u(T.line,T.ch),to:u(k,O)}}}}l.registerHelper("fold","xml",function(T,E){for(var c=new g(T,E.line,0);;){var w=R(c);if(!w||c.line!=E.line)return;var k=m(c);if(!k)return;if(!w[1]&&k!="selfClose"){var O=u(c.line,c.ch),L=W(c,w[2]);return L&&h(L.from,O)>0?{from:O,to:L.from}:null}}}),l.findMatchingTag=function(T,E,c){var w=new g(T,E.line,E.ch,c);if(!(w.text.indexOf(">")==-1&&w.text.indexOf("<")==-1)){var k=m(w),O=k&&u(w.line,w.ch),L=k&&_(w);if(!(!k||!L||h(w,E)>0)){var j={from:u(w.line,w.ch),to:O,tag:L[2]};return k=="selfClose"?{open:j,close:null,at:"open"}:L[1]?{open:N(w,L[2]),close:j,at:"close"}:(w=new g(T,O.line,O.ch,c),{open:j,close:W(w,L[2]),at:"open"})}}},l.findEnclosingTag=function(T,E,c,w){for(var k=new g(T,E.line,E.ch,c);;){var O=N(k,w);if(!O)break;var L=new g(T,E.line,E.ch,c),j=W(L,O.tag);if(j)return{open:O,close:j}}},l.scanForClosingTag=function(T,E,c,w){var k=new g(T,E.line,E.ch,w?{from:0,to:w}:null);return W(k,c)}})})(),function(o,a){(function(l){l(ct.exports,Hc.exports)})(function(l){l.defineOption("autoCloseTags",!1,function(y,A,m){if(m!=l.Init&&m&&y.removeKeyMap("autoCloseTags"),!!A){var _={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(_["'/'"]=function(R){return b(R)}),(typeof A!="object"||A.whenOpening!==!1)&&(_["'>'"]=function(R){return p(R)}),y.addKeyMap(_)}});var u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],h=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function p(y){if(y.getOption("disableInput"))return l.Pass;for(var A=y.listSelections(),m=[],_=y.getOption("autoCloseTags"),R=0;RI.ch&&(c=c.slice(0,c.length-W.end+I.ch));var L=c.toLowerCase();if(!c||W.type=="string"&&(W.end!=I.ch||!/[\"\']/.test(W.string.charAt(W.string.length-1))||W.string.length==1)||W.type=="tag"&&E.close||W.string.indexOf("/")==I.ch-W.start-1||k&&g(k,L)>-1||x(y,N.mode.xmlCurrentContext&&N.mode.xmlCurrentContext(T)||[],c,I,!0))return l.Pass;var j=typeof _=="object"&&_.emptyTags;if(j&&g(j,c)>-1){m[R]={text:"/>",newPos:l.Pos(I.line,I.ch+2)};continue}var B=O&&g(O,L)>-1;m[R]={indent:B,text:">"+(B?` `:"")+"",newPos:B?l.Pos(I.line+1,0):l.Pos(I.line,I.ch+1)}}for(var U=typeof _=="object"&&_.dontIndentOnAutoClose,R=A.length-1;R>=0;R--){var Q=m[R];y.replaceRange(Q.text,A[R].head,A[R].anchor,"+insert");var X=y.listSelections().slice(0);X[R]={head:Q.newPos,anchor:Q.newPos},y.setSelections(X),!U&&Q.indent&&(y.indentLine(Q.newPos.line,null,!0),y.indentLine(Q.newPos.line+1,null,!0))}}function S(y,A){for(var m=y.listSelections(),_=[],R=A?"/":""&&(k+=">"),_[N]=k}if(y.replaceSelections(_),m=y.listSelections(),!W)for(var N=0;N=0&&A[T]==m;T--)++N;_=W.to;for(var T=1;TL.cursorCoords(Me,"window").top&&((D=V).style.opacity=.4)}))};g(L,T(L),X,z,function(te,ue){var de=l.keyName(te),Me=L.getOption("extraKeys"),V=Me&&Me[de]||l.keyMap[L.getOption("keyMap")][de];V=="findNext"||V=="findPrev"||V=="findPersistentNext"||V=="findPersistentPrev"?(l.e_stop(te),_(L,p(L),ue),L.execCommand(V)):(V=="find"||V=="findPersistent")&&(l.e_stop(te),z(ue,te))}),U&&X&&(_(L,Q,X),I(L,j))}else x(L,T(L),"Search for:",X,function(te){te&&!Q.query&&L.operation(function(){_(L,Q,te),Q.posFrom=Q.posTo=L.getCursor(),I(L,j)})})}function I(L,j,B){L.operation(function(){var U=p(L),Q=b(L,U.query,j?U.posFrom:U.posTo);!Q.find(j)&&(Q=b(L,U.query,j?l.Pos(L.lastLine()):l.Pos(L.firstLine(),0)),!Q.find(j))||(L.setSelection(Q.from(),Q.to()),L.scrollIntoView({from:Q.from(),to:Q.to()},20),U.posFrom=Q.from(),U.posTo=Q.to(),B&&B(Q.from(),Q.to()))})}function W(L){L.operation(function(){var j=p(L);j.lastQuery=j.query,!!j.query&&(j.query=j.queryText=null,L.removeOverlay(j.overlay),j.annotate&&(j.annotate.clear(),j.annotate=null))})}function N(L,j){var B=L?document.createElement(L):document.createDocumentFragment();for(var U in j)B[U]=j[U];for(var Q=2;Qb.firstLine();)g=l.Pos(g.line-1,0),R=_(!1);if(!(!R||R.cleared||y==="unfold")){var I=h(b,x,R);l.on(I,"mousedown",function(N){W.clear(),l.e_preventDefault(N)});var W=b.markText(R.from,R.to,{replacedWith:I,clearOnEnter:S(b,x,"clearOnEnter"),__isFold:!0});W.on("clear",function(N,T){l.signal(b,"unfold",b,N,T)}),l.signal(b,"fold",b,R.from,R.to)}}function h(b,g,x){var y=S(b,g,"widget");if(typeof y=="function"&&(y=y(x.from,x.to)),typeof y=="string"){var A=document.createTextNode(y);y=document.createElement("span"),y.appendChild(A),y.className="CodeMirror-foldmarker"}else y&&(y=y.cloneNode(!0));return y}l.newFoldFunction=function(b,g){return function(x,y){u(x,y,{rangeFinder:b,widget:g})}},l.defineExtension("foldCode",function(b,g,x){u(this,b,g,x)}),l.defineExtension("isFolded",function(b){for(var g=this.findMarksAt(b),x=0;x=c){if(O&&B&&O.test(B.className))return;j=b(T.indicatorOpen)}}!j&&!B||I.setGutterMarker(L,T.gutter,j)})}function x(I){return new RegExp("(^|\\s)"+I+"(?:$|\\s)\\s*")}function y(I){var W=I.getViewport(),N=I.state.foldGutter;!N||(I.operation(function(){g(I,W.from,W.to)}),N.from=W.from,N.to=W.to)}function A(I,W,N){var T=I.state.foldGutter;if(!!T){var E=T.options;if(N==E.gutter){var c=S(I,W);c?c.clear():I.foldCode(u(W,0),E)}}}function m(I){var W=I.state.foldGutter;if(!!W){var N=W.options;W.from=W.to=0,clearTimeout(W.changeUpdate),W.changeUpdate=setTimeout(function(){y(I)},N.foldOnChangeTimeSpan||600)}}function _(I){var W=I.state.foldGutter;if(!!W){var N=W.options;clearTimeout(W.changeUpdate),W.changeUpdate=setTimeout(function(){var T=I.getViewport();W.from==W.to||T.from-W.to>20||W.from-T.to>20?y(I):I.operation(function(){T.fromW.to&&(g(I,W.to,T.to),W.to=T.to)})},N.updateViewportTimeSpan||400)}}function R(I,W){var N=I.state.foldGutter;if(!!N){var T=W.line;T>=N.from&&Tx))_=x,A="{",m="}";else if(y!=null)_=y,A="[",m="]";else return;var R=1,I=u.lastLine(),W,N;e:for(var T=p;T<=I;++T)for(var E=u.getLine(T),c=T==p?_:0;;){var w=E.indexOf(A,c),k=E.indexOf(m,c);if(w<0&&(w=E.length),k<0&&(k=E.length),c=Math.min(w,k),c==E.length)break;if(u.getTokenTypeAt(l.Pos(T,c+1))==b){if(c==w)++R;else if(!--R){W=T,N=c;break e}}++c}if(!(W==null||p==W))return{from:l.Pos(p,_),to:l.Pos(W,N)}}),l.registerHelper("fold","import",function(u,h){function p(A){if(Au.lastLine())return null;var m=u.getTokenAt(l.Pos(A,1));if(/\S/.test(m.string)||(m=u.getTokenAt(l.Pos(A,m.end+1))),m.type!="keyword"||m.string!="import")return null;for(var _=A,R=Math.min(u.lastLine(),A+10);_<=R;++_){var I=u.getLine(_),W=I.indexOf(";");if(W!=-1)return{startCh:m.end,end:l.Pos(_,W)}}}var S=h.line,b=p(S),g;if(!b||p(S-1)||(g=p(S-2))&&g.end.line==S-1)return null;for(var x=b.end;;){var y=p(x.line+1);if(y==null)break;x=y.end}return{from:u.clipPos(l.Pos(S,b.startCh+1)),to:x}}),l.registerHelper("fold","include",function(u,h){function p(y){if(yu.lastLine())return null;var A=u.getTokenAt(l.Pos(y,1));if(/\S/.test(A.string)||(A=u.getTokenAt(l.Pos(y,A.end+1))),A.type=="meta"&&A.string.slice(0,8)=="#include")return A.start+8}var S=h.line,b=p(S);if(b==null||p(S-1)!=null)return null;for(var g=S;;){var x=p(g+1);if(x==null)break;++g}return{from:l.Pos(S,b+1),to:u.clipPos(l.Pos(g))}})})}(),function(o,a){(function(l){l(ct.exports)})(function(l){l.registerGlobalHelper("fold","comment",function(u){return u.blockCommentStart&&u.blockCommentEnd},function(u,h){var p=u.getModeAt(h),S=p.blockCommentStart,b=p.blockCommentEnd;if(!S||!b)return;for(var g=h.line,x=u.getLine(g),y,A=h.ch,m=0;;){var _=A<=0?-1:x.lastIndexOf(S,A-1);if(_==-1){if(m==1)return;m=1,A=x.length;continue}if(m==1&&_Le("div"+le.position("absolute").w("100%").top(o.toolbar()).left(0).bottom(0).right(0).overflow("hidden").$after(le.content("").position("absolute").top("-7vh").width("100%").height("100vh").zIndex(3).opacity(.1).pointerEvents("none").backgroundImage("url(data:image/svg+xml;base64,"+Gc+")").backgroundSize("120% auto").backgroundRepeat("no-repeat").backgroundPosition("center center")).$nest(".CodeMirror",le.fontFamily("Source Code Pro, monospace").lineHeight("22px").cursor("text").w("100%").h("100%").fontSize(14)).$nest(".cm-s-material.CodeMirror, .cm-s-material div.CodeMirror-gutters",le.backgroundColor(o.state.color)).$nest(".CodeMirror-activeline",le.background("rgba(255,255,255,0.07)")),{oncreate:({dom:l})=>{const u=/[{([]$/,h=/[^{}[\]()]/g,p=dn(l,{theme:o.state.theme||"material",readOnly:!o.state.editable,autoCloseBrackets:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0,lineNumbers:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],tabSize:2,viewportMargin:o.state.autoHeight?1/0:10,keyMap:"sublime",extraKeys:{"Alt-F":"findPersistent","Shift-Tab":"indentLess","Cmd-L":!1,"Cmd-M":!1,"Ctrl-L":!1,Enter:b=>{const g=b.getCursor(),x=b.getRange({line:g.line,ch:0},g).trim(),y=u.test(x),A=!y&&u.test(x.replace(h,"")),m=jn("=>",x),_=jn(",",x);b.setOption("smartIndent",A&&!_),b.execCommand("newlineAndIndent"),b.setOption("smartIndent",!0),(m||y)&&b.execCommand("insertSoftTab")},Tab:b=>{b.somethingSelected()?b.indentSelection("add"):b.execCommand("insertSoftTab")},Backspace:b=>{const g=b.getCursor(),x=b.getRange({line:g.line,ch:0},g);x.length%2==0&&jn(" ",x)&&dn.commands.delCharBefore(b),dn.commands.delCharBefore(b)}}});p.on("gutterClick",qc),p.on("scrollCursorIntoView",(b,g)=>{g.codemirrorIgnore=!0});const S=p.getDoc();o.refreshCm.map(()=>p.refresh()),o.focus.map(({line:b=0,column:g=0,scrollTo:x=!1}={})=>{p.setCursor(b-1,g-1),p.focus(),x&&requestAnimationFrame(()=>p.scrollIntoView({line:b,ch:g},100))}),o.selected.map(b=>{if(!b)return;const g=b.patched||b.content||"",x=pn[Ri(b.name)]||pn[b.type]||"javascript",y=o.state.editable&&b.editable!==!1;p.setOption("lineWrapping",x.lineWrapping||!1),p.setOption("readOnly",!y),b.doc||(b.doc=dn.Doc(g,x),b.doc.ignoreCursor=!0,b.doc.on("change",(_,R)=>{R.origin!=="setValue"&&(b.doc.ignoreCursor=!0,Promise.resolve().then(()=>b.doc.ignoreCursor=!1),a.fileChange(b,b.doc.getValue(),Ba(b.doc.listSelections())))}),b.doc.on("cursorActivity",(_,R)=>{b.doc.ignoreCursor||a.fileSelectionChange(b,Ba(b.doc.listSelections()))})),b.doc.ignoreCursor=!0,Promise.resolve().then(()=>b.doc.ignoreCursor=!1),g!==b.doc.getValue()&&b.doc.setValue(g);const A=p.getDoc()!==S||o.state.autoFocus;p.getDoc()!==b.doc&&p.swapDoc(b.doc);const m=Xc(b.selections);m&&m.length&&(b.doc.setSelections(m),requestAnimationFrame(()=>{p.scrollIntoView(m[0].head,500)})),A&&p.focus(),!o.cmHeight&&o.state.autoHeight&&requestAnimationFrame(()=>o.cmHeight=l.querySelector(".CodeMirror-sizer").offsetHeight*(o.vertical()?2:1)+o.toolbar()*(o.vertical()?4:3))})}});function qc(o,a,l,u){if(l==="CodeMirror-foldgutter")return;const h=o.listSelections(),p=u.ctrlKey||u.metaKey?h:[],S=u.shiftKey&&h.length?h[0].anchor.line:a;let b=u.shiftKey&&h.length&&S>a?a:a+1;y();const g=function(A){const m=o.lineAtHeight(A.clientY,"client");m!==b&&(b=m,y())},x=A=>{window.removeEventListener("mouseup",x),window.removeEventListener("mousemove",g)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",x);function y(){o.setSelections(p.concat([{anchor:dn.Pos(S,b>S?0:null),head:dn.Pos(b,0)}]),p.length,{origin:"*mouse"})}}function Xc(o=""){return o.split(",").map(a=>(a=a.split("-").map(l=>(l=l.split(":"),{line:parseInt(l[0])||0,ch:parseInt(l[1])||0})),{anchor:a[0],head:a[1]||a[0]}))}function Ba(o){return o.map(a=>a.anchor.line+":"+a.anchor.ch+(a.head&&(a.anchor.line!==a.head.line||a.anchor.ch!==a.head.ch)?"-"+a.head.line+":"+a.head.ch:"")).join(",")}var qn=(o,a)=>Le("i"+le.w(o.size||18).h(o.size||18).display("flex").jc("center").ai("center").$nest("svg",le.w("100%").h("100%")),o,Le.trust(a)),Ha='',Yc=(o,a)=>Le("nav.toolbar"+le.position("relative").f("left").display("flex").c("gray").w("100%").minHeight(o.toolbar()).background("rgb(246,246,246)").fontSize(14).zi(20).boxShadow("0 1px 1px rgba(0,0,0,0.35)").$after(le.content("").w(2).h("100%").position("absolute").right(-2).bc("inherit")),Le(".tabs"+le.display("flex").overflowX("auto").overflowY("hidden").flexGrow(1),o.state.fileTabs&&$c(o,a),o.state.linkTabs&&Qc(o,a)));function Qc(o,a){return o.state.links.map(l=>Wa(Le("div"+le.display("flex"),Le("a"+le.c("inherit"),{href:l.url,target:"_blank",onclick:u=>l.content&&u.preventDefault()},l.name),l.patches&&Le("span"+le.$animate("0.3s",{from:le.maxWidth(0).o(0),to:le.maxWidth(120).o(1)}).fontStyle("italic").ml(2).mt(2).fs(12),{onbeforeremove:({dom:u})=>(u.style.animation=le.$animate("0.3s",{from:le.maxWidth(120).o(1),to:le.maxWidth(0).o(0)}).style.animation,new Promise(h=>setTimeout(h,300)))},"(modified)"),l.editable===!1&&qn({size:16,class:le.ml(6).class},Ha)),()=>l.content&&a.select(l),l===o.selected(),o))}function $c(o,a){return o.state.files.map(l=>Wa(Le("div"+le.display("flex"),l.name,l.editable===!1&&qn({size:16,class:le.ml(6).class},Ha)),()=>a.select(l),l===o.selected(),o))}function Wa(o,a,l,u){return Le(".tab"+le.display("flex").ai("center").transition("background .3s, color .3s").minWidth(40).maxWidth(200).cursor("pointer").flexShrink(2).$hover(le.flexShrink(0).background("#ddd").c("#333")),{style:l?le.background(u.state.color).zi(1).c("white").flexShrink(0).style:{},onclick:a},Le("span"+le.flexGrow(1).overflow("hidden").ta("center").whiteSpace("nowrap").p("0 12px"),o))}var Ua=(o,a)=>Le("div"+le.position("absolute").w("100%").h("100%").zi(50).t(0).cursor("pointer").background("rgb(255,255,255)").transition("opacity 0.5s").$animate("0.5s",{from:le.o(0),to:le.o(1)}).boxShadow("0 0 10px rgba(0,0,0,.35)").display("flex").jc("center").ai("center"),{onbeforeremove:l=>(l.dom.style.opacity=0,new Promise(u=>setTimeout(u,500))),onclick:a},qn({class:le.h(28).w(28).class},o)),Zc='',Jc=(o,a)=>Le(".handle"+le.position("absolute").zi(40),{style:o.vertical()?le.height(6).bottom(0).left(0).cursor("row-resize").w("100%").style:le.top(0).width("6px").right(0).cursor("col-resize").h("100%").style,onmousedown:l=>{a.startDragging(!0),window.addEventListener("mouseup",function u(h){l.pageX===h.pageX&&l.pageY===h.pageY&&a.setMiddle(0),window.removeEventListener("mousemove",a.changeMiddle,!1),window.removeEventListener("mouseup",u,!1),a.stopDragging(!1),Le.redraw()},!1),window.addEventListener("mousemove",a.changeMiddle,!1)}}),Vc=(o,a)=>[(o.vertical()&&o.editor?o.editor.offsetHeight<=o.toolbar():o.state.middle<3)&&Ua(Zc,a.resetSize),o.state.toolbar&&Yc(o,a),jc(o,a),o.state.resizeable&&Jc(o,a)];const Ka=(o,a)=>Le("iframe"+le.flexGrow(1).userSelect("none").minHeight(50).width("100%").h(0),{name:o.id,title:"Runtime iframe",style:le.pointerEvents(o.dragging&&"none").style,sandbox:"allow-modals allow-forms allow-same-origin allow-scripts allow-popups",allow:"geolocation; microphone; camera; midi; encrypted-media",allowfullscreen:!0,frameborder:"0",oncreate:l=>a.initIframe(l.dom)}),eh=(o,a)=>Le(".iframeScroller"+le.overflowScrolling("touch").flexGrow(1).overflowY("scroll").display("flex").fd("column").w("100%"),Ka(o,a));var th=(o,a)=>o.iOS?eh(o,a):Ka(o,a),rh=(o,a)=>Le(".size"+le.position("absolute").fontFamily("Source Code Pro, monospace").zi(1).fontSize(14).top(o.toolbar()+8).p("4px 8px").right(8).background("white").o(.65).transition("opacity 0.3s").$animate(".3s",{from:le.o(0),to:le.o(1)}).boxShadow("0 0 3px rgba(0, 0, 0, .35)"),{onbeforeremove:nh},o.iframe.clientWidth," x ",o.iframe.clientHeight);function nh(o){return o.dom.style.opacity=0,new Promise(a=>setTimeout(a,300))}var ih='';function Ga(o,a){return o.querySelector(a)||(o.parentElement?Ga(o.parentElement,a):null)}const ja=o=>{const l=(Ga(o,".flems")||document.body).parentElement.getBoundingClientRect(),u=o.parentElement.getBoundingClientRect();return{top:u.top-l.top,bottom:u.bottom-l.bottom,right:u.right-l.right,width:u.width}},oh=({dom:o})=>{ja(o).top<40?(o.style.bottom=0,o.style.borderBottom="5px solid white"):(o.style.top=0,o.style.borderTop="5px solid white")},lh=({dom:o})=>{const a=ja(o),l=Math.min(-o.clientWidth/2+o.parentElement.clientWidth/2,-o.clientWidth+a.width+(-a.right-4));o.style.left=l+"px",a.top<40?(o.style.transformOrigin=Math.abs(l)+a.width/2+"px 0px",o.style.bottom="-26px"):(o.style.transformOrigin=Math.abs(l)+a.width/2+"px 26px",o.style.top="-26px")},ah=({dom:o})=>{o.parentElement.classList.add(le.$nest(":hover .tooltip",le.o(1).transform("scale(1)")).class),lh({dom:o})};var sh=({zIndex:o=11,title:a=""})=>Le(".tooltip"+le.position("absolute").o(0).c("gray").zi(o).transform("scale(0)").w("auto").h(26).fontSize(12).br(2).p("5px 8px").bc("white").bs("0 2px 8px rgba(0,0,0,0.35)").transition("opacity 0.3s, transform 0.3s").pointerEvents("none").textTransform("uppercase").textAlign("right").whiteSpace("nowrap"),{key:"tooltip",oncreate:ah},a,Le(".tooltip_triangle"+le.pointerEvents("none").o(0).zi(o+1).transform("scale(0)").position("absolute").transformOrigin("bottom center").transition("opacity 0.3s, transform 0.3s").l("calc(50% - 5px)").w(0).h(0).borderLeft("5px solid transparent").borderRight("5px solid transparent").textAlign("right"),{oncreate:oh})),Fi=(o,a={})=>Le(".icon"+le.position("relative").cursor("pointer").borderRadius(3).$hover(le.background("#ddd").color("gray")),{style:a.attention?le.$animate("1s linear infinite",{"0%":le.transform("scale(1)").o(1),"50%":le.transform("scale(1.2)").o(.5),"100%":le.transform("scale(1)").o(1)}).style:{}},qn({key:"icon_"+o,style:le.o(a.disabled&&.65).style,onclick:a.onclick,size:26,class:le.p(5).position("relative").class+" "+(a.iconClass?a.iconClass.class:"")},o),Le.fragment({key:"badge"},Boolean(a.badge)&&Le(".badge"+le.position("absolute").background("red").borderRadius(7).pointerEvents("none").p("0 3px").minWidth(14).h(14).top(0).right(0).c("white").fontStyle("normal").fontSize(10).textAlign("center"),a.badge)),sh({title:a.title})),uh='',qa='',fh='',ch='',hh='',dh=(o,a)=>Le(".toolbar"+le.w("100%").h(o.toolbar()).p(4,6).position("relative").flexShrink(0).justifyContent("flex-end").alignItems("center").display("flex").c("gray").zi(20).background("rgb(246,246,246)").boxShadow("0 1px 1px rgba(0,0,0,0.35)"),Fi(o.state.autoReload?hh:ch,{title:(o.state.autoReload?"Disable":"Enable")+" auto reload",onclick:a.toggleAutoReload}),o.state.reloadButton&&Fi(o.loading?qa:fh,{onclick:l=>a.refresh({force:!0}),attention:o.hasChanges,title:"Refresh"}),o.state.shareButton&&Le("a"+le.color("inherit"),{href:"https://flems.io",target:"_blank",oncreate:a.setShareUrl},Fi(uh,{title:"Open / share on flems.io"}))),ph=o=>Le(".loading"+le.position("absolute").background("white").pointerEvents("none").top(o.toolbar()+1).left(0).bottom(0).right(0).display("flex").jc("center").ai("center").transition("opacity 0.3s"),{style:le.o(o.loading?1:0).style},Le("div"+le.w(120).h(120).borderRadius(30).bc("gray").o(.25).$animate("2s linear infinite",{from:le.transform("rotate(0deg)"),to:le.transform("rotate(360deg)")}))),gh=(o,a)=>[o.state.toolbar&&dh(o,a),th(o,a),o.state.middle>97&&Ua(ih,a.resetSize),ph(o),o.resizing&&o.state.middle<=98&&rh(o)],vh=(o,a)=>Le(".input"+le.display("flex").p(2,0).flexShrink(0).w("100%").ff("Source Code Pro, monospace"),{onbeforeremove:Ra(300)},Le("label"+le.display("flex").ai("center").m("0 6px 0 10px").flexShrink(0).c("blue"),{for:"input"},">"),Le("textarea#input"+le.p(0).flexGrow(1).fs(12).lineHeight(o.console.lineHeight).bc("transparent").resize("none").outline("none").maxHeight(o.console.lineHeight*5).border("none"),{resize:!1,style:le.minHeight(o.console.inputHeight()).maxHeight(o.console.inputHeight()).style,oninput:a.onConsoleInput,onkeydown:a.onConsoleKeyDown},o.console.input)),mh='',yh=(o,a)=>Le(".console"+le.bs("0 0 8px rgba(0,0,0,.2)").position("relative").maxHeight(34).zi(30).display("flex").transition("max-height 0.3s").fd("column").background("rgb(246,246,246)"),{oncreate:({dom:l})=>o.console.dom=l,style:le.maxHeight(o.state.console===!0&&"50%").style},Le("div"+le.display("flex").jc("space-between").c("#777").flexShrink(0),{onclick:a.toggleConsole},Le("div"+le.display("flex").fs(12).tt("uppercase").p("8px 10px"),Le("span"+le.mr(4),"Console"),Xa("#d82c2c",a.clearErrors,o.console.errors()),Xa("gray",a.clearLogs,o.console.infos())),Le("div"+le.display("flex").p(2,6),Fi(mh,{iconClass:le.transition("transform 0.3s").transform(o.state.console===!0&&"rotate(180deg)"),title:o.state.console===!0?"Hide console":"Show console"}))),o.state.console===!0&&Le(".scroll"+le.overflow("auto"),{onscroll:l=>{if(l.redraw=!1,o.ignoreScroll){o.ignoreScroll=!1;return}o.console.manualScroll=l.target.scrollTop!==l.target.scrollHeight-l.target.offsetHeight},onbeforeremove:Ra(300),oncreate:({dom:l})=>{l.scrollTop=l.scrollHeight-l.clientHeight},onupdate:({state:l,dom:u})=>{o.console.manualScroll||(o.ignoreScroll=!0,u.scrollTop=u.scrollHeight-u.clientHeight)}},o.console.output.slice(-200).map(l=>Le(".logLine"+le.display("flex").ff("Source Code Pro, monospace").alignItems("center").p(2,10).minHeight(22).fs(12).borderBottom("1px solid #eee").c("#555").whiteSpace("pre-wrap").alignItems("center"),{key:l.number,onclick:()=>l.expand=!l.expand,title:l.date},[Le("div"+le.flexGrow(1).$nest(">span",le.mr(10)),l.content.length>1&&l.content[0].indexOf("%c")>-1&&Le("span",l.content[0].split("%c").filter(u=>u).map((u,h)=>Le("span"+le(l.content[h+1]||""),u))),l.content.slice(l.content.length>1&&l.content[0].indexOf("%c")>-1?l.content[0].match(/%c/g).length+1:0).map((u,h)=>Le("span",u))),l.stack&&Le(".stack"+le.ta("right").flexShrink(0).overflow("hidden"),l.stack.slice(0,!l.expand&&l.type!=="error"?1:void 0).map(u=>Le("div",(u.function||"")+" at ",Le("a"+(u.file?le.textDecoration("underline").cursor("pointer"):""),{onclick:h=>{h.stopPropagation(),u.select&&a.select(u.select),o.focus({line:u.line,column:u.column,scrollTo:!0})}},(u.file||0)+":"+(u.line||0)+":"+(u.column||0)))))]))),o.state.console===!0&&vh(o,a));function Xa(o,a,l){return Le("span"+le.bc(o).position("relative").m(0,4).p(0,10).ta("center").c("white").display("flex").ai("center").br(50).o(.2).transition("opacity 0.5s"),{style:le.o(l>0&&1).style},l,l>0&&qn({size:14,onclick:u=>{u.stopPropagation(),a(u)},class:le.p(3).ml(4).mr(-8).br(20).cursor("pointer").transition("opacity 0.3s").$hover(le.transform("scale").bc("rgba(255,255,255,0.25)")).class},qa))}var bh=(o,a)=>Le(".flems"+le.fontFamily('-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"').overflow("hidden").position("relative").display("flex").fd("column").boxSizing("border-box").lh(18).fs(16).$nest({"input, textarea":le.fontFamily("inherit").m(0).p(0),"*, *:before, *:after":le.boxSizing("inherit").fw("normal"),svg:le.fill("currentColor").va("middle"),"svg:not(:root)":le.overflow("hidden"),"a, a:link, a:visited":le.c("inherit").td("none").border("none")}),{style:le.h(o.state.autoHeight?o.cmHeight:"100%").userSelect(o.dragging&&"none").style},Le("main"+le.flexGrow(1).display("flex").flexDirection(o.vertical()&&"column").position(o.vertical()&&"relative"),{style:le.ai(!o.vertical()&&"stretch").style},Le(".editor"+le.position("relative").minWidth(50).minHeight(o.toolbar()).zIndex(30).flexGrow(1),{style:le.position(o.vertical()&&"absolute").width(o.vertical()&&"100%").height(o.vertical()&&o.state.middle+"%").maxWidth(!o.vertical()&&o.state.middle+"%").style},Vc(o,a)),Le(".runtime"+le.position("relative").minWidth(50).minHeight(o.toolbar()).b(0).r(0).display("flex").fd("column").flexGrow(1),{style:le.position(o.vertical()&&"absolute").width(o.vertical()&&"100%").height(o.vertical()&&100-o.state.middle+"%").maxHeight(o.vertical()&&"calc(100% - "+o.toolbar()+"px").maxWidth(!o.vertical()&&100-o.state.middle+"%").style},gh(o,a))),o.state.console&&yh(o,a)),Ya={exports:{}};(function(o){var a=function(){var l=String.fromCharCode,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",p={};function S(g,x){if(!p[g]){p[g]={};for(var y=0;y>>8,y[A*2+1]=_%256}return y},decompressFromUint8Array:function(g){if(g==null)return b.decompress(g);for(var x=new Array(g.length/2),y=0,A=x.length;y>1}else{for(m=1,A=0;A>1}T--,T==0&&(T=Math.pow(2,c),c++),delete R[N]}else for(m=_[N],A=0;A>1;T--,T==0&&(T=Math.pow(2,c),c++),_[W]=E++,N=String(I)}if(N!==""){if(Object.prototype.hasOwnProperty.call(R,N)){if(N.charCodeAt(0)<256){for(A=0;A>1}else{for(m=1,A=0;A>1}T--,T==0&&(T=Math.pow(2,c),c++),delete R[N]}else for(m=_[N],A=0;A>1;T--,T==0&&(T=Math.pow(2,c),c++)}for(m=2,A=0;A>1;for(;;)if(k=k<<1,O==x-1){w.push(y(k));break}else O++;return w.join("")},decompress:function(g){return g==null?"":g==""?null:b._decompress(g.length,32768,function(x){return g.charCodeAt(x)})},_decompress:function(g,x,y){var A=[],m=4,_=4,R=3,I="",W=[],N,T,E,c,w,k,O,L={val:y(0),position:x,index:1};for(N=0;N<3;N+=1)A[N]=N;for(E=0,w=Math.pow(2,2),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;switch(E){case 0:for(E=0,w=Math.pow(2,8),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;O=l(E);break;case 1:for(E=0,w=Math.pow(2,16),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;O=l(E);break;case 2:return""}for(A[3]=O,T=O,W.push(O);;){if(L.index>g)return"";for(E=0,w=Math.pow(2,R),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;switch(O=E){case 0:for(E=0,w=Math.pow(2,8),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;A[_++]=l(E),O=_-1,m--;break;case 1:for(E=0,w=Math.pow(2,16),k=1;k!=w;)c=L.val&L.position,L.position>>=1,L.position==0&&(L.position=x,L.val=y(L.index++)),E|=(c>0?1:0)*k,k<<=1;A[_++]=l(E),O=_-1,m--;break;case 2:return W.join("")}if(m==0&&(m=Math.pow(2,R),R++),A[O])I=A[O];else if(O===_)I=T+T.charAt(0);else return null;W.push(I),A[_++]=T+I.charAt(0),m--,T=I,m==0&&(m=Math.pow(2,R),R++)}}};return b}();o!=null&&(o.exports=a)})(Ya);var wh=Ya.exports;const gr=Dc(o=>new Promise((a,l)=>{const u=document.createElement("script");u.async=!1,u.charset="utf-8",u.src=o,document.body.appendChild(u),u.onload=a,u.onerror=h=>l("Could not load compiler from "+o)})),Qa={styl:o=>gr("https://static.flems.io/compilers/stylus.min.js").then(()=>({code:window.stylus.render(o.content)})),scss:o=>gr("https://static.flems.io/compilers/sass.sync.js").then(()=>new Promise((a,l)=>window.Sass.compile(o.content,u=>{u.message?l(u.message):a({code:u.text})}))),sass:o=>gr("https://static.flems.io/compilers/sass.sync.js").then(()=>new Promise((a,l)=>window.Sass.compile(o.content,{indentedSyntax:!0},u=>{u.message?l(u.message):a({code:u.text})}))),less:o=>gr("https://static.flems.io/compilers/less.min.js").then(()=>window.less.render(o.content).then(a=>({code:a.css}))),ts:o=>gr("https://static.flems.io/compilers/typescriptServices.js").then(()=>{const a=window.ts.transpileModule(o.content,{fileName:o.name,compilerOptions:{module:"ESNext",sourceMap:!0,jsx:"react"}});return{code:a.outputText.substring(0,a.outputText.lastIndexOf(` `)),map:a.sourceMapText}}),babel:o=>gr("https://static.flems.io/compilers/babel.min.js").then(()=>window.Babel.transform(o.content,{presets:[["es2015",{modules:!1}],"stage-2","react"],sourceMaps:!0,sourceType:"unambiguous",sourceFileName:o.name})),ls:o=>gr("https://static.flems.io/compilers/livescript-min.js").then(()=>{window.livescript||(window.livescript=window.require("livescript"));const a=window.livescript.compile(o.content,{map:"linked",filename:o.name});return{code:a.code,map:a.map.toString()}}),coffee:o=>Promise.all([gr("https://static.flems.io/compilers/babel.min.js"),gr("https://static.flems.io/compilers/coffeescript.js")]).then(()=>{const a=window.CoffeeScript.compile(o.content,{sourceMap:!0,filename:o.name});return window.Babel.transform(a.js,{presets:[["es2015",{modules:!1}],"stage-2","react"],sourceMaps:!0,inputSourceMap:JSON.parse(a.v3SourceMap),sourceFileName:o.name})}),sibilant:o=>gr("https://static.flems.io/compilers/sibilant.js").then(()=>({code:window.sibilant.sibilize(o.content)}))},qo={html:"document",js:"script",mjs:"script",ts:"script",ls:"script",coffee:"script",sibilant:"script",css:"style",styl:"style",less:"style",scss:"style",sass:"style"},Bi=()=>({middle:50,selected:".js",color:"rgb(38,50,56)",theme:"material",layout:"auto",resizeable:!0,editable:!0,toolbar:!0,fileTabs:!0,linkTabs:!0,shareButton:!0,reloadButton:!0,console:!0,autoReload:!0,autoReloadDelay:400,autoFocus:!1,autoHeight:!1,scroll:null,files:[{name:".html",content:""},{name:".js",content:""},{name:".css",content:""}],links:[]});function $a(o){const a=Bi();return Object.keys(a).forEach(l=>{l in o||(o[l]=a[l])}),o.middle=Math.min(Math.max(o.middle,0),100),o.files.forEach(l=>{if(l.type=l.type||qo[Ri(l.name)],l.content=l.content||"",typeof l.compiler=="string"&&!(l.compiler in Qa))throw new Error("Unknown compler: "+l.compiler)}),o.files.reduce((l,u)=>{if(l.indexOf(u.name)>-1)throw new Error("Multiple files with the same name: "+name);return l.concat(u.name)},[]),o.links.forEach(l=>{if(!zc.test(l.url))throw new Error("Link url's should start with http:// or https://");l.type=qo[l.type]||l.type||qo[Ri(l.url)]||"script",l.name=l.name||l.url.slice(l.url.lastIndexOf("/")+1)}),Gn(o,o.selected)||(o.selected=(o.files[0]||{}).name||(o.links[0]||{}).url),o}const Za=o=>"https://flems.io/#0="+wh.compressToEncodedURIComponent(JSON.stringify(xh(o)));function xh(o){const a=Object.keys(Bi()).reduce((l,u)=>(u in o&&o[u]!==Bi[u]&&(l[u]=o[u]),l),{});return o.files&&o.files.length&&(a.files=Ja(o.files,["name","content","compiler","selections"])),o.links&&(a.links=Ja(o.links,["name","url","type","patches","selections"])),a}function Ja(o=[],a){return o.map(l=>a.reduce((u,h)=>(u[h]=l[h],u),{}))}var Va={exports:{}};(function(o){(function(){l.SKIP={},l.lift=b,l.scan=p,l.merge=h,l.combine=u,l.scanMerge=S,l["fantasy-land/of"]=l;var a=!1;Object.defineProperty(l,"HALT",{get:function(){return a||console.log("HALT is deprecated and has been renamed to SKIP"),a=!0,l.SKIP}});function l(x){var y=[],A=[];function m(I){return arguments.length&&I!==l.SKIP&&(x=I,g(m)&&(m._changing(),m._state="active",y.forEach(function(W,N){W(A[N](x))}))),x}m.constructor=l,m._state=arguments.length&&x!==l.SKIP?"active":"pending",m._parents=[],m._changing=function(){g(m)&&(m._state="changing"),y.forEach(function(I){I._changing()})},m._map=function(I,W){var N=W?l():l(I(x));return N._parents.push(m),y.push(N),A.push(I),N},m.map=function(I){return m._map(I,m._state!=="active")};var _;function R(){return _=l(),_.map(function(I){return I===!0&&(m._parents.forEach(function(W){W._unregisterChild(m)}),m._state="ended",m._parents.length=y.length=A.length=0),I}),_}return m.toJSON=function(){return x!=null&&typeof x.toJSON=="function"?x.toJSON():x},m["fantasy-land/map"]=m.map,m["fantasy-land/ap"]=function(I){return u(function(W,N){return W()(N())},[I,m])},m._unregisterChild=function(I){var W=y.indexOf(I);W!==-1&&(y.splice(W,1),A.splice(W,1))},Object.defineProperty(m,"end",{get:function(){return _||R()}}),m}function u(x,y){var A=y.every(function(W){if(W.constructor!==l)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream");return W._state==="active"}),m=A?l(x.apply(null,y.concat([y]))):l(),_=[],R=y.map(function(W){return W._map(function(N){return _.push(W),(A||y.every(function(T){return T._state!=="pending"}))&&(A=!0,m(x.apply(null,y.concat([_]))),_=[]),N},!0)}),I=m.end.map(function(W){W===!0&&(R.forEach(function(N){N.end(!0)}),I.end(!0))});return m}function h(x){return u(function(){return x.map(function(y){return y()})},x)}function p(x,y,A){var m=A.map(function(_){var R=x(y,_);return R!==l.SKIP&&(y=R),R});return m(y),m}function S(x,y){var A=x.map(function(_){return _[0]}),m=u(function(){var _=arguments[arguments.length-1];return A.forEach(function(R,I){_.indexOf(R)>-1&&(y=x[I][1](y,R()))}),y},A);return m(y),m}function b(){var x=arguments[0],y=Array.prototype.slice.call(arguments,1);return h(y).map(function(A){return x.apply(void 0,A)})}function g(x){return x._state==="pending"||x._state==="active"||x._state==="changing"}o.exports=l})()})(Va);var Xo=Va.exports;const es=document.getElementsByTagName("script"),Yo=es[es.length-1],kh=jn("flems.html",Yo?Yo.src:"")&&Yo.src;function Sh(o,a,l){a=$a(a);const h={id:Ch(),dom:o,state:a,selected:Xo(Gn(a,a.selected)),iOS:"overflowScrolling"in le,runtimeUrl:l||kh||"flems.html",console:{input:"",inputNumber:0,output:[],history:[],position:0,manualScroll:!1,lineHeight:22,errors:()=>h.console.output.filter(p=>p.type==="error").length,infos:()=>h.console.output.filter(p=>p.type!=="error").length,inputHeight:()=>Math.min(h.console.lineHeight*h.console.input.split(` `).length,h.console.lineHeight*5)},cmHeight:null,iframe:null,loading:!0,resizing:!1,hideError:!0,dragging:!1,refreshCm:Xo(),focus:Xo(),vertical:()=>o.offsetWidth*1.25h.state.toolbar?40:0};return h}function Ch(){return("000"+(Math.random()*46656|0).toString(36)).slice(-3)+("000"+(Math.random()*46656|0).toString(36)).slice(-3)}var Lh={},Th=Object.freeze({__proto__:null,default:Lh}),Mh=ec(Th),Qo=typeof Map=="function"&&Map.prototype,$o=Object.getOwnPropertyDescriptor&&Qo?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hi=Qo&&$o&&typeof $o.get=="function"?$o.get:null,Ah=Qo&&Map.prototype.forEach,Zo=typeof Set=="function"&&Set.prototype,Jo=Object.getOwnPropertyDescriptor&&Zo?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wi=Zo&&Jo&&typeof Jo.get=="function"?Jo.get:null,Oh=Zo&&Set.prototype.forEach,_h=Boolean.prototype.valueOf,Eh=Object.prototype.toString,Nh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Vo=Mh.custom,el=Vo&&ns(Vo)?Vo:null,Ph=function o(a,l,u,h){if(l||(l={}),tl(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(typeof a=="undefined")return"undefined";if(a===null)return"null";if(typeof a=="boolean")return a?"true":"false";if(typeof a=="string")return Yh(a,l);if(typeof a=="number")return a===0?1/0/a>0?"0":"-0":String(a);if(typeof a=="bigint")return String(a)+"n";var p=typeof l.depth=="undefined"?5:l.depth;if(typeof u=="undefined"&&(u=0),u>=p&&p>0&&typeof a=="object")return"[Object]";if(typeof h=="undefined")h=[];else if(Gh(h,a)>=0)return"[Circular]";function S(R,I){return I&&(h=h.slice(),h.push(I)),o(R,l,u+1,h)}if(typeof a=="function"){var b=Kh(a);return"[Function"+(b?": "+b:"")+"]"}if(ns(a)){var g=Symbol.prototype.toString.call(a);return typeof a=="object"?Xn(g):g}if(Xh(a)){for(var x="<"+String(a.nodeName).toLowerCase(),y=a.attributes||[],A=0;A",x}if(rs(a))return a.length===0?"[]":"[ "+rl(a,S).join(", ")+" ]";if(Rh(a)){var m=rl(a,S);return m.length===0?"["+String(a)+"]":"{ ["+String(a)+"] "+m.join(", ")+" }"}if(typeof a=="object"){if(el&&typeof a[el]=="function")return a[el]();if(typeof a.inspect=="function")return a.inspect()}if(jh(a)){var m=[];return Ah.call(a,function(I,W){m.push(S(W,a)+" => "+S(I,a))}),is("Map",Hi.call(a),m)}if(qh(a)){var m=[];return Oh.call(a,function(I){m.push(S(I,a))}),is("Set",Wi.call(a),m)}if(Bh(a))return Xn(S(Number(a)));if(Hh(a))return Xn(S(Nh.call(a)));if(Wh(a))return Xn(_h.call(a));if(Fh(a))return Xn(S(String(a)));if(!Dh(a)&&!Ih(a)){var _=rl(a,S);return _.length===0?"{}":"{ "+_.join(", ")+" }"}return String(a)};function ts(o,a,l){var u=(l.quoteStyle||a)==="double"?'"':"'";return u+o+u}function zh(o){return String(o).replace(/"/g,""")}function rs(o){return Lr(o)==="[object Array]"}function Dh(o){return Lr(o)==="[object Date]"}function Ih(o){return Lr(o)==="[object RegExp]"}function Rh(o){return Lr(o)==="[object Error]"}function ns(o){return Lr(o)==="[object Symbol]"}function Fh(o){return Lr(o)==="[object String]"}function Bh(o){return Lr(o)==="[object Number]"}function Hh(o){return Lr(o)==="[object BigInt]"}function Wh(o){return Lr(o)==="[object Boolean]"}var Uh=Object.prototype.hasOwnProperty||function(o){return o in this};function tl(o,a){return Uh.call(o,a)}function Lr(o){return Eh.call(o)}function Kh(o){if(o.name)return o.name;var a=String(o).match(/^function\s*([\w$]+)/);if(a)return a[1]}function Gh(o,a){if(o.indexOf)return o.indexOf(a);for(var l=0,u=o.length;la.length?o:a,S=o.length>a.length?a:o,b=p.indexOf(S);if(b!==-1)return h=[[ht,p.substring(0,b)],[Ue,S],[ht,p.substring(b+S.length)]],o.length>a.length&&(h[0][0]=h[2][0]=at),h;if(S.length===1)return[[at,o],[ht,a]];const g=ad(o,a);if(g){const x=g[0],y=g[1],A=g[2],m=g[3],_=g[4],R=Dr(x,A,l,u),I=Dr(y,m,l,u);return R.concat([[Ue,_]],I)}return l&&o.length>100&&a.length>100?nd(o,a,u):id(o,a,u)}function nd(o,a,l){const u=od(o,a);o=u.chars1,a=u.chars2;const h=u.lineArray,p=Dr(o,a,!1,l);ld(p,h),cs(p),p.push([Ue,""]);let S=0,b=0,g=0,x="",y="";for(;S=1&&g>=1){p.splice(S-b-g,b+g),S=S-b-g;const A=Dr(x,y,!1,l);for(let m=A.length-1;m>=0;m--)p.splice(S,0,A[m]);S=S+A.length}g=0,b=0,x="",y=""}S++}return p.pop(),p}function id(o,a,l){const u=o.length,h=a.length,p=Math.ceil((u+h)/2),S=p,b=2*p,g=new Array(b),x=new Array(b);for(let W=0;Wl);W++){for(let N=-W+m;N<=W-_;N+=2){const T=S+N;let E;N===-W||N!==W&&g[T-1]u)_+=2;else if(c>h)m+=2;else if(A){const w=S+y-N;if(w>=0&&w=k)return us(o,a,E,c,l)}}}for(let N=-W+R;N<=W-I;N+=2){const T=S+N;let E;N===-W||N!==W&&x[T-1]u)I+=2;else if(c>h)R+=2;else if(!A){const w=S+y-N;if(w>=0&&w=E)return us(o,a,k,O,l)}}}}return[[at,o],[ht,a]]}function us(o,a,l,u,h){const p=o.substring(0,l),S=a.substring(0,u),b=o.substring(l),g=a.substring(u),x=Dr(p,S,!1,h),y=Dr(b,g,!1,h);return x.concat(y)}function od(o,a){const l=[],u={};l[0]="";function h(b){let g="",x=0,y=-1,A=l.length;for(;yu?o=o.substring(l-u):la.length?o:a,u=o.length>a.length?a:o;if(l.length<4||u.length*2=_.length?[E,c,w,k,T]:null}const p=h(l,u,Math.ceil(l.length/4)),S=h(l,u,Math.ceil(l.length/2));let b;if(!p&&!S)return null;S?p?b=p[4].length>S[4].length?p:S:b=S:b=p;let g,x,y,A;o.length>a.length?(g=b[0],x=b[1],y=b[2],A=b[3]):(y=b[0],A=b[1],g=b[2],x=b[3]);const m=b[4];return[g,x,y,A,m]}function cs(o){let a=!1;const l=[];let u=0,h=null,p=0,S=0,b=0,g=0,x=0;for(;p0?l[u-1]:-1,S=0,b=0,g=0,x=0,h=null,a=!0)),p++;for(a&&Ki(o),hs(o),p=1;p=_?(m>=y.length/2||m>=A.length/2)&&(o.splice(p,0,[Ue,A.substring(0,m)]),o[p-1][1]=y.substring(0,y.length-m),o[p+1][1]=A.substring(m),p++):(_>=y.length/2||_>=A.length/2)&&(o.splice(p,0,[Ue,y.substring(0,_)]),o[p-1][0]=ht,o[p-1][1]=A.substring(0,A.length-_),o[p+1][0]=at,o[p+1][1]=y.substring(_),p++),p++}p++}}function hs(o){function a(u,h){if(!u||!h)return 6;const p=u.charAt(u.length-1),S=h.charAt(0),b=p.match(ls),g=S.match(ls),x=b&&p.match(as),y=g&&S.match(as),A=x&&p.match(ss),m=y&&S.match(ss),_=A&&u.match(ed),R=m&&h.match(td);return _||R?5:A||m?4:b&&!x&&y?3:x||y?2:b||g?1:0}let l=1;for(;l=y&&(y=A,b=u,g=h,x=p)}o[l-1][1]!==b&&(b?o[l-1][1]=b:(o.splice(l-1,1),l--),o[l][1]=g,x?o[l+1][1]=x:(o.splice(l+1,1),l--))}l++}}function sd(o){let a=!1;const l=[];let u=0,h=null,p=0,S=!1,b=!1,g=!1,x=!1;for(;p0?l[u-1]:-1,g=x=!1),a=!0)),p++;a&&Ki(o)}function Ki(o){o.push([Ue,""]);let a=0,l=0,u=0,h="",p="",S;for(;a1?(l!==0&&u!==0&&(S=nl(p,h),S!==0&&(a-l-u>0&&o[a-l-u-1][0]===Ue?o[a-l-u-1][1]+=p.substring(0,S):(o.splice(0,0,[Ue,p.substring(0,S)]),a++),p=p.substring(S),h=h.substring(S)),S=Ui(p,h),S!==0&&(o[a][1]=p.substring(p.length-S)+o[a][1],p=p.substring(0,p.length-S),h=h.substring(0,h.length-S))),l===0?o.splice(a-u,l+u,[ht,p]):u===0?o.splice(a-l,l+u,[at,h]):o.splice(a-l-u,l+u,[at,h],[ht,p]),a=a-l-u+(l?1:0)+(u?1:0)+1):a!==0&&o[a-1][0]===Ue?(o[a-1][1]+=o[a][1],o.splice(a,1)):a++,u=0,l=0,h="",p="");o[o.length-1][1]===""&&o.pop();let b=!1;for(a=1;aTr)throw new Error("Pattern too long for this browser.");const u=ud(a);function h(m,_){const R=m/a.length,I=Math.abs(l-_);return R+I/Vh}let p=Jh,S=o.indexOf(a,l);S!==-1&&(p=Math.min(h(0,S),p),S=o.lastIndexOf(a,l+a.length),S!==-1&&(p=Math.min(h(0,S),p)));const b=1<=_;W--){const N=u[o.charAt(W-1)];if(m===0?I[W]=(I[W+1]<<1|1)&N:I[W]=(I[W+1]<<1|1)&N|((A[W+1]|A[W])<<1|1)|A[W+1],I[W]&b){const T=h(m,W-1);if(T<=p)if(p=T,S=W-1,S>l)_=Math.max(1,2*l-S);else break}}if(h(m+1,l)>p)break;A=I}return S}function gs(o,a){if(a.length===0)return;let l=a.substring(o.start2,o.start2+o.length1),u=0;for(;a.indexOf(l)!==a.lastIndexOf(l)&&l.length2&&(cs(h),sd(h)));const p=[];let S=Gi(),b=0,g=0,x=0,y=u,A=u;for(let m=0;m=2*ir&&b&&(gs(S,y),p.push(S),S=Gi(),b=0,y=A,g=x)),_!==ht&&(g+=R.length),_!==at&&(x+=R.length)}return b&&(gs(S,y),p.push(S)),md(p)}function hd(o){const a=[];for(let l=0;lTr?(g=il(o,b.substring(0,Tr),S),g!==-1&&(x=il(o,b.substring(b.length-Tr),S+b.length-Tr),(x===-1||g>=x)&&(g=-1))):g=il(o,b,S),g===-1)h[p]=!1,u-=a[p].length2-a[p].length1;else{h[p]=!0,u=g-S;let y;if(x===-1?y=o.substring(g,g+b.length):y=o.substring(g,x+Tr),b===y)o=o.substring(0,g)+ps(a[p].diffs)+o.substring(g+b.length);else{const A=Dr(b,y,!1,void 0);if(b.length>Tr&&dd(A)/b.length>Zh)h[p]=!1;else{hs(A);let m=0,_;for(let R=0;Ra));S++)h=l,p=u;return o.length!==S&&o[S][0]===at?p:p+(a-h)}function gd(o){const a=ir;let l="";for(let p=1;p<=a;p++)l+=String.fromCharCode(p);for(let p=0;ph[0][1].length){const p=a-h[0][1].length;h[0][1]=l.substring(h[0][1].length)+h[0][1],u.start1-=p,u.start2-=p,u.length1+=p,u.length2+=p}if(u=o[o.length-1],h=u.diffs,h.length===0||h[h.length-1][0]!==Ue)h.push([Ue,l]),u.length1+=a,u.length2+=a;else if(a>h[h.length-1][1].length){const p=a-h[h.length-1][1].length;h[h.length-1][1]+=l.substring(0,p),u.length1+=p,u.length2+=p}return l}function vd(o){const a=Tr;for(let l=0;l2*a?(b.length1+=A.length,h+=A.length,g=!1,b.diffs.push([y,A]),u.diffs.shift()):(A=A.substring(0,a-b.length1-ir),b.length1+=A.length,h+=A.length,y===Ue?(b.length2+=A.length,p+=A.length):g=!1,b.diffs.push([y,A]),A===u.diffs[0][1]?u.diffs.shift():u.diffs[0][1]=u.diffs[0][1].substring(A.length))}S=ps(b.diffs),S=S.substring(S.length-ir);const x=ds(u.diffs).substring(0,ir);x!==""&&(b.length1+=x.length,b.length2+=x.length,b.diffs.length!==0&&b.diffs[b.diffs.length-1][0]===Ue?b.diffs[b.diffs.length-1][1]+=x:b.diffs.push([Ue,x])),g||o.splice(++l,0,b)}}}function Gi(){return{diffs:[],start1:null,start2:null,length1:0,length2:0}}function md(o){return o.length?o.map(a=>a.diffs.concat([a.length1,a.length2,a.start1,a.start2])):void 0}function yd(o){return o.map(a=>({diffs:Array.isArray(a[0])?a.slice(0,-4):[[0,a[1]],[a[0],a[2]],[0,a[3]]],length1:a[a.length-4],length2:a[a.length-3],start1:a[a.length-2],start2:a[a.length-1]}))}var ji={},ol={},qi={},ll={},ms="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ll.encode=function(o){if(0<=o&&o>1;return a?-l:l}qi.encode=function(a){var l="",u,h=bd(a);do u=h&ws,h>>>=al,h>0&&(u|=xs),l+=ys.encode(u);while(h>0);return l},qi.decode=function(a,l,u){var h=a.length,p=0,S=0,b,g;do{if(l>=h)throw new Error("Expected more digits in base 64 VLQ value.");if(g=ys.decode(a.charCodeAt(l++)),g===-1)throw new Error("Invalid base64 digit: "+a.charAt(l-1));b=!!(g&xs),g&=ws,p=p+(g<=0;U--)j=L[U],j==="."?L.splice(U,1):j===".."?B++:B>0&&(j===""?(L.splice(U+1,B),B=0):(L.splice(U,2),B--));return w=L.join("/"),w===""&&(w=O?"/":"."),k?(k.path=w,p(k)):w}o.normalize=S;function b(c,w){c===""&&(c="."),w===""&&(w=".");var k=h(w),O=h(c);if(O&&(c=O.path||"/"),k&&!k.scheme)return O&&(k.scheme=O.scheme),p(k);if(k||w.match(u))return w;if(O&&!O.host&&!O.path)return O.host=w,p(O);var L=w.charAt(0)==="/"?w:S(c.replace(/\/+$/,"")+"/"+w);return O?(O.path=L,p(O)):L}o.join=b,o.isAbsolute=function(c){return c.charAt(0)==="/"||l.test(c)};function g(c,w){c===""&&(c="."),c=c.replace(/\/$/,"");for(var k=0;w.indexOf(c+"/")!==0;){var O=c.lastIndexOf("/");if(O<0||(c=c.slice(0,O),c.match(/^([^\/]+:\/)?\/*$/)))return w;++k}return Array(k+1).join("../")+w.substr(c.length+1)}o.relative=g;var x=function(){var c=Object.create(null);return!("__proto__"in c)}();function y(c){return c}function A(c){return _(c)?"$"+c:c}o.toSetString=x?y:A;function m(c){return _(c)?c.slice(1):c}o.fromSetString=x?y:m;function _(c){if(!c)return!1;var w=c.length;if(w<9||c.charCodeAt(w-1)!==95||c.charCodeAt(w-2)!==95||c.charCodeAt(w-3)!==111||c.charCodeAt(w-4)!==116||c.charCodeAt(w-5)!==111||c.charCodeAt(w-6)!==114||c.charCodeAt(w-7)!==112||c.charCodeAt(w-8)!==95||c.charCodeAt(w-9)!==95)return!1;for(var k=w-10;k>=0;k--)if(c.charCodeAt(k)!==36)return!1;return!0}function R(c,w,k){var O=W(c.source,w.source);return O!==0||(O=c.originalLine-w.originalLine,O!==0)||(O=c.originalColumn-w.originalColumn,O!==0||k)||(O=c.generatedColumn-w.generatedColumn,O!==0)||(O=c.generatedLine-w.generatedLine,O!==0)?O:W(c.name,w.name)}o.compareByOriginalPositions=R;function I(c,w,k){var O=c.generatedLine-w.generatedLine;return O!==0||(O=c.generatedColumn-w.generatedColumn,O!==0||k)||(O=W(c.source,w.source),O!==0)||(O=c.originalLine-w.originalLine,O!==0)||(O=c.originalColumn-w.originalColumn,O!==0)?O:W(c.name,w.name)}o.compareByGeneratedPositionsDeflated=I;function W(c,w){return c===w?0:c===null?1:w===null?-1:c>w?1:-1}function N(c,w){var k=c.generatedLine-w.generatedLine;return k!==0||(k=c.generatedColumn-w.generatedColumn,k!==0)||(k=W(c.source,w.source),k!==0)||(k=c.originalLine-w.originalLine,k!==0)||(k=c.originalColumn-w.originalColumn,k!==0)?k:W(c.name,w.name)}o.compareByGeneratedPositionsInflated=N;function T(c){return JSON.parse(c.replace(/^\)]}'[^\n]*\n/,""))}o.parseSourceMapInput=T;function E(c,w,k){if(w=w||"",c&&(c[c.length-1]!=="/"&&w[0]!=="/"&&(c+="/"),w=c+w),k){var O=h(k);if(!O)throw new Error("sourceMapURL could not be parsed");if(O.path){var L=O.path.lastIndexOf("/");L>=0&&(O.path=O.path.substring(0,L+1))}w=b(p(O),w)}return S(w)}o.computeSourceURL=E})(gn);var sl={},ul=gn,fl=Object.prototype.hasOwnProperty,$r=typeof Map!="undefined";function Mr(){this._array=[],this._set=$r?new Map:Object.create(null)}Mr.fromArray=function(a,l){for(var u=new Mr,h=0,p=a.length;h=0)return l}else{var u=ul.toSetString(a);if(fl.call(this._set,u))return this._set[u]}throw new Error('"'+a+'" is not in the set.')},Mr.prototype.at=function(a){if(a>=0&&al||u==l&&p>=h||Ss.compareByGeneratedPositionsInflated(o,a)<=0}function Xi(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Xi.prototype.unsortedForEach=function(a,l){this._array.forEach(a,l)},Xi.prototype.add=function(a){xd(this._last,a)?(this._last=a,this._array.push(a)):(this._sorted=!1,this._array.push(a))},Xi.prototype.toArray=function(){return this._sorted||(this._array.sort(Ss.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},ks.MappingList=Xi;var Yn=qi,mt=gn,Yi=sl.ArraySet,kd=ks.MappingList;function er(o){o||(o={}),this._file=mt.getArg(o,"file",null),this._sourceRoot=mt.getArg(o,"sourceRoot",null),this._skipValidation=mt.getArg(o,"skipValidation",!1),this._sources=new Yi,this._names=new Yi,this._mappings=new kd,this._sourcesContents=null}er.prototype._version=3,er.fromSourceMap=function(a){var l=a.sourceRoot,u=new er({file:a.file,sourceRoot:l});return a.eachMapping(function(h){var p={generated:{line:h.generatedLine,column:h.generatedColumn}};h.source!=null&&(p.source=h.source,l!=null&&(p.source=mt.relative(l,p.source)),p.original={line:h.originalLine,column:h.originalColumn},h.name!=null&&(p.name=h.name)),u.addMapping(p)}),a.sources.forEach(function(h){var p=h;l!==null&&(p=mt.relative(l,h)),u._sources.has(p)||u._sources.add(p);var S=a.sourceContentFor(h);S!=null&&u.setSourceContent(h,S)}),u},er.prototype.addMapping=function(a){var l=mt.getArg(a,"generated"),u=mt.getArg(a,"original",null),h=mt.getArg(a,"source",null),p=mt.getArg(a,"name",null);this._skipValidation||this._validateMapping(l,u,h,p),h!=null&&(h=String(h),this._sources.has(h)||this._sources.add(h)),p!=null&&(p=String(p),this._names.has(p)||this._names.add(p)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:h,name:p})},er.prototype.setSourceContent=function(a,l){var u=a;this._sourceRoot!=null&&(u=mt.relative(this._sourceRoot,u)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[mt.toSetString(u)]=l):this._sourcesContents&&(delete this._sourcesContents[mt.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},er.prototype.applySourceMap=function(a,l,u){var h=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);h=a.file}var p=this._sourceRoot;p!=null&&(h=mt.relative(p,h));var S=new Yi,b=new Yi;this._mappings.unsortedForEach(function(g){if(g.source===h&&g.originalLine!=null){var x=a.originalPositionFor({line:g.originalLine,column:g.originalColumn});x.source!=null&&(g.source=x.source,u!=null&&(g.source=mt.join(u,g.source)),p!=null&&(g.source=mt.relative(p,g.source)),g.originalLine=x.line,g.originalColumn=x.column,x.name!=null&&(g.name=x.name))}var y=g.source;y!=null&&!S.has(y)&&S.add(y);var A=g.name;A!=null&&!b.has(A)&&b.add(A)},this),this._sources=S,this._names=b,a.sources.forEach(function(g){var x=a.sourceContentFor(g);x!=null&&(u!=null&&(g=mt.join(u,g)),p!=null&&(g=mt.relative(p,g)),this.setSourceContent(g,x))},this)},er.prototype._validateMapping=function(a,l,u,h){if(l&&typeof l.line!="number"&&typeof l.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!u&&!h)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&u)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:a,source:u,original:l,name:h}))}},er.prototype._serializeMappings=function(){for(var a=0,l=1,u=0,h=0,p=0,S=0,b="",g,x,y,A,m=this._mappings.toArray(),_=0,R=m.length;_0){if(!mt.compareByGeneratedPositionsInflated(x,m[_-1]))continue;g+=","}g+=Yn.encode(x.generatedColumn-a),a=x.generatedColumn,x.source!=null&&(A=this._sources.indexOf(x.source),g+=Yn.encode(A-S),S=A,g+=Yn.encode(x.originalLine-1-h),h=x.originalLine-1,g+=Yn.encode(x.originalColumn-u),u=x.originalColumn,x.name!=null&&(y=this._names.indexOf(x.name),g+=Yn.encode(y-p),p=y)),b+=g}return b},er.prototype._generateSourcesContent=function(a,l){return a.map(function(u){if(!this._sourcesContents)return null;l!=null&&(u=mt.relative(l,u));var h=mt.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,h)?this._sourcesContents[h]:null},this)},er.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},er.prototype.toString=function(){return JSON.stringify(this.toJSON())},ol.SourceMapGenerator=er;var Qi={},Cs={};(function(o){o.GREATEST_LOWER_BOUND=1,o.LEAST_UPPER_BOUND=2;function a(l,u,h,p,S,b){var g=Math.floor((u-l)/2)+l,x=S(h,p[g],!0);return x===0?g:x>0?u-g>1?a(g,u,h,p,S,b):b==o.LEAST_UPPER_BOUND?u1?a(l,g,h,p,S,b):b==o.LEAST_UPPER_BOUND?g:l<0?-1:l}o.search=function(u,h,p,S){if(h.length===0)return-1;var b=a(-1,h.length,u,h,p,S||o.GREATEST_LOWER_BOUND);if(b<0)return-1;for(;b-1>=0&&p(h[b],h[b-1],!0)===0;)--b;return b}})(Cs);var Ls={};function cl(o,a,l){var u=o[a];o[a]=o[l],o[l]=u}function Sd(o,a){return Math.round(o+Math.random()*(a-o))}function hl(o,a,l,u){if(l=0){var S=this._originalMappings[p];if(a.column===void 0)for(var b=S.originalLine;S&&S.originalLine===b;)h.push({line:ke.getArg(S,"generatedLine",null),column:ke.getArg(S,"generatedColumn",null),lastColumn:ke.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++p];else for(var g=S.originalColumn;S&&S.originalLine===l&&S.originalColumn==g;)h.push({line:ke.getArg(S,"generatedLine",null),column:ke.getArg(S,"generatedColumn",null),lastColumn:ke.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++p]}return h},Qi.SourceMapConsumer=tt;function Mt(o,a){var l=o;typeof o=="string"&&(l=ke.parseSourceMapInput(o));var u=ke.getArg(l,"version"),h=ke.getArg(l,"sources"),p=ke.getArg(l,"names",[]),S=ke.getArg(l,"sourceRoot",null),b=ke.getArg(l,"sourcesContent",null),g=ke.getArg(l,"mappings"),x=ke.getArg(l,"file",null);if(u!=this._version)throw new Error("Unsupported version: "+u);S&&(S=ke.normalize(S)),h=h.map(String).map(ke.normalize).map(function(y){return S&&ke.isAbsolute(S)&&ke.isAbsolute(y)?ke.relative(S,y):y}),this._names=vn.fromArray(p.map(String),!0),this._sources=vn.fromArray(h,!0),this._absoluteSources=this._sources.toArray().map(function(y){return ke.computeSourceURL(S,y,a)}),this.sourceRoot=S,this.sourcesContent=b,this._mappings=g,this._sourceMapURL=a,this.file=x}Mt.prototype=Object.create(tt.prototype),Mt.prototype.consumer=tt,Mt.prototype._findSourceIndex=function(o){var a=o;if(this.sourceRoot!=null&&(a=ke.relative(this.sourceRoot,a)),this._sources.has(a))return this._sources.indexOf(a);var l;for(l=0;l1&&(I.source=b+N[1],b+=N[1],I.originalLine=p+N[2],p=I.originalLine,I.originalLine+=1,I.originalColumn=S+N[3],S=I.originalColumn,N.length>4&&(I.name=g+N[4],g+=N[4])),R.push(I),typeof I.originalLine=="number"&&_.push(I)}Qn(R,ke.compareByGeneratedPositionsDeflated),this.__generatedMappings=R,Qn(_,ke.compareByOriginalPositions),this.__originalMappings=_},Mt.prototype._findMapping=function(a,l,u,h,p,S){if(a[u]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+a[u]);if(a[h]<0)throw new TypeError("Column must be greater than or equal to 0, got "+a[h]);return dl.search(a,l,p,S)},Mt.prototype.computeColumnSpans=function(){for(var a=0;a=0){var h=this._generatedMappings[u];if(h.generatedLine===l.generatedLine){var p=ke.getArg(h,"source",null);p!==null&&(p=this._sources.at(p),p=ke.computeSourceURL(this.sourceRoot,p,this._sourceMapURL));var S=ke.getArg(h,"name",null);return S!==null&&(S=this._names.at(S)),{source:p,line:ke.getArg(h,"originalLine",null),column:ke.getArg(h,"originalColumn",null),name:S}}}return{source:null,line:null,column:null,name:null}},Mt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(a){return a==null}):!1},Mt.prototype.sourceContentFor=function(a,l){if(!this.sourcesContent)return null;var u=this._findSourceIndex(a);if(u>=0)return this.sourcesContent[u];var h=a;this.sourceRoot!=null&&(h=ke.relative(this.sourceRoot,h));var p;if(this.sourceRoot!=null&&(p=ke.urlParse(this.sourceRoot))){var S=h.replace(/^file:\/\//,"");if(p.scheme=="file"&&this._sources.has(S))return this.sourcesContent[this._sources.indexOf(S)];if((!p.path||p.path=="/")&&this._sources.has("/"+h))return this.sourcesContent[this._sources.indexOf("/"+h)]}if(l)return null;throw new Error('"'+h+'" is not in the SourceMap.')},Mt.prototype.generatedPositionFor=function(a){var l=ke.getArg(a,"source");if(l=this._findSourceIndex(l),l<0)return{line:null,column:null,lastColumn:null};var u={source:l,originalLine:ke.getArg(a,"line"),originalColumn:ke.getArg(a,"column")},h=this._findMapping(u,this._originalMappings,"originalLine","originalColumn",ke.compareByOriginalPositions,ke.getArg(a,"bias",tt.GREATEST_LOWER_BOUND));if(h>=0){var p=this._originalMappings[h];if(p.source===u.source)return{line:ke.getArg(p,"generatedLine",null),column:ke.getArg(p,"generatedColumn",null),lastColumn:ke.getArg(p,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},Qi.BasicSourceMapConsumer=Mt;function or(o,a){var l=o;typeof o=="string"&&(l=ke.parseSourceMapInput(o));var u=ke.getArg(l,"version"),h=ke.getArg(l,"sections");if(u!=this._version)throw new Error("Unsupported version: "+u);this._sources=new vn,this._names=new vn;var p={line:-1,column:0};this._sections=h.map(function(S){if(S.url)throw new Error("Support for url field in sections not implemented.");var b=ke.getArg(S,"offset"),g=ke.getArg(b,"line"),x=ke.getArg(b,"column");if(g=0;l--)this.prepend(a[l]);else if(a[mn]||typeof a=="string")this.children.unshift(a);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+a);return this},Yt.prototype.walk=function(a){for(var l,u=0,h=this.children.length;u0){for(l=[],u=0;uS.onchange(o.state),p=V=>pe=>(V(pe),h());o.selected.map(V=>o.state.selected=V.url||V.name);const S={onchange:()=>{},setMiddle:V=>o.state.middle=V,toggleConsole:p(V=>o.state.console=o.state.console===!0?"collapsed":!0),resetSize:p(()=>S.setMiddle(50)),loaded:()=>{o.loading=!1,o.console.clearOnNext&&(o.console.output=[],o.console.clearOnNext=!1),typeof S.onloaded=="function"&&S.onloaded(o.state)},fileSelectionChange:z,selectFileByIndex:L,toggleAutoReload:I,onConsoleKeyDown:T,onConsoleInput:N,consoleOutput:Q,startDragging:_,stopDragging:R,changeMiddle:te,setShareUrl:m,clearErrors:x,clearLogs:y,fileChange:X,initIframe:j,setState:A,resizing:ue,refresh:de,getLink:k,select:O,scroll:W};return b(),S;function b(){Promise.all(o.state.links.map(k)).then(()=>de({force:!0}))}function g(){o.console.output=[{content:[Le("i","Console was cleared")]}]}function x(){o.console.output=o.console.output.filter(V=>V.type!=="error")}function y(){o.console.output=o.console.output.filter(V=>V.type==="error")}function A(V){o.state=$a(V),O(Gn(o.state,o.state.selected),!0),D(),Le.redraw()}function m({dom:V}){V.addEventListener("mousedown",pe=>{V.href=Za(o.state)},!0)}function _(){o.dragging=!0}function R(){o.dragging=!1,o.refreshCm(!0),h()}function I(){o.state.autoReload=!o.state.autoReload,h(),o.state.autoReload&&de()}function W(V){o.state.scroll=V,h()}function N(V){o.console.input=V.target.value}function T(V){if((V.key==="Enter"||V.keyCode===13)&&!V.shiftKey&&!V.altKey)return V.preventDefault(),o.console.output.push({type:"input",content:["> "+o.console.input],number:"i"+o.console.inputNumber++}),o.console.input.indexOf("console.clear()")===0&&g(),E(),!1;(V.key==="ArrowUp"||V.keyCode===38)&&(o.console.historyNavigated||V.target.selectionStart===0)?(V.preventDefault(),c()):(V.key==="ArrowDown"||V.keyCode===40)&&(o.console.historyNavigated||o.console.input==="")?(V.preventDefault(),w()):o.console.historyNavigated=!1}function E(V){!o.console.input||(o.iframe.contentWindow.postMessage({name:"eval",content:o.console.input},"*"),o.console.position=o.console.history.push(o.console.input),o.console.input="")}function c(){o.console.historyNavigated=!0,o.console.position>=0&&(o.console.position-=1),o.console.input=o.console.history[o.console.position]||""}function w(){o.console.historyNavigated=!0,o.console.position{pe=pe.replace(/\r\n/g,` `),!(pe.length>3e5)&&(V.content=pe,V.patched=V.patches?pd(pe,V.patches)[0]:pe,o.selected()===V&&O(V))}).catch(()=>{})}function O(V,pe){typeof V=="string"&&(V=Gn(o.state,V)),o.selected(V),!pe&&h()}function L(V){const pe=o.state.files.concat(o.state.links)[V];pe&&O(pe)}function j(V){o.iframe=V,o.iframe.addEventListener("load",B)}function B(){o.iframe.contentWindow.postMessage({name:"init",content:{id:o.id,state:{scroll:o.state.scroll,files:u,links:o.state.links.map(V=>({type:V.type,name:V.name,url:V.url,content:V.patched||V.content}))}}},"*")}function U(V){const pe=V.compiler==="function"?V.compiler:Qa[V.compiler||Ri(V.name)];return pe?pe(V).then(Ne=>(Ne.error&&Q(Ne.error),Ne.map&&(V.map=Ne.map),{name:V.name,type:V.type,content:Ne.code})).catch(Ne=>(Q({content:["Error compiling "+V.compiler+":",Ph(Ne)],type:"error",stack:[]}),{name:V.name,type:V.type,content:V.content})):{name:V.name,type:V.type,content:V.content}}function Q(V){o.console.clearOnNext&&(o.console.output=[],o.console.clearOnNext=!1),V.stack.forEach(pe=>{const Ne=Gn(o.state,pe.file);if(!Ne||!Ne.map)return;const je=new ji.SourceMapConsumer(Ne.map).originalPositionFor({line:pe.line,column:pe.column});pe.line=je.line,pe.column=je.column}),V.content&&!Array.isArray(V.content)&&(V.content=[V.content]),o.console.output.push(V)}function X(V,pe,Ne){V.url?V.patched=pe:V.content=pe,Ne&&(V.selections=Ne==="0:0"?void 0:Ne),typeof S.onload=="function"&&S.onload(),D(V),h()}function D(V){clearTimeout(l),l=setTimeout(()=>{if(!V)return de();V.url&&(V.patches=cd(V.content,V.patched)),o.state.autoReload&&(V.type==="style"||V.type==="css")?(o.iframe.contentWindow.postMessage({name:"css",content:{name:V.name,url:V.url,content:V.patched||V.content}},"*"),typeof S.onloaded=="function"&&S.onloaded(o.state),h()):de()},o.state.autoReloadDelay||400)}function z(V,pe){pe=pe==="0:0"?void 0:pe,pe!==V.selections&&(V.selections=pe,h())}function te(V){const{top:pe,left:Ne}=o.dom.getBoundingClientRect();o.state.middle=Math.min(Math.max(Math.round((o.vertical()?(V.clientY-pe+5)/(o.dom.offsetHeight-o.console.dom.offsetHeight):(V.clientX-Ne+5)/o.dom.offsetWidth)*1e4)/100,0),100),Le.redraw()}function ue(){o.iOS||(o.resizing=!0,clearTimeout(a),a=setTimeout(()=>{o.resizing=!1,Le.redraw()},1e3))}function de(V={}){if(!V.force&&!o.state.autoReload)return o.hasChanges=!0;o.hasChanges=!1,o.loading=!0,o.console.clearOnNext=!0,Promise.all(o.state.files.map(U)).then(Me),Le.redraw()}function Me(V){if(!o.iframe)return setTimeout(Me,10,V);Ad&&(o.iframe.src+="?"),u=V,o.iframe.src=o.runtimeUrl}}var _d={listen:(o,a)=>{const l={loaded:a.loaded,console:a.consoleOutput,resize:a.resizing,scroll:a.scroll};window.addEventListener("message",({data:u})=>{u.flems!==o.id||!(u.name in l)||(l[u.name](u.content),Le.redraw())})}};let As=!1;function Zi(o,a={},l){const u=Sh(o,a,l),h=Od(u);return As||(window.addEventListener("resize",()=>Le.redraw()),As=!0),_d.listen(u,h),Le.mount(o,{view:()=>bh(u,h)}),{focus:u.focus,reload:()=>h.refresh({force:!0}),onchange:p=>h.onchange=p,onload:p=>h.onload=p,onloaded:p=>h.onloaded=p,getLink:h.getLink,set:h.setState,redraw:Le.redraw}}return Zi.defaults=Bi,Zi.createFlemsIoLink=Za,Zi.version="1.5.8",Zi}); //# sourceMappingURL=flems.js.map // -->