/* ")):D.match("DOCTYPE",!0,!0)?(D.eatWhile(/[\w\._\-]/),te(N(1))):null:D.eat("?")?(D.eatWhile(/[\w\._\-]/),z.tokenize=W("meta","?>"),"meta"):(M=D.eat("/")?"closeTag":"openTag",z.tokenize=F,"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 F(D,z){var te=D.next();if(te==">"||te=="/"&&D.eat(">"))return z.tokenize=_,M=te==">"?"endTag":"selfcloseTag","tag bracket";if(te=="=")return M="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=F;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(),S):D=="closeTag"?O:w}function S(D,z,te){return D=="word"?(te.tagName=z.current(),v="tag",B):g.allowMissingTagName&&D=="endTag"?(v="tag bracket",B(D,z,te)):(v="error",S)}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?(v="tag",L):(v="tag error",j)}else return g.allowMissingTagName&&D=="endTag"?(v="tag bracket",L(D,z,te)):(v="error",j)}function L(D,z,te){return D!="endTag"?(v="error",L):(E(te),w)}function j(D,z,te){return v="error",L(D,z,te)}function B(D,z,te){if(D=="word")return v="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 v="error",B}function U(D,z,te){return D=="equals"?Q:(g.allowMissing||(v="error"),B(D,z,te))}function Q(D,z,te){return D=="string"?X:D=="word"&&g.allowUnquoted?(v="string",B):(v="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;M=null;var te=z.tokenize(D,z);return(te||M)&&te!="comment"&&(v=null,z.state=z.state(M||te,D,z),v&&(te=v=="error"?te+" error":v)),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!=F&&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,Rc.exports,Ic.exports,Fc.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(M,v,_){var F=M.current(),I=F.search(v);return I>-1?M.backUp(F.length-I):F.match(/<\/?$/)&&(M.backUp(F.length),M.match(v,!1)||M.match(F)),_}var p={};function k(M){var v=p[M];return v||(p[M]=new RegExp("\\s+"+M+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function b(M,v){var _=M.match(k(v));return _?/^\s*(.*?)\s*$/.exec(_[2])[1]:""}function g(M,v){return new RegExp((v?"^":"")+"","i")}function x(M,v){for(var _ in M)for(var F=v[_]||(v[_]=[]),I=M[_],W=I.length-1;W>=0;W--)F.unshift(I[W])}function y(M,v){for(var _=0;_=0;N--)F.script.unshift(["type",W[N].matches,W[N].mode]);function T(E,c){var w=_.token(E,c.htmlState),S=/\btag\b/.test(w),O;if(S&&!/[<>\s\/]/.test(E.current())&&(O=c.htmlState.tagName&&c.htmlState.tagName.toLowerCase())&&F.hasOwnProperty(O))c.inTag=O+" ";else if(c.inTag&&S&&/>$/.test(E.current())){var L=/^([\S]+) (.*)/.exec(c.inTag);c.inTag=null;var j=E.current()==">"&&y(F[L[1]],L[2]),B=l.getMode(M,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 Ra={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,S=0;SL);j++){var B=T.getLine(O++);w=w==null?B:w+` `+B}S=S*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,S=0;S<=T.length;){E.lastIndex=S;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),S=O.index+1}return w}function y(T,E,c){E=p(E,"g");for(var w=c.line,S=c.ch,O=T.firstLine();w>=O;w--,S=-1){var L=T.getLine(w),j=x(L,E,S<0?0:L.length-S);if(j)return{from:u(w,j.index),to:u(w,j.index+j[0].length),match:j}}}function M(T,E,c){if(!k(E))return y(T,E,c);E=p(E,"gm");for(var w,S=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}S*=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 v,_;String.prototype.normalize?(v=function(T){return T.normalize("NFD").toLowerCase()},_=function(T){return T.normalize("NFD")}):(v=function(T){return T.toLowerCase()},_=function(T){return T});function F(T,E,c,w){if(T.length==E.length)return c;for(var S=0,O=c+Math.max(0,T.length-E.length);;){if(S==O)return S;var L=S+O>>1,j=w(T.slice(0,L)).length;if(j==c)return L;j>c?O=L:S=L+1}}function I(T,E,c,w){if(!E.length)return null;var S=w?v:_,O=S(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=S(U);if(O.length==1){var X=Q.indexOf(O[0]);if(X==-1)continue e;var c=F(U,Q,X,S)+j;return{from:u(L,F(U,Q,X,S)+j),to:u(L,F(U,Q,X+O[0].length,S)+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=S(U);if(O.length==1){var X=Q.lastIndexOf(O[0]);if(X==-1)continue e;return{from:u(L,F(U,Q,X,S)),to:u(L,F(U,Q,X+O[0].length,S))}}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 k(v){return v&&v.bracketRegex||/[(){}[\]]/}function b(v,_,F){var I=v.getLineHandle(_.line),W=_.ch-1,N=F&&F.afterCursor;N==null&&(N=/(^| )cm-fat-cursor($| )/.test(v.getWrapperElement().className));var T=k(F),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(F&&F.strict&&c>0!=(W==_.ch))return null;var w=v.getTokenTypeAt(h(_.line,W+1)),S=g(v,h(_.line,W+(c>0?1:0)),c,w,F);return S==null?null:{from:h(_.line,W),to:S&&S.pos,match:S&&S.ch==E.charAt(0),forward:c>0}}function g(v,_,F,I,W){for(var N=W&&W.maxScanLineLength||1e4,T=W&&W.maxScanLines||1e3,E=[],c=k(W),w=F>0?Math.min(_.line+T,v.lastLine()+1):Math.max(v.firstLine()-1,_.line-T),S=_.line;S!=w;S+=F){var O=v.getLine(S);if(!!O){var L=F>0?0:O.length-1,j=F>0?O.length:-1;if(!(O.length>N))for(S==_.line&&(L=_.ch-(F<0?1:0));L!=j;L+=F){var B=O.charAt(L);if(c.test(B)&&(I===void 0||(v.getTokenTypeAt(h(S,L+1))||"")==(I||""))){var U=p[B];if(U&&U.charAt(1)==">"==F>0)E.push(B);else if(E.length)E.pop();else return{pos:h(S,L),ch:B}}}}}return S-F==(F>0?v.lastLine():v.firstLine())?!1:null}function x(v,_,F){for(var I=v.state.matchBrackets.maxHighlightLineLength||1e3,W=F&&F.highlightNonMatching,N=[],T=v.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=S<0?0:O.length,X=0;U!=Q;U+=S,X++){var D=O.charAt(S<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+S;else if(L=="in"&&j!=z){if(j=="w"&&z=="W"&&S<0&&U--,j=="W"&&z=="w"&&S>0)if(U==B+1){j="w";continue}else U--;break}}return h(w.line,U)}function k(c,w){c.extendSelectionsBy(function(S){return c.display.shift||c.doc.extend||S.empty()?p(c.doc,S.head,w):w<0?S.from():S.to()})}u.goSubwordLeft=function(c){k(c,-1)},u.goSubwordRight=function(c){k(c,1)},u.scrollLineUp=function(c){var w=c.getScrollInfo();if(!c.somethingSelected()){var S=c.lineAtHeight(w.top+w.clientHeight,"local");c.getCursor().line>=S&&c.execCommand("goLineUp")}c.scrollTo(null,w.top-c.defaultTextHeight())},u.scrollLineDown=function(c){var w=c.getScrollInfo();if(!c.somethingSelected()){var S=c.lineAtHeight(w.top,"local")+1;c.getCursor().line<=S&&c.execCommand("goLineDown")}c.scrollTo(null,w.top+c.defaultTextHeight())},u.splitSelectionByLine=function(c){for(var w=c.listSelections(),S=[],O=0;OL.line&&B==j.line&&j.ch==0||S.push({anchor:B==L.line?L:h(B,0),head:B==j.line?j:h(B)});c.setSelections(S,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(),S=[],O=0;OO?S.push(U,Q):S.length&&(S[S.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(),S=[],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=S[Q],D=S[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(),S=[],O=0;O=0;j--){var B=S[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(),S=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%S==0){var Q=new h(L.line,l.findColumn(j,B-S,S));Q.ch!=L.ch&&(U=Q)}c.replaceRange("",U,L,"+delete")}})},u.delLineRight=function(c){c.operation(function(){for(var w=c.listSelections(),S=w.length-1;S>=0;S--)c.replaceRange("",w[S].anchor,h(w[S].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 S=c.getCursor(),O=w;if(l.cmpPos(S,O)>0){var L=O;O=S,S=L}c.state.sublimeKilled=c.getRange(S,O),c.replaceRange("",S,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"),S=c.getCursor("to");if(l.cmpPos(w,S)==0){var O=g(c,w);if(!O.word)return;w=O.from,S=O.to}return{from:w,to:S,query:c.getRange(w,S),word:O}}function N(c,w){var S=W(c);if(!!S){var O=S.query,L=c.getSearchCursor(O,w?S.to:S.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()):S.word&&c.setSelection(S.from,S.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 S=c.getSearchCursor(w.query),O=[],L=-1;S.findNext();)O.push({anchor:S.from(),head:S.to()}),S.from().line<=w.from.line&&S.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,k=l.cmpPos;function b(y){var M=y.search(h);return M==-1?0:M}l.commands.toggleComment=function(y){y.toggleComment()},l.defineExtension("toggleComment",function(y){y||(y=u);for(var M=this,v=1/0,_=this.listSelections(),F=null,I=_.length-1;I>=0;I--){var W=_[I].from(),N=_[I].to();W.line>=v||(N.line>=v&&(N=p(v,0)),v=W.line,F==null?M.uncomment(W,N,y)?F="un":(M.lineComment(W,N,y),F="line"):F=="un"?M.uncomment(W,N,y):M.lineComment(W,N,y))}});function g(y,M,v){return/\bstring\b/.test(y.getTokenTypeAt(p(M.line,0)))&&!/^[\'\"\`]/.test(v)}function x(y,M){var v=y.getMode();return v.useInnerComments===!1||!v.innerMode?v:y.getModeAt(M)}l.defineExtension("lineComment",function(y,M,v){v||(v=u);var _=this,F=x(_,y),I=_.getLine(y.line);if(!(I==null||g(_,y,I))){var W=v.lineComment||F.lineComment;if(!W){(v.blockCommentStart||F.blockCommentStart)&&(v.fullLines=!0,_.blockComment(y,M,v));return}var N=Math.min(M.ch!=0||M.line==y.line?M.line+1:M.line,_.lastLine()+1),T=v.padding==null?" ":v.padding,E=v.commentBlankLines||y.line==M.line;_.operation(function(){if(v.indent){for(var c=null,w=y.line;wO.length)&&(c=O)}for(var w=y.line;wN||_.operation(function(){if(v.fullLines!=!1){var E=h.test(_.getLine(N));_.replaceRange(T+W,p(N)),_.replaceRange(I+T,p(y.line,0));var c=v.blockCommentLead||F.blockCommentLead;if(c!=null)for(var w=y.line+1;w<=N;++w)(w!=N||E)&&_.replaceRange(c+T,p(w,0))}else{var S=k(_.getCursor("to"),M)==0,O=!_.somethingSelected();_.replaceRange(W,M),S&&_.setSelection(O?M:_.getCursor("from"),M),_.replaceRange(I,y)}})}}),l.defineExtension("uncomment",function(y,M,v){v||(v=u);var _=this,F=x(_,y),I=Math.min(M.ch!=0||M.line==y.line?M.line:M.line-1,_.lastLine()),W=Math.min(y.line,I),N=v.lineComment||F.lineComment,T=[],E=v.padding==null?" ":v.padding,c;e:{if(!N)break e;for(var w=W;w<=I;++w){var S=_.getLine(w),O=S.indexOf(N);if(O>-1&&!/comment/.test(_.getTokenTypeAt(p(w,O+1)))&&(O=-1),O==-1&&h.test(S)||O>-1&&h.test(S.slice(0,O)))break e;T.push(S)}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=v.blockCommentStart||F.blockCommentStart,j=v.blockCommentEnd||F.blockCommentEnd;if(!L||!j)return!1;var B=v.blockCommentLead||F.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,M.ch);var Me=X.slice(M.ch).lastIndexOf(L,de-M.ch);return ue=de==-1||Me==-1?-1:M.ch+Me,de!=-1&&ue!=-1&&ue!=M.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(k),N.state.closeBrackets=null),T&&(b(p(T,"pairs")),N.state.closeBrackets=T,N.addKeyMap(k))});function p(N,T){return T=="pairs"&&typeof N=="string"?N:typeof N=="object"&&N[T]!=null?N[T]:u[T]}var k={Backspace:y,Enter:M};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 M(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 F(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 S=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)||S.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")v(N,1);else if(U=="skipThree")v(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 M(T){if(!(T.line<=T.min))return T.text=T.cm.getLine(--T.line),T.ch=T.text.length,!0}function v(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(M(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 F(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(M(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=F(T),S,O=T.line,L=T.ch-(w?w[0].length:0);if(!w||!(S=v(T)))return;if(S!="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 S=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(S,O)}}}}l.registerHelper("fold","xml",function(T,E){for(var c=new g(T,E.line,0);;){var w=F(c);if(!w||c.line!=E.line)return;var S=v(c);if(!S)return;if(!w[1]&&S!="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 S=v(w),O=S&&u(w.line,w.ch),L=S&&_(w);if(!(!S||!L||h(w,E)>0)){var j={from:u(w.line,w.ch),to:O,tag:L[2]};return S=="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 S=new g(T,E.line,E.ch,c);;){var O=N(S,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 S=new g(T,E.line,E.ch,w?{from:0,to:w}:null);return W(S,c)}})})(),function(o,a){(function(l){l(ct.exports,Hc.exports)})(function(l){l.defineOption("autoCloseTags",!1,function(y,M,v){if(v!=l.Init&&v&&y.removeKeyMap("autoCloseTags"),!!M){var _={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(_["'/'"]=function(F){return b(F)}),(typeof M!="object"||M.whenOpening!==!1)&&(_["'>'"]=function(F){return p(F)}),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 M=y.listSelections(),v=[],_=y.getOption("autoCloseTags"),F=0;FI.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||S&&g(S,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){v[F]={text:"/>",newPos:l.Pos(I.line,I.ch+2)};continue}var B=O&&g(O,L)>-1;v[F]={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,F=M.length-1;F>=0;F--){var Q=v[F];y.replaceRange(Q.text,M[F].head,M[F].anchor,"+insert");var X=y.listSelections().slice(0);X[F]={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 k(y,M){for(var v=y.listSelections(),_=[],F=M?"/":""&&(S+=">"),_[N]=S}if(y.replaceSelections(_),v=y.listSelections(),!W)for(var N=0;N=0&&M[T]==v;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),F=_(!1);if(!(!F||F.cleared||y==="unfold")){var I=h(b,x,F);l.on(I,"mousedown",function(N){W.clear(),l.e_preventDefault(N)});var W=b.markText(F.from,F.to,{replacedWith:I,clearOnEnter:k(b,x,"clearOnEnter"),__isFold:!0});W.on("clear",function(N,T){l.signal(b,"unfold",b,N,T)}),l.signal(b,"fold",b,F.from,F.to)}}function h(b,g,x){var y=k(b,g,"widget");if(typeof y=="function"&&(y=y(x.from,x.to)),typeof y=="string"){var M=document.createTextNode(y);y=document.createElement("span"),y.appendChild(M),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 M(I,W,N){var T=I.state.foldGutter;if(!!T){var E=T.options;if(N==E.gutter){var c=k(I,W);c?c.clear():I.foldCode(u(W,0),E)}}}function v(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 F(I,W){var N=I.state.foldGutter;if(!!N){var T=W.line;T>=N.from&&Tx))_=x,M="{",v="}";else if(y!=null)_=y,M="[",v="]";else return;var F=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(M,c),S=E.indexOf(v,c);if(w<0&&(w=E.length),S<0&&(S=E.length),c=Math.min(w,S),c==E.length)break;if(u.getTokenTypeAt(l.Pos(T,c+1))==b){if(c==w)++F;else if(!--F){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(M){if(Mu.lastLine())return null;var v=u.getTokenAt(l.Pos(M,1));if(/\S/.test(v.string)||(v=u.getTokenAt(l.Pos(M,v.end+1))),v.type!="keyword"||v.string!="import")return null;for(var _=M,F=Math.min(u.lastLine(),M+10);_<=F;++_){var I=u.getLine(_),W=I.indexOf(";");if(W!=-1)return{startCh:v.end,end:l.Pos(_,W)}}}var k=h.line,b=p(k),g;if(!b||p(k-1)||(g=p(k-2))&&g.end.line==k-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(k,b.startCh+1)),to:x}}),l.registerHelper("fold","include",function(u,h){function p(y){if(yu.lastLine())return null;var M=u.getTokenAt(l.Pos(y,1));if(/\S/.test(M.string)||(M=u.getTokenAt(l.Pos(y,M.end+1))),M.type=="meta"&&M.string.slice(0,8)=="#include")return M.start+8}var k=h.line,b=p(k);if(b==null||p(k-1)!=null)return null;for(var g=k;;){var x=p(g+1);if(x==null)break;++g}return{from:l.Pos(k,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),k=p.blockCommentStart,b=p.blockCommentEnd;if(!k||!b)return;for(var g=h.line,x=u.getLine(g),y,M=h.ch,v=0;;){var _=M<=0?-1:x.lastIndexOf(k,M-1);if(_==-1){if(v==1)return;v=1,M=x.length;continue}if(v==1&&_Ce("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").borderRight("1px solid #000")).$nest(".CodeMirror",le.fontFamily("Source Code Pro, monospace").lineHeight("22px").cursor("text").w("100%").h("100%").fontSize(14)).$nest(".cm-s-tch056.CodeMirror, .cm-s-tch056 div.CodeMirror-gutters",le.backgroundColor("white")).$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||"tch056",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),M=!y&&u.test(x.replace(h,"")),v=qn("=>",x),_=qn(",",x);b.setOption("smartIndent",M&&!_),b.execCommand("newlineAndIndent"),b.setOption("smartIndent",!0),(v||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&&qn(" ",x)&&dn.commands.delCharBefore(b),dn.commands.delCharBefore(b)}}});p.on("gutterClick",jc),p.on("scrollCursorIntoView",(b,g)=>{g.codemirrorIgnore=!0});const k=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",(_,F)=>{F.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",(_,F)=>{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 M=p.getDoc()!==k||o.state.autoFocus;p.getDoc()!==b.doc&&p.swapDoc(b.doc);const v=qc(b.selections);v&&v.length&&(b.doc.setSelections(v),requestAnimationFrame(()=>{p.scrollIntoView(v[0].head,500)})),M&&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 jc(o,a,l,u){if(l==="CodeMirror-foldgutter")return;const h=o.listSelections(),p=u.ctrlKey||u.metaKey?h:[],k=u.shiftKey&&h.length?h[0].anchor.line:a;let b=u.shiftKey&&h.length&&k>a?a:a+1;y();const g=function(M){const v=o.lineAtHeight(M.clientY,"client");v!==b&&(b=v,y())},x=M=>{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(k,b>k?0:null),head:dn.Pos(b,0)}]),p.length,{origin:"*mouse"})}}function qc(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 Xn=(o,a)=>Ce("i"+le.w(o.size||18).h(o.size||18).display("flex").jc("center").ai("center").$nest("svg",le.w("100%").h("100%")),o,Ce.trust(a)),Ha='',Xc=(o,a)=>Ce("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")),Ce(".tabs"+le.display("flex").overflowX("auto").overflowY("hidden").flexGrow(1),o.state.fileTabs&&Qc(o,a),o.state.linkTabs&&Yc(o,a)));function Yc(o,a){return o.state.links.map(l=>Wa(Ce("div"+le.display("flex"),Ce("a"+le.c("inherit"),{href:l.url,target:"_blank",onclick:u=>l.content&&u.preventDefault()},l.name),l.patches&&Ce("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&&Xn({size:16,class:le.ml(6).class},Ha)),()=>l.content&&a.select(l),l===o.selected(),o))}function Qc(o,a){return o.state.files.map(l=>Wa(Ce("div"+le.display("flex"),l.name,l.editable===!1&&Xn({size:16,class:le.ml(6).class},Ha)),()=>a.select(l),l===o.selected(),o))}function Wa(o,a,l,u){return Ce(".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},Ce("span"+le.flexGrow(1).overflow("hidden").ta("center").whiteSpace("nowrap").p("0 12px"),o))}var Ua=(o,a)=>Ce("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},Xn({class:le.h(28).w(28).class},o)),$c='',Zc=(o,a)=>Ce(".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),Ce.redraw()},!1),window.addEventListener("mousemove",a.changeMiddle,!1)}}),Jc=(o,a)=>[(o.vertical()&&o.editor?o.editor.offsetHeight<=o.toolbar():o.state.middle<3)&&Ua($c,a.resetSize),o.state.toolbar&&Xc(o,a),Gc(o,a),o.state.resizeable&&Zc(o,a)];const Ka=(o,a)=>Ce("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-presentation",allow:"geolocation; microphone; camera; midi; encrypted-media",allowfullscreen:!0,frameborder:"0",oncreate:l=>a.initIframe(l.dom)}),Vc=(o,a)=>Ce(".iframeScroller"+le.overflowScrolling("touch").flexGrow(1).overflowY("scroll").display("flex").fd("column").w("100%"),Ka(o,a));var eh=(o,a)=>o.iOS?Vc(o,a):Ka(o,a),th=(o,a)=>Ce(".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:rh},o.iframe.clientWidth," x ",o.iframe.clientHeight);function rh(o){return o.dom.style.opacity=0,new Promise(a=>setTimeout(a,300))}var nh='';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}},ih=({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")},oh=({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")},lh=({dom:o})=>{o.parentElement.classList.add(le.$nest(":hover .tooltip",le.o(1).transform("scale(1)")).class),oh({dom:o})};var ah=({zIndex:o=11,title:a=""})=>Ce(".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:lh},a,Ce(".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:ih})),gn=(o,a={})=>Ce(".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:{}},Xn({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),Ce.fragment({key:"badge"},Boolean(a.badge)&&Ce(".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)),ah({title:a.title})),sh='',qa='',uh='',fh='',ch='',hh='',dh='',ph=(o,a)=>Ce(".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)"),gn(o.state.autoReload?ch:fh,{title:(o.state.autoReload?"D\xE9sactive":"Activer")+" le rafraichissement automatique",onclick:a.toggleAutoReload}),o.state.reloadButton&&gn(o.loading?qa:uh,{onclick:l=>a.refresh({force:!0}),attention:o.hasChanges,title:"Rafraichir la page"}),o.state.saveButton&&Ce("a"+le.color("inherit"),{onclick:o.state.save},gn(hh,{title:"Sauvegarder"})),o.state.cancelButton&&Ce("a"+le.color("inherit"),{onclick:o.state.cancelChanges},gn(dh,{title:"Annuler mes modification"})),o.state.shareButton&&Ce("a"+le.color("inherit"),{href:"https://flems.io",target:"_blank",oncreate:a.setShareUrl},gn(sh,{title:"Ouvrir / partager sur flems.io"}))),gh=o=>Ce(".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},Ce("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)")}))),vh=(o,a)=>[o.state.toolbar&&ph(o,a),eh(o,a),o.state.middle>97&&Ua(nh,a.resetSize),gh(o),o.resizing&&o.state.middle<=98&&th(o)],mh=(o,a)=>Ce(".input"+le.display("flex").p(2,0).flexShrink(0).w("100%").ff("Source Code Pro, monospace"),{onbeforeremove:Fa(300)},Ce("label"+le.display("flex").ai("center").m("0 6px 0 10px").flexShrink(0).c("blue"),{for:"input"},">"),Ce("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)),yh='',bh=(o,a)=>Ce(".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},Ce("div"+le.display("flex").jc("space-between").c("#777").flexShrink(0),{onclick:a.toggleConsole},Ce("div"+le.display("flex").fs(12).tt("uppercase").p("8px 10px"),Ce("span"+le.mr(4),"Console"),Xa("#d82c2c",a.clearErrors,o.console.errors()),Xa("gray",a.clearLogs,o.console.infos())),Ce("div"+le.display("flex").p(2,6),gn(yh,{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&&Ce(".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:Fa(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=>Ce(".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},[Ce("div"+le.flexGrow(1).$nest(">span",le.mr(10)),l.content.length>1&&l.content[0].indexOf("%c")>-1&&Ce("span",l.content[0].split("%c").filter(u=>u).map((u,h)=>Ce("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)=>Ce("span",u))),l.stack&&Ce(".stack"+le.ta("right").flexShrink(0).overflow("hidden"),l.stack.slice(0,!l.expand&&l.type!=="error"?1:void 0).map(u=>Ce("div",(u.function||"")+" at ",Ce("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&&mh(o,a));function Xa(o,a,l){return Ce("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&&Xn({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 wh=(o,a)=>Ce(".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},Ce("main"+le.flexGrow(1).display("flex").flexDirection(o.vertical()&&"column").position(o.vertical()&&"relative"),{style:le.ai(!o.vertical()&&"stretch").style},Ce(".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},Jc(o,a)),Ce(".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},vh(o,a))),o.state.console&&bh(o,a)),Ya={exports:{}};(function(o){var a=function(){var l=String.fromCharCode,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",p={};function k(g,x){if(!p[g]){p[g]={};for(var y=0;y>>8,y[M*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,M=x.length;y>1}else{for(v=1,M=0;M>1}T--,T==0&&(T=Math.pow(2,c),c++),delete F[N]}else for(v=_[N],M=0;M>1;T--,T==0&&(T=Math.pow(2,c),c++),_[W]=E++,N=String(I)}if(N!==""){if(Object.prototype.hasOwnProperty.call(F,N)){if(N.charCodeAt(0)<256){for(M=0;M>1}else{for(v=1,M=0;M>1}T--,T==0&&(T=Math.pow(2,c),c++),delete F[N]}else for(v=_[N],M=0;M>1;T--,T==0&&(T=Math.pow(2,c),c++)}for(v=2,M=0;M>1;for(;;)if(S=S<<1,O==x-1){w.push(y(S));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 M=[],v=4,_=4,F=3,I="",W=[],N,T,E,c,w,S,O,L={val:y(0),position:x,index:1};for(N=0;N<3;N+=1)M[N]=N;for(E=0,w=Math.pow(2,2),S=1;S!=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)*S,S<<=1;switch(E){case 0:for(E=0,w=Math.pow(2,8),S=1;S!=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)*S,S<<=1;O=l(E);break;case 1:for(E=0,w=Math.pow(2,16),S=1;S!=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)*S,S<<=1;O=l(E);break;case 2:return""}for(M[3]=O,T=O,W.push(O);;){if(L.index>g)return"";for(E=0,w=Math.pow(2,F),S=1;S!=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)*S,S<<=1;switch(O=E){case 0:for(E=0,w=Math.pow(2,8),S=1;S!=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)*S,S<<=1;M[_++]=l(E),O=_-1,v--;break;case 1:for(E=0,w=Math.pow(2,16),S=1;S!=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)*S,S<<=1;M[_++]=l(E),O=_-1,v--;break;case 2:return W.join("")}if(v==0&&(v=Math.pow(2,F),F++),M[O])I=M[O];else if(O===_)I=T+T.charAt(0);else return null;W.push(I),M[_++]=T+I.charAt(0),v--,T=I,v==0&&(v=Math.pow(2,F),F++)}}};return b}();o!=null&&(o.exports=a)})(Ya);var xh=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",target:"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:"tch056",layout:"auto",resizeable:!0,editable:!0,toolbar:!0,fileTabs:!0,linkTabs:!0,shareButton:!1,reloadButton:!1,saveButton:!0,cancelButton:!0,console:!0,autoReload:!0,autoReloadDelay:400,autoFocus:!1,autoHeight:!1,autoSave:!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)}),jn(o,o.selected)||(o.selected=(o.files[0]||{}).name||(o.links[0]||{}).url),o}const Za=o=>"https://flems.io/#0="+xh.compressToEncodedURIComponent(JSON.stringify(kh(o)));function kh(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=k,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=[],M=[];function v(I){return arguments.length&&I!==l.SKIP&&(x=I,g(v)&&(v._changing(),v._state="active",y.forEach(function(W,N){W(M[N](x))}))),x}v.constructor=l,v._state=arguments.length&&x!==l.SKIP?"active":"pending",v._parents=[],v._changing=function(){g(v)&&(v._state="changing"),y.forEach(function(I){I._changing()})},v._map=function(I,W){var N=W?l():l(I(x));return N._parents.push(v),y.push(N),M.push(I),N},v.map=function(I){return v._map(I,v._state!=="active")};var _;function F(){return _=l(),_.map(function(I){return I===!0&&(v._parents.forEach(function(W){W._unregisterChild(v)}),v._state="ended",v._parents.length=y.length=M.length=0),I}),_}return v.toJSON=function(){return x!=null&&typeof x.toJSON=="function"?x.toJSON():x},v["fantasy-land/map"]=v.map,v["fantasy-land/ap"]=function(I){return u(function(W,N){return W()(N())},[I,v])},v._unregisterChild=function(I){var W=y.indexOf(I);W!==-1&&(y.splice(W,1),M.splice(W,1))},Object.defineProperty(v,"end",{get:function(){return _||F()}}),v}function u(x,y){var M=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"}),v=M?l(x.apply(null,y.concat([y]))):l(),_=[],F=y.map(function(W){return W._map(function(N){return _.push(W),(M||y.every(function(T){return T._state!=="pending"}))&&(M=!0,v(x.apply(null,y.concat([_]))),_=[]),N},!0)}),I=v.end.map(function(W){W===!0&&(F.forEach(function(N){N.end(!0)}),I.end(!0))});return v}function h(x){return u(function(){return x.map(function(y){return y()})},x)}function p(x,y,M){var v=M.map(function(_){var F=x(y,_);return F!==l.SKIP&&(y=F),F});return v(y),v}function k(x,y){var M=x.map(function(_){return _[0]}),v=u(function(){var _=arguments[arguments.length-1];return M.forEach(function(F,I){_.indexOf(F)>-1&&(y=x[I][1](y,F()))}),y},M);return v(y),v}function b(){var x=arguments[0],y=Array.prototype.slice.call(arguments,1);return h(y).map(function(M){return x.apply(void 0,M)})}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],Sh=qn("flems.html",Yo?Yo.src:"")&&Yo.src;function Ch(o,a,l){a=$a(a);const h={id:Lh(),dom:o,state:a,selected:Xo(jn(a,a.selected)),iOS:"overflowScrolling"in le,runtimeUrl:l||Sh||"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 Lh(){return("000"+(Math.random()*46656|0).toString(36)).slice(-3)+("000"+(Math.random()*46656|0).toString(36)).slice(-3)}var Th={},Mh=Object.freeze({__proto__:null,default:Th}),Ah=ec(Mh),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,Oh=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,_h=Zo&&Set.prototype.forEach,Eh=Boolean.prototype.valueOf,Nh=Object.prototype.toString,Ph=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Vo=Ah.custom,el=Vo&&ns(Vo)?Vo:null,zh=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 Qh(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(jh(h,a)>=0)return"[Circular]";function k(F,I){return I&&(h=h.slice(),h.push(I)),o(F,l,u+1,h)}if(typeof a=="function"){var b=Gh(a);return"[Function"+(b?": "+b:"")+"]"}if(ns(a)){var g=Symbol.prototype.toString.call(a);return typeof a=="object"?Yn(g):g}if(Yh(a)){for(var x="<"+String(a.nodeName).toLowerCase(),y=a.attributes||[],M=0;M",x}if(rs(a))return a.length===0?"[]":"[ "+rl(a,k).join(", ")+" ]";if(Rh(a)){var v=rl(a,k);return v.length===0?"["+String(a)+"]":"{ ["+String(a)+"] "+v.join(", ")+" }"}if(typeof a=="object"){if(el&&typeof a[el]=="function")return a[el]();if(typeof a.inspect=="function")return a.inspect()}if(qh(a)){var v=[];return Oh.call(a,function(I,W){v.push(k(W,a)+" => "+k(I,a))}),is("Map",Hi.call(a),v)}if(Xh(a)){var v=[];return _h.call(a,function(I){v.push(k(I,a))}),is("Set",Wi.call(a),v)}if(Hh(a))return Yn(k(Number(a)));if(Wh(a))return Yn(k(Ph.call(a)));if(Uh(a))return Yn(Eh.call(a));if(Bh(a))return Yn(k(String(a)));if(!Ih(a)&&!Fh(a)){var _=rl(a,k);return _.length===0?"{}":"{ "+_.join(", ")+" }"}return String(a)};function ts(o,a,l){var u=(l.quoteStyle||a)==="double"?'"':"'";return u+o+u}function Dh(o){return String(o).replace(/"/g,""")}function rs(o){return Lr(o)==="[object Array]"}function Ih(o){return Lr(o)==="[object Date]"}function Fh(o){return Lr(o)==="[object RegExp]"}function Rh(o){return Lr(o)==="[object Error]"}function ns(o){return Lr(o)==="[object Symbol]"}function Bh(o){return Lr(o)==="[object String]"}function Hh(o){return Lr(o)==="[object Number]"}function Wh(o){return Lr(o)==="[object BigInt]"}function Uh(o){return Lr(o)==="[object Boolean]"}var Kh=Object.prototype.hasOwnProperty||function(o){return o in this};function tl(o,a){return Kh.call(o,a)}function Lr(o){return Nh.call(o)}function Gh(o){if(o.name)return o.name;var a=String(o).match(/^function\s*([\w$]+)/);if(a)return a[1]}function jh(o,a){if(o.indexOf)return o.indexOf(a);for(var l=0,u=o.length;la.length?o:a,k=o.length>a.length?a:o,b=p.indexOf(k);if(b!==-1)return h=[[ht,p.substring(0,b)],[Ue,k],[ht,p.substring(b+k.length)]],o.length>a.length&&(h[0][0]=h[2][0]=at),h;if(k.length===1)return[[at,o],[ht,a]];const g=sd(o,a);if(g){const x=g[0],y=g[1],M=g[2],v=g[3],_=g[4],F=Dr(x,M,l,u),I=Dr(y,v,l,u);return F.concat([[Ue,_]],I)}return l&&o.length>100&&a.length>100?id(o,a,u):od(o,a,u)}function id(o,a,l){const u=ld(o,a);o=u.chars1,a=u.chars2;const h=u.lineArray,p=Dr(o,a,!1,l);ad(p,h),cs(p),p.push([Ue,""]);let k=0,b=0,g=0,x="",y="";for(;k=1&&g>=1){p.splice(k-b-g,b+g),k=k-b-g;const M=Dr(x,y,!1,l);for(let v=M.length-1;v>=0;v--)p.splice(k,0,M[v]);k=k+M.length}g=0,b=0,x="",y=""}k++}return p.pop(),p}function od(o,a,l){const u=o.length,h=a.length,p=Math.ceil((u+h)/2),k=p,b=2*p,g=new Array(b),x=new Array(b);for(let W=0;Wl);W++){for(let N=-W+v;N<=W-_;N+=2){const T=k+N;let E;N===-W||N!==W&&g[T-1]u)_+=2;else if(c>h)v+=2;else if(M){const w=k+y-N;if(w>=0&&w=S)return us(o,a,E,c,l)}}}for(let N=-W+F;N<=W-I;N+=2){const T=k+N;let E;N===-W||N!==W&&x[T-1]u)I+=2;else if(c>h)F+=2;else if(!M){const w=k+y-N;if(w>=0&&w=E)return us(o,a,S,O,l)}}}}return[[at,o],[ht,a]]}function us(o,a,l,u,h){const p=o.substring(0,l),k=a.substring(0,u),b=o.substring(l),g=a.substring(u),x=Dr(p,k,!1,h),y=Dr(b,g,!1,h);return x.concat(y)}function ld(o,a){const l=[],u={};l[0]="";function h(b){let g="",x=0,y=-1,M=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,S,T]:null}const p=h(l,u,Math.ceil(l.length/4)),k=h(l,u,Math.ceil(l.length/2));let b;if(!p&&!k)return null;k?p?b=p[4].length>k[4].length?p:k:b=k:b=p;let g,x,y,M;o.length>a.length?(g=b[0],x=b[1],y=b[2],M=b[3]):(y=b[0],M=b[1],g=b[2],x=b[3]);const v=b[4];return[g,x,y,M,v]}function cs(o){let a=!1;const l=[];let u=0,h=null,p=0,k=0,b=0,g=0,x=0;for(;p0?l[u-1]:-1,k=0,b=0,g=0,x=0,h=null,a=!0)),p++;for(a&&Ki(o),hs(o),p=1;p=_?(v>=y.length/2||v>=M.length/2)&&(o.splice(p,0,[Ue,M.substring(0,v)]),o[p-1][1]=y.substring(0,y.length-v),o[p+1][1]=M.substring(v),p++):(_>=y.length/2||_>=M.length/2)&&(o.splice(p,0,[Ue,y.substring(0,_)]),o[p-1][0]=ht,o[p-1][1]=M.substring(0,M.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),k=h.charAt(0),b=p.match(ls),g=k.match(ls),x=b&&p.match(as),y=g&&k.match(as),M=x&&p.match(ss),v=y&&k.match(ss),_=M&&u.match(td),F=v&&h.match(rd);return _||F?5:M||v?4:b&&!x&&y?3:x||y?2:b||g?1:0}let l=1;for(;l=y&&(y=M,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 ud(o){let a=!1;const l=[];let u=0,h=null,p=0,k=!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="",k;for(;a1?(l!==0&&u!==0&&(k=nl(p,h),k!==0&&(a-l-u>0&&o[a-l-u-1][0]===Ue?o[a-l-u-1][1]+=p.substring(0,k):(o.splice(0,0,[Ue,p.substring(0,k)]),a++),p=p.substring(k),h=h.substring(k)),k=Ui(p,h),k!==0&&(o[a][1]=p.substring(p.length-k)+o[a][1],p=p.substring(0,p.length-k),h=h.substring(0,h.length-k))),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=fd(a);function h(v,_){const F=v/a.length,I=Math.abs(l-_);return F+I/ed}let p=Vh,k=o.indexOf(a,l);k!==-1&&(p=Math.min(h(0,k),p),k=o.lastIndexOf(a,l+a.length),k!==-1&&(p=Math.min(h(0,k),p)));const b=1<=_;W--){const N=u[o.charAt(W-1)];if(v===0?I[W]=(I[W+1]<<1|1)&N:I[W]=(I[W+1]<<1|1)&N|((M[W+1]|M[W])<<1|1)|M[W+1],I[W]&b){const T=h(v,W-1);if(T<=p)if(p=T,k=W-1,k>l)_=Math.max(1,2*l-k);else break}}if(h(v+1,l)>p)break;M=I}return k}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),ud(h)));const p=[];let k=Gi(),b=0,g=0,x=0,y=u,M=u;for(let v=0;v=2*ir&&b&&(gs(k,y),p.push(k),k=Gi(),b=0,y=M,g=x)),_!==ht&&(g+=F.length),_!==at&&(x+=F.length)}return b&&(gs(k,y),p.push(k)),yd(p)}function dd(o){const a=[];for(let l=0;lTr?(g=il(o,b.substring(0,Tr),k),g!==-1&&(x=il(o,b.substring(b.length-Tr),k+b.length-Tr),(x===-1||g>=x)&&(g=-1))):g=il(o,b,k),g===-1)h[p]=!1,u-=a[p].length2-a[p].length1;else{h[p]=!0,u=g-k;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 M=Dr(b,y,!1,void 0);if(b.length>Tr&&pd(M)/b.length>Jh)h[p]=!1;else{hs(M);let v=0,_;for(let F=0;Fa));k++)h=l,p=u;return o.length!==k&&o[k][0]===at?p:p+(a-h)}function vd(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 md(o){const a=Tr;for(let l=0;l2*a?(b.length1+=M.length,h+=M.length,g=!1,b.diffs.push([y,M]),u.diffs.shift()):(M=M.substring(0,a-b.length1-ir),b.length1+=M.length,h+=M.length,y===Ue?(b.length2+=M.length,p+=M.length):g=!1,b.diffs.push([y,M]),M===u.diffs[0][1]?u.diffs.shift():u.diffs[0][1]=u.diffs[0][1].substring(M.length))}k=ps(b.diffs),k=k.substring(k.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 yd(o){return o.length?o.map(a=>a.diffs.concat([a.length1,a.length2,a.start1,a.start2])):void 0}function bd(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=wd(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,k=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?"/":"."),S?(S.path=w,p(S)):w}o.normalize=k;function b(c,w){c===""&&(c="."),w===""&&(w=".");var S=h(w),O=h(c);if(O&&(c=O.path||"/"),S&&!S.scheme)return O&&(S.scheme=O.scheme),p(S);if(S||w.match(u))return w;if(O&&!O.host&&!O.path)return O.host=w,p(O);var L=w.charAt(0)==="/"?w:k(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 S=0;w.indexOf(c+"/")!==0;){var O=c.lastIndexOf("/");if(O<0||(c=c.slice(0,O),c.match(/^([^\/]+:\/)?\/*$/)))return w;++S}return Array(S+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 M(c){return _(c)?"$"+c:c}o.toSetString=x?y:M;function v(c){return _(c)?c.slice(1):c}o.fromSetString=x?y:v;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 S=w-10;S>=0;S--)if(c.charCodeAt(S)!==36)return!1;return!0}function F(c,w,S){var O=W(c.source,w.source);return O!==0||(O=c.originalLine-w.originalLine,O!==0)||(O=c.originalColumn-w.originalColumn,O!==0||S)||(O=c.generatedColumn-w.generatedColumn,O!==0)||(O=c.generatedLine-w.generatedLine,O!==0)?O:W(c.name,w.name)}o.compareByOriginalPositions=F;function I(c,w,S){var O=c.generatedLine-w.generatedLine;return O!==0||(O=c.generatedColumn-w.generatedColumn,O!==0||S)||(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 S=c.generatedLine-w.generatedLine;return S!==0||(S=c.generatedColumn-w.generatedColumn,S!==0)||(S=W(c.source,w.source),S!==0)||(S=c.originalLine-w.originalLine,S!==0)||(S=c.originalColumn-w.originalColumn,S!==0)?S: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,S){if(w=w||"",c&&(c[c.length-1]!=="/"&&w[0]!=="/"&&(c+="/"),w=c+w),S){var O=h(S);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 k(w)}o.computeSourceURL=E})(vn);var sl={},ul=vn,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){kd(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 Qn=qi,mt=vn,Yi=sl.ArraySet,Sd=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 Sd,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 k=a.sourceContentFor(h);k!=null&&u.setSourceContent(h,k)}),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 k=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&&!k.has(y)&&k.add(y);var M=g.name;M!=null&&!b.has(M)&&b.add(M)},this),this._sources=k,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,k=0,b="",g,x,y,M,v=this._mappings.toArray(),_=0,F=v.length;_0){if(!mt.compareByGeneratedPositionsInflated(x,v[_-1]))continue;g+=","}g+=Qn.encode(x.generatedColumn-a),a=x.generatedColumn,x.source!=null&&(M=this._sources.indexOf(x.source),g+=Qn.encode(M-k),k=M,g+=Qn.encode(x.originalLine-1-h),h=x.originalLine-1,g+=Qn.encode(x.originalColumn-u),u=x.originalColumn,x.name!=null&&(y=this._names.indexOf(x.name),g+=Qn.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,k,b){var g=Math.floor((u-l)/2)+l,x=k(h,p[g],!0);return x===0?g:x>0?u-g>1?a(g,u,h,p,k,b):b==o.LEAST_UPPER_BOUND?u1?a(l,g,h,p,k,b):b==o.LEAST_UPPER_BOUND?g:l<0?-1:l}o.search=function(u,h,p,k){if(h.length===0)return-1;var b=a(-1,h.length,u,h,p,k||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 Cd(o,a){return Math.round(o+Math.random()*(a-o))}function hl(o,a,l,u){if(l=0){var k=this._originalMappings[p];if(a.column===void 0)for(var b=k.originalLine;k&&k.originalLine===b;)h.push({line:ke.getArg(k,"generatedLine",null),column:ke.getArg(k,"generatedColumn",null),lastColumn:ke.getArg(k,"lastGeneratedColumn",null)}),k=this._originalMappings[++p];else for(var g=k.originalColumn;k&&k.originalLine===l&&k.originalColumn==g;)h.push({line:ke.getArg(k,"generatedLine",null),column:ke.getArg(k,"generatedColumn",null),lastColumn:ke.getArg(k,"lastGeneratedColumn",null)}),k=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",[]),k=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);k&&(k=ke.normalize(k)),h=h.map(String).map(ke.normalize).map(function(y){return k&&ke.isAbsolute(k)&&ke.isAbsolute(y)?ke.relative(k,y):y}),this._names=mn.fromArray(p.map(String),!0),this._sources=mn.fromArray(h,!0),this._absoluteSources=this._sources.toArray().map(function(y){return ke.computeSourceURL(k,y,a)}),this.sourceRoot=k,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=k+N[3],k=I.originalColumn,N.length>4&&(I.name=g+N[4],g+=N[4])),F.push(I),typeof I.originalLine=="number"&&_.push(I)}$n(F,ke.compareByGeneratedPositionsDeflated),this.__generatedMappings=F,$n(_,ke.compareByOriginalPositions),this.__originalMappings=_},Mt.prototype._findMapping=function(a,l,u,h,p,k){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,k)},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 k=ke.getArg(h,"name",null);return k!==null&&(k=this._names.at(k)),{source:p,line:ke.getArg(h,"originalLine",null),column:ke.getArg(h,"originalColumn",null),name:k}}}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 k=h.replace(/^file:\/\//,"");if(p.scheme=="file"&&this._sources.has(k))return this.sourcesContent[this._sources.indexOf(k)];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 mn,this._names=new mn;var p={line:-1,column:0};this._sections=h.map(function(k){if(k.url)throw new Error("Support for url field in sections not implemented.");var b=ke.getArg(k,"offset"),g=ke.getArg(b,"line"),x=ke.getArg(b,"column");if(g=0;l--)this.prepend(a[l]);else if(a[yn]||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;uk.onchange(o.state),p=V=>pe=>(V(pe),h());o.selected.map(V=>o.state.selected=V.url||V.name);const k={onchange:()=>{},setMiddle:V=>o.state.middle=V,toggleConsole:p(V=>o.state.console=o.state.console===!0?"collapsed":!0),resetSize:p(()=>k.setMiddle(50)),loaded:()=>{o.loading=!1,o.console.clearOnNext&&(o.console.output=[],o.console.clearOnNext=!1),typeof k.onloaded=="function"&&k.onloaded(o.state)},fileSelectionChange:z,selectFileByIndex:L,toggleAutoReload:I,onConsoleKeyDown:T,onConsoleInput:N,consoleOutput:Q,startDragging:_,stopDragging:F,changeMiddle:te,setShareUrl:v,clearErrors:x,clearLogs:y,fileChange:X,initIframe:j,setState:M,resizing:ue,refresh:de,getLink:S,select:O,scroll:W};return b(),k;function b(){Promise.all(o.state.links.map(S)).then(()=>de({force:!0}))}function g(){o.console.output=[{content:[Ce("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 M(V){o.state=$a(V),O(jn(o.state,o.state.selected),!0),D(),Ce.redraw()}function v({dom:V}){V.addEventListener("mousedown",pe=>{V.href=Za(o.state)},!0)}function _(){o.dragging=!0}function F(){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?gd(pe,V.patches)[0]:pe,o.selected()===V&&O(V))}).catch(()=>{})}function O(V,pe){typeof V=="string"&&(V=jn(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+":",zh(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=jn(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 k.onload=="function"&&k.onload(),D(V),h()}function D(V){clearTimeout(l),l=setTimeout(()=>{if(!V)return de();V.url&&(V.patches=hd(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 k.onloaded=="function"&&k.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),Ce.redraw()}function ue(){o.iOS||(o.resizing=!0,clearTimeout(a),a=setTimeout(()=>{o.resizing=!1,Ce.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),Ce.redraw()}function Me(V){if(!o.iframe)return setTimeout(Me,10,V);Od&&(o.iframe.src+="?"),u=V,o.iframe.src=o.runtimeUrl}}var Ed={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),Ce.redraw())})}};let As=!1;function Zi(o,a,l={},u){var h=localStorage.getItem(a);if(h!==null&&l.files!==void 0){var p=JSON.parse(h);p.forEach(function(v,_){l.files.forEach(function(F,I){F.name===v.name&&(l.files[I].content=v.content)})})}const k=Ch(o,l,u),b=_d(k);return As||(window.addEventListener("resize",g),As=!0),Ed.listen(k,b),Ce.mount(o,null),Ce.mount(o,{view:()=>wh(k,b)}),l.save=x,l.cancelChanges=y,l.autoSave&&setTimeout(M,5e3),{focus:k.focus,reload:()=>b.refresh({force:!0}),onchange:v=>b.onchange=v,onload:v=>b.onload=v,onloaded:v=>b.onloaded=v,getLink:b.getLink,set:b.setState,redraw:g,state:l,model:k,save:x,cancelChanges:y};function g(){Ce.redraw(),k.refreshCm(!0)}function x(){var v=[],_=JSON.stringify(l.files,function(F,I){if(I!=null&&typeof I=="object"){if(v.indexOf(I)>=0)return;v.push(I)}return I});localStorage.setItem(a,_)}function y(){var v=`\xCAtes vous s\xFBr de vouloir annuler vos modifications et revenir \xE0 la version initiale? Cette action est irr\xE9cup\xE9rable`;confirm(v)==!0&&(localStorage.removeItem(a),location.reload())}function M(){x(),setTimeout(M,5e3)}}return Zi.defaults=Bi,Zi.createFlemsIoLink=Za,Zi.version="1.5.10",Zi}); //# sourceMappingURL=flems.js.map // -->