2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(e,n,r){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const r=e.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(n,r))}function c(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode.removeChild(t)}function l(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function d(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function m(){return f(" ")}function p(){return f("")}function h(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function g(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function b(t,e){e=""+e,t.data!==e&&(t.data=e)}let y;function v(t){y=t}const $=[],M=[],w=[],D=[],k=Promise.resolve();let S=!1;function x(t){w.push(t)}let Y=!1;const H=new Set;function T(){if(!Y){Y=!0;do{for(let t=0;t<$.length;t+=1){const e=$[t];v(e),J(e.$$)}for($.length=0;M.length;)M.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];H.has(e)||(H.add(e),e())}w.length=0}while($.length);for(;D.length;)D.pop()();S=!1,Y=!1,H.clear()}}function J(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}const N=new Set;function j(t,e){t&&t.i&&(N.delete(t),t.i(e))}function A(t,e,n,r){if(t&&t.o){if(N.has(t))return;N.add(t),(void 0).c.push(()=>{N.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function C(t){t&&t.c()}function _(t,n,a){const{fragment:s,on_mount:c,on_destroy:i,after_update:u}=t.$$;s&&s.m(n,a),x(()=>{const n=c.map(e).filter(o);i?i.push(...n):r(n),t.$$.on_mount=[]}),u.forEach(x)}function O(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function L(t,e){-1===t.$$.dirty[0]&&($.push(t),S||(S=!0,k.then(T)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function P(e,o,a,s,c,i,l=[-1]){const d=y;v(e);const f=o.props||{},m=e.$$={fragment:null,ctx:null,props:i,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:n(),dirty:l};let p=!1;if(m.ctx=a?a(e,f,(t,n,...r)=>{const o=r.length?r[0]:n;return m.ctx&&c(m.ctx[t],m.ctx[t]=o)&&(m.bound[t]&&m.bound[t](o),p&&L(e,t)),n}):[],m.update(),p=!0,r(m.before_update),m.fragment=!!s&&s(m.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);m.fragment&&m.fragment.l(t),t.forEach(u)}else m.fragment&&m.fragment.c();o.intro&&j(e.$$.fragment),_(e,o.target,o.anchor),T()}v(d)}class R{$destroy(){O(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}const E=[];function F(e,n=t){let r;const o=[];function s(t){if(a(e,t)&&(e=t,r)){const t=!E.length;for(let t=0;t<o.length;t+=1){const n=o[t];n[1](),E.push(n,e)}if(t){for(let t=0;t<E.length;t+=2)E[t][0](E[t+1]);E.length=0}}}return{set:s,update:function(t){s(t(e))},subscribe:function(a,c=t){const i=[a,c];return o.push(i),1===o.length&&(r=n(s)||t),a(e),()=>{const t=o.indexOf(i);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}var Z=function t(e){function n(t){return function(e,n){return a(e,Object.assign({method:t},n))}}function r(t){return function(e,n,r){return a(e,Object.assign({method:t,data:n},r))}}function o(t,e,n){if(Array.isArray(t))return t.concat(e);if(e&&"object"==typeof e){var r,a={};if(t)for(r in t)a[n?r.toLowerCase():r]=t[r];for(r in e){var s=n?r.toLowerCase():r;"headers"===s&&(n=!0),a[s]=r in a?o(a[s],e[r],n):e[r]}return a}return e}function a(t,n){"string"!=typeof t&&(t=(n=t).url);var r=o(e,n||{}),a=r.data;if(r.transformRequest)for(var s=0;s<r.transformRequest.length;s++){var c=r.transformRequest[s](a,r.headers);void 0!==c&&(a=c)}var i={};if(a&&"object"==typeof a&&(a=JSON.stringify(a),i["Content-Type"]="application/json"),r.xsrfCookieName)for(var u=document.cookie.split(/ *[;=] */),l=0;l<u.length;l+=2)if(u[l]==r.xsrfCookieName){i[r.xsrfHeaderName]=decodeURIComponent(u[l+1]);break}r.auth&&(i.Authorization=r.auth);var d={};return d.config=n,fetch(t,{method:r.method,body:a,headers:o(r.headers,i,!0)}).then((function(t){var e;for(e in t)"function"!=typeof t[e]&&(d[e]=t[e]);return(r.validateStatus?r.validateStatus(t.status):t.ok)?("stream"===r.responseType?Promise.resolve(t.body):t[r.responseType||"text"]()).then((function(t){return d.data=t,d})):Promise.reject(t)}))}return e=e||{},a.request=a,a.get=n("get"),a.delete=n("delete"),a.options=n("options"),a.post=r("post"),a.put=r("put"),a.patch=r("patch"),a.all=Promise.all,a.spread=function(t){return function(e){return t.apply(this,e)}},a.CancelToken=self.AbortController||Object,a.create=t,a}();const q=`${location.protocol}//${location.hostname}`,z={jobs:q.concat("/v2/jobs"),apply:q.concat("/v2/apply"),readall:q.concat("/v2/readall"),kill:q.concat("/kill"),upvote:q.concat("/vote/up"),downvote:q.concat("/vote/down")},I=F([]),U=F({}),W={getJobList(){Z.get(z.jobs).then(t=>{const e=JSON.parse(t.data);I.set(e)}).catch(t=>{console.error("getJobList",t)})},loadJobDetail(t){if(console.log("loadJobDetail: "+t),t){const e=`${z.jobs}/${t}`;Z.get(e).then(t=>{const e=JSON.parse(t.data);U.set(e)}).catch(t=>{console.error("loadJobDetail",t)})}},async touchJob(t){if(console.log("touchJob: "+t),t){const e=`${z.jobs}/${t}`;await Z.put(e).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("touchJob",t)}),I.update(e=>(e.map(e=>{if(e._id===t)return e.read=(new Date).getTime(),e}),e))}},async appliedJob(t){console.log("touchJob: "+t);const e=(new Date).getTime();if(t){console.log("Applying..");const n=`${z.apply}/${t}`;await Z.put(n).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("appliedJob",t)});const r=t;I.update(t=>(t.map(t=>{if(t._id===r)return t.applied=e,t}),t)),U.update(t=>(t.data.applied=e,t))}},async markAllRead(){console.log(">> markAllRead");const t=""+z.readall;await Z.put(t).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("markAllRead",t)}),this.getJobList()},killWord(t){console.log(">> killword:"+t);const e=`${z.kill}/${t}`;Z.put(e).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("killword",t)})},upVote(t){console.log(">> upvote:"+t);const e=`${z.upvote}/${t}`;Z.put(e).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("upvote",t)})},downVote(t){console.log(">> downvote:"+t);const e=`${z.downvote}/${t}`;Z.put(e).then(t=>{200!==t.status&&console.error(t)}).catch(t=>{console.error("downvote",t)})}};var V=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,B=/\[([^]*?)\]/gm;function G(t,e){for(var n=[],r=0,o=t.length;r<o;r++)n.push(t[r].substr(0,e));return n}function K(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,o=e;r<o.length;r++){var a=o[r];for(var s in a)t[s]=a[s]}return t}var Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],X=["January","February","March","April","May","June","July","August","September","October","November","December"],tt=G(X,3),et=K({},{dayNamesShort:G(Q,3),dayNames:Q,monthNamesShort:tt,monthNames:X,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),nt=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},rt={D:function(t){return String(t.getDate())},DD:function(t){return nt(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return nt(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return nt(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return nt(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return nt(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return nt(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return nt(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return nt(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return nt(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return nt(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return nt(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+nt(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+nt(Math.floor(Math.abs(e)/60),2)+":"+nt(Math.abs(e)%60,2)}},ot={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},at=function(t,e,n){if(void 0===e&&(e=ot.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=ot[e]||e).replace(B,(function(t,e){return r.push(e),"@@@"}));var o=K(K({},et),n);return(e=e.replace(V,(function(e){return rt[e](t,o)}))).replace(/@@@/g,(function(){return r.shift()}))};function st(t,e,n){const r=t.slice();return r[5]=e[n],r[7]=n,r}function ct(t){let e,n,r,o,a,s,l,p,y,v,$,M,w,D,k,S,x,Y,H=t[5].title+"",T=t[5].site+"",J=ut(t[5].company,25)+"",N=t[2](t[5].timestamp)+"";return{c(){e=d("tr"),n=d("td"),r=f(H),o=m(),a=d("td"),s=f(T),l=m(),p=d("td"),y=f(J),$=m(),M=d("td"),w=f(N),k=m(),g(n,"class","noOverflow svelte-hvjw8w"),g(p,"title",v=t[5].company),g(M,"title",D=ft(t[5].timestamp)),g(e,"class",S="dataRow "+lt(t[5])+" "+dt(t[5])+" svelte-hvjw8w"),g(e,"data-id",x=t[5]._id)},m(u,d,f){var m;i(u,e,d),c(e,n),c(n,r),c(e,o),c(e,a),c(a,s),c(e,l),c(e,p),c(p,y),c(e,$),c(e,M),c(M,w),c(e,k),f&&Y(),Y=h(e,"click",(m=t[1],function(t){return t.stopPropagation(),m.call(this,t)}))},p(t,n){1&n&&H!==(H=t[5].title+"")&&b(r,H),1&n&&T!==(T=t[5].site+"")&&b(s,T),1&n&&J!==(J=ut(t[5].company,25)+"")&&b(y,J),1&n&&v!==(v=t[5].company)&&g(p,"title",v),1&n&&N!==(N=t[2](t[5].timestamp)+"")&&b(w,N),1&n&&D!==(D=ft(t[5].timestamp))&&g(M,"title",D),1&n&&S!==(S="dataRow "+lt(t[5])+" "+dt(t[5])+" svelte-hvjw8w")&&g(e,"class",S),1&n&&x!==(x=t[5]._id)&&g(e,"data-id",x)},d(t){t&&u(e),Y()}}}function it(e){let n,r,o,a,s,f=e[0],p=[];for(let t=0;t<f.length;t+=1)p[t]=ct(st(e,f,t));return{c(){n=d("div"),r=d("table"),o=d("thead"),o.innerHTML='<tr><th class="col-5">\n Title\n </th> \n <th class="col-2">\n Site\n </th> \n <th class="col-3">\n Company\n </th> \n <th class="col-2">\n Date\n </th></tr>',a=m(),s=d("tbody");for(let t=0;t<p.length;t+=1)p[t].c();g(r,"class",""),g(n,"class","lister svelte-hvjw8w")},m(t,e){i(t,n,e),c(n,r),c(r,o),c(r,a),c(r,s);for(let t=0;t<p.length;t+=1)p[t].m(s,null)},p(t,[e]){if(7&e){let n;for(f=t[0],n=0;n<f.length;n+=1){const r=st(t,f,n);p[n]?p[n].p(r,e):(p[n]=ct(r),p[n].c(),p[n].m(s,null))}for(;n<p.length;n+=1)p[n].d(1);p.length=f.length}},i:t,o:t,d(t){t&&u(n),l(p,t)}}}function ut(t,e=40,n=!0){if(t.length<=e)return t;const r=t.substr(0,e-1);return(n?r.substr(0,r.lastIndexOf(" ")):r)+"…"}function lt(t){return 0!==t.read?"read":""}function dt(t){return 0!==t.applied?"applied":""}function ft(t){return new Date(t).toLocaleString()}function mt(t,e,n){let r;return s(t,I,t=>n(0,r=t)),[r,function(t){const e=t.target.parentElement.dataset.id;W.loadJobDetail(e),W.touchJob(e)},function(t){const e=864e5*~~(Date.now()/864e5);return at(new Date(t),t>e?"shortTime":"isoDate")}]}class pt extends R{constructor(t){super(),P(this,t,mt,it,a,{})}}function ht(t,e,n){const r=t.slice();return r[8]=e[n],r[10]=n,r}function gt(t){let e,n,r,o,a,s,p,h,y,v,$,M,w,D,k,S,x,Y,H,T,J,N,j,A,C,_,O,L,P,R,E,F,Z,q,z,I,U,W,V,B,G,K,Q=t[3].title+"",X=t[3].company+"",tt=t[3].location+"",et=t[3].salary+"",nt=t[3].date+"",rt=t[3].site+"",ot=t[3].summary+"";function at(t,e){return 1===t[2]?yt:2===t[2]?bt:void 0}let st=at(t),ct=st&&st(t);function it(t,e){return t[1]?vt:$t}let ut=it(t),lt=ut(t),dt=t[3].data.autoclass.words,ft=[];for(let e=0;e<dt.length;e+=1)ft[e]=kt(ht(t,dt,e));return{c(){e=d("div"),n=d("div"),r=d("div"),o=d("div"),a=f(Q),s=m(),ct&&ct.c(),p=m(),h=d("div"),y=d("div"),v=f("Company: "),$=d("span"),M=f(X),w=m(),D=d("div"),k=f("Location: "),S=d("span"),x=f(tt),Y=m(),H=d("div"),T=f("Applied:\n "),lt.c(),J=m(),N=d("div"),j=d("div"),A=f("Salary: "),C=d("span"),_=m(),O=d("div"),L=f("Scraped: "),P=d("span"),R=f(nt),E=m(),F=d("div"),Z=f("Site: "),q=d("a"),z=f(rt),U=m(),W=d("div"),V=d("div");for(let t=0;t<ft.length;t+=1)ft[t].c();G=m(),K=d("blockquote"),g(o,"class","col-12 text-primary lead"),g(r,"class","row svelte-ewk0kd"),g($,"class","text-primary"),g(y,"class","col-1-3rd"),g(S,"class","text-primary"),g(D,"class","col-1-3rd"),g(H,"class","col-1-3rd"),g(h,"class","row svelte-ewk0kd"),g(C,"class","text-primary"),g(j,"class","col-1-3rd"),g(P,"class","text-primary"),g(O,"class","col-1-3rd"),g(q,"href",I=t[3].url),g(q,"class","text-capitalize"),g(q,"target","_blank"),g(F,"class","col-1-3rd"),g(N,"class","row svelte-ewk0kd"),g(V,"class","col-12"),g(W,"class","row svelte-ewk0kd"),g(n,"class",B="detailHead bg-light "+(t[1]?"applied":"")+" svelte-ewk0kd"),g(K,"class","container noscroll"),g(e,"class","detail svelte-ewk0kd")},m(t,u){i(t,e,u),c(e,n),c(n,r),c(r,o),c(o,a),c(r,s),ct&&ct.m(r,null),c(n,p),c(n,h),c(h,y),c(y,v),c(y,$),c($,M),c(h,w),c(h,D),c(D,k),c(D,S),c(S,x),c(h,Y),c(h,H),c(H,T),lt.m(H,null),c(n,J),c(n,N),c(N,j),c(j,A),c(j,C),C.innerHTML=et,c(N,_),c(N,O),c(O,L),c(O,P),c(P,R),c(N,E),c(N,F),c(F,Z),c(F,q),c(q,z),c(n,U),c(n,W),c(W,V);for(let t=0;t<ft.length;t+=1)ft[t].m(V,null);c(e,G),c(e,K),K.innerHTML=ot},p(t,e){if(8&e&&Q!==(Q=t[3].title+"")&&b(a,Q),st!==(st=at(t))&&(ct&&ct.d(1),ct=st&&st(t),ct&&(ct.c(),ct.m(r,null))),8&e&&X!==(X=t[3].company+"")&&b(M,X),8&e&&tt!==(tt=t[3].location+"")&&b(x,tt),ut===(ut=it(t))&<?lt.p(t,e):(lt.d(1),lt=ut(t),lt&&(lt.c(),lt.m(H,null))),8&e&&et!==(et=t[3].salary+"")&&(C.innerHTML=et),8&e&&nt!==(nt=t[3].date+"")&&b(R,nt),8&e&&rt!==(rt=t[3].site+"")&&b(z,rt),8&e&&I!==(I=t[3].url)&&g(q,"href",I),8&e){let n;for(dt=t[3].data.autoclass.words,n=0;n<dt.length;n+=1){const r=ht(t,dt,n);ft[n]?ft[n].p(r,e):(ft[n]=kt(r),ft[n].c(),ft[n].m(V,null))}for(;n<ft.length;n+=1)ft[n].d(1);ft.length=dt.length}2&e&&B!==(B="detailHead bg-light "+(t[1]?"applied":"")+" svelte-ewk0kd")&&g(n,"class",B),8&e&&ot!==(ot=t[3].summary+"")&&(K.innerHTML=ot)},d(t){t&&u(e),ct&&ct.d(),lt.d(),l(ft,t)}}}function bt(t){let e;return{c(){e=d("span"),e.textContent="Permanent",g(e,"class","badge badge-danger")},m(t,n){i(t,e,n)},d(t){t&&u(e)}}}function yt(t){let e;return{c(){e=d("span"),e.textContent="Contract",g(e,"class","badge badge-success")},m(t,n){i(t,e,n)},d(t){t&&u(e)}}}function vt(e){let n;return{c(){n=f("Applied!")},m(t,e){i(t,n,e)},p:t,d(t){t&&u(n)}}}function $t(e){let n,r;return{c(){n=d("button"),n.textContent="Applied",g(n,"class","btn btn-sm btn-primary")},m(t,o,a){i(t,n,o),a&&r(),r=h(n,"click",e[4])},p:t,d(t){t&&u(n),r()}}}function Mt(t){let e,n,r,a=t[8]+"";return{c(){e=d("span"),n=f(a),g(e,"class","badge badge-dark")},m(a,s,u){i(a,e,s),c(e,n),u&&r(),r=h(e,"click",(function(){o(Yt(t[8]))&&Yt(t[8]).apply(this,arguments)}))},p(e,r){t=e,8&r&&a!==(a=t[8]+"")&&b(n,a)},d(t){t&&u(e),r()}}}function wt(t){let e,n,r=t[8]+"";return{c(){e=d("span"),n=f(r),g(e,"class","badge badge-danger")},m(t,r){i(t,e,r),c(e,n)},p(t,e){8&e&&r!==(r=t[8]+"")&&b(n,r)},d(t){t&&u(e)}}}function Dt(t){let e,n,r=t[8]+"";return{c(){e=d("span"),n=f(r),g(e,"class","badge badge-success")},m(t,r){i(t,e,r),c(e,n)},p(t,e){8&e&&r!==(r=t[8]+"")&&b(n,r)},d(t){t&&u(e)}}}function kt(t){let e,n,r;function o(t,r){return(null==e||8&r)&&(e=!(-1===t[3].data.autoclass.good.indexOf(t[8]))),e?Dt:((null==n||8&r)&&(n=!(-1===t[3].data.autoclass.bad.indexOf(t[8]))),n?wt:Mt)}let a=o(t,-1),s=a(t);return{c(){s.c(),r=p()},m(t,e){s.m(t,e),i(t,r,e)},p(t,e){a===(a=o(t,e))&&s?s.p(t,e):(s.d(1),s=a(t),s&&(s.c(),s.m(r.parentNode,r)))},d(t){s.d(t),t&&u(r)}}}function St(e){let n,r=e[0]&>(e);return{c(){r&&r.c(),n=p()},m(t,e){r&&r.m(t,e),i(t,n,e)},p(t,[e]){t[0]?r?r.p(t,e):(r=gt(t),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&u(n)}}}function xt(t){for(const e in t)if(t.hasOwnProperty(e))return!1;return!0}function Yt(t){console.log(">>kill",t)}function Ht(t,e,n){let r;s(t,U,t=>n(3,r=t));let o=!1,a=!1,c=0;return U.subscribe(t=>{n(0,o=!xt(t))}),t.$$.update=()=>{8&t.$$.dirty&&(xt(r)||(n(1,a="number"==typeof r.data.applied&&0!==r.data.applied),n(2,c=r.data.jobtype)))},[o,a,c,r,function(){W.appliedJob(r._id)}]}class Tt extends R{constructor(t){super(),P(this,t,Ht,St,a,{})}}function Jt(e){let n,r,o,a,s,l,f;return{c(){n=d("header"),r=d("section"),o=d("span"),o.textContent=""+Nt,a=m(),s=d("section"),l=d("button"),l.textContent="Mark All Read",g(o,"class","text-bold navbar-brand mx-1 text-uppercase"),g(r,"class","navbar-section"),g(l,"class","btn btn-sm btn-primary"),g(s,"class","navbar-section text-right"),g(n,"class","navbar bg-primary")},m(t,u,d){i(t,n,u),c(n,r),c(r,o),c(n,a),c(n,s),c(s,l),d&&f(),f=h(l,"click",e[0])},p:t,i:t,o:t,d(t){t&&u(n),f()}}}let Nt="Jobs";function jt(t){return[function(){W.markAllRead()}]}class At extends R{constructor(t){super(),P(this,t,jt,Jt,a,{})}}function Ct(e){let n,r,o,a,s;const l=new At({}),f=new pt({}),p=new Tt({});return{c(){C(l.$$.fragment),n=m(),r=d("div"),o=d("div"),C(f.$$.fragment),a=m(),C(p.$$.fragment),g(o,"class","col-12"),g(r,"class","container fullWidth noscroll")},m(t,e){_(l,t,e),i(t,n,e),i(t,r,e),c(r,o),_(f,o,null),c(o,a),_(p,o,null),s=!0},p:t,i(t){s||(j(l.$$.fragment,t),j(f.$$.fragment,t),j(p.$$.fragment,t),s=!0)},o(t){A(l.$$.fragment,t),A(f.$$.fragment,t),A(p.$$.fragment,t),s=!1},d(t){O(l,t),t&&u(n),t&&u(r),O(f),O(p)}}}var _t=1e3,Ot=6e4,Lt=60*Ot,Pt=24*Lt,Rt=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var n=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*Pt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Lt;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ot;case"seconds":case"second":case"secs":case"sec":case"s":return n*_t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(t);if("number"===n&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=Pt)return Et(t,e,Pt,"day");if(e>=Lt)return Et(t,e,Lt,"hour");if(e>=Ot)return Et(t,e,Ot,"minute");if(e>=_t)return Et(t,e,_t,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=Pt)return Math.round(t/Pt)+"d";if(e>=Lt)return Math.round(t/Lt)+"h";if(e>=Ot)return Math.round(t/Ot)+"m";if(e>=_t)return Math.round(t/_t)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Et(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}let Ft=0;const Zt=new class extends R{constructor(t){super(),P(this,t,null,Ct,a,{})}}({target:document.body});return function t(){W.getJobList();const e=function(t=0){return 36e5-(new Date).getTime()%36e5+t}()+Rt("10m");console.log("Next:",e),Ft=setTimeout(()=>{t()},e)}(),Zt}();
|