PageSourceSearch

https://lakki-app.com/static/js/async/89.6c460652e2.js

js lakki-app.com collected 2026-09-24 14:17:38 UTC 15,045 bytes, 1 lines download raw bytes

1"use strict";(globalThis.rspackChunksimpo||=[]).push([[89],{75872(e,t){t.A=function(){function e(t,r){if(void 0===r&&(r="0"),this.value=t,this.bucket=r,!e.isValidLexValue(t))throw'Invalid lex value "'+t+'"';if(!e.isValidLexBucket(r))throw'Invalid lex bucket "'+r+'"';this.value=t,this.bucket=r}return e.from=function(t){if(t instanceof e)return new e(t.value,t.bucket);var r=this.parse(t);return new e(r.value,r.bucket)},e.parse=function(e){var t=/^(?<bucket>[0-2])\|(?<value>[0-9a-z]*[1-9a-z])$/.exec(e);if(!t)throw"Invalid lex string";return{value:t.groups.value,bucket:t.groups.bucket}},e.prototype.toString=function(){return this.bucket+"|"+this.value},e.nextBucket=function(e){if(!this.isValidLexBucket(e))throw'Invalid lex bucket "'+e+'"';return"2"===e?"0":String.fromCharCode(e.charCodeAt(0)+1)},e.prevBucket=function(e){if(!this.isValidLexBucket(e))throw'Invalid lex bucket "'+e+'"';return"0"===e?"2":String.fromCharCode(e.charCodeAt(0)-1)},e.isValidLexValue=function(e){return/^[0-9a-z]*[1-9a-z]$/.test(e)},e.isValidLexBucket=function(e){return/^[0-2]$/.test(e)},e.prototype.lessThan=function(t){for(var r=e.from(t),n=Math.max(this.value.length,r.value.length),o=0;o<n;o++){var i=this.value[o],a=r.value[o];if(!a)break;if(!i||i<a)return!0;if(i>a)break}return!1},e.prototype.increment=function(){for(var t=this.value.length-1;t>=0;t--){var r=this.value[t];if("z"!==r){var n=this.value.substring(0,t)+e.incrementChar(r);return new e(n,this.bucket)}}return new e(this.value+"1",this.bucket)},e.prototype.decrement=function(){var t=this.value.length,r=this.value[t-1];if("1"!==r){var n=this.value.substring(0,t-1)+e.decrementChar(r);return new e(n,this.bucket)}if(this.hasNonZeroLeadingChars()){var o=e.cleanTrailingZeros(this.value.substring(0,t-1));return new e(o,this.bucket)}return new e("0"+this.value,this.bucket)},e.prototype.hasNonZeroLeadingChars=function(){return this.value.length>1&&!this.value.substr(0,this.value.length-1).match(/^0+$/)},e.cleanTrailingZeros=function(e){var t=/^(?<value>[0-9a-z]*[1-9a-z])0*$/.exec(e);if(!t)throw"Invalid lex string";return t.groups.value},e.prototype.append=function(t){return new e(this.value+t,this.bucket)},e.incrementChar=function(e){return"z"===e?"-1":"9"===e?"a":String.fromCharCode(e.charCodeAt(0)+1)},e.decrementChar=function(e){return"1"===e?"-1":"a"===e?"9":String.fromCharCode(e.charCodeAt(0)-1)},e.between=function(t,r){if(!t&&!r)throw"Only one argument may be null";if(!r)return e.from(t).increment();if(!t)return e.from(r).decrement();var n=e.from(t),o=e.from(r);if(n.bucket!==o.bucket)throw"Lex buckets must be the same";if(!n.lessThan(o))throw n.value+" is not less than "+o.value;var i=n.increment();if(i.lessThan(o))return i;var a=n.append("1");if(a.lessThan(o))return a;for(var l="0",d=n.append(l+"1");!d.lessThan(o);)l+="0",d=n.append(l+"1");return d},e}()},25795(e,t,r){var n=r(74848);r(96540);var o=r(63295),i=r(33364),a=r(94412),l=r(74222);t.A=e=>{let t=e.color||l.z1,r=(0,o.d)(.9*!!e.value),d=(0,i.G)(r,[.05,.15],[0,1]);return(0,n.jsx)(a.P.div,{className:e.className,"data-todo-ignore-click":!0,role:"checkbox","aria-checked":e.value,"aria-label":e["aria-label"],onTap:()=>e.onChange(!e.value),initial:!1,style:{width:30,height:30,borderRadius:7,border:`2px solid ${t}`,cursor:"pointer",scale:.8,...e.style},children:(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",children:(0,n.jsx)(a.P.path,{d:"M38 74.707l24.647 24.646L116.5 45.5",fill:"transparent",strokeWidth:"18",stroke:t,strokeLinecap:"round",transition:{duration:.175},animate:{pathLength:.9*!!e.value},style:{pointerEvents:"none",pathLength:r,opacity:d,scale:.17,x:-63,y:-59}})})})}},64220(e,t,r){var n=r(74848);r(96540),t.A=e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 6.35 6.35",width:"24",...e,fill:e.color||"currentColor",children:(0,n.jsx)("switch",{transform:"matrix(.06678 0 0 .06743 -.16 -.197)",children:(0,n.jsxs)("g",{children:[(0,n.jsx)("path",{d:"M83.6 16.8c-18.5-18.5-48.5-18.5-67 0l-5.4 5.4v-9.1c0-2.4-2-4.4-4.4-4.4-2.4 0-4.4 2-4.4 4.4v19.7c0 2.4 2 4.4 4.4 4.4h19.7c2.4 0 4.4-2 4.4-4.4 0-2.4-2-4.4-4.4-4.4h-9.1l5.4-5.4c7.5-7.5 17.4-11.3 27.3-11.3 9.9 0 19.8 3.8 27.3 11.3 7.8 7.8 11.9 18.6 11.2 29.6-.1 2.4 1.7 4.5 4.1 4.7h.3c2.3 0 4.2-1.8 4.4-4.1.8-13.5-4.2-26.8-13.8-36.4z"}
1),(0,n.jsx)("path",{d:"M50.6 24.3c-2.4 0-4.4 2-4.4 4.4v21.6c0 2 1.3 3.7 3.2 4.2L65.3 59c2.3.7 4.8-.8 5.4-3 .7-2.3-.7-4.8-3.1-5.4L55 46.9V28.7c0-2.4-1.9-4.4-4.4-4.4zM69.6 84.2c-2.3 1.3-4.7 2.4-7.2 3.2-1 .3-1.8 1-2.3 1.9-.5.9-.5 2-.2 3 .7 2 2.9 3.1 4.9 2.5 3-1 5.9-2.3 8.6-3.8 1.9-1.1 2.5-3.4 1.4-5.3-.9-1.9-3.3-2.6-5.2-1.5zM11.4 55.7c-.1-1-.7-1.9-1.5-2.6-.7-.5-1.5-.8-2.3-.8h-.5c-1 .1-1.9.7-2.6 1.5-.6.8-.9 1.8-.7 2.9.4 3.2 1.1 6.3 2.2 9.2.7 2 3 3.1 5 2.4 1-.3 1.8-1.1 2.2-2 .4-.9.5-2 .2-3-1-2.4-1.6-5-2-7.6zM22.5 77.9c-.6-.6-1.1-1.2-1.7-1.8-.8-.9-1.8-1.3-2.9-1.3-.9 0-1.8.3-2.6 1-1.6 1.4-1.8 3.9-.3 5.5.6.7 1.3 1.4 2 2.1 1.5 1.5 3.2 3 4.9 4.3 1.7 1.3 4.2.9 5.4-.8.6-.8.9-1.8.8-2.9-.1-1-.7-1.9-1.5-2.6-1.4-1-2.8-2.2-4.1-3.5zM90.3 66.1c-.6-.3-1.1-.4-1.7-.4-.4 0-.8.1-1.2.2-1 .3-1.8 1-2.3 2-1.2 2.3-2.6 4.6-4.2 6.6-1.3 1.7-1 4.1.6 5.5 1.6 1.3 4.2 1 5.5-.6 1.9-2.5 3.6-5.1 5-7.9.5-.9.5-2 .2-3-.3-1.2-1-2-1.9-2.4zM47.7 89.3c-2.6-.2-5.2-.6-7.7-1.3-.3-.1-.7-.1-1-.1-.7 0-1.3.2-1.9.5-.9.5-1.5 1.4-1.8 2.4-.6 2.1.7 4.2 2.7 4.8 3 .8 6.1 1.3 9.3 1.5h.2c2 0 3.7-1.6 3.9-3.6.1-2.2-1.6-4.1-3.7-4.2z"})]})})})},27106(e,t,r){var n=r(96540);r.d(t,{},{I:()=>{let[,e]=(0,n.useState)(0);return(0,n.useCallback)(()=>{e(e=>e+1)},[])}})},19105(e,t,r){var n=r(96540),o=r(58588),i=r(82177),a=r(27106);let l=e=>{let[t,r]=(0,n.useState)(e.isReady);return(0,n.useEffect)(()=>{r(e.isReady);let t=e=>r(e);return e.on(o.qY.READY,t),()=>e.off(o.qY.READY,t)},[]),{ready:t,db:e}},d=[];r.d(t,{},{Be:l,HX:(e,t,r)=>{var s;let c,u,h,f,y,p,_,{db:m,ready:g}=l(o.HY.instance);return s=g?r:{...r||{},disable:!0},c=(0,a.I)(),u=s?.disable,h=(0,n.useRef)(d),f=(0,i.Z)(e),y=(0,i.Z)(t),p=(0,i.Z)(u),u&&(h.current=d),_=JSON.stringify(e),m&&!u&&e&&t&&(!1===p&&!0===u||!f||!y||y!==t||JSON.stringify(f)!==_)&&(h.current=m.searchEngine.find(t,e)),(0,n.useEffect)(()=>{if(!u&&m&&e&&t){let r=!0;return m.searchEngine.findAndSubscribe(e,t,e=>{let t=()=>{h.current=e,c()};r?(r=!1,JSON.stringify(e)!==JSON.stringify(h.current)&&(t(),h.current=e)):t()})}},[m,_,t,u]),h.current}})},82167(e,t,r){var n=r(58588),o=r(19105),i=r(54905),a=r(96540),l=r(1672),d=r(42877),s=r.n(d),c=r(61571);let u=(e,t)=>(0,o.HX)(e,n.Ey.todo,t),h=({sortBy:e}={})=>{let{t,ready:r}=(0,c.Bd)("common",{useSuspense:!1}),i=(0,o.HX)({},n.Ey.todoList),d=r?t("common:todos.default_list_title",{defaultValue:"Incoming"}):"Incoming";return{lists:(0,a.useMemo)(()=>{let t=e?s()(i,"title"):[...i];return t.unshift({_id:l.D8,title:d}),t},[i,e]),defaultListName:d}};r.d(t,{},{RE:h,Zw:u,jN:({sortBy:e}={})=>{let{lists:t}=h({sortBy:e});return(0,a.useMemo)(()=>t.reduce((e,{_id:t,title:r})=>(e[t]=r,e),{}),[t])},yJ:(e,t="day",r)=>{let n=u(e,r);return(0,a.useMemo)(()=>"day"===t?i.Z.sortByDayOrder(n):"list"===t?i.Z.sortByListOrder(n):n,[n,t])}})},39363(e,t,r){r.d(t,{n:()=>j});var n=r(55364),o=r.n(n),i=r(69287),a=r(58156),l=r.n(a),d=r(63560),s=r.n(d),c=r(8483),u=r.n(c),h=r(54905),f=r(58588),y=r(29825),p=r(52044),_=r(95093),m=r.n(_),g=r(23788),v=r(75005);let w=`${g.H$}/todo`,b=e=>(0,v.bE)(`${w}/cancelReminder/${e}`);var x=r(56559),k=r(26695),A=r(75337),C=r(99571),T=r(17709);let S={walkTodoChildren(e,t){let r=e=>{if(!(0,T.A)(e))for(let n of e)t(n),Array.isArray(n.children)&&r(n.children)};Array.isArray(e.children)&&r(e.children)}};var B=r(81947),E=r(1672),D=r(49413),O=r(3749),L=r(50440);let I=f.HY.instance,$=e=>!(0,x.A)(e.remind_rule),R=e=>{if($(e)){let t,r,n=(r=m()(e.date).subtract(e.remind_rule,"milliseconds")).isAfter(m()())?r:null;n&&(t={id:e._id,date:n.toISOString()},(0,v.bE)(`${w}/scheduleReminder`,t))}},P=(e,t)=>{let r=!t,n=!r,o=n&&e.done!==t.done,i=n&&e.list!==t.list;if(r||o||i){let t=h.Z.sortByListOrder(y.c.getTodosByList(e.list));e.done?e.order_list=h.Z.extractListBottomPos(t):e.order_list=h.Z.extractListTopPos(t)}if(e.date){let i=!1;if((r||o)&&(i=!0),!i&&n&&(i=!t.date||!m()(e.date).isSame(t.date,"day")),i){let t=h.Z.sortByDayOrder(y.c.getTodosByDay(e.date));e.done?e.order_day=h.Z.extractDayBottomPos(t):e.order_day=h.Z.extractDayTopPos(t)}}return e},Z=(e,t,r)=>{e.done!==t.done&&(t.done?t.done_at=new Date().toISOString():t.done_at=null),r||P(t,e)},z=async(e,t,r,n)=>{let o={...(0,i.A)(e),...t};Z(e,o,r),n&&M(o,e._id),await I.updateDoc(o),(e.remind_rule!==o.remind_rule||e.date!==o.date)&&($(o)?R(o):$(e)&&b(e._id))},M=async(e,t)=>{let r,n;if(e.done||!B.$.getTodoCompletionProbTipVisibility())return;let o=new Date().toISOString(),i=e.date&&m()(e.date);if(i&&i.isBefore(o))return;let a=await (n={creation_date:o,date:i?.toISOString(),has_reminder:$(e),has_deadline:!!e.due_date,priority:e.priority?E.oO.findIndex(t=>t===e.priority)+1:0,has_project:e.list&&e.list!==E.D8,all_day:!!i&&e.all_day,has_children:!(0,T.A)(e.children),title:e.title},(0,v.bE)(`${w}/calcCompletionProbability`,n)).then(({data:{success:e}})=>Math.round(100*e)),l=window.__i18n,d=a>=50;if(a){let e=`${l.t(`common:todos.completion_prob_${d?"success":"fail"}`,{prob:a})}. ${l.t("common:todos.completion_prob_improve_tip")}`;r=(0,D.V)({componentProps:{message:e,onConfirm:()=>{C.oR.dismiss(r),setTimeout(()=>{let e=I.isReady?I.searchEngine.findById(f.Ey.todo,t):null;e&&(0,L.wj)().dispatch(O.E.openTodoEditor({strategy:"updateTodo",todo:e}))},100)},onReject:()=>{C.oR.dismiss(r)},extraActionText:l.t("common:show_no_more"),onExtraAction:()=>{C.oR.dismiss(r),B.$.changeTodoCompletionProbTipVisibility(!1),(0,C.oR)(l.t("common:todos.activate_later_completion_prob_tip"),{hideProgressBar:!0,autoClose:3e3,position:"bottom-left",pauseOnHover:!0})}},toastArgs:{}})}},V=async(e,{isClone:t=!1}={})=>{e.type=f.Ey.todo,P(e);let{id:r}=await I.addDoc(e);R({...e,_id:r}),t||M(e,r)},j={replaceTodo:async e=>{await I.updateDoc(e)},updateTodos:async e=>{await I.updateDocs(e)},async toggle(e){let t,r={done:!e.done};if(r.done&&e.rrule){r.rrule=null;let n=p.m.getNextOccurence(e.rrule,e.date);n&&((t=(0,k.A)(e,["created_at","_id","_rev","$loki","meta","done_at"])).chain_root_date||(t.chain_root_date=e.date),t.chain_root_due_date||(t.chain_root_due_date=e.due_date),t.chain_root_id||
1(t.chain_root_id=e._id),t.done=!1,t.done_at=null,t._id=(0,A.E)(),t.date=n.toISOString(),t.rrule=p.m.insertStartDate(t.rrule,n))}if(t){let n=o()((0,i.A)(e),r);Z(e,n),S.walkTodoChildren(n,e=>{e._id=(0,A.E)(),e.done=!1}),P(t),await I.addBulk([n,t]),R(t),C.oR.success(window.__i18n.t("common:recurr_todo_next_occur_popover",{date:m()(t.date).format("LLL")}))}else await z(e,r)},createTodo:V,updateTodo:z,async cloneTodo(e){let t=(0,i.A)((0,k.A)(e,["_id","_rev","list_pos","day_pos","created_at","type","$loki","meta","done_at","chain_root_date","chain_root_due_date","chain_root_id"]));return t.done=!1,S.walkTodoChildren(t,e=>{e._id=(0,A.E)(),e.done=!1}),await V(t,{isClone:!0})},async removeTodo(e){await I.removeDoc(e._id),$(e)&&b(e._id)},async toggleTodoCollapse(e){await z(e,{collapsed:!e.collapsed},!0)},async createChildTodo({rootTodo:e,data:t,childrenPath:r="children"}){t._id=(0,A.E)(),e=(0,i.A)(e);let n=l()(e,r,[]);t.done?n.push(t):n.unshift(t),s()(e,r,n),await I.updateDoc(e)},async toggleChildTodoCompletion({rootTodo:e,childId:t}){let r=y.c.findChildById(e,t);if(!r)return;let{index:n,parentPath:o}=r;e=(0,i.A)(e);let a=l()(e,o);if(!Array.isArray(a))return;let d=a[n];d&&(d.done=!d.done,a.length>1&&(d.done?(a.splice(n,1),a.push(d)):(a.splice(n,1),a.unshift(d))),await I.updateDoc(e))},async updateChildTodo({rootTodo:e,data:t,childId:r}){let n=y.c.findChildById(e,r);n&&(e=(0,i.A)(e),u()(e,n.path,e=>o()(e,t)),await I.updateDoc(e))},async completeAllChildren({rootTodo:e,childrenPath:t}){e=(0,i.A)(e);let r=l()(e,t,[]);S.walkTodoChildren({children:r},e=>{e.done=!0}),await I.updateDoc(e)},async uncompleteAllChildren({rootTodo:e,childrenPath:t}){e=(0,i.A)(e);let r=l()(e,t,[]);S.walkTodoChildren({children:r},e=>{e.done=!1}),await I.updateDoc(e)},async removeChildTodo({rootTodo:e,childId:t}){let r=y.c.findChildById(e,t);r&&(e=(0,i.A)(e),u()(e,r.parentPath,e=>(e.splice(r.index,1),e)),await I.updateDoc(e))}}},54905(e,t,r){var n=r(1672),o=r(42877),i=r.n(o),a=r(24994),l=r(74966),d=r(75872);let s=e=>{if(!e)return null;if("string"!=typeof e)return e;try{return d.A.from(e)}catch(t){return console.error(t),new d.A(e)}},c=e=>e?"string"==typeof e?e:e.toString():null,u=e=>{try{return c(s(e)?.increment())}catch(t){return console.error(t),c(e)}},h=e=>{try{return c(s(e)?.decrement())}catch(t){return console.error(t),c(e)}},f=(e,t)=>{try{return c(d.A.between(s(e),s(t)))}catch(e){return console.error(e),c(t)}},y=(e,t)=>{if(e||t){if(e&&t)return f(e,t);else if(e&&!t)return u(e);else if(!e&&t)return h(t)}return n.o3};r.d(t,{},{Z:{getNextPos:u,getPrevPos:h,getPosBetween:f,calcPos:y,extractListTopPos:e=>y(null,(0,l.A)(e)?.order_list),extractListBottomPos:e=>y((0,a.A)(e)?.order_list,null),extractDayTopPos:e=>y(null,(0,l.A)(e)?.order_day),extractDayBottomPos:e=>y((0,a.A)(e)?.order_day,null),sortByDayOrder:e=>i()(e,"order_day"),sortByListOrder:e=>i()(e,"order_list"),calcNewPosOnReorder:({todos:e,idx:t,key:r="order_day"})=>e[t+1]?e[t-1]?f(e[t-1][r],e[t+1][r]):h(e[t+1][r]):u(e[t-1][r])}})},29825(e,t,r){var n=r(95093),o=r.n(n),i=r(58588);let a=i.HY.instance;r.d(t,{},{c:{getTodosByCreationDay:e=>(e=o()(e),a.isReady)?a.searchEngine.find(i.Ey.todo,{created_at:{$between:[e.startOf("day").toISOString(),e.endOf("day").toISOString()]}}):[],getTodosByDay:e=>a.isReady?a.searchEngine.find(i.Ey.todo,{date:{$between:[o()(e).startOf("day").toISOString(),o()(e).endOf("day").toISOString()]}}):[],findChildById(e,t){let r;if("string"==typeof e){if(!a.searchEngine)return null;r=a.searchEngine.findById(i.Ey.todo,e)}else r=e;let n=(e,r)=>{if(!e)return null;for(let o=0;o<e.length;o++){let i=e[o];if(i._id===t)return{child:i,path:`${r}[${o}]`,parentPath:r,index:o};if(Array.isArray(i.children)){let e=n(i.children,`${r}[${o}].children`);if(e)return e}}return null};return n(r.children,"children")},getTodosByList:e=>a.isReady?a.searchEngine.find(i.Ey.todo,{list:e}):[]}})},52044(e,t,r){var n=r(69512),o=r(95093),i=r.n(o),a=r(23788),l=r(67703);let d=e=>i()(e).utc(!0).toDate();r.d(t,{},{m:{toRRuleDate:d,insertStartDate(e,t){let r=(e=>{if(!e)return null;try{return n.p3.parseString(e)}catch(e){return console.error(e),null}})(e);if(r)return r.dtstart=d(t),new n.p3(r).toString()},getNextOccurence(e,t){try{let r=(e=>{if(!e)return null;try{return"string"==typeof e?n.p3.fromString(e):new n.p3(e)}catch(e){return console.error(e),null}})(e);if(!r)return null;let o=r.after(d(t));return o?i().utc(o).local(!0):null}catch(e){return console.error(e),null}},makeAbstractRange:({todo:e,start:t,end:r})=>n.p3.fromString(e.rrule).between(t,r,!0).map(t=>{let r=i()(t).format(a.dY),n=e.children?.[r];return{abstract:!0,parent_id:e._id,child_key:r,_id:r+e._id,done:n?.done??!1,order_day:n?.order_day,...(0,l.A)(e,["list","order_list","remind_rule","title","duration","color","note","all_day","rrule"])}})}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.