"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[6574],{26574:(t,e,n)=>{n.r(e);var r=n(33638),o=n(7460);function l(t,e,n,r,o,l,a){try{var i=t[l](a),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){l(a,r,o,i,c,"next",t)}function c(t){l(a,r,o,i,c,"throw",t)}i(void 0)}))}}var i=function(t,e){var n,r,o,l,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}};function c(){return(c=a((function(t){var e,n,l,a,c,u,s,f,p,h,y;function v(t){var e=!0,n=!1,r=void 0;try{for(var o,i=t[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var c=o.value;l[c]||(l[c]=!0,a.push({text:c,displayText:"◇ ".concat(c)}))}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}return i(this,(function(i){switch(i.label){case 0:return e=t.getDoc().getCursor(),n=t.getTokenAt(e),l={},a=[],null!=(c=r.hint.anyword(t))&&null!=c.list&&v(c.list),null!=(c=r.hint.fromList(t,{words:o.completions}))&&null!=c.list&&v(c.list),a.sort(),void 0===t.cocalc_actions?[3,2]:[4,t.cocalc_actions.complete(e.line,e.ch)];case 1:for(u=i.sent(),s=0;s<u.length;s++)f=u[s],p=f.text,h=f.type,y="▣ ".concat(p," : ").concat(h),a.push({text:p,displayText:y});i.label=2;case 2:return[2,{list:a,from:r.Pos(e.line,n.start),to:r.Pos(e.line,n.end)}]}}))}))).apply(this,arguments)}r.registerHelper("hint","lean",(function(t){return c.apply(this,arguments)}))}}]);