{"title":"$:/plugins/tiddlywiki/codemirror-autocomplete","name":"CodeMirror Autocomplete","description":"Autocompletion for CodeMirror","parent-plugin":"$:/plugins/tiddlywiki/codemirror","dependents":"$:/plugins/tiddlywiki/codemirror-mode-css","list":"readme","version":"5.2.2","plugin-type":"plugin","type":"application/json","tiddlers":{"$:/config/codemirror/autocomplete":{"title":"$:/config/codemirror/autocomplete","extend":"extraKeys","type":"json","text":"{\n\t\"Ctrl-Space\": \"autocomplete\"\n}"},"$:/plugins/tiddlywiki/codemirror/addon/hint/anyword-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(e){\"object\"==typeof exports&&\"object\"==typeof module?e(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],e):e(CodeMirror)}(function(y){\"use strict\";var b=/[\\w$]+/;y.registerHelper(\"hint\",\"anyword\",function(e,r){for(var t=r&&r.word||b,o=r&&r.range||500,i=e.getCursor(),n=e.getLine(i.line),f=i.ch,s=f;s&&t.test(n.charAt(s-1));)--s;for(var a=s!=f&&n.slice(s,f),c=r&&r.list||[],l={},d=new RegExp(t.source,\"g\"),u=-1;u<=1;u+=2)for(var p=i.line,g=Math.min(Math.max(p+u*o,e.firstLine()),e.lastLine())+u;p!=g;p+=u)for(var h,m=e.getLine(p);h=d.exec(m);)p==i.line&&h[0]===a||a&&0!=h[0].lastIndexOf(a,0)||Object.prototype.hasOwnProperty.call(l,h[0])||(l[h[0]]=!0,c.push(h[0]));return{list:c,from:y.Pos(i.line,s),to:y.Pos(i.line,f)}})});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/anyword-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(e){\"object\"==typeof exports&&\"object\"==typeof module?e(require(\"../../lib/codemirror\"),require(\"../../mode/css/css\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\",\"../../mode/css/css\"],e):e(CodeMirror)}(function(f){\"use strict\";var p={active:1,after:1,before:1,checked:1,default:1,disabled:1,empty:1,enabled:1,\"first-child\":1,\"first-letter\":1,\"first-line\":1,\"first-of-type\":1,focus:1,hover:1,\"in-range\":1,indeterminate:1,invalid:1,lang:1,\"last-child\":1,\"last-of-type\":1,link:1,not:1,\"nth-child\":1,\"nth-last-child\":1,\"nth-last-of-type\":1,\"nth-of-type\":1,\"only-of-type\":1,\"only-child\":1,optional:1,\"out-of-range\":1,placeholder:1,\"read-only\":1,\"read-write\":1,required:1,root:1,selection:1,target:1,valid:1,visited:1};f.registerHelper(\"hint\",\"css\",function(e){var t=e.getCursor(),r=e.getTokenAt(t),o=f.innerMode(e.getMode(),r.state);if(\"css\"==o.mode.name){if(\"keyword\"==r.type&&0==\"!important\".indexOf(r.string))return{list:[\"!important\"],from:f.Pos(t.line,r.start),to:f.Pos(t.line,r.end)};var i=r.start,s=t.ch,n=r.string.slice(0,s-i);/[^\\w$_-]/.test(n)&&(n=\"\",i=s=t.ch);var a=f.resolveMode(\"text/css\"),d=[],l=o.state.state;return\"pseudo\"==l||\"variable-3\"==r.type?c(p):\"block\"==l||\"maybeprop\"==l?c(a.propertyKeywords):\"prop\"==l||\"parens\"==l||\"at\"==l||\"params\"==l?(c(a.valueKeywords),c(a.colorKeywords)):\"media\"!=l&&\"media_parens\"!=l||(c(a.mediaTypes),c(a.mediaFeatures)),d.length?{list:d,from:f.Pos(t.line,i),to:f.Pos(t.line,s)}:void 0}function c(e){for(var t in e)n&&0!=t.lastIndexOf(n,0)||d.push(t)}})});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addon/hint/html-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(l){\"object\"==typeof exports&&\"object\"==typeof module?l(require(\"../../lib/codemirror\"),require(\"./xml-hint\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\",\"./xml-hint\"],l):l(CodeMirror)}(function(n){\"use strict\";var l=\"ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu\".split(\" \"),t=[\"_blank\",\"_self\",\"_top\",\"_parent\"],e=[\"ascii\",\"utf-8\",\"utf-16\",\"latin1\",\"latin1\"],a=[\"get\",\"post\",\"put\",\"delete\"],r=[\"application/x-www-form-urlencoded\",\"multipart/form-data\",\"text/plain\"],o=[\"all\",\"screen\",\"print\",\"embossed\",\"braille\",\"handheld\",\"print\",\"projection\",\"screen\",\"tty\",\"tv\",\"speech\",\"3d-glasses\",\"resolution [>][<][=] [X]\",\"device-aspect-ratio: X/Y\",\"orientation:portrait\",\"orientation:landscape\",\"device-height: [X]\",\"device-width: [X]\"],s={attrs:{}},u={a:{attrs:{href:null,ping:null,type:null,media:o,target:t,hreflang:l}},abbr:s,acronym:s,address:s,applet:s,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:o,hreflang:l,type:null,shape:[\"default\",\"rect\",\"circle\",\"poly\"]}},article:s,aside:s,audio:{attrs:{src:null,mediagroup:null,crossorigin:[\"anonymous\",\"use-credentials\"],preload:[\"none\",\"metadata\",\"auto\"],autoplay:[\"\",\"autoplay\"],loop:[\"\",\"loop\"],controls:[\"\",\"controls\"]}},b:s,base:{attrs:{href:null,target:t}},basefont:s,bdi:s,bdo:s,big:s,blockquote:{attrs:{cite:null}},body:s,br:s,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[\"\",\"autofocus\"],disabled:[\"\",\"autofocus\"],formenctype:r,formmethod:a,formnovalidate:[\"\",\"novalidate\"],formtarget:t,type:[\"submit\",\"reset\",\"button\"]}},canvas:{attrs:{width:null,height:null}},caption:s,center:s,cite:s,code:s,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[\"command\",\"checkbox\",\"radio\"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[\"\",\"disabled\"],checked:[\"\",\"checked\"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[\"\",\"disabled\"],multiple:[\"\",\"multiple\"]}},datalist:{attrs:{data:null}},dd:s,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[\"\",\"open\"]}},dfn:s,dir:s,div:s,dl:s,dt:s,em:s,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[\"\",\"disabled\"],form:null,name:null}},figcaption:s,figure:s,font:s,footer:s,form:{attrs:{action:null,name:null,\"accept-charset\":e,autocomplete:[\"on\",\"off\"],enctype:r,method:a,novalidate:[\"\",\"novalidate\"],target:t}},frame:s,frameset:s,h1:s,h2:s,h3:s,h4:s,h5:s,h6:s,head:{attrs:{},children:[\"title\",\"base\",\"link\",\"style\",\"meta\",\"script\",\"noscript\",\"command\"]},header:s,hgroup:s,hr:s,html:{attrs:{manifest:null},children:[\"head\",\"body\"]},i:s,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[\"allow-top-navigation\",\"allow-same-origin\",\"allow-forms\",\"allow-scripts\"],seamless:[\"\",\"seamless\"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[\"anonymous\",\"use-credentials\"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[\"audio/*\",\"video/*\",\"image/*\"],autocomplete:[\"on\",\"off\"],autofocus:[\"\",\"autofocus\"],checked:[\"\",\"checked\"],disabled:[\"\",\"disabled\"],formenctype:r,formmethod:a,formnovalidate:[\"\",\"novalidate\"],formtarget:t,multiple:[\"\",\"multiple\"],readonly:[\"\",\"readonly\"],required:[\"\",\"required\"],type:[\"hidden\",\"text\",\"search\",\"tel\",\"url\",\"email\",\"password\",\"datetime\",\"date\",\"month\",\"week\",\"time\",\"datetime-local\",\"number\",\"range\",\"color\",\"checkbox\",\"radio\",\"file\",\"submit\",\"image\",\"reset\",\"button\"]}},ins:{attrs:{cite:null,datetime:null}},kbd:s,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[\"\",\"autofocus\"],disabled:[\"\",\"disabled\"],keytype:[\"RSA\"]}},label:{attrs:{for:null,form:null}},legend:s,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:l,media:o,sizes:[\"all\",\"16x16\",\"16x16 32x32\",\"16x16 32x32 64x64\"]}},map:{attrs:{name:null}},mark:s,menu:{attrs:{label:null,type:[\"list\",\"context\",\"toolbar\"]}},meta:{attrs:{content:null,charset:e,name:[\"viewport\",\"application-name\",\"author\",\"description\",\"generator\",\"keywords\"],\"http-equiv\":[\"content-language\",\"content-type\",\"default-style\",\"refresh\"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:s,noframes:s,noscript:s,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[\"\",\"typemustmatch\"]}},ol:{attrs:{reversed:[\"\",\"reversed\"],start:null,type:[\"1\",\"a\",\"A\",\"i\",\"I\"]}},optgroup:{attrs:{disabled:[\"\",\"disabled\"],label:null}},option:{attrs:{disabled:[\"\",\"disabled\"],label:null,selected:[\"\",\"selected\"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:s,param:{attrs:{name:null,value:null}},pre:s,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:s,rt:s,ruby:s,s:s,samp:s,script:{attrs:{type:[\"text/javascript\"],src:null,async:[\"\",\"async\"],defer:[\"\",\"defer\"],charset:e}},section:s,select:{attrs:{form:null,name:null,size:null,autofocus:[\"\",\"autofocus\"],disabled:[\"\",\"disabled\"],multiple:[\"\",\"multiple\"]}},small:s,source:{attrs:{src:null,type:null,media:null}},span:s,strike:s,strong:s,style:{attrs:{type:[\"text/css\"],media:o,scoped:null}},sub:s,summary:s,sup:s,table:s,tbody:s,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[\"\",\"autofocus\"],disabled:[\"\",\"disabled\"],readonly:[\"\",\"readonly\"],required:[\"\",\"required\"],wrap:[\"soft\",\"hard\"]}},tfoot:s,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]}},thead:s,time:{attrs:{datetime:null}},title:s,tr:s,track:{attrs:{src:null,label:null,default:null,kind:[\"subtitles\",\"captions\",\"descriptions\",\"chapters\",\"metadata\"],srclang:l}},tt:s,u:s,ul:s,var:s,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[\"anonymous\",\"use-credentials\"],preload:[\"auto\",\"metadata\",\"none\"],autoplay:[\"\",\"autoplay\"],mediagroup:[\"movie\"],muted:[\"\",\"muted\"],controls:[\"\",\"controls\"]}},wbr:s},i={accesskey:[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],class:null,contenteditable:[\"true\",\"false\"],contextmenu:null,dir:[\"ltr\",\"rtl\",\"auto\"],draggable:[\"true\",\"false\",\"auto\"],dropzone:[\"copy\",\"move\",\"link\",\"string:\",\"file:\"],hidden:[\"hidden\"],id:null,inert:[\"inert\"],itemid:null,itemprop:null,itemref:null,itemscope:[\"itemscope\"],itemtype:null,lang:[\"en\",\"es\"],spellcheck:[\"true\",\"false\"],autocorrect:[\"true\",\"false\"],autocapitalize:[\"true\",\"false\"],style:null,tabindex:[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"],title:null,translate:[\"yes\",\"no\"],onclick:null,rel:[\"stylesheet\",\"alternate\",\"author\",\"bookmark\",\"help\",\"license\",\"next\",\"nofollow\",\"noreferrer\",\"prefetch\",\"prev\",\"search\",\"tag\"]};function d(l){for(var t in i)i.hasOwnProperty(t)&&(l.attrs[t]=i[t])}for(var c in d(s),u)u.hasOwnProperty(c)&&u[c]!=s&&d(u[c]);n.htmlSchema=u,n.registerHelper(\"hint\",\"html\",function(l,t){var e={schemaInfo:u};if(t)for(var a in t)e[a]=t[a];return n.hint.xml(l,e)})});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/html-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addon/hint/javascript-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(t){\"object\"==typeof exports&&\"object\"==typeof module?t(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],t):t(CodeMirror)}(function(f){var c=f.Pos;function g(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r])}function r(t,e,r,n){var i=t.getCursor(),o=r(t,i);if(!/\\b(?:string|comment)\\b/.test(o.type)){var s=f.innerMode(t.getMode(),o.state);if(\"json\"!==s.mode.helperType){o.state=s.state,/^[\\w$_]*$/.test(o.string)?o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)):o={start:i.ch,end:i.ch,string:\"\",state:o.state,type:\".\"==o.string?\"property\":null};for(var a=o;\"property\"==a.type;){if(\".\"!=(a=r(t,c(i.line,a.start))).string)return;a=r(t,c(i.line,a.start));var l=l||[];l.push(a)}return{list:function(t,e,r,n){var i=[],o=t.string,s=n&&n.globalScope||window;function a(t){0!=t.lastIndexOf(o,0)||function(t,e){if(Array.prototype.indexOf)return-1!=t.indexOf(e);for(var r=t.length;r--;)if(t[r]===e)return 1}(i,t)||i.push(t)}function l(t){\"string\"==typeof t?g(y,a):t instanceof Array?g(h,a):t instanceof Function&&g(v,a),function(t,e){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var r=t;r;r=Object.getPrototypeOf(r))Object.getOwnPropertyNames(r).forEach(e);else for(var n in t)e(n)}(t,a)}if(e&&e.length){var f,c=e.pop();for(c.type&&0===c.type.indexOf(\"variable\")?(n&&n.additionalContext&&(f=n.additionalContext[c.string]),n&&!1===n.useGlobalScope||(f=f||s[c.string])):\"string\"==c.type?f=\"\":\"atom\"==c.type?f=1:\"function\"==c.type&&(null==s.jQuery||\"$\"!=c.string&&\"jQuery\"!=c.string||\"function\"!=typeof s.jQuery?null!=s._&&\"_\"==c.string&&\"function\"==typeof s._&&(f=s._()):f=s.jQuery());null!=f&&e.length;)f=f[e.pop().string];null!=f&&l(f)}else{for(var p=t.state.localVars;p;p=p.next)a(p.name);for(var u=t.state.context;u;u=u.prev)for(p=u.vars;p;p=p.next)a(p.name);for(p=t.state.globalVars;p;p=p.next)a(p.name);if(n&&null!=n.additionalContext)for(var d in n.additionalContext)a(d);n&&!1===n.useGlobalScope||l(s),g(r,a)}return i}(o,l,e,n),from:c(i.line,o.start),to:c(i.line,o.end)}}}}function n(t,e){var r=t.getTokenAt(e);return e.ch==r.start+1&&\".\"==r.string.charAt(0)?(r.end=r.start,r.string=\".\",r.type=\"property\"):/^\\.[\\w$_]*$/.test(r.string)&&(r.type=\"property\",r.start++,r.string=r.string.replace(/\\./,\"\")),r}f.registerHelper(\"hint\",\"javascript\",function(t,e){return r(t,i,function(t,e){return t.getTokenAt(e)},e)}),f.registerHelper(\"hint\",\"coffeescript\",function(t,e){return r(t,o,n,e)});var y=\"charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search\".split(\" \"),h=\"length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight \".split(\" \"),v=\"prototype apply call bind\".split(\" \"),i=\"break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield\".split(\" \"),o=\"and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes\".split(\" \")});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/javascript-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(t){\"object\"==typeof exports&&\"object\"==typeof module?t(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],t):t(CodeMirror)}(function(W){\"use strict\";var I=\"CodeMirror-hint-active\";function o(t,i){this.cm=t,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(\"start\"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var e=this;t.on(\"cursorActivity\",this.activityFunc=function(){e.cursorActivity()})}W.showHint=function(t,i,e){if(!i)return t.showHint(e);e&&e.async&&(i.async=!0);var n={hint:i};if(e)for(var o in e)n[o]=e[o];return t.showHint(n)},W.defineExtension(\"showHint\",function(t){t=function(t,i,e){var n=t.options.hintOptions,o={};for(var s in l)o[s]=l[s];if(n)for(var s in n)void 0!==n[s]&&(o[s]=n[s]);if(e)for(var s in e)void 0!==e[s]&&(o[s]=e[s]);o.hint.resolve&&(o.hint=o.hint.resolve(t,i));return o}(this,this.getCursor(\"start\"),t);var i=this.listSelections();if(!(1<i.length)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var e=0;e<i.length;e++)if(i[e].head.line!=i[e].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var n=this.state.completionActive=new o(this,t);n.options.hint&&(W.signal(this,\"startCompletion\",this),n.update(!0))}}),W.defineExtension(\"closeHint\",function(){this.state.completionActive&&this.state.completionActive.close()});var s=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},c=window.cancelAnimationFrame||clearTimeout;function B(t){return\"string\"==typeof t?t:t.text}function K(t,i){for(;i&&i!=t;){if(\"LI\"===i.nodeName.toUpperCase()&&i.parentNode==t)return i;i=i.parentNode}}function n(o,t){this.completion=o,this.data=t,this.picked=!1;var e=this,s=o.cm,c=s.getInputField().ownerDocument,r=c.defaultView||c.parentWindow,l=this.hints=c.createElement(\"ul\"),i=o.cm.options.theme;l.className=\"CodeMirror-hints \"+i,this.selectedHint=t.selectedHint||0;for(var n=t.list,h=0;h<n.length;++h){var a=l.appendChild(c.createElement(\"li\")),u=n[h],f=\"CodeMirror-hint\"+(h!=this.selectedHint?\"\":\" \"+I);null!=u.className&&(f=u.className+\" \"+f),a.className=f,u.render?u.render(a,t,u):a.appendChild(c.createTextNode(u.displayText||B(u))),a.hintId=h}var p,d,m,g=o.options.container||c.body,v=s.cursorCoords(o.options.alignWithWord?t.from:null),y=v.left,w=v.bottom,H=!0,C=0,b=0;g!==c.body&&(d=(p=-1!==[\"absolute\",\"relative\",\"fixed\"].indexOf(r.getComputedStyle(g).position)?g:g.offsetParent).getBoundingClientRect(),m=c.body.getBoundingClientRect(),C=d.left-m.left-p.scrollLeft,b=d.top-m.top-p.scrollTop),l.style.left=y-C+\"px\",l.style.top=w-b+\"px\";var k=r.innerWidth||Math.max(c.body.offsetWidth,c.documentElement.offsetWidth),A=r.innerHeight||Math.max(c.body.offsetHeight,c.documentElement.offsetHeight);g.appendChild(l);var x,T,S=l.getBoundingClientRect(),M=S.bottom-A,N=l.scrollHeight>l.clientHeight+1,F=s.getScrollInfo();0<M&&(x=S.bottom-S.top,0<v.top-(v.bottom-S.top)-x?(l.style.top=(w=v.top-x-b)+\"px\",H=!1):A<x&&(l.style.height=A-5+\"px\",l.style.top=(w=v.bottom-S.top-b)+\"px\",T=s.getCursor(),t.from.ch!=T.ch&&(v=s.cursorCoords(T),l.style.left=(y=v.left-C)+\"px\",S=l.getBoundingClientRect())));var E,O=S.right-k;if(0<O&&(S.right-S.left>k&&(l.style.width=k-5+\"px\",O-=S.right-S.left-k),l.style.left=(y=v.left-O-C)+\"px\"),N)for(var P=l.firstChild;P;P=P.nextSibling)P.style.paddingRight=s.display.nativeBarWidth+\"px\";return s.addKeyMap(this.keyMap=function(t,n){var o={Up:function(){n.moveFocus(-1)},Down:function(){n.moveFocus(1)},PageUp:function(){n.moveFocus(1-n.menuSize(),!0)},PageDown:function(){n.moveFocus(n.menuSize()-1,!0)},Home:function(){n.setFocus(0)},End:function(){n.setFocus(n.length-1)},Enter:n.pick,Tab:n.pick,Esc:n.close};/Mac/.test(navigator.platform)&&(o[\"Ctrl-P\"]=function(){n.moveFocus(-1)},o[\"Ctrl-N\"]=function(){n.moveFocus(1)});var i=t.options.customKeys,s=i?{}:o;function e(t,i){var e=\"string\"!=typeof i?function(t){return i(t,n)}:o.hasOwnProperty(i)?o[i]:i;s[t]=e}if(i)for(var c in i)i.hasOwnProperty(c)&&e(c,i[c]);var r=t.options.extraKeys;if(r)for(var c in r)r.hasOwnProperty(c)&&e(c,r[c]);return s}(o,{moveFocus:function(t,i){e.changeActive(e.selectedHint+t,i)},setFocus:function(t){e.changeActive(t)},menuSize:function(){return e.screenAmount()},length:n.length,close:function(){o.close()},pick:function(){e.pick()},data:t})),o.options.closeOnUnfocus&&(s.on(\"blur\",this.onBlur=function(){E=setTimeout(function(){o.close()},100)}),s.on(\"focus\",this.onFocus=function(){clearTimeout(E)})),s.on(\"scroll\",this.onScroll=function(){var t=s.getScrollInfo(),i=s.getWrapperElement().getBoundingClientRect(),e=w+F.top-t.top,n=e-(r.pageYOffset||(c.documentElement||c.body).scrollTop);if(H||(n+=l.offsetHeight),n<=i.top||n>=i.bottom)return o.close();l.style.top=e+\"px\",l.style.left=y+F.left-t.left+\"px\"}),W.on(l,\"dblclick\",function(t){var i=K(l,t.target||t.srcElement);i&&null!=i.hintId&&(e.changeActive(i.hintId),e.pick())}),W.on(l,\"click\",function(t){var i=K(l,t.target||t.srcElement);i&&null!=i.hintId&&(e.changeActive(i.hintId),o.options.completeOnSingleClick&&e.pick())}),W.on(l,\"mousedown\",function(){setTimeout(function(){s.focus()},20)}),this.scrollToActive(),W.signal(t,\"select\",n[this.selectedHint],l.childNodes[this.selectedHint]),!0}function r(t,i,e,n){var o;t.async?t(i,n,e):(o=t(i,e))&&o.then?o.then(n):n(o)}o.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off(\"cursorActivity\",this.activityFunc),this.widget&&this.data&&W.signal(this.data,\"close\"),this.widget&&this.widget.close(),W.signal(this.cm,\"endCompletion\",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,i){var e=t.list[i],n=this;this.cm.operation(function(){e.hint?e.hint(n.cm,t,e):n.cm.replaceRange(B(e),e.from||t.from,e.to||t.to,\"complete\"),W.signal(t,\"pick\",e),n.cm.scrollIntoView()}),this.close()},cursorActivity:function(){this.debounce&&(c(this.debounce),this.debounce=0);var t=this.startPos;this.data&&(t=this.data.from);var i,e=this.cm.getCursor(),n=this.cm.getLine(e.line);e.line!=this.startPos.line||n.length-e.ch!=this.startLen-this.startPos.ch||e.ch<t.ch||this.cm.somethingSelected()||!e.ch||this.options.closeCharacters.test(n.charAt(e.ch-1))?this.close():((i=this).debounce=s(function(){i.update()}),this.widget&&this.widget.disable())},update:function(i){var e,n;null!=this.tick&&(n=++(e=this).tick,r(this.options.hint,this.cm,this.options,function(t){e.tick==n&&e.finishUpdate(t,i)}))},finishUpdate:function(t,i){this.data&&W.signal(this.data,\"update\");var e=this.widget&&this.widget.picked||i&&this.options.completeSingle;this.widget&&this.widget.close(),(this.data=t)&&t.list.length&&(e&&1==t.list.length?this.pick(t,0):(this.widget=new n(this,t),W.signal(t,\"shown\")))}},n.prototype={close:function(){var t;this.completion.widget==this&&(this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap),t=this.completion.cm,this.completion.options.closeOnUnfocus&&(t.off(\"blur\",this.onBlur),t.off(\"focus\",this.onFocus)),t.off(\"scroll\",this.onScroll))},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var t=this;this.keyMap={Enter:function(){t.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,i){var e;t>=this.data.list.length?t=i?this.data.list.length-1:0:t<0&&(t=i?0:this.data.list.length-1),this.selectedHint!=t&&((e=this.hints.childNodes[this.selectedHint])&&(e.className=e.className.replace(\" \"+I,\"\")),(e=this.hints.childNodes[this.selectedHint=t]).className+=\" \"+I,this.scrollToActive(),W.signal(this.data,\"select\",this.data.list[this.selectedHint],e))},scrollToActive:function(){var t=this.completion.options.scrollMargin||0,i=this.hints.childNodes[Math.max(0,this.selectedHint-t)],e=this.hints.childNodes[Math.min(this.data.list.length-1,this.selectedHint+t)],n=this.hints.firstChild;i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-n.offsetTop:e.offsetTop+e.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=e.offsetTop+e.offsetHeight-this.hints.clientHeight+n.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},W.registerHelper(\"hint\",\"auto\",{resolve:function(t,i){var e,c=t.getHelpers(i,\"hint\");if(c.length){var n=function(t,n,o){var s=function(t,i){if(!t.somethingSelected())return i;for(var e=[],n=0;n<i.length;n++)i[n].supportsSelection&&e.push(i[n]);return e}(t,c);!function i(e){if(e==s.length)return n(null);r(s[e],t,o,function(t){t&&0<t.list.length?n(t):i(e+1)})}(0)};return n.async=!0,n.supportsSelection=!0,n}return(e=t.getHelper(t.getCursor(),\"hintWords\"))?function(t){return W.hint.fromList(t,{words:e})}:W.hint.anyword?function(t,i){return W.hint.anyword(t,i)}:function(){}}}),W.registerHelper(\"hint\",\"fromList\",function(t,i){var e,n=t.getCursor(),o=t.getTokenAt(n),s=W.Pos(n.line,o.start),c=n;o.start<n.ch&&/\\w/.test(o.string.charAt(n.ch-o.start-1))?e=o.string.substr(0,n.ch-o.start):(e=\"\",s=n);for(var r=[],l=0;l<i.words.length;l++){var h=i.words[l];h.slice(0,e.length)==e&&r.push(h)}if(r.length)return{list:r,from:s,to:c}}),W.commands.autocomplete=W.showHint;var l={hint:W.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\\s()\\[\\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};W.defineOption(\"hintOptions\",null)});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.css":{"text":".CodeMirror-hints {\n  position: absolute;\n  z-index: 10;\n  overflow: hidden;\n  list-style: none;\n\n  margin: 0;\n  padding: 2px;\n\n  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  border-radius: 3px;\n  border: 1px solid silver;\n\n  background: white;\n  font-size: 90%;\n  font-family: monospace;\n\n  max-height: 20em;\n  overflow-y: auto;\n}\n\n.CodeMirror-hint {\n  margin: 0;\n  padding: 0 4px;\n  border-radius: 2px;\n  white-space: pre;\n  color: black;\n  cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n  background: #08f;\n  color: white;\n}\n","type":"text/css","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/show-hint.css","tags":"[[$:/tags/Stylesheet]]"},"$:/plugins/tiddlywiki/codemirror/addon/hint/xml-hint.js":{"text":"// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n!function(t){\"object\"==typeof exports&&\"object\"==typeof module?t(require(\"../../lib/codemirror\")):\"function\"==typeof define&&define.amd?define([\"../../lib/codemirror\"],t):t(CodeMirror)}(function(H){\"use strict\";var R=H.Pos;function z(t,e,r){return r?0<=t.indexOf(e):0==t.lastIndexOf(e,0)}H.registerHelper(\"hint\",\"xml\",function(t,e){var r=e&&e.schemaInfo,n=e&&e.quoteChar||'\"',s=e&&e.matchInMiddle;if(r){var i=t.getCursor(),o=t.getTokenAt(i);if(o.end>i.ch&&(o.end=i.ch,o.string=o.string.slice(0,i.ch-o.start)),(p=H.innerMode(t.getMode(),o.state)).mode.xmlCurrentTag){var a,l,g,c=[],f=!1,h=/\\btag\\b/.test(o.type)&&!/>$/.test(o.string),u=h&&/^\\w/.test(o.string);u?(M=t.getLine(i.line).slice(Math.max(0,o.start-2),o.start),(g=/<\\/$/.test(M)?\"close\":/<$/.test(M)?\"open\":null)&&(l=o.start-(\"close\"==g?2:1))):h&&\"<\"==o.string?g=\"open\":h&&\"</\"==o.string&&(g=\"close\");var d=p.mode.xmlCurrentTag(p.state);if(!h&&!d||g){u&&(a=o.string),f=g;var p,m=p.mode.xmlCurrentContext?p.mode.xmlCurrentContext(p.state):[],v=(p=m.length&&m[m.length-1])&&r[p],y=p?v&&v.children:r[\"!top\"];if(y&&\"close\"!=g)for(var x=0;x<y.length;++x)a&&!z(y[x],a,s)||c.push(\"<\"+y[x]);else if(\"close\"!=g)for(var C in r)!r.hasOwnProperty(C)||\"!top\"==C||\"!attrs\"==C||a&&!z(C,a,s)||c.push(\"<\"+C);p&&(!a||\"close\"==g&&z(p,a,s))&&c.push(\"</\"+p+\">\")}else{var b=(v=d&&r[d.name])&&v.attrs,O=r[\"!attrs\"];if(!b&&!O)return;if(b){if(O){var w={};for(var A in O)O.hasOwnProperty(A)&&(w[A]=O[A]);for(var A in b)b.hasOwnProperty(A)&&(w[A]=b[A]);b=w}}else b=O;if(\"string\"==o.type||\"=\"==o.string){var M,P,$,I,T,j=(M=t.getRange(R(i.line,Math.max(0,i.ch-60)),R(i.line,\"string\"==o.type?o.start:o.end))).match(/([^\\s\\u00a0=<>\\\"\\']+)=$/);if(!j||!b.hasOwnProperty(j[1])||!(P=b[j[1]]))return;\"function\"==typeof P&&(P=P.call(this,t)),\"string\"==o.type&&(a=o.string,$=0,/['\"]/.test(o.string.charAt(0))&&(n=o.string.charAt(0),a=o.string.slice(1),$++),I=o.string.length,/['\"]/.test(o.string.charAt(I-1))&&(n=o.string.charAt(I-1),a=o.string.substr($,I-2)),!$||(T=t.getLine(i.line)).length>o.end&&T.charAt(o.end)==n&&o.end++,f=!0);var q=function(t){if(t)for(var e=0;e<t.length;++e)a&&!z(t[e],a,s)||c.push(n+t[e]+n);return k()};return P&&P.then?P.then(q):q(P)}for(var L in\"attribute\"==o.type&&(a=o.string,f=!0),b)!b.hasOwnProperty(L)||a&&!z(L,a,s)||c.push(L)}return k()}}function k(){return{list:c,from:f?R(i.line,null==l?o.start:l):i,to:f?R(i.line,o.end):i}}})});\n","type":"application/javascript","title":"$:/plugins/tiddlywiki/codemirror/addon/hint/xml-hint.js","module-type":"codemirror"},"$:/plugins/tiddlywiki/codemirror-autocomplete/readme":{"title":"$:/plugins/tiddlywiki/codemirror-autocomplete/readme","text":"This plugin enhances the [[CodeMirror|http://codemirror.net]] text editor with Autocompletion functionality. It needs the latest [[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]] to be installed\n\nIt adds Autocompletion for ''html'', ''javascript'' and ''xml'' and also for ''already present words'' within a text-editor instance\n\nThe ''Keyboard Shortcut'' for autocompletion is `Ctrl+Space`\n\n"}}}