1var MMCQ,PriorityQueue;!function(e,t,s,o){var n="textareaAutoSize",a="plugin_"+n;function i(t,s){this.element=t,this.$element=e(t),this.init()}i.prototype={init:function(){this.$element.outerHeight();var s=parseInt(this.$element.css("paddingBottom"))+parseInt(this.$element.css("paddingTop"))||0;this.element.value.replace(/\s/g,"").length>0&&this.$element.height(this.element.scrollHeight-s),this.$element.on("input keyup",function(o){var n=e(t),a=n.scrollTop();e(this).height(0).height(this.scrollHeight-s),n.scrollTop(a)})}},e.fn[n]=function(t){return this.each(function(){e.data(this,a)||e.data(this,a,new i(this,t))}),this}}(jQuery,window,document),function(e){var t=function(){return e("html").hasClass("editmode")},s=function(e,t,s){var o;return function(){var n=this,a=arguments,i=s&&!o;clearTimeout(o),o=setTimeout(function(){o=null,s||e.apply(n,a)},t),i&&e.apply(n,a)}};e(".mobile-menu-toggler").click(function(t){t.preventDefault(),e("html").toggleClass("mobilemenu-open"),e("html").removeClass("menu-language-popover-open"),e("body").removeClass("mobilesearch-open"),e("#mobile-menu").removeClass("reset-touch").addClass("reset-touch")}),e(".tags-toggle").click(function(){e(this).find(".ico-arrow").toggleClass("active"),e(".tags-bottom").toggleClass("visible")}),e(".js-toggle-sub-menu").click(function(){e("#mobile-menu").removeClass("reset-touch").addClass("reset-touch"),e(this).toggleClass("active"),e(this).parent("li").toggleClass("current-parent")}),e(".mobile-menu-close").on("click",function(){event.preventDefault(),e("html").hasClass("menu-language-popover-open")?e("html").removeClass("menu-language-popover-open"):e("html").removeClass("mobilemenu-open")}),e(".js-lang-menu-btn").on("click",function(){e("html").removeClass("search-open"),e(".js-search").removeClass("active"),e("html").hasClass("menu-language-popover-open")?e("html").removeClass("menu-language-popover-open"):(r(e(this)),e("html").addClass("menu-language-popover-open"))});var o,n,a,i,r=function(t){var s=e("html").hasClass("language-flags-disabled")?t.find(".js-lang-title-inner"):t,o=e("html").hasClass("language-flags-disabled")?5:9;e(".js-popup-menu-popover").css({top:s.offset().top+s.outerHeight()-e(".site-container").offset().top,right:e(window).width()-s.offset().left-s.outerWidth()-o})},l=function(){var t=e("html"),s=e(".js-menu-language-settings");e(window).width()<=1024&&0===s.closest(".js-menu-main-mobile").length?s.appendTo(".js-menu-main-mobile"):e(window).width()>1024&&0===s.closest(".js-menu-main-desktop").length&&(t.hasClass("language-menu-mode-list")?(s.appendTo(".js-menu-language-list-setting-parent"),r(e(".js-lang-menu-btn"))):(s.appendTo(".js-menu-language-popover-setting-parent"),r(e(".js-lang-menu-btn"))))},c=function(t,s){s>.6?e(t).find(".js-background-type").addClass("light-background").removeClass("dark-background"):e(t).find(".js-background-type").addClass("dark-background").removeClass("light-background")},g=function(t,s){return function(t,s){if(t&&s){"string"==typeof t&&(t=t.replace(/rgba?\(/,"").replace(/\)/,"").split(","),e.each(t,function(e,s){t[e]=+s})),"string"==typeof s&&(s=s.replace(/rgba?\(/,"").replace(/\)/,"").split(","),e.each(s,function(e,t){s[e]=+t})),"object"==typeof t&&t.hasOwnProperty("length")&&3==t.length&&t.push(1),"object"==typeof s&&s.hasOwnProperty("length")&&3==s.length&&s.push(1);var o=[0,0,0,0];return o[3]=1-(1-s[3])*(1-t[3]),0===o[3]&&(o[3]=1e-6),o[0]=Math.min(s[0]*s[3]/o[3]+t[0]*t[3]*(1-s[3])/o[3],255),o[1]=Math.min(s[1]*s[3]/o[3]+t[1]*t[3]*(1-s[3])/o[3],255),o[2]=Math.min(s[2]*s[3]/o[3]+t[2]*t[3]*(1-s[3])/o[3],255),e.map(o,function(e){return Math.floor(e)})}}(t||[255,255,255,1],s||[255,255,255,1])},d=function(e,t){var s=g(e,t);return Math.round((.2126*+s[0]+.7152*+s[1]+.0722*+s[2])/2.55)/100},u=function(){var t=e(".main-content");if(e("html").hasClass("comments-open")){var s=e(document).outerHeight(),o=e(".js-site-header").outerHeight(),n=e(".article-comments"),a=n.outerHeight(),i=e(".site-footer").outerHeight();n.css("min-height",s-o),t.css("min-height",a-i),e("html, body").animate({scrollTop:e(".js-comments").offset().top},300)}else t.removeAttr("style")},h=function(){e(".article-comments").removeAttr("style");
1e(document).height(),e(".site-container").height(),e(".article-comments").height();var t=parseInt(e(".article-comments").css("padding-top")),s=parseInt(e(".article-comments").css("padding-bottom")),o=e(".page-content").height(),n=e(".site-header").height(),a=o+n+e(".site-footer").height()-n-t-s;e(window).width()>480&&e(".article-comments").css("min-height",a)},m=function(t){if(e(".js-type-btn").removeClass("is-active"),t.addClass("is-active"),"photo-article"==t.data("article-type")){e(".js-article-title").prependTo(".js-article-header-title-wrap"),e(".js-text-article-component").addClass("is-hidden"),e(".js-photo-article-component").removeClass("is-hidden"),e(".js-site-header").addClass("photo-article"),e(".js-site-header .js-background-settings").removeClass("is-hidden");var s=e(".js-site-header .js-background-type").data("article-bg-type");e(".js-site-header .js-background-type").removeClass("dark-background light-background").addClass(s),Edicy.articles.currentArticle.setData("photo_article_state",!0)}else{e(".js-article-title").prependTo(".js-article-body-title-wrap"),e(".js-photo-article-component").addClass("is-hidden"),e(".js-text-article-component").removeClass("is-hidden"),e(".js-site-header").removeClass("photo-article"),e(".js-site-header .js-background-settings").addClass("is-hidden");s=e(".js-site-header .js-background-type").data("blog-bg-type");e(".js-site-header .js-background-type").removeClass("dark-background light-background").addClass(s),Edicy.articles.currentArticle.setData("photo_article_state",!1)}},p=function(){e(window).width()<=640?e(".js-voog-search-modal").css("max-height",e(window).height()-56):e(".js-voog-search-modal").css("max-height","auto")};window.site=e.extend(window.site||{},{bgPickerPreview:function(t,s,o,n){var a=e(t).find(".js-background-image").css("background-image"),i=s.imageSizes?function(e,t){for(var s,o=0,n=e.length;o<n;o++){if(e[o].width<t)return s||e[o];s=e[o]}return e[e.length-1]}(s.imageSizes,e(window).width()):null,r=s.image&&""!==s.image?"url("+i.url+")":"none",l=s.imageSizes&&""!==s.imageSizes?s.imageSizes:null,g=s.color&&""!==s.color?s.color:"rgba(0,0,0,0)",u=(s.colorData&&""!==s.colorData&&s.colorData.lightness,e("<img>")),h=e("<canvas>"),m=s.image&&""!==s.image?s.image:null;m?function(e,t){for(var s=e.length;s--;)if(t.indexOf(e[s].url.trim())>-1)return!0;return!1}(l,a)?(o.imageColor=o.imageColor?o.imageColor:n,o.combinedLightness=d(o.imageColor,g),c(t,o.combinedLightness)):(u.attr("src",m.replace(/.*\/(photos|voogstock)/g,"/photos")),u.on("load",function(){ColorExtract.extract(u[0],h[0],function(e){o.imageColor=e.bgColor?e.bgColor:"rgba(255,255,255,1)",o.combinedLightness=d(o.imageColor,g),c(t,o.combinedLightness)})})):(o.imageColor="rgba(255,255,255,1)",o.combinedLightness=d(o.imageColor,g),c(t,o.combinedLightness)),"articlePage"===pageType&&t.hasClass("site-header")?e("#preview-style").html(".photo-article.site-header .js-background-image { background-image: "+r+" }
1 .photo-article.site-header .js-background-color { background-color: "+g+" }"):(e(t).find(".js-background-image").css({"background-image":r}),e(t).find(".js-background-color").css({"background-color":g}))},bgPickerCommit:function(t,s,o,n){var a,i=e.extend(!0,{},s);i.image=s.image||"",i.imageSizes=null==(a=s.imageSizes)||"string"==typeof a&&a.match(/^[\\'"]+$/)?"":a,i.color=s.color||"",i.combinedLightness=o.combinedLightness,"articlePage"===n?"footer_bg"==t?siteData.set(t,i):Edicy.articles.currentArticle.setData(t,i):"contentPage"===n&&"footer_bg"===t||"body_bg"===t?siteData.set(t,i):pageData.set(t,i)},bgPickerColorScheme:function(t){void 0!==t&&(t>.6?e(".header-wrapper").addClass("light").removeClass("dark"):e(".header-wrapper").addClass("dark").removeClass("light"))},initWindowResize:function(){e(window).resize(s(function(){h(),p(),l(),e(".js-menu-language-settings-popover").hide()},100)),e(window).resize(s(function(){e("html").removeClass("menu-language-popover-open"),e(".js-menu-language-settings-popover").hide(),e(".js-menu-language-settings-toggle").removeClass("edy-cbtn-active")},25))},initBlogPage:function(){},initArticlePage:function(){h(),e("html").hasClass("js-calculate-comments-height")&&u()},initCommonPage:function(){},initFrontPage:function(){},bindLanguageMenuSettings:function(t){"type"in t||(t.type="popover"),"item_state"in t||(t.item_state="flags_and_names");new Edicy.SettingsEditor(e(".js-menu-language-settings-toggle").get(0),{menuItems:[{titleI18n:"format_desktop_only",type:"radio",key:"type",list:[{titleI18n:"dropdown_menu",value:"popover"},{titleI18n:"expanded_menu",value:"list"}]},{titleI18n:"show",type:"radio",key:"item_state",list:[{titleI18n:"flags_only",value:"flags_only"},{titleI18n:"names_only",value:"names_only"},{titleI18n:"flags_and_names",value:"flags_and_names"}]}],buttonTitleI18n:"settings",values:t,containerClass:["js-menu-language-settings-popover","js-prevent-sideclick"],preview:function(t){var s=e("html");e(".js-menu-language-settings"),"list"===t.type?(s.removeClass("language-menu-mode-popover"),s.removeClass("menu-language-popover-open"),s.addClass("language-menu-mode-list")):(s.removeClass("language-menu-mode-list"),s.addClass("language-menu-mode-popover"),s.addClass("menu-language-popover-open")),"flags_only"===t.item_state?(s.removeClass("language-flags-disabled"),s.removeClass("language-names-enabled"),s.addClass("language-flags-enabled"),s.addClass("language-names-disabled")):"names_only"===t.item_state?(s.removeClass("language-flags-enabled"),s.removeClass("language-names-disabled"),s.addClass("language-flags-disabled"),s.addClass("language-names-enabled")):"flags_and_names"===t.item_state&&(s.removeClass("language-flags-disabled"),s.removeClass("language-names-disabled"),s.addClass("language-flags-enabled"),s.addClass("language-names-enabled")),l(),this.setPosition()},commit:function(e){siteData.set("settings_language_menu",e)}});l()},initItemsPage:function(){t()||(e(document).ready(function(){setTimeout(function(){e(".js-content-item-box").addClass("not-loaded")},3e3)}),e(".js-lazyload").lazyload({threshold:500,effect:"fadeIn",placeholder:"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",load:function(){var t=e(this).closest(".js-content-item-box");t.removeClass("not-loaded with-error").addClass("is-loaded"),setTimeout(function(){t.removeClass("not-loaded with-error"),t.find(".js-loader").remove()},3e3)}}))},bindContentItemImgDropAreas:function(t){e(".js-content-item-img-drop-area").each(function(s,o){var n=e(o),a=n.closest(".js-content-item-box"),i=a.data("item-id"),r=a.data("item-type");new Edicy.CustomData({type:r,id:i}),new Edicy.ImgDropArea(n,{positionable:!1,target_width:1280,placeholder:'<div class="edy-img-drop-area-placeholder">'+t+"</div>",removeBtn:'<div class="edy-img-drop-area-remove-image"><div class="edy-img-drop-area-remove-image-ico"><svg width="16" height="20" viewBox="0 0 26 30" xmlns="http://www.w3.org/2000/svg"><g fill-rule="nonzero" fill="currentColor"><g transform="translate(2 5)"><path d="M0 .997h2V21c0 1 1 2 2 2h14c1 0 2-1 2-2V1h2v20c0 2.25-1.75 4-4 4H4c-2.25 0-4-1.75-4-4V.997z"/><rect x="10" y="4" width="2" height="16" rx="1"/><rect x="5" y="4" width="2" height="16" rx="1"/><rect x="15" y="4" width="2" height="16" rx="1"/></g>
1<path d="M26 4v2H0V4h7V2c0-1 1-2 2-2h8c1 0 2 1 2 2v2h7zM9 4h8V3c0-.5-.5-1-1-1h-6c-.5 0-1 .5-1 1v1z"/></g></svg></div></div>',change:function(t){var s,o,l,c,g,d,u,h,m,p,f,v,b;n.removeClass("is-cropped").addClass("not-cropped").css("opacity",.1),t?(s=t.original_id,a.removeClass("without-image is-loaded with-error").addClass("with-image not-loaded"),o=a,l=t.width,c=t.height,g=o.find(".js-content-item-img-drop-area"),d=o.find(".js-toggle-crop-state"),l>c?g.removeClass("image-landscape image-square image-portrait").addClass("image-landscape"):l===c?g.removeClass("image-landscape image-square image-portrait").addClass("image-square"):g.removeClass("image-landscape image-square image-portrait").addClass("image-portrait"),g.hasClass("image-square")?d.removeClass("is-visible").addClass("is-hidden"):d.removeClass("is-hidden").addClass("is-visible")):(s=null,a.removeClass("with-image is-loaded with-error").addClass("without-image not-loaded"),a.find(".edy-img-drop-area-placeholder").css("opacity",0)),u=a,h=n,m=i,p=s,v="article"===(f=r)?"articles":"pages",b=new Edicy.CustomData({type:f,id:m}),e.ajax({type:"PATCH",contentType:"application/json",url:"/admin/api/"+v+"/"+m,data:JSON.stringify({image_id:p}),dataType:"json",success:function(e){b.set("image_crop_state","not-cropped"),u.removeClass("not-loaded with-error").addClass("is-loaded"),u.find(".edy-img-drop-area-placeholder").css("opacity",1),h.css("opacity",1)},timeout:3e4,error:function(e){u.removeClass("not-loaded is-loaded with-error").addClass("with-error")}})}})})},bindContentItemImageCropToggle:function(){e(".js-toggle-crop-state").on("click",function(){var t,s=e(this).closest(".js-content-item-box"),o=s.find(".js-content-item-img-drop-area"),n=s.data("item-id"),a=s.data("item-type"),i=new Edicy.CustomData({type:a,id:n});o.hasClass("is-cropped")?(o.removeClass("is-cropped").addClass("not-cropped"),t="not-cropped"):(o.removeClass("not-cropped").addClass("is-cropped"),t="is-cropped"),i.set("image_crop_state",t)})},bindRootItemSettings:function(t){"show_product_related_pages_in_main_menu"in t||(t.show_product_related_pages_in_main_menu=!1),e(".js-root-item-settings-toggle").each(function(s,o){new Edicy.SettingsEditor(o,{menuItems:[{titleI18n:"show_in_main_menu",type:"checkbox",key:"show_product_related_pages_in_main_menu",states:{on:!0,off:!1}}],buttonTitleI18n:"settings",values:t,containerClass:["js-root-item-settings-popover","js-prevent-sideclick"],preview:function(t){1==!t.show_product_related_pages_in_main_menu?e(".js-menu-item-products").addClass("is-hidden"):e(".js-menu-item-products").removeClass("is-hidden")},commit:function(e){siteData.set("settings_root_item",e)}})})},bindSiteSearch:function(t,s,o){t&&new VoogSearch(t,{per_page:10,lang:s,resultsContainer:e(".js-voog-search-modal").get(0),sideclick:!0,mobileModeWidth:640,updateOnKeypress:!0,noResults:o})}}),window.site=e.extend(window.site||{},{}),e(".site-container").on("mousedown",function(t){e(t.target).closest(".js-prevent-sideclick").length||(e(".js-btn").hasClass("open")&&e(".js-btn").removeClass("open"),e(".js-popover").hasClass("expanded")&&e(".js-popover").removeClass("expanded"),e(".js-search").hasClass("active")&&(e(".js-search").removeClass("active"),e(".search-btn").removeClass("open")),e("html").hasClass("mobilemenu-open")&&e(".mobile-menu-toggler").trigger("click"),e("html").hasClass("menu-language-popover-open")&&e("html").removeClass("menu-language-popover-open"),e("html").hasClass("comments-open")&&(e("html").removeClass("comments-open"),e(".js-comments-toggle-btn, .js-comments").removeClass("open")),e("html").hasClass("search-open")&&e("html").removeClass("search-open"),u())}),e(".js-menu-btn").click(function(){e(this).toggleClass("open"),e(".js-menu-main").toggleClass("expanded")}),e(".js-menu-lang-btn").click(function(){e(".js-menu-lang-btn").toggleClass("open"),e(".js-menu-lang").toggleClass("expanded")}),e(".js-tags-btn").click(function(){e(this).toggleClass("open"),e(".js-menu-tags").toggleClass("expanded")}),e(".js-search-toggle-btn").click(function(){e("html").removeClass("mobilemenu-open"),e("html").removeClass("menu-language-popover-open"),e(".js-search").toggleClass("active"),e(".js-search").hasClass("active")&&e(".js-search-input").focus(),e("html").toggleClass("search-open")}),e(".js-search-input").on("input",function(){var t=e(this).parent().next();e(this).val().length>1?t.addClass("active"):t.removeClass("active"),p()}),e(".js-search-reset-btn").click(function(){e("html").removeClass("search-open"),e(".js-search").removeClass("active")}),e(".js-comments-toggle-btn").click(function(){e(this).toggleClass("open"),e(".js-comments").toggleClass("open"),e("html").toggleClass("comments-open"),e(".js-comments-input").val("").focus(),e(window).width()>640&&u()}),e(".submenu-load-more-lvl1").click(function(){e(this).addClass("open"),e(this).next().addClass("open"),e(this).next().next().addClass("open")}
1),e(".submenu-close-lvl1").click(function(){e(this).removeClass("open"),e(this).prev().removeClass("open"),e(this).next().removeClass("open")}),e(".submenu-load-more-lvl2").click(function(){e(this).addClass("open"),e(this).next().addClass("open"),e(this).next().next().addClass("open")}),e(".submenu-close-lvl2").click(function(){e(this).removeClass("open"),e(this).prev().removeClass("open"),e(this).next().removeClass("open")}),e(".js-type-btn").click(function(){m(e(this))}),e(".publicmode .js-slide-to-article").click(function(){e("html, body").animate({scrollTop:e(".page-content").offset().top},300)}),e("body:not(.editmode) table").each(function(){e(this).wrap('<div class="table-holder" />')}),e(document).ready(function(){e(".comment-form").hasClass("form_with_errors")?e("html, body").scrollTop(e(".comment-form").offset().top):e("form").find(".form_error, .form_notice").length>0&&e("html, body").scrollTop(e(".form_error, .form_notice").closest("form").offset().top)}),document.addEventListener("edicy:customstyles:change",function(t){Object.keys(t.detail.changes).indexOf("--header-background-color")>-1&&(void 0===t.detail.changes["--header-background-color"].value?(e("body").removeClass("header-top-with-bg"),siteData.remove("has_header_bg_color")):(e("body").addClass("header-top-with-bg"),siteData.set("has_header_bg_color",!0)))}),!Modernizr.flexbox&&t()&&(o=e(".js-header-top-wrap").width(),n=e(".js-header-right"),a=n.width(),i=parseInt(n.css("margin-left"))+1,e(".js-header-left").css("min-width",o-a-i))}(jQuery),PriorityQueue=function(){function e(e){this.comparator=e,this.contents=[],this.sorted=!1}return e.prototype.sort=function(){return this.contents.sort(this.comparator),this.sotred=!0},e.prototype.push=function(e){return this.contents.push(e),this.sorted=!1},e.prototype.peek=function(e){return null==e&&(e=this.contents.length-1),this.sorted||this.sort(),this.contents[e]},e.prototype.pop=function(){return this.sorted||this.sort(),this.contents.pop()},e.prototype.size=function(){return this.contents.length},e.prototype.map=function(e){return this.contents.map(e)},e}(),MMCQ=function(){var e,t,s,o,n,a;function i(){this.maxIterations=1e3,this.fractByPopulations=.75}return i.sigbits=5,i.rshift=8-i.sigbits,o=function(e,t,s){return(e<<2*i.sigbits)+(t<<i.sigbits)+s},e=function(){function e(e,t,s,o,n,a,i){this.r1=e,this.r2=t,this.g1=s,this.g2=o,this.b1=n,this.b2=a,this.histo=i}return e.prototype.volume=function(e){return this._volume&&!e||(this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1)),this._volume},e.prototype.count=function(e){var t,s,n,a,i,r,l,c,g,d,u;if(!this._count_set||e){for(a=0,i=r=this.r1,g=this.r2;r<=g;i=r+=1)for(s=l=this.g1,d=this.g2;l<=d;s=l+=1)for(t=c=this.b1,u=this.b2;c<=u;t=c+=1)n=o(i,s,t),a+=this.histo[n]||0;this._count_set=!0,this._count=a}return this._count},e.prototype.copy=function(){return new e(this.r1,this.r2,this.g1,this.g2,this.b1,this.b2,this.histo)},e.prototype.average=function(e){var t,s,n,a,r,l,c,g,d,u,h,m,p,f,v,b;if(!this._average||e){for(c=1<<8-i.sigbits,u=0,d=0,a=0,s=0,g=h=this.r1,f=this.r2;h<=f;g=h+=1)for(n=m=this.g1,v=this.g2;m<=v;n=m+=1)for(t=p=this.b1,b=this.b2;p<=b;t=p+=1)l=o(g,n,t),u+=r=this.histo[l]||0,d+=r*(g+.5)*c,a+=r*(n+.5)*c,s+=r*(t+.5)*c;this._average=u?[~~(d/u),~~(a/u),~~(s/u)]:[~~(c*(this.r1+this.r2+1)/2),~~(c*(this.g1+this.g2+1)/2),~~(c*(this.b1+this.b2+1)/2)]}return this._average},e.prototype.contains=function(e){var t,s,o;return o=e[0]>>i.rshift,s=e[1]>>i.rshift,t=e[2]>>i.rshift,this.r1<=o&&o<=this.r2&&this.g1<=s&&s<=this.g2&&this.b1<=t&&t<=this.b2},e}(),t=function(){function e(){this.cboxes=new PriorityQueue(function(e,t){var s,o;return(s=e.count()*e.volume())>(o=t.count()*t.volume())?1:s<o?-1:0})}return e.prototype.push=function(e){return this.cboxes.push({cbox:e,color:e.average()})},e.prototype.palette=function(){return this.cboxes.map(function(e){return e.color})},e.prototype.size=function(){return this.cboxes.size()},e.prototype.map=function(e){var t,s,o;for(t=s=0,o=this.cboxes.size();s<o;t=s+=1)return this.cboxes.peek(t).cbox.contains(e)?this.cboxes.peek(t).color:this.nearest(e)},e.prototype.cboxes=function(){return this.cboxes},e.prototype.nearest=function(e){var t,s,o,n,a,i,r;for(a=function(e){return e*e},o=1e9,s=i=0,r=this.cboxes.size();i<r;s=i+=1)(t=Math.sqrt(a(e[0]-this.cboxes.peek(s).color[0])+a(e[1]-this.cboxes.peek(s).color[1])+a(e[2]-this.cboxes.peek(s).color[2])))<o&&(o=t,n=this.cboxes.peek(s).color);return n},e}(),n=function(e){var t,s,n,a,r,l,c,g,d;for(a=1<<3*i.sigbits,n=new Array(a),g=0,d=e.length;g<d;g++)c=(l=e[g])[0]>>i.rshift,s=l[1]>>i.rshift,t=l[2]>>i.rshift,n[r=o(c,s,t)]=(n[r]||0)+1;return n},s=function(t,s){var o,n,a,r,l,c,g,d,u,h,m,p;for(h=1e6,u=0,c=1e6,l=0,a=1e6,n=0,m=0,p=t.length;m<p;m++)d=(g=t[m])[0]>>i.rshift,r=g[1]>>i.rshift,o=g[2]>>i.rshift,d<h?h=d:d>u&&(u=d),r<c?c=r:r>l&&(l=r),o<a?a=o:o>n&&(n=o);return new e(h,u,c,l,a,n,s)},a=function(e,t){var s,n,a,i,r,l,c,g,d,u,h,m,p,f,v,b,C,y,w,j,_,k,x,A,I,z,D,M,T,P;if(t.count()){if(1===t.count())return[t.copy()];if(u=t.r2-t.r1+1,r=t.g2-t.g1+1,n=t.b2-t.b1+1,c=Math.max(u,r,n),m=0,g=[],l=[],c===u)for(d=p=t.r1,k=t.r2;p<=k;d=p+=1){for(h=0,i=f=t.g1,D=t.g2;f<=D;i=f+=1)for(s=v=t.b1,M=t.b2;v<=M;s=v+=1)h+=e[o(d,i,s)]||0;m+=h,g[d]=m}else if(c===r)for(i=b=t.g1,T=t.g2;b<=T;i=b+=1){for(h=0,d=C=t.r1,P=t.r2;C<=P;d=C+=1)for(s=y=t.b1,x=t.b2;y<=x;s=y+=1)h+=e[o(d,i,s)]||0;m+=h,g[i]=m}else for(s=w=t.b1,A=t.b2;w<=A;s=w+=1){for(h=0,d=j=t.r1,I=t.r2;j<=I;d=j+=1)for(i=_=t.g1,z=t.g2;_<=z;i=_+=1)h+=e[o(d,i,s)]||0;m+=h,g[s]=m}return g.forEach(function(e,t){return l[t]=m-e}),a=function(e){var s,o,n,a,i,r,c,d,u,h,p;for(r=e+"2",c=h=t[i=e+"1"],p=t[r];h<=p;c=h+=1)if(g[c]>m/2){for(s=t.copy(),o=t.copy(),a=(d=c-t[i])<=(u=t[r]-c)?Math.min(t[r]-1,~~(c+u/2)):Math.max(t[i],~~(c-1-d/2));!g[a];)a++;for(n=l[a];!n&&g[a-1];)n=l[--a];return s[r]=a,o[i]=s[r]+1,[s,o]}},c===u?a("r"):c===r?a("g"):c===n?a("b"):void 0}},i.prototype.quantize=function(e,o){var i,r,l,c,g,d,u=this;if(!e.length||o<2||o>256)return console.log("invalid arguments"),!1;for(l=n(e),i=s(e,l),(g=new PriorityQueue(function(e,t){var s,o;return(s=e.count())>(o=t.count())?1:s<o?-1:0})).push(i),(c=function(e,t){var s,o,n,r,c;for(r=1,c=0;c<u.maxIterations;)if((i=e.pop()).count()){if(s=(n=a(l,i))[0],o=n[1],!s)return void console.log("cbox1 not defined; shouldn't happen");if(e.push(s),o&&(e.push(o),r++),r>=t)return;if(c++>u.maxIterations)return void console.log("infinite loop; perhaps too few pixels")}else e.push(i),c++})(g,this.fractByPopulations*o),d=new PriorityQueue(function(e,t){var s,o;return(s=e.count()*e.volume())>(o=t.count()*t.volume())?1:s<o?-1:0});g.size();)d.push(g.pop());for(c(d,o-d.size()),r=new t;d.size();)r.push(d.pop());return r},i}.call(this),function(){window.ColorExtract=function(){function e(){}return e.getColorMap=function(e,t,s,o,n,a){var i,r,l,c,g,d,u,h,m,p;for(null==a&&(a=8),l=e.getContext("2d").getImageData(t,s,o,n).data,c=[],d=u=s,m=s+n;u<m;d=u+=1)for(r=d*o*4,g=h=t,p=t+o;h<p;g=h+=1)i=r+4*g,c.push([l[i],l[i+1],l[i+2]]);return(new MMCQ).quantize(c,a)},e.colorDist=function(e,t){var s;return(s=function(e){return e*e})(e[0]-t[0])+s(e[1]-t[1])+s(e[2]-t[2])},e.extract=function(t,s,o){var n,a,i,r,l,c,g,d,u,h,m,p,f;for(s.width=25,s.height=25,s.getContext("2d").drawImage(t,0,0,s.width,s.height),(a=e.getColorMap(s,0,0,s.width,s.height,4).
1cboxes.map(function(e){return{count:e.cbox.count(),rgb:e.color}})).sort(function(e,t){return t.count-e.count}),n=a[0].rgb,(g=e.getColorMap(s,0,0,t.width,t.height,10).cboxes.map(function(e){return{count:e.cbox.count(),rgb:e.color}})).sort(function(e,t){return t.count-e.count}),d=0,h=0,p=g.length;h<p;h++)i=g[h],(r=e.colorDist(n,i.rgb))>d&&(d=r,l=i.rgb);for(d=0,m=0,f=g.length;m<f;m++)i=g[m],(r=e.colorDist(n,i.rgb))>d&&i.rgb!==l&&(d=r,c=i.rgb);return o({bgColor:(u=function(e){return"rgb("+e[0]+", "+e[1]+", "+e[2]+")"})(n),fgColor:u(l),fgColor2:u(c)})},e}()}.call(this);
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.