2025-10-08 08:42:00 +05:00
|
|
|
(()=>{var e={804:function(e){var t=/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,n=/and|article|body|column|content|main|shadow/i;function i(e){return(!e.style||"none"!=e.style.display)&&!e.hasAttribute("hidden")&&(!e.hasAttribute("aria-hidden")||"true"!=e.getAttribute("aria-hidden")||e.className&&e.className.indexOf&&-1!==e.className.indexOf("fallback-image"))}e.exports=function(e,r={}){"function"==typeof r&&(r={visibilityChecker:r}),r=Object.assign({minScore:20,minContentLength:140,visibilityChecker:i},r);var o=e.querySelectorAll("p, pre, article"),a=e.querySelectorAll("div > br");if(a.length){var s=new Set(o);[].forEach.call(a,function(e){s.add(e.parentNode)}),o=Array.from(s)}var l=0;return[].some.call(o,function(e){if(!r.visibilityChecker(e))return!1;var i=e.className+" "+e.id;if(t.test(i)&&!n.test(i)||e.matches("li p"))return!1;var o=e.textContent.trim().length;return!(o<r.minContentLength)&&(l+=Math.sqrt(o-r.minContentLength))>r.minScore})}},238:function(e){function t(e,t){if(t&&t.documentElement)e=t,t=arguments[2];else if(!e||!e.documentElement)throw Error("First argument to Readability constructor should be a document object.");if(t=t||{},this._doc=e,this._docJSDOMParser=this._doc.firstChild.__JSDOMParser__,this._articleTitle=null,this._articleByline=null,this._articleDir=null,this._articleSiteName=null,this._attempts=[],this._debug=!!t.debug,this._maxElemsToParse=t.maxElemsToParse||this.DEFAULT_MAX_ELEMS_TO_PARSE,this._nbTopCandidates=t.nbTopCandidates||this.DEFAULT_N_TOP_CANDIDATES,this._charThreshold=t.charThreshold||this.DEFAULT_CHAR_THRESHOLD,this._classesToPreserve=this.CLASSES_TO_PRESERVE.concat(t.classesToPreserve||[]),this._keepClasses=!!t.keepClasses,this._serializer=t.serializer||function(e){return e.innerHTML},this._disableJSONLD=!!t.disableJSONLD,this._flags=this.FLAG_STRIP_UNLIKELYS|this.FLAG_WEIGHT_CLASSES|this.FLAG_CLEAN_CONDITIONALLY,this._debug){let e=function(e){if(e.nodeType==e.TEXT_NODE)return`${e.nodeName} ("${e.textContent}")`;let t=Array.from(e.attributes||[],function(e){return`${e.name}="${e.value}"`}).join(" ");return`<${e.localName} ${t}>`};this.log=function(){if("undefined"!=typeof dump){var t=Array.prototype.map.call(arguments,function(t){return t&&t.nodeName?e(t):t}).join(" ");dump("Reader: (Readability) "+t+"\n")}else if("undefined"!=typeof console){let t=Array.from(arguments,t=>t&&t.nodeType==this.ELEMENT_NODE?e(t):t);t.unshift("Reader: (Readability)"),console.log.apply(console,t)}}}else this.log=function(){}}t.prototype={FLAG_STRIP_UNLIKELYS:1,FLAG_WEIGHT_CLASSES:2,FLAG_CLEAN_CONDITIONALLY:4,ELEMENT_NODE:1,TEXT_NODE:3,DEFAULT_MAX_ELEMS_TO_PARSE:0,DEFAULT_N_TOP_CANDIDATES:5,DEFAULT_TAGS_TO_SCORE:"SECTION,H2,H3,H4,H5,H6,P,TD,PRE".split(","),DEFAULT_CHAR_THRESHOLD:500,REGEXPS:{unlikelyCandidates:/-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,okMaybeItsACandidate:/and|article|body|column|content|main|shadow/i,positive:/article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,negative:/-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,extraneous:/print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,byline:/byline|author|dateline|writtenby|p-author/i,replaceFonts:/<(\/?)font[^>]*>/gi,normalize:/\s{2,}/g,videos:/\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,shareElements:/(\b|_)(share|sharedaddy)(\b|_)/i,nextLink:/(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,prevLink:/(prev|earl|
|
|
|
|
|
${n.cssText}
|
|
|
|
|
}`;a.appendChild(document.createTextNode(o)),r=!0}r&&(t.className=s,t.appendChild(a))}(c,u,h)),function(e){let t=window.location.href;for(let n of["href","src"]){let i=e.getAttribute(n),r=(null==i?void 0:i.startsWith("http"))?void 0:i;if(r){let i=new URL(r,t).href;e.setAttribute(n,i)}}}(u),d=c,f=u,(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&f.setAttribute("value",d.value),(g=u)instanceof SVGElement&&(g.setAttribute("xmlns","http://www.w3.org/2000/svg"),["width","height"].forEach(function(e){let t=g.getAttribute(e);!t||g.style.getPropertyValue(e)||g.style.setProperty(e,t)}))),u):null})},t.isSVGElement=l;let r=n(113),o=n(132),a=["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"].map(e=>e.toLowerCase()),s=["script"].map(e=>e.toLowerCase());function l(e){return!!e&&!!e.tagName&&a.includes(e.tagName.toLowerCase())}},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tokenize=function(e){var t,g;return t=function(e){for(;h();)switch(f(c)){case 0:r(function(e){for(;!f(i(u,l));)h();return d(e,l)}(l-1),e);break;case 2:var t;r(d(l-1,function e(t){for(;h();)switch(c){case t:return l;case 34:case 39:34!==t&&39!==t&&e(c);break;case 40:41===t&&e(t);break;case 92:h()}return l}(91===(t=c)?t+2:40===t?t+1:t)).trim(),e);break;default:r(n(c),e)}return e}((g=e,o=a=1,s=(u=g).length,l=0,[])),u="",t};let n=String.fromCharCode;function i(e,t){return 0|e.charCodeAt(t)}function r(e,t){return t.push(e),e}let o=1,a=1,s=0,l=0,c=0,u="";function h(){return c=l<s?i(u,l++):0,a++,10===c&&(a=1,o++),c}function d(e,t){return u.slice(e,t)}function f(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 42:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}},399:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.toJpeg=function(e,t){return t.raster=!0,f(e,t).then(function(e){return null==e?void 0:e.toDataURL("image/jpeg",t.quality||1)})},t.toBlob=function(e,t){return t.raster=!0,f(e,t).then(e=>e&&(0,l.canvasToBlob)(e))},t.toCanvas=function(e,t){return t.raster=!0,f(e,t)},t.toPixelData=function(e,t){return(t=t||{}).raster=!0,f(e,t).then(function(t){var n;return null==(n=null==t?void 0:t.getContext("2d"))?void 0:n.getImageData(0,0,(0,l.width)(e),(0,l.height)(e)).data})},t.toPng=function(e,t){return t.raster=!0,f(e,t).then(function(e){return null==e?void 0:e.toDataURL()})},t.toSvg=d,t.getInlinedNode=h;let r=n(900),o=n(113),a=n(536),s=n(307),l=n(132),c=n(707),u={inlineOptions:{}};function h(e,t){return i(this,void 0,void 0,function*(){let{fonts:n,images:i,stylesheets:o,inlineImages:l}=t.inlineOptions||{};o&&(yield(0,c.inlineStylesheets)(t.fetchOptions));let u=getComputedStyle(document.documentElement),h=o?yield(0,c.cacheStylesheets)(u):void 0,d=yield(0,r.cloneNode)(e,{styles:t.styles,filter:t.filter,root
|
|
|
|
|
${o}`})},t.clipArticle=function(e,t){return i(this,void 0,void 0,function*(){let{body:n,head:i}=yield _(e,t);if(!n||!i)return null;let o=y(i,n),a=new r.Readability(o);a.PRESENTATIONAL_ATTRIBUTES=["align","background","bgcolor","border","cellpadding","cellspacing","frame","hspace","rules","valign","vspace"];let s=a.parse();return`<!DOCTYPE html><html>${(null==i?void 0:i.outerHTML)||""}<body>${(null==s?void 0:s.content)||""}</body></html>`})},t.cleanup=v,t.clipScreenshot=function(e){return i(this,arguments,void 0,function*(e,t="jpeg",n){let i=e||document.body,r="jpeg"===t?s.toJpeg:"png"===t?s.toPng:s.toBlob,o=yield r(i,{quality:1,backgroundColor:"white",width:document.body.scrollWidth,height:document.body.scrollHeight,fetchOptions:b(n),inlineOptions:{fonts:!0,images:!0,stylesheets:!0},styles:!0});return"jpeg"===t||"png"===t?`<img width="${document.body.scrollWidth}px" height="${document.body.scrollHeight}px" src="${o}" />`:o})},t.enterNodeSelectionMode=function(e,t){let n;return setTimeout(()=>{e.body.addEventListener("click",p),e.body.addEventListener("mouseout",m),e.body.addEventListener("mouseover",g)},0),n=`.${l} {
|
|
|
|
|
border: 1px solid green;
|
|
|
|
|
background-color: rgb(0,0,0,0.05);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.${c} {
|
|
|
|
|
border: 2px solid green;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.${u} {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0px;
|
|
|
|
|
right: 0px;
|
|
|
|
|
z-index: ${Number.MAX_VALUE};
|
|
|
|
|
}`,(0,o.injectCss)(n,"nn-clipper-styles"),new Promise((e,n)=>{var r,o;let l;r=()=>i(this,void 0,void 0,function*(){v();let n=document.querySelectorAll(`.${c}`),i=document.createElement("div");for(let e of n){e.classList.remove(c);let n=yield(0,s.getInlinedNode)(e,{raster:!1,fetchOptions:b(t),inlineOptions:Object.assign(Object.assign({},d),{images:null==t?void 0:t.images,inlineImages:null==t?void 0:t.inlineImages})});n&&i.appendChild(n)}e(null==i?void 0:i.outerHTML)}),o=()=>n("Cancelled."),(l=document.createElement("div")).classList.add(u),setTimeout(()=>{document.body.appendChild(l)},0),(0,a.app)({init:{isClipping:!1},view:({isClipping:e})=>(0,a.h)("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"5px",boxShadow:"0px 0px 10px 0px #00000038"}},[(0,a.h)("p",{style:{marginBottom:"0px",fontSize:"18px"}},[(0,a.text)("Notesnook Web Clipper")]),(0,a.h)("p",{style:{margin:"0px",marginBottom:"5px",fontStyle:"italic"}},[e?(0,a.text)("Clipping selected elements. Please wait..."):(0,a.text)("Click on any element to select it.")]),(0,a.h)("div",{style:{display:"flex",alignItems:"center"}},[(0,a.h)("button",{onclick:e=>[Object.assign(Object.assign({},e),{isClipping:!0}),e=>{null==r||r(),e({isClipping:!1})}],style:{marginRight:"5px"},disabled:e},[e?(0,a.text)("Clipping..."):(0,a.text)("Clip")]),(0,a.h)("button",{onclick:e=>(v(),null==o||o(),e),disabled:e},[(0,a.text)("Cancel")])])]),node:l})})};let r=n(396),o=n(132),a=n(673),s=n(399),l="nn-node-selection--hover",c="nn-node-selection--selected",u="nn-node-selection-container",h=[c,u],d={fonts:!1,images:!1,stylesheets:!0};function f(e){for(let t of h)if(e.classList.contains(t)||e.closest(`.${t}`))return!1;return!0}let g=e=>{let t=e.target;!t.classList.contains(l)&&f(t)&&t.classList.add(l)},m=e=>{let t=e.target;t.classList.contains(l)&&t.classList.remove(l)},p=e=>{e.preventDefault();let t=e.target;t.classList.contains(c)?t.classList.remove(c):f(t)&&t.classList.add(c)};function y(e,t){let n=document.implementation.createHTMLDocument();return n.documentElement.replaceChildren(e,t),n}function v(){setTimeout(()=>{var e;document.querySelectorAll(`.${c}`).forEach(e=>{e instanceof HTMLElement&&e.classList.remove(c)}),document.querySelectorAll(`.${u}`).forEach(e=>e.remove()),(e=document).body.removeEventListener("mouseout",m),e.body.removeEventListener("mouseover",g),document.body.removeEventListener("click",p)},0)}function _(e,t){return i(this,arguments,void 0,function*(e,t,n=!1){let i=yield(0,s.getInlinedNode)(e.body,{raster:!0,fetchOptions:b(t),inlineOptions:{fonts:!1,inlineImages:null==t?void 0:t.inlineImages,images:null==t?void 0:t.images,stylesheets:null==t?void 0:t.styles},styles:null==t?void 0:t.styles,filter:e=>{var t;let i,r,o,a,s,l,c,u,h,d,f,g,m,p,y,v;return!n||(((t=e).nodeType===Node.TEXT_NODE||!t.getBoundingClientRect)&&t.parentElement&&(t=t.parentElement),(i={isInViewport:!1,isPartiallyInViewport:!1,isInsideViewport:!1,isAroundViewport:!1,isOnEdge:!1,isOnTopEdge:!1,isOnRightEdge:!1,isOnBottomEdge:!1,isOnLeftEdge:!1},r=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight,a=window.innerWidth||document.documentElement.clientWidth,s=r.left>=0&&r.left+r.width<=a,l=r.top>=0&&r.top+r.height<=o,i.isInsideViewport=s&&l,c=r.left<0&&r.left+r.width>a,u=r.top<0&&r.top+r.height>o,i.isAroundViewport=c&&u,h=r.top<0&&r.top+r.height>0,d=r.left<a&&r.left+r.width>a,f=r.left<0&&r.left+r.width>0,g=r.top<o&&r.top+r.height>o,m=l||u||h||g,p=s||c||f||d,i.isOnTopEdge=h&&p,i.isOnRightEdge=d&&m,i.isOnBottomEdge=g&&p,i.isOnLeftEdge=f&&m,i.isOnEdge=i.isOnLeftEdge||i.isOnRightEdge||i.isOnTopEdge||i.isOnBottomEdge,y=s||c||i.isOnLeftEdge||i.isOnRightEdge,v=l||u||i.isOnTopEdge||i.isOnBottomEdge,i.isInViewport=y&&v,i.isPartiallyInViewport=i.isInViewport&&i.isOnEdge,i).isInViewport)}});if(!i)return{};let r=e.createElement("head"),o=e.createElement("title");return o.innerText=e.title,r.appendChild(o),{body:i,head:r}})}function b(e){return(null==e?void 0:e.corsProxy)?{bypassCors:!0,corsHost:e.corsProxy,crossOrigin:"anonymous",noCache:!0}:void 0}},812:function(e,t,n){"u
|