!function(i){i.fn.theiaStickySidebar=function(t){function e(t,e){var a=o(t,e);a||(console.log("TSS: Body width smaller than options.minWidth. Init is delayed."),i(document).on("scroll."+t.namespace,function(t,e){return function(a){var n=o(t,e);n&&i(this).unbind(a)}}(t,e)),i(window).on("resize."+t.namespace,function(t,e){return function(a){var n=o(t,e);n&&i(this).unbind(a)}}(t,e)))}function o(t,e){return t.initialized===!0||!(i("body").width()<t.minWidth)&&(a(t,e),!0)}function a(t,e){t.initialized=!0;var o=i("#theia-sticky-sidebar-stylesheet-"+t.namespace);0===o.length&&i("head").append(i('<style id="theia-sticky-sidebar-stylesheet-'+t.namespace+'">.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')),e.each(function(){function e(){a.fixedScrollTop=0,a.sidebar.css({"min-height":"1px"}),a.stickySidebar.css({position:"static",width:"",transform:"none"})}function o(t){var e=t.height();return t.children().each(function(){e=Math.max(e,i(this).height())}),e}var a={};if(a.sidebar=i(this),a.options=t||{},a.container=i(a.options.containerSelector),0==a.container.length&&(a.container=a.sidebar.parent()),a.sidebar.parents().css("-webkit-transform","none"),a.sidebar.css({position:a.options.defaultPosition,overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),a.stickySidebar=a.sidebar.find(".theiaStickySidebar"),0==a.stickySidebar.length){var s=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;a.sidebar.find("script").filter(function(i,t){return 0===t.type.length||t.type.match(s)}).remove(),a.stickySidebar=i("<div>").addClass("theiaStickySidebar").append(a.sidebar.children()),a.sidebar.append(a.stickySidebar)}a.marginBottom=parseInt(a.sidebar.css("margin-bottom")),a.paddingTop=parseInt(a.sidebar.css("padding-top")),a.paddingBottom=parseInt(a.sidebar.css("padding-bottom"));var r=a.stickySidebar.offset().top,d=a.stickySidebar.outerHeight();a.stickySidebar.css("padding-top",1),a.stickySidebar.css("padding-bottom",1),r-=a.stickySidebar.offset().top,d=a.stickySidebar.outerHeight()-d-r,0==r?(a.stickySidebar.css("padding-top",0),a.stickySidebarPaddingTop=0):a.stickySidebarPaddingTop=1,0==d?(a.stickySidebar.css("padding-bottom",0),a.stickySidebarPaddingBottom=0):a.stickySidebarPaddingBottom=1,a.previousScrollTop=null,a.fixedScrollTop=0,e(),a.onScroll=function(a){if(a.stickySidebar.is(":visible")){if(i("body").width()<a.options.minWidth)return void e();if(a.options.disableOnResponsiveLayouts){var s=a.sidebar.outerWidth("none"==a.sidebar.css("float"));if(s+50>a.container.width())return void e()}var r=i(document).scrollTop(),d="static";if(r>=a.sidebar.offset().top+(a.paddingTop-a.options.additionalMarginTop)){var c,p=a.paddingTop+t.additionalMarginTop,b=a.paddingBottom+a.marginBottom+t.additionalMarginBottom,l=a.sidebar.offset().top,f=a.sidebar.offset().top+o(a.container),h=0+t.additionalMarginTop,g=a.stickySidebar.outerHeight()+p+b<i(window).height();c=g?h+a.stickySidebar.outerHeight():i(window).height()-a.marginBottom-a.paddingBottom-t.additionalMarginBottom;var u=l-r+a.paddingTop,S=f-r-a.paddingBottom-a.marginBottom,y=a.stickySidebar.offset().top-r,m=a.previousScrollTop-r;"fixed"==a.stickySidebar.css("position")&&"modern"==a.options.sidebarBehavior&&(y+=m),"stick-to-top"==a.options.sidebarBehavior&&(y=t.additionalMarginTop),"stick-to-bottom"==a.options.sidebarBehavior&&(y=c-a.stickySidebar.outerHeight()),y=m>0?Math.min(y,h):Math.max(y,c-a.stickySidebar.outerHeight()),y=Math.max(y,u),y=Math.min(y,S-a.stickySidebar.outerHeight());var k=a.container.height()==a.stickySidebar.outerHeight();d=(k||y!=h)&&(k||y!=c-a.stickySidebar.outerHeight())?r+y-a.sidebar.offset().top-a.paddingTop<=t.additionalMarginTop?"static":"absolute":"fixed"}if("fixed"==d){var v=i(document).scrollLeft();a.stickySidebar.css({position:"fixed",width:n(a.stickySidebar)+"px",transform:"translateY("+y+"px)",left:a.sidebar.offset().left+parseInt(a.sidebar.css("padding-left"))-v+"px",top:"0px"})}else if("absolute"==d){var x={};"absolute"!=a.stickySidebar.css("position")&&(x.position="absolute",x.transform="translateY("+(r+y-a.sidebar.offset().top-a.stickySidebarPaddingTop-a.stickySidebarPaddingBottom)+"px)",x.top="0px"),x.width=n(a.stickySidebar)+"px",x.left="",a.stickySidebar.css(x)}else"static"==d&&e();"static"!=d&&1==a.options.updateSidebarHeight&&a.sidebar.css({"min-height":a.stickySidebar.outerHeight()+a.stickySidebar.offset().top-a.sidebar.offset().top+a.paddingBottom}),a.previousScrollTop=r}},a.onScroll(a),i(document).on("scroll."+a.options.namespace,function(i){return function(){i.onScroll(i)}}(a)),i(window).on("resize."+a.options.namespace,function(i){return function(){i.stickySidebar.css({position:"static"}),i.onScroll(i)}}(a)),"undefined"!=typeof ResizeSensor&&new ResizeSensor(a.stickySidebar[0],function(i){return function(){i.onScroll(i)}}(a))})}function n(i){var t;try{t=i[0].getBoundingClientRect().width}catch(i){}return"undefined"==typeof t&&(t=i.width()),t}var s={containerSelector:"",additionalMarginTop:0,additionalMarginBottom:0,updateSidebarHeight:!0,minWidth:0,disableOnResponsiveLayouts:!0,sidebarBehavior:"modern",defaultPosition:"relative",namespace:"TSS"};return t=i.extend(s,t),t.additionalMarginTop=parseInt(t.additionalMarginTop)||0,t.additionalMarginBottom=parseInt(t.additionalMarginBottom)||0,e(t,this),this}}(jQuery);
(function ($){
jQuery('.kanews-sticky').theiaStickySidebar({
additionalMarginTop: 50
});
})(jQuery);
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,(function(t,e){"use strict";var i=Array.prototype.slice,n=t.console,o=void 0===n?function(){}:function(t){n.error(t)};function r(n,r,l){(l=l||e||t.jQuery)&&(r.prototype.option||(r.prototype.option=function(t){l.isPlainObject(t)&&(this.options=l.extend(!0,this.options,t))}),l.fn[n]=function(t){var e;return"string"==typeof t?function(t,e,i){var r,s="$()."+n+'("'+e+'")';return t.each((function(t,a){var h=l.data(a,n);if(h){var c=h[e];if(c&&"_"!=e.charAt(0)){var u=c.apply(h,i);r=void 0===r?u:r}else o(s+" is not a valid method")}else o(n+" not initialized. Cannot call methods, i.e. "+s)})),void 0!==r?r:t}(this,t,i.call(arguments,1)):(e=t,this.each((function(t,i){var o=l.data(i,n);o?(o.option(e),o._init()):(o=new r(i,e),l.data(i,n,o))})),this)},s(l))}function s(t){!t||t&&t.bridget||(t.bridget=r)}return s(e||t.jQuery),r})),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o];n&&n[r]&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i]+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}})),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,(function(t,e){var i={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e}},n=Array.prototype.slice;i.makeArray=function(t){return Array.isArray(t)?t:null==t?[]:"object"==typeof t&&"number"==typeof t.length?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(n){e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}else o.push(t)})),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout((function(){n.apply(r,e),delete r[o]}),i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,(function(t,e,i){return e+"-"+i})).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady((function(){var r=i.toDashed(n),s="data-"+r,l=document.querySelectorAll("["+s+"]"),a=document.querySelectorAll(".js-"+r),h=i.makeArray(l).concat(i.makeArray(a)),c=s+"-options",u=t.jQuery;h.forEach((function(t){var i,r=t.getAttribute(s)||t.getAttribute(c);try{i=r&&JSON.parse(r)}catch(e){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+e))}var l=new e(t,i);u&&u.data(t,n,l)}))}))},i})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/core",["ev-emitter/ev-emitter","fizzy-ui-utils/utils"],(function(i,n){return e(t,i,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("fizzy-ui-utils")):t.InfiniteScroll=e(t,t.EvEmitter,t.fizzyUIUtils)}(window,(function(t,e,i){var n=t.jQuery,o={};function r(t,e){var s=i.getQueryElement(t);if(s){if((t=s).infiniteScrollGUID){var l=o[t.infiniteScrollGUID];return l.option(e),l}this.element=t,this.options=i.extend({},r.defaults),this.option(e),n&&(this.$element=n(this.element)),this.create()}}r.defaults={},r.create={},r.destroy={};var s=r.prototype;i.extend(s,e.prototype);var l=0;s.create=function(){var t=this.guid=++l;if(this.element.infiniteScrollGUID=t,o[t]=this,this.pageIndex=1,this.loadCount=0,this.updateGetPath(),this.getPath&&this.getPath())for(var e in this.updateGetAbsolutePath(),this.log("initialized",[this.element.className]),this.callOnInit(),r.create)r.create[e].call(this)},s.option=function(t){i.extend(this.options,t)},s.callOnInit=function(){var t=this.options.onInit;t&&t.call(this,this)},s.dispatchEvent=function(t,e,i){this.log(t,i);var o=e?[e].concat(i):i;if(this.emitEvent(t,o),n&&this.$element){var r=t+=".infiniteScroll";if(e){var s=n.Event(e);s.type=t,r=s}this.$element.trigger(r,i)}};var a={initialized:function(t){return"on "+t},request:function(t){return"URL: "+t},load:function(t,e){return(t.title||"")+". URL: "+e},error:function(t,e){return t+". URL: "+e},append:function(t,e,i){return i.length+" items. URL: "+e},last:function(t,e){return"URL: "+e},history:function(t,e){return"URL: "+e},pageIndex:function(t,e){return"current page determined to be: "+t+" from "+e}};s.log=function(t,e){if(this.options.debug){var i="[InfiniteScroll] "+t,n=a[t];n&&(i+=". "+n.apply(this,e)),console.log(i)}},s.updateMeasurements=function(){this.windowHeight=t.innerHeight;var e=this.element.getBoundingClientRect();this.top=e.top+t.pageYOffset},s.updateScroller=function(){var e=this.options.elementScroll;if(e){if(this.scroller=!0===e?this.element:i.getQueryElement(e),!this.scroller)throw"Unable to find elementScroll: "+e}else this.scroller=t},s.updateGetPath=function(){var t=this.options.path;if(t){var e=typeof t;if("function"!=e)"string"==e&&t.match("{{#}}")?this.updateGetPathTemplate(t):this.updateGetPathSelector(t);else this.getPath=t}},s.updateGetPathTemplate=function(t){this.getPath=function(){var e=this.pageIndex+1;return t.replace("{{#}}",e)}.bind(this);var e=t.replace(/(\\\?|\?)/,"\\?").replace("{{#}}","(\\d\\d?\\d?)"),i=new RegExp(e),n=location.href.match(i);n&&(this.pageIndex=parseInt(n[1],10),this.log("pageIndex",[this.pageIndex,"template string"]))};var h=[/^(.*?\/?page\/?)(\d\d?\d?)(.*?$)/,/^(.*?\/?\?page=)(\d\d?\d?)(.*?$)/,/(.*?)(\d\d?\d?)(?!.*\d)(.*?$)/];return s.updateGetPathSelector=function(t){var e=document.querySelector(t);if(e){for(var i,n,o=e.getAttribute("href"),r=0;o&&r<h.length;r++){n=h[r];var s=o.match(n);if(s){i=s.slice(1);break}}i&&(this.isPathSelector=!0,this.getPath=function(){var t=this.pageIndex+1;return i[0]+t+i[2]}.bind(this),this.pageIndex=parseInt(i[1],10)-1,this.log("pageIndex",[this.pageIndex,"next link"]))}},s.updateGetAbsolutePath=function(){var t=this.getPath();if(t.match(/^http/)||t.match(/^\//))this.getAbsolutePath=this.getPath;else{var e=location.pathname;if(t.match(/^\?/))this.getAbsolutePath=function(){return e+this.getPath()};else{var i=e.substring(0,e.lastIndexOf("/"));this.getAbsolutePath=function(){return i+"/"+this.getPath()}}}},r.create.hideNav=function(){var t=i.getQueryElement(this.options.hideNav);t&&(t.style.display="none",this.nav=t)},r.destroy.hideNav=function(){this.nav&&(this.nav.style.display="")},s.destroy=function(){for(var t in this.allOff(),r.destroy)r.destroy[t].call(this);delete this.element.infiniteScrollGUID,delete o[this.guid],n&&this.$element&&n.removeData(this.element,"infiniteScroll")},r.throttle=function(t,e){var i,n;return e=e||200,function(){var o=+new Date,r=arguments,s=function(){i=o,t.apply(this,r)}.bind(this);i&&o<i+e?(clearTimeout(n),n=setTimeout(s,e)):s()}},r.data=function(t){var e=(t=i.getQueryElement(t))&&t.infiniteScrollGUID;return e&&o[e]},r.setJQuery=function(t){n=t},i.htmlInit(r,"infinite-scroll"),s._init=function(){},n&&n.bridget&&n.bridget("infiniteScroll",r),r})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/page-load",["./core"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("./core")):e(t,t.InfiniteScroll)}(window,(function(t,e){var i=e.prototype;function n(t){for(var e=document.createDocumentFragment(),i=0;t&&i<t.length;i++)e.appendChild(t[i]);return e}function o(t,e){for(var i=t.attributes,n=0;n<i.length;n++){var o=i[n];e.setAttribute(o.name,o.value)}}return e.defaults.loadOnScroll=!0,e.defaults.checkLastPage=!0,e.defaults.responseType="document",e.create.pageLoad=function(){this.canLoad=!0,this.on("scrollThreshold",this.onScrollThresholdLoad),this.on("load",this.checkLastPage),this.options.outlayer&&this.on("append",this.onAppendOutlayer)},i.onScrollThresholdLoad=function(){this.options.loadOnScroll&&this.loadNextPage()},i.loadNextPage=function(){if(!this.isLoading&&this.canLoad){var t=this.getAbsolutePath();this.isLoading=!0;var e=function(e){this.onPageLoad(e,t)}.bind(this),i=function(e){this.onPageError(e,t)}.bind(this),n=function(e){this.lastPageReached(e,t)}.bind(this);!function(t,e,i,n,o){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType=e||"",r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.onload=function(){if(200==r.status)i(r.response);else if(204==r.status)o(r.response);else{var t=new Error(r.statusText);n(t)}},r.onerror=function(){var e=new Error("Network error requesting "+t);n(e)},r.send()}(t,this.options.responseType,e,i,n),this.dispatchEvent("request",null,[t])}},i.onPageLoad=function(t,e){return this.options.append||(this.isLoading=!1),this.pageIndex++,this.loadCount++,this.dispatchEvent("load",null,[t,e]),this.appendNextPage(t,e),t},i.appendNextPage=function(t,e){var i=this.options.append;if("document"==this.options.responseType&&i){var o=t.querySelectorAll(i),r=n(o),s=function(){this.appendItems(o,r),this.isLoading=!1,this.dispatchEvent("append",null,[t,e,o])}.bind(this);this.options.outlayer?this.appendOutlayerItems(r,s):s()}},i.appendItems=function(t,e){t&&t.length&&(function(t){for(var e=t.querySelectorAll("script"),i=0;i<e.length;i++){var n=e[i],r=document.createElement("script");o(n,r),r.innerHTML=n.innerHTML,n.parentNode.replaceChild(r,n)}}(e=e||n(t)),this.element.appendChild(e))},i.appendOutlayerItems=function(i,n){var o=e.imagesLoaded||t.imagesLoaded;if(!o)return console.error("[InfiniteScroll] imagesLoaded required for outlayer option"),void(this.isLoading=!1);o(i,n)},i.onAppendOutlayer=function(t,e,i){this.options.outlayer.appended(i)},i.checkLastPage=function(t,e){var i=this.options.checkLastPage;if(i){var n,o=this.options.path;if("function"==typeof o)if(!this.getPath())return void this.lastPageReached(t,e);if("string"==typeof i?n=i:this.isPathSelector&&(n=o),n&&t.querySelector)t.querySelector(n)||this.lastPageReached(t,e)}},i.lastPageReached=function(t,e){this.canLoad=!1,this.dispatchEvent("last",null,[t,e])},i.onPageError=function(t,e){return this.isLoading=!1,this.canLoad=!1,this.dispatchEvent("error",null,[t,e]),t},e.create.prefill=function(){if(this.options.prefill){var t=this.options.append;t?(this.updateMeasurements(),this.updateScroller(),this.isPrefilling=!0,this.on("append",this.prefill),this.once("error",this.stopPrefill),this.once("last",this.stopPrefill),this.prefill()):console.error("append option required for prefill. Set as :"+t)}},i.prefill=function(){var t=this.getPrefillDistance();this.isPrefilling=t>=0,this.isPrefilling?(this.log("prefill"),this.loadNextPage()):this.stopPrefill()},i.getPrefillDistance=function(){return this.options.elementScroll?this.scroller.clientHeight-this.scroller.scrollHeight:this.windowHeight-this.element.clientHeight},i.stopPrefill=function(){this.log("stopPrefill"),this.off("append",this.prefill)},e})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/scroll-watch",["./core","fizzy-ui-utils/utils"],(function(i,n){return e(t,i,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){var n=e.prototype;return e.defaults.scrollThreshold=400,e.create.scrollWatch=function(){this.pageScrollHandler=this.onPageScroll.bind(this),this.resizeHandler=this.onResize.bind(this);var t=this.options.scrollThreshold;(t||0===t)&&this.enableScrollWatch()},e.destroy.scrollWatch=function(){this.disableScrollWatch()},n.enableScrollWatch=function(){this.isScrollWatching||(this.isScrollWatching=!0,this.updateMeasurements(),this.updateScroller(),this.on("last",this.disableScrollWatch),this.bindScrollWatchEvents(!0))},n.disableScrollWatch=function(){this.isScrollWatching&&(this.bindScrollWatchEvents(!1),delete this.isScrollWatching)},n.bindScrollWatchEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.pageScrollHandler),t[i]("resize",this.resizeHandler)},n.onPageScroll=e.throttle((function(){this.getBottomDistance()<=this.options.scrollThreshold&&this.dispatchEvent("scrollThreshold")})),n.getBottomDistance=function(){return this.options.elementScroll?this.getElementBottomDistance():this.getWindowBottomDistance()},n.getWindowBottomDistance=function(){return this.top+this.element.clientHeight-(t.pageYOffset+this.windowHeight)},n.getElementBottomDistance=function(){return this.scroller.scrollHeight-(this.scroller.scrollTop+this.scroller.clientHeight)},n.onResize=function(){this.updateMeasurements()},i.debounceMethod(e,"onResize",150),e})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/history",["./core","fizzy-ui-utils/utils"],(function(i,n){return e(t,i,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){var n=e.prototype;e.defaults.history="replace";var o=document.createElement("a");return e.create.history=function(){this.options.history&&(o.href=this.getAbsolutePath(),(o.origin||o.protocol+"//"+o.host)==location.origin?this.options.append?this.createHistoryAppend():this.createHistoryPageLoad():console.error("[InfiniteScroll] cannot set history with different origin: "+o.origin+" on "+location.origin+" . History behavior disabled."))},n.createHistoryAppend=function(){this.updateMeasurements(),this.updateScroller(),this.scrollPages=[{top:0,path:location.href,title:document.title}],this.scrollPageIndex=0,this.scrollHistoryHandler=this.onScrollHistory.bind(this),this.unloadHandler=this.onUnload.bind(this),this.scroller.addEventListener("scroll",this.scrollHistoryHandler),this.on("append",this.onAppendHistory),this.bindHistoryAppendEvents(!0)},n.bindHistoryAppendEvents=function(e){var i=e?"addEventListener":"removeEventListener";this.scroller[i]("scroll",this.scrollHistoryHandler),t[i]("pagehide",this.unloadHandler)},n.createHistoryPageLoad=function(){this.on("load",this.onPageLoadHistory)},e.destroy.history=n.destroyHistory=function(){this.options.history&&this.options.append&&this.bindHistoryAppendEvents(!1)},n.onAppendHistory=function(t,e,i){if(i&&i.length){var n=i[0],r=this.getElementScrollY(n);o.href=e,this.scrollPages.push({top:r,path:o.href,title:t.title})}},n.getElementScrollY=function(t){return this.options.elementScroll?this.getElementElementScrollY(t):this.getElementWindowScrollY(t)},n.getElementWindowScrollY=function(e){return e.getBoundingClientRect().top+t.pageYOffset},n.getElementElementScrollY=function(t){return t.offsetTop-this.top},n.onScrollHistory=function(){for(var t,e,i=this.getScrollViewY(),n=0;n<this.scrollPages.length;n++){var o=this.scrollPages[n];if(o.top>=i)break;t=n,e=o}t!=this.scrollPageIndex&&(this.scrollPageIndex=t,this.setHistory(e.title,e.path))},i.debounceMethod(e,"onScrollHistory",150),n.getScrollViewY=function(){return this.options.elementScroll?this.scroller.scrollTop+this.scroller.clientHeight/2:t.pageYOffset+this.windowHeight/2},n.setHistory=function(t,e){var i=this.options.history;i&&history[i+"State"]&&(history[i+"State"](null,t,e),this.options.historyTitle&&(document.title=t),this.dispatchEvent("history",null,[t,e]))},n.onUnload=function(){var e=this.scrollPageIndex;if(0!==e){var i=this.scrollPages[e],n=t.pageYOffset-i.top+this.top;this.destroyHistory(),scrollTo(0,n)}},n.onPageLoadHistory=function(t,e){this.setHistory(t.title,e)},e})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/button",["./core","fizzy-ui-utils/utils"],(function(i,n){return e(t,i,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){function n(t,e){this.element=t,this.infScroll=e,this.clickHandler=this.onClick.bind(this),this.element.addEventListener("click",this.clickHandler),e.on("request",this.disable.bind(this)),e.on("load",this.enable.bind(this)),e.on("error",this.hide.bind(this)),e.on("last",this.hide.bind(this))}return e.create.button=function(){var t=i.getQueryElement(this.options.button);t&&(this.button=new n(t,this))},e.destroy.button=function(){this.button&&this.button.destroy()},n.prototype.onClick=function(t){t.preventDefault(),this.infScroll.loadNextPage()},n.prototype.enable=function(){this.element.removeAttribute("disabled")},n.prototype.disable=function(){this.element.disabled="disabled"},n.prototype.hide=function(){this.element.style.display="none"},n.prototype.destroy=function(){this.element.removeEventListener("click",this.clickHandler)},e.Button=n,e})),function(t,e){"function"==typeof define&&define.amd?define("infinite-scroll/js/status",["./core","fizzy-ui-utils/utils"],(function(i,n){return e(t,i,n)})):"object"==typeof module&&module.exports?module.exports=e(t,require("./core"),require("fizzy-ui-utils")):e(t,t.InfiniteScroll,t.fizzyUIUtils)}(window,(function(t,e,i){var n=e.prototype;function o(t){s(t,"none")}function r(t){s(t,"block")}function s(t,e){t&&(t.style.display=e)}return e.create.status=function(){var t=i.getQueryElement(this.options.status);t&&(this.statusElement=t,this.statusEventElements={request:t.querySelector(".infinite-scroll-request"),error:t.querySelector(".infinite-scroll-error"),last:t.querySelector(".infinite-scroll-last")},this.on("request",this.showRequestStatus),this.on("error",this.showErrorStatus),this.on("last",this.showLastStatus),this.bindHideStatus("on"))},n.bindHideStatus=function(t){var e=this.options.append?"append":"load";this[t](e,this.hideAllStatus)},n.showRequestStatus=function(){this.showStatus("request")},n.showErrorStatus=function(){this.showStatus("error")},n.showLastStatus=function(){this.showStatus("last"),this.bindHideStatus("off")},n.showStatus=function(t){r(this.statusElement),this.hideStatusEventElements(),r(this.statusEventElements[t])},n.hideAllStatus=function(){o(this.statusElement),this.hideStatusEventElements()},n.hideStatusEventElements=function(){for(var t in this.statusEventElements){o(this.statusEventElements[t])}},e})),
function(t,e){"function"==typeof define&&define.amd?define(["infinite-scroll/js/core","infinite-scroll/js/page-load","infinite-scroll/js/scroll-watch","infinite-scroll/js/history","infinite-scroll/js/button","infinite-scroll/js/status"],e):"object"==typeof module&&module.exports&&(module.exports=e(require("./core"),require("./page-load"),require("./scroll-watch"),require("./history"),require("./button"),require("./status")))}(window,(function(t){return t})),
function(t,e){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){var i=t.jQuery,n=t.console;function o(t,e){for(var i in e)t[i]=e[i];return t}var r=Array.prototype.slice;function s(t,e,l){if(!(this instanceof s))return new s(t,e,l);var a,h=t;("string"==typeof t&&(h=document.querySelectorAll(t)),h)?(this.elements=(a=h,Array.isArray(a)?a:"object"==typeof a&&"number"==typeof a.length?r.call(a):[a]),this.options=o({},this.options),"function"==typeof e?l=e:o(this.options,e),l&&this.on("always",l),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):n.error("Bad element for imagesLoaded "+(h||t))}s.prototype=Object.create(e.prototype),s.prototype.options={},s.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},s.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&l[e]){for(var i=t.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var l={1:!0,9:!0,11:!0};function a(t){this.img=t}function h(t,e){this.url=t,this.element=e,this.img=new Image}return s.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(e.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,t),n=i.exec(e.backgroundImage)}},s.prototype.addImage=function(t){var e=new a(t);this.images.push(e)},s.prototype.addBackground=function(t,e){var i=new h(t,e);this.images.push(i)},s.prototype.check=function(){var t=this;function e(e,i,n){setTimeout((function(){t.progress(e,i,n)}))}this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?this.images.forEach((function(t){t.once("progress",e),t.check()})):this.complete()},s.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&n&&n.log("progress: "+i,t,e)},s.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},a.prototype=Object.create(e.prototype),a.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.src)},a.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},a.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},a.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},a.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},h.prototype=Object.create(a.prototype),h.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},h.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},h.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},s.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((i=e).fn.imagesLoaded=function(t,e){return new s(this,t,e).jqDeferred.promise(i(this))})},s.makeJQueryPlugin(),s}));
(function($){
"use strict";
var page_pagination=function(){
var status=kan_vars.pagination,
scrollThreshold=kan_vars.pagination=='button' ? !1:100,
custom=$('[kanews-data-load-more]').attr("data-status"),
path=(custom==true) ? '.nav-links .next':'.kanews_pagination_next a',
scrollThreshold=(custom==true) ? 100:scrollThreshold;
if(typeof $.fn.infiniteScroll==='undefined'){
return false;
}
if(status==='button'||status==='infinite'||custom===true){
$('[kanews-data-load-more]').infiniteScroll({
path: path,
append: '[kanews-data-load-more] .toinfinite',
button: '[kanews-data-load-more-button]',
scrollThreshold: scrollThreshold,
status: '.page-load-status',
}).on("append.infiniteScroll",function(){
var myLazyLoad=new LazyLoad();
myLazyLoad.update();
var myLazyLoad2=new LazyLoad({
elements_selector: ".entry-content-inner img",
});
myLazyLoad2.update();
if(typeof window.pageTracker!=='undefined') window.pageTracker._trackPageview(path);
window.history.pushState(null, (0, $(document).attr('title'), $(location).attr('href')));
});
}else{
return false;
}}
page_pagination();
})(jQuery);
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e}},s=27,i=9,n=13,o=38,a=39,u=40,l=t.noop;function r(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.noSuggestionsContainer=null,this.options=t.extend(!0,{},r.defaults,s),this.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},this.hint=null,this.hintValue="",this.selection=null,this.initialize(),this.setOptions(s)}r.utils=e,t.Autocomplete=r,r.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,onHint:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(t,s){if(!s)return t.value;var i="("+e.escapeRegExChars(s)+")";return t.value.replace(new RegExp(i,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},formatGroup:function(t,e){return'<div class="autocomplete-group">'+e+"</div>"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:l,onSearchComplete:l,onSearchError:l,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(e){return"string"==typeof e?t.parseJSON(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},r.prototype={initialize:function(){var e,s=this,i="."+s.classes.suggestion,n=s.classes.selected,o=s.options;s.element.setAttribute("autocomplete","off"),s.noSuggestionsContainer=t('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),s.suggestionsContainer=r.utils.createNode(o.containerClass),(e=t(s.suggestionsContainer)).appendTo(o.appendTo||"body"),"auto"!==o.width&&e.css("width",o.width),e.on("mouseover.autocomplete",i,function(){s.activate(t(this).data("index"))}),e.on("mouseout.autocomplete",function(){s.selectedIndex=-1,e.children("."+n).removeClass(n)}),e.on("click.autocomplete",i,function(){s.select(t(this).data("index"))}),e.on("click.autocomplete",function(){clearTimeout(s.blurTimeoutId)}),s.fixPositionCapture=function(){s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",s.fixPositionCapture),s.el.on("keydown.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},onFocus:function(){this.disabled||(this.fixPosition(),this.el.val().length>=this.options.minChars&&this.onValueChange())},onBlur:function(){var e=this,s=e.options,i=e.el.val(),n=e.getQuery(i);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==n&&(s.onInvalidateSelection||t.noop).call(e.element)},200)},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=t.extend({},this.options,e);this.isLocal=Array.isArray(s.lookup),this.isLocal&&(s.lookup=this.verifySuggestionsFormat(s.lookup)),s.orientation=this.validateOrientation(s.orientation,"bottom"),t(this.suggestionsContainer).css({"max-height":s.maxHeight+"px",width:s.width+"px","z-index":s.zIndex}),this.options=s},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e=t(this.suggestionsContainer),s=e.parent().get(0);if(s===document.body||this.options.forceFixPosition){var i=this.options.orientation,n=e.outerHeight(),o=this.el.outerHeight(),a=this.el.offset(),u={top:a.top,left:a.left};if("auto"===i){var l=t(window).height(),r=t(window).scrollTop(),h=-r+a.top-n,c=r+l-(a.top+o+n);i=Math.max(h,c)===h?"top":"bottom"}if(u.top+="top"===i?-n:o,s!==document.body){var g,d=e.css("opacity");this.visible||e.css("opacity",0).show(),g=e.offsetParent().offset(),u.top-=g.top,u.top+=s.scrollTop,u.left-=g.left,this.visible||e.css("opacity",d).hide()}"auto"===this.options.width&&(u.width=this.el.outerWidth()+"px"),e.css(u)}},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==u||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case s:this.el.val(this.currentValue),this.hide();break;case a:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case i:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case n:if(-1===this.selectedIndex)return void this.hide();this.select(this.selectedIndex);break;case o:this.moveUp();break;case u:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case o:case u:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?this.hide():this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e},getSuggestionsLocal:function(e){var s,i=this.options,n=e.toLowerCase(),o=i.lookupFilter,a=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return o(t,e,n)})},a&&s.suggestions.length>a&&(s.suggestions=s.suggestions.slice(0,a)),s},getSuggestions:function(e){var s,i,n,o,a=this,u=a.options,l=u.serviceUrl;u.params[u.paramName]=e,!1!==u.onSearchStart.call(a.element,u.params)&&(i=u.ignoreParams?null:u.params,t.isFunction(u.lookup)?u.lookup(e,function(t){a.suggestions=t.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,t.suggestions)}):(a.isLocal?s=a.getSuggestionsLocal(e):(t.isFunction(l)&&(l=l.call(a.element,e)),n=l+"?"+t.param(i||{}),s=a.cachedResponse[n]),s&&Array.isArray(s.suggestions)?(a.suggestions=s.suggestions,a.suggest(),u.onSearchComplete.call(a.element,e,s.suggestions)):a.isBadQuery(e)?u.onSearchComplete.call(a.element,e,[]):(a.abortAjax(),o={url:l,data:i,type:u.type,dataType:u.dataType},t.extend(o,u.ajaxSettings),a.currentRequest=t.ajax(o).done(function(t){var s;a.currentRequest=null,s=u.transformResult(t,e),a.processResponse(s,e,n),u.onSearchComplete.call(a.element,e,s.suggestions)}).fail(function(t,s,i){u.onSearchError.call(a.element,e,t,s,i)}))))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(){var e=t(this.suggestionsContainer);t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,e),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),t(this.suggestionsContainer).hide(),this.onHint(null)},suggest:function(){if(this.suggestions.length){var e,s=this.options,i=s.groupBy,n=s.formatResult,o=this.getQuery(this.currentValue),a=this.classes.suggestion,u=this.classes.selected,l=t(this.suggestionsContainer),r=t(this.noSuggestionsContainer),h=s.beforeRender,c="";s.triggerSelectOnValidInput&&this.isExactMatch(o)?this.select(0):(t.each(this.suggestions,function(t,u){i&&(c+=function(t,n){var o=t.data[i];return e===o?"":(e=o,s.formatGroup(t,e))}(u,0)),c+='<div class="'+a+'" data-index="'+t+'">'+n(u,o,t)+"</div>"}),this.adjustContainerWidth(),r.detach(),l.html(c),t.isFunction(h)&&h.call(this.element,l,this.suggestions),this.fixPosition(),l.show(),s.autoSelectFirst&&(this.selectedIndex=0,l.scrollTop(0),l.children("."+a).first().addClass(u)),this.visible=!0,this.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var e=this.options.beforeRender,s=t(this.suggestionsContainer),i=t(this.noSuggestionsContainer);this.adjustContainerWidth(),i.detach(),s.empty(),s.append(i),t.isFunction(e)&&e.call(this.element,s,this.suggestions),this.fixPosition(),s.show(),this.visible=!0},adjustContainerWidth:function(){var e,s=this.options,i=t(this.suggestionsContainer);"auto"===s.width?(e=this.el.outerWidth(),i.css("width",e>0?e:300)):"flex"===s.width&&i.css("width","")},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var n=0===i.value.toLowerCase().indexOf(e);return n&&(s=i),!n}),this.onHint(s))},onHint:function(e){var s=this.options.onHint,i="";e&&(i=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==i&&(this.hintValue=i,this.hint=e,t.isFunction(s)&&s.call(this.element,i))},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&(this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,n=t(this.suggestionsContainer),o=n.find("."+this.classes.suggestion);return n.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&o.length>this.selectedIndex?(s=o.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.hide(),this.onSelect(t)},moveUp:function(){if(-1!==this.selectedIndex)return 0===this.selectedIndex?(t(this.suggestionsContainer).children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint()):void this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s=this.activate(e);if(s){var i,n,o,a=t(s).outerHeight();i=s.offsetTop,o=(n=t(this.suggestionsContainer).scrollTop())+this.options.maxHeight-a,i<n?t(this.suggestionsContainer).scrollTop(i):i>o&&t(this.suggestionsContainer).scrollTop(i-this.options.maxHeight+a),this.options.preserveInput||(this.ignoreValueChange=!0,this.el.val(this.getValue(this.suggestions[e].value))),this.onHint(null)}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue),this.onHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),t(this.suggestionsContainer).remove()}},t.fn.devbridgeAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),n=i.data("autocomplete");"string"==typeof e?n&&"function"==typeof n[e]&&n[e](s):(n&&n.dispose&&n.dispose(),n=new r(this,e),i.data("autocomplete",n))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.devbridgeAutocomplete)});
jQuery(document).ready(function(){
'use strict';
jQuery('.kanews-ajax-search').devbridgeAutocomplete({
serviceUrl:kan_vars.ajax,
params:{'action':'kanews_ajax_search'},
type:'post',
minChars:3,
deferRequestBy: 300,
width:'auto',
maxHeight:'auto',
noSuggestionNotice: kan_vars.noresult,
showNoSuggestionNotice: true,
onSearchStart: function(query){
jQuery(this).parent().find('#kanews-loader').html('<div class="kanews-loader kanews-loader-sm">Loading...</div>')
},
onSearchComplete: function(query){
jQuery(this).parent().find('#kanews-loader').empty()
},
formatResult: function(suggestion, currentValue){
return suggestion.layout;
},
onSelect: function(suggestion){
window.location=suggestion.url;
}});
});
!function(i){"use strict";function n(t,e){this.$element=i(t),this.options=i.extend({},n.DEFAULTS,e),this.$trigger=i('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()}function s(t){t=t.attr("data-target")||(t=t.attr("href"))&&t.replace(/.*(?=#[^\s]+$)/,"");return i(document).find(t)}function l(a){return this.each(function(){var t=i(this),e=t.data("bs.collapse"),s=i.extend({},n.DEFAULTS,t.data(),"object"==typeof a&&a);!e&&s.toggle&&/show|hide/.test(a)&&(s.toggle=!1),e||t.data("bs.collapse",e=new n(this,s)),"string"==typeof a&&e[a]()})}n.VERSION="3.4.1",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t=this.$parent&&this.$parent.children(".collapse-item").children(".in, .collapsing");if(!(t&&t.length&&(a=t.data("bs.collapse"))&&a.transitioning)){var e=i.Event("show.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){t&&t.length&&(l.call(t,"hide"),a||t.data("bs.collapse",null));var s=this.dimension(),e=(this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")});if(!i.support.transition)return e.call(this);var a=i.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",i.proxy(e,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[s](this.$element[0][a])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=i.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var t=this.dimension(),e=(this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")});if(!i.support.transition)return e.call(this);this.$element[t](0).one("bsTransitionEnd",i.proxy(e,this)).emulateTransitionEnd(n.TRANSITION_DURATION)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return i(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(i.proxy(function(t,e){e=i(e);this.addAriaAndCollapsedClass(s(e),e)},this)).end()},n.prototype.addAriaAndCollapsedClass=function(t,e){var s=t.hasClass("in");t.attr("aria-expanded",s),e.toggleClass("collapsed",!s).attr("aria-expanded",s)};var t=i.fn.collapse;i.fn.collapse=l,i.fn.collapse.Constructor=n,i.fn.collapse.noConflict=function(){return i.fn.collapse=t,this},i(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=i(this),t=(e.attr("data-target")||t.preventDefault(),s(e)),e=t.data("bs.collapse")?"toggle":e.data();l.call(t,e)})}(jQuery);
!function(s){"use strict";s(document).on("click",".kanews-like-button",function(){var e=s(this),t=e.attr("data-post-id"),a=e.attr("data-nonce"),e=e.attr("data-iscomment"),n=s("1"===e?".kanews-like-comment-button-"+t:".kanews-like-button-"+t),i=n.find("#kanews-like-loader");return""!==t&&s.ajax({type:"POST",url:kan_vars.ajax,data:{action:"process_simple_like",post_id:t,nonce:a,is_comment:e},beforeSend:function(){i.html('<div class="kanews-loader-2 kanews-loader-sm">Yükleniyor..</div>')},success:function(e){var t=e.icon;e.count;n.html(t+'<span id="kanews-like-loader"></div>'),"unliked"===e.status?(n.prop("title",""),n.removeClass("liked")):(n.prop("title",""),n.addClass("liked")),i.empty()}}),!1})}(jQuery);
1==kan_vars.text_share&&(!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Sharect=t():e.Sharect=t()}(window,function(){return r=[function(e,t,r){"use strict";function n(){return window.getSelection().toString()}function c(e){var n=(window.getSelection().baseNode||window.getSelection().anchorNode).parentNode;return e.some(function(e){var t=n,r=e;if(Element.prototype.closest)return t.closest(r);Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector);var o=t;do{if(o.matches(r))return o}while(null!==(o=o.parentNode)&&o.nodeType===Node.ELEMENT_NODE);return null})}function a(e){var t=e.iconSize,r=e.buttonMargin,o=e.arrowSize,e=e.icons,n=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=t+r,r=window.pageXOffset||document.documentElement.scrollTop||document.body.scrollTop;return{top:n.top+r-t-o,left:n.left+(n.width-t*e.length)/2}}r.r(t);function s(e){return"line-height:0;transition:all .2s ease-in-out;background:"+e+";"}function u(e,t){return"position:absolute;border-radius:3px;top:"+e+"px;left:"+t+"px;"}function p(e){var t=e.arrowSize;return"position:absolute;border-left:"+t+"px solid transparent;border-right:"+t+"px solid transparent;border-top:"+t+"px solid "+e.backgroundColor+";bottom:-"+(t-1)+"px;left:"+(e.buttonSize*e.icons.length/2-t)+"px;width:0;height:0;"}function f(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function i(e){var t,r,o,n,c,i,l=a(e),e=function(o){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach(function(e){var t,r;t=o,r=n[e=e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))})}return o}({},e,{top:l.top,left:l.left});document.body.appendChild((t=(l=e).top,r=e.left,o=e.iconSize,n=e.buttonMargin,c=e.backgroundColor,i=e.icons,l=e.arrowSize,e=document.createElement("div"),o+=n,e.className="sharect",e.style.cssText=s(c),e.style.cssText+=u(t,r),e.appendChild(i.icons),n={arrowSize:l,backgroundColor:c,buttonSize:o,icons:i},(t=document.createElement("div")).style.cssText=p(n),r=t,e.appendChild(r),e))}function l(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function d(o){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach(function(e){var t,r;t=o,r=n[e=e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))})}return o}function b(o){setTimeout(function(){if(document.querySelector(".sharect")){if(n()&&c(o.selectableElements))return e=a(d({},o)),t=e.top,e=e.left,(r=document.querySelector(".sharect")).style.top="".concat(t,"px"),void(r.style.left="".concat(e,"px"));document.body.removeChild(document.querySelector(".sharect"))}var e,t,r;n()&&c(o.selectableElements)&&i(d({},o))},10)}var h,w,m,g,y,v;function O(){this.style.transform="scale(1.2)"}function E(){this.style.transform="scale(1)"}function S(e,t,r){return e=e,(o=document.createElement("div")).style.cssText="display:inline-block;margin:7px;cursor:pointer;transition:all .2s ease-in-out;",o.innerHTML=e,o.onmousedown=function(){var e=function(e,t){return e.replace(/PAGE_URL/,window.location.href).replace(/TEXT_SELECTION/,window.getSelection().toString()).replace(/USERNAME/,t)}(t,r);window.open(e,"Share","width=550, height=280")},o.onmouseover=O,o.onmouseout=E,o;var o}function j(t,e){var r,o=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,r)),o}function P(o){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach(function(e){var t,r;t=o,r=n[e=e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))})}return o}t.default=(h={twitter:{isActive:!0,username:"",url:"https://twitter.com/intent/tweet?text=TEXT_SELECTION&via=USERNAME&url=PAGE_URL",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8.2,20.2c6.5,0,11.7-5.2,11.8-11.6c0-0.1,0-0.1,0-0.2c0-0.2,0-0.4,0-0.5c0.8-0.6,1.5-1.3,2.1-2.2c-0.8,0.3-1.6,0.6-2.4,0.7c0.9-0.5,1.5-1.3,1.8-2.3c-0.8,0.5-1.7,0.8-2.6,1c-1.6-1.7-4.2-1.7-5.9-0.1c-1.1,1-1.5,2.5-1.2,3.9C8.5,8.7,5.4,7.1,3.3,4.6c-1.1,1.9-0.6,4.3,1.3,5.5c-0.7,0-1.3-0.2-1.9-0.5l0,0c0,2,1.4,3.7,3.3,4.1c-0.6,0.2-1.2,0.2-1.9,0.1c0.5,1.7,2.1,2.8,3.9,2.9c-1.7,1.4-3.9,2-6.1,1.7C3.8,19.5,6,20.2,8.2,20.2"/></svg>'},facebook:{isActive:!0,url:"https://www.facebook.com/sharer/sharer.php?u=PAGE_URL&quote=TEXT_SELECTION",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" enable-background="new 0 0 24 24" width="24" height="24" class="sharect__icon"><path d="M20,2H4C2.9,2,2,2.9,2,4v16c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M18.4,7.4H17c-0.9,0-1,0.3-1,1l0,1.3 h2.1L18,12h-1.9v7h-3.2v-7h-1.2V9.6h1.2V8.1c0-2,0.8-3.1,3.1-3.1h2.4V7.4z"/></svg>'}},m=["body"],g=[],y="#333",v="#fff",{config:function(e){return void 0!==e.twitter&&(h.twitter.isActive=e.twitter),void 0!==e.facebook&&(h.facebook.isActive=e.facebook),e.twitterUsername&&(h.twitter.username=e.twitterUsername),e.backgroundColor&&(y=e.backgroundColor),e.iconColor&&(v=e.iconColor),e.selectableElements&&(m=e.selectableElements),this},appendCustomShareButtons:function(e){return g=e,this},init:function(){var e,t,r,o={backgroundColor:y,iconColor:v,arrowSize:5,buttonMargin:14,iconSize:24,selectableElements:m,networks:h,customShareButtons:g};return t=P({},o).iconColor,(r=document.createElement("style")).id="sharect-style",r.innerHTML=".sharect svg{fill:".concat(t,";}"),document.body.appendChild(r),w=function(e){var t,r,o,n,c=e.networks,e=e.customShareButtons,i=document.createElement("div"),l=0;for(t in c)c[t]&&c[t].isActive&&(r=(n=c[t]).icon,o=n.url,n=n.username,i.appendChild(S(r,o,n)),l++);return 0<e.length&&e.forEach(function(e){i.appendChild(S(e.icon,e.url)),l++}),{icons:i,length:l}}(P({},o)),e=P({},o,{icons:w}),window.addEventListener("mouseup",function(){return b(e)},!1),this}})}],o={},n.m=r,n.c=o,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0).default;function n(e){var t;return(o[e]||(t=o[e]={i:e,l:!1,exports:{}},r[e].call(t.exports,t,t.exports,n),t.l=!0,t)).exports}var r,o}),Sharect.appendCustomShareButtons([{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 478.165 478.165"><path d="M478.165 232.946c0 128.567-105.057 232.966-234.679 232.966-41.102 0-79.814-10.599-113.445-28.969L0 478.165l42.437-125.04c-21.438-35.065-33.77-76.207-33.77-120.159C8.667 104.34 113.763 0 243.485 0c129.623 0 234.68 104.34 234.68 232.946zM243.485 37.098c-108.802 0-197.422 87.803-197.422 195.868 0 42.915 13.986 82.603 37.576 114.879l-24.586 72.542 75.849-23.968c31.121 20.481 68.457 32.296 108.583 32.296 108.723 0 197.323-87.843 197.323-195.908 0-107.886-88.6-195.709-197.323-195.709zM361.931 286.62c-1.395-2.331-5.22-3.746-10.898-6.814-5.917-2.849-34.089-16.497-39.508-18.37-5.16-1.913-8.986-2.849-12.811 2.829-4.005 5.638-14.903 18.629-18.23 22.354-3.546 3.785-6.854 4.264-12.552 1.435-5.618-2.809-24.267-8.866-46.203-28.391-17.055-15.042-28.67-33.711-31.997-39.508-3.427-5.758-.398-8.826 2.471-11.635 2.69-2.59 5.778-6.734 8.627-10.041 2.969-3.287 3.905-5.638 5.798-9.424 1.913-3.905.936-7.192-.478-10.141-1.415-2.849-13.01-30.881-17.752-42.337-4.841-11.416-9.543-9.523-12.871-9.523-3.467 0-7.212-.478-11.117-.478-3.785 0-10.041 1.395-15.381 7.192-5.2 5.658-20.123 19.465-20.123 47.597 0 28.052 20.601 55.308 23.55 59.053 2.869 3.785 39.747 63.197 98.303 86.07 58.476 22.872 58.476 15.321 69.115 14.365 10.38-.956 34.069-13.867 38.811-27.096 4.66-13.45 4.66-24.766 3.246-27.137z"/></svg>',url:"https://api.whatsapp.com/send?text=TEXT_SELECTION%20PAGE_URL"}]).init(),Sharect.config({facebook:!0,twitter:!0,backgroundColor:"#555",iconColor:"#fff",selectableElements:[".entry-content-inner",".kanews-article-title",".kanews-article-title + p"]}).init());
var $kan=jQuery(document),$window=jQuery(window),intialWidth=window.innerWidth,kan_loader='<div class="kanews-loader kanews-loader-sm">Loading...</div>';kan_loader2='<div class="kanews-loader kanews-loader-md">Loading...</div>',(n=>{function t(){var a=".entry-content-inner .page-links",e=n(a).attr("data-scrollThreshold"),t=n(a).attr("data-button");1==n(a).attr("data-status")&&n(".entry-content-wrapper").infiniteScroll({path:".entry-content-inner .page-links .next",append:".entry-content-inner",button:t,scrollThreshold:e,status:".page-load-status"}).on("append.infiniteScroll",function(){(new LazyLoad).update(),void 0!==window.pageTracker&&window.pageTracker._trackPageview(path),window.history.pushState(null,(n(document).attr("title"),n(location).attr("href")))}).on("last",function(e,t){n(a).addClass("last")})}jQuery(document).ready(function(t){$kan.on("click",".kanews-ai-btn",function(e){e.preventDefault();e=t(this).data("post-id");t.ajax({url:kan_vars.ajax,type:"POST",data:{action:"get_post_summary",post_id:e},success:function(e){e.success?(t("#kanews-modal-summary").remove(),t("body").append('<div id="kanews-modal-summary" class="kanews-modal is-active"><div class="kanews-modal-content"><div class="kanews-modal-title">'+e.data.title+'</div><div data-toggle="kanews-modal-summary" class="kanews-modal-close-btn"><i class="icon-close"></i></div><div class="kanews-modal-content-inner">'+e.data.summary+"</div></div></div>")):console.log("Özet bulunamadı.")},error:function(){console.log("Bir hata oluştu.")}})})}),$kan.on("click",".css-15q1ax4",function(){n("#glkj1").toggleClass("is-show")}),$kan.ready(function(){$window.scroll(function(){var e,t,a,i;n(".js-bar").length&&(i=n(".site-main-inner:last-child"),e=n(".js-bar"),!(100<=(i=((t=n(this).scrollTop()+n(this).height())-(a=i.offset().top))/i.height()*100))&&a<=t?e.css("width",i+"%"):e.css("width","0%"))})}),$kan.on("click","#expandPlayer",function(){n(".kanews-watch-panel-right").hasClass("d-none")?n("#expandPlayer").attr("aria-label",kan_vars.translate.expand2):n("#expandPlayer").attr("aria-label",kan_vars.translate.expand),n(".kanews-watch-panel-left").toggleClass("col-lg-9"),n(".kanews-watch-panel-right").toggleClass("d-none")}),e=16,n(".increase-text").click(function(){if(24<=e)return!1;e+=1,n(".kanews-article-content p, .kanews-article-content ul li, .kanews-article-content ol li").css({"font-size":e+"px","line-height":"1.54 * "+e+"px"})}),n(".decrease-text").click(function(){if(e<=10)return!1;--e,n(".kanews-article-content p, .kanews-article-content ul li, .kanews-article-content ol li").css({"font-size":e+"px","line-height":"1.54 * "+e+"px"})}),t(),1==kan_vars.infinite_scroll&&n(".site-main-wrapper").infiniteScroll({path:function(){return n(".site-main-inner .kanews-prev-post-link a").attr("href")},append:".site-main-inner",button:0,scrollThreshold:600,history:"replace",historyTitle:!0,status:".page-load-status"}).on("append.infiniteScroll",function(){(new LazyLoad).update(),t(),n(".kanews-reading-bar").not(":last").remove(),n(".kanews-prev-post-link").not(":last").remove(),1==kan_vars.sticky_sidebar&&jQuery(document).ready(function(){jQuery(".kanews-sticky").theiaStickySidebar({additionalMarginTop:50})});var e=document.createElement("script"),e=(e.type="text/javascript",e.src=kan_vars.assets+"js/magnific-popup.min.js",n("html").before().append(e),n("head").append("<link id='yournewcss' href='"+kan_vars.assets+"css/magnific-popup.css' type='text/css' rel='stylesheet' />"),n(".kanews-gallery-lightbox").on("click",function(){n(this).magnificPopup("open")}),jQuery(".kanews-gallery").each(function(){jQuery(this).magnificPopup({delegate:"figure",type:"image",mainClass:"mfp-zoom-in kanews-post-gallery-lightbox",zoom:{enabled:!0,duration:300},cursor:"mfp-zoom-out-cur",closeBtnInside:!1,removalDelay:400,overflowY:"hidden",gallery:{enabled:!0,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',tCounter:'<span class="mfp-counter">%curr%/%total%</span>'},image:{titleSrc:!1,markup:'<div class="mfp-figure d-flex flex-column"><div class="mfp-top-bar d-flex align-items-center justify-content-between"><div class="mfp-title"></div><div class="mfp-counter"></div></div><div class="mfp-inner row m-0"><div class="mfp-left-column col-12 col-md-7 col-lg-9"><div class="mfp-img"></div></div><div class="mfp-right-column col-12 col-md-5 col-lg-3"><div class="mfp-inner-content"></div></div></div></div>'},callbacks:{change:function(){n(this.content).find(".mfp-inner-content").html("<h5>"+n(this.currItem.el).attr("title")+"</h5>"+n(this.currItem.el).attr("content"))}}})}),n(".entry-content-inner:last-child .page-links[data-status='1']").show(),n(".site-main-inner:not(:first-child) .kanews-article-assets").hide(),void 0!==window.pageTracker&&window.pageTracker._trackPageview(path),window.history.pushState(null,(n(document).attr("title"),n(location).attr("href"))),n(this).find(".audio-icon:not([initialized])"));void 0===window.kanAudioPlayer&&(window.kanAudioPlayer=new KanAudioPlayer({playingIconURL:kan_vars.assets+"img/static/sound.gif",playLabel:"Dinlemeye Başla",pauseLabel:"Dinlemeyi Durdur"})),e.each(function(){window.kanAudioPlayer.addPlayer(this),n(this).attr("initialized","true")})}),$kan.ready(function(){n(".reaction-item").click(function(){var e=!!n(this).hasClass("clicked"),t=n(this).parent().data("postId")||n(this).parent().data("post-id"),a=kan_vars.ajax,i=n(this).data().reaction,a=(n.post(a,{postid:t,action:"kanews_react",reaction:i,unreact:e},function(e){console.log("Ajax: "+e)}),n(this).toggleClass("clicked"),n(".reaction-item").toggleClass("none"),n(this).hasClass("clicked none")&&n(this).removeClass("none"),parseInt(n(this).find(".reaction-count").text()));0<a?n(this).hasClass("clicked")?a+=1:--a:a=1,n(this).find(".reaction-count").text(a)})}),$kan.on("submit","#kanews-login-form",function(e){e.preventDefault();var t=n(this).find('button[type="submit"]'),a=n(this),i=a.find("#kanews-loader");n.ajax({type:"POST",url:kan_vars.ajax,data:n(this).serialize()+"&action=kanews_ajax_login&nonce="+kan_vars.nonce,dataType:"json",beforeSend:function(){t.attr("disabled",!0),i.html(kan_loader)},success:function(e){var t=e.success?"success":"danger",t=n('<div class="kanews-response bg-'+t+'" role="alert">'+e.data.message+"</div>");a.find(".kanews-response").remove(),t.prependTo(a),e.success&&setTimeout(function(){var e=window.location.href;-1<e.indexOf("?")?e+="&login=1":e+="?login=1",window.location.href=e,window.location.href.reload()},2500),i.empty()},error:function(e){t.attr("disabled",!1),i.empty()},complete:function(){t.attr("disabled",!1)}})}),$kan.on("submit","#kanews-register-form",function(e){e.preventDefault();var t=n(this).find('button[type="submit"]'),a=n(this),i=a.find("#kanews-loader");n.ajax({type:"POST",url:kan_vars.ajax,data:n(this).serialize()+"&action=kanews_ajax_register&nonce="+kan_vars.nonce,dataType:"json",beforeSend:function(){t.attr("disabled",!0),i.html(kan_loader)},success:function(e){var t=e.success?"success":"danger",t=n('<div class="kanews-response bg-'+t+'" role="alert">'+e.data.message+"</div>");a.find(".kanews-response").remove(),t.prependTo(a),e.success&&setTimeout(function(){var e=window.location.href;-1<e.indexOf("?")?e+="&register=1":e+="?register=1",window.location.href=e,window.location.href.reload()},2500),i.empty()},error:function(e){t.attr("disabled",!1),i.empty()},complete:function(){t.attr("disabled",!1)}})}),$kan.on("submit","#kanews-contact-form",function(e){e.preventDefault();var t=n(this).find('button[type="submit"]'),a=n(this),i=a.find("#kanews-loader");n.ajax({type:"POST",url:kan_vars.ajax,data:n(this).serialize()+"&action=kanews_ajax_contact&nonce="+kan_vars.nonce,dataType:"json",beforeSend:function(){t.attr("disabled",!0),i.html(kan_loader)},success:function(e){var t=e.success?"success":"danger",t=n('<div class="kanews-response bg-'+t+'" role="alert">'+e.data.message+"</div>");a.find(".kanews-response").remove(),t.prependTo(a),e.success&&setTimeout(function(){window.location.reload()},2500),i.empty()},error:function(e){t.attr("disabled",!1),i.empty()},complete:function(){t.attr("disabled",!1)}})}),$kan.on("submit","#kanews-profile-form",function(e){e.preventDefault();var t=n(this).find('button[type="submit"]'),a=n(this),i=a.find("#kanews-loader");n.ajax({type:"POST",url:kan_vars.ajax,data:n(this).serialize()+"&action=kanews_ajax_profile&nonce="+kan_vars.nonce,dataType:"json",beforeSend:function(){t.attr("disabled",!0),i.html(kan_loader)},success:function(e){var t=e.success?"success":"danger",t=n('<div class="kanews-response bg-'+t+'" role="alert">'+e.data.message+"</div>");a.find(".kanews-response").remove(),t.prependTo(a),e.success&&setTimeout(function(){window.location.reload()},2500),i.empty()},error:function(e){t.attr("disabled",!1),i.empty()},complete:function(){t.attr("disabled",!1)}})}),$kan.on("click",".kanews-collapse-btn",function(){var e=n(this),t=e.closest(".kanews-collapse-wrapper").find(".kanews-collapse-item"),a=e.find("span"),e=e.find(".icon-arrow");e.hasClass("icon-180deg")?(e.removeClass("icon-180deg"),a.html(kan_vars.translate.showmore)):(e.addClass("icon-180deg"),a.html(kan_vars.translate.showless)),t.each(function(){n(this).toggleClass("hidden-mobile")})}),$kan.on("click","#kanews-ilan-update",function(e){e.preventDefault();var a=n(this),t=a.find("#kanews-loader");n.ajax({type:"POST",url:kan_vars.ajax,data:{action:"kanews_ilan_ilan_update",nonce:kan_vars.nonce,pid:n(this).data("pid"),puid:n(this).data("puid")},dataType:"json",beforeSend:function(){a.attr("disabled",!0),t.html(kan_loader)},success:function(e){var t=e.success?"success":"danger";n("body").append('<div id="kanews-ilan-alert" class="kanews-response-fixed kanews-response bg-'+t+'" role="alert">'+e.data.message+"</div>"),setTimeout(function(){n("#kanews-ilan-alert").fadeOut("normal",function(){n(this).remove()})},5e3),a.remove()}})}),$kan.on("click",".kanews-comment-show-more",function(){var e=n(this).closest("li").attr("id"),e=n("#"+e+" + .children"),t=n(this).find(".icon-caret"),a=n(this).find("span");t.hasClass("icon-180deg")?(t.removeClass("icon-180deg"),a.text(kan_vars.hide_children)):(t.addClass("icon-180deg"),a.text(kan_vars.show_children)),e.slideToggle(300)}),navigator.share?$kan.on("click",".kanews-native-share",function(){var e=n("head title").text(),t=window.location.href;navigator.share({title:e,url:t}).then(console.log("Successful share")).catch(console.error)}):(a=n("head title").text(),i=window.location.href,n(".kanews-native-share").html('<i class="icon-envelope"></i>'),n(".kanews-native-share").removeAttr("onclick"),n(".kanews-native-share").attr("href","mailto:e-posta@domain.com?subject="+a+">&body="+i)),$kan.on("click",".kanews-show-password",function(){var e=n(this),t=e.parent().find("input");"password"===t.attr("type")?(t.attr("type","text"),e.addClass("skew-on"),e.removeClass("skew-off")):(t.attr("type","password"),e.addClass("skew-off"),e.removeClass("skew-on"))}),$kan.ready(function(){var t=!1,i=(n("#countrySelect").click(function(){t||n.getJSON("https://prayer-api-gamma.vercel.app/api/countries",function(e){var a="";n.each(e,function(e,t){"Turkey"==t.name?a+="<option value='"+t.name+"' selected>"+t.name+"</option>":a+="<option value='"+t.name+"'>"+t.name+"</option>"}),n("#countrySelect").html(a),t=!0})}),n("#countrySelect").change(function(){var t="Turkey";n.getJSON("https://prayer-api-gamma.vercel.app/api/regions?country="+t,function(e){var a="";n.each(e,function(e,t){a+="<option value='"+t+"'>"+t+"</option>"}),n("#regionSelect").html(a)}),setTimeout(function(){var e=n("#regionSelect").val();""!==e&&a(t,e)},3e3)}),n("#regionSelect").change(function(){var e=n(this).val();""!==i&&""!==e&&a(i,e)}),"Turkey"),e=n("#regionSelect").val();function a(e,t){var a,i;Cookies.get(t+"_cities")?(a=JSON.parse(Cookies.get(t+"_cities")),i="",n.each(a,function(e,t){i+="<option value='"+t+"'>"+t+"</option>"}),n("#citySelect").html(i)):n.getJSON("https://prayer-api-gamma.vercel.app/api/cities?country="+e+"&region="+t,function(e){var a="";Cookies.set(t+"_cities",JSON.stringify(e),{expires:9999}),n.each(e,function(e,t){a+="<option value='"+t+"'>"+t+"</option>"}),n("#citySelect").html(a)})}function s(){let s=new Date;document.querySelectorAll(".time").forEach(e=>{var t=e.textContent.split(":"),a=parseInt(t[0],10),t=parseInt(t[1],10),i=new Date;i.setHours(a,t,0,0),i<s?e.parentElement.parentElement.classList.add("active"):e.parentElement.parentElement.classList.remove("active")})}""!==i&&""!==e&&a(i,e),n("#getirButton").click(function(){var e,t=n("#regionSelect").val(),a=n("#citySelect").val();""!==i&&""!==t&&(e=window.location.href.split("?")[0],window.location.href=e+"?sehir="+t+"&ilce="+a)}),setInterval(s,6e4),s()});var e,a,i,s=n(".table-sorter").find("tbody"),r=s.find("tr").length,o=n(".table-sorter").data("shown")?n(".table-sorter").data("shown"):9,l=n(".table-sorter").data("more")?n(".table-sorter").data("more"):3;s.find("tr:gt("+(o-1)+")").hide().end().after('<tbody id="more"><tr><td colspan="'+s.find("tr:first td").length+'"><div style="display:inline-block" class="kanews-label">\t'+kan_vars.translate.showmore+" <span>("+l+")</span></div</tbody></td></tr>"),n("#more").click(function(){r<=(o+=l)&&n("#more").remove(),r-o<l&&n("#more span").html(r-o),s.find("tr:lt("+o+")").show()})})(jQuery);class KanAudioPlayer{constructor(e={}){this.options={iconSelector:".audio-icon",audioPlayerID:"kan-audio-player",progressCircleRadius:16,playingIconURL:e.playingIconURL||"/assets/img/static/sound.gif",playLabel:e.playLabel||"Dinlemeye Başla",pauseLabel:e.pauseLabel||"Dinlemeyi Durdur",...e},this.players=new Map,this.globalAudioElement=null,this.currentlyPlaying=null,this.init()}init(){document.getElementById(this.options.audioPlayerID)?this.globalAudioElement=document.getElementById(this.options.audioPlayerID):(this.globalAudioElement=document.createElement("audio"),this.globalAudioElement.id=this.options.audioPlayerID,this.globalAudioElement.style.display="none",document.body.appendChild(this.globalAudioElement)),document.querySelectorAll(this.options.iconSelector).forEach(e=>{this.setupAudioIcon(e)}),document.addEventListener("click",e=>{e=e.target.closest(this.options.iconSelector);e&&!this.players.has(e)&&(this.setupAudioIcon(e),e.click())})}setupAudioIcon(t){if(!this.players.has(t)){var a=t.getAttribute("data-src");if(a){this.ensureIconStructure(t);let e={element:t,originalIcon:t.querySelector(".icon-mic"),progressCircle:t.querySelector(".progress-circle circle"),isPlaying:!1,pauseTime:0,audioSrc:a};a=2*Math.PI*this.options.progressCircleRadius;e.progressCircle.style.strokeDasharray=""+a,e.progressCircle.style.strokeDashoffset=""+a,e.circumference=a,t.addEventListener("click",()=>this.togglePlayback(e)),this.players.set(t,e)}}}ensureIconStructure(e){var t,a;"static"===getComputedStyle(e).position&&(e.style.position="relative"),e.querySelector(".progress-circle")||((t=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("class","progress-circle"),t.setAttribute("width","40"),t.setAttribute("height","40"),t.setAttribute("viewBox","0 0 40 40"),t.style.position="absolute",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",(a=document.createElementNS("http://www.w3.org/2000/svg","circle")).setAttribute("cx","20"),a.setAttribute("cy","20"),a.setAttribute("r",this.options.progressCircleRadius.toString()),a.setAttribute("fill","none"),a.setAttribute("stroke","#3498db"),a.setAttribute("stroke-width","3"),a.setAttribute("transform","rotate(-90, 20, 20)"),t.appendChild(a),e.appendChild(t)),e.querySelector(".icon-mic")||((a=document.createElement("div")).classList.add("icon-mic"),a.innerHTML="🔊",e.appendChild(a)),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",this.options.playLabel)}togglePlayback(t){var e;t.isPlaying?(t.pauseTime=this.globalAudioElement.currentTime,this.globalAudioElement.pause(),t.isPlaying=!1,this.currentlyPlaying=null,t.element.setAttribute("aria-label",this.options.playLabel),t.originalIcon.style.display="block",(e=t.element.querySelector(".playing"))&&(e.style.display="none")):(this.currentlyPlaying&&(e=this.players.get(this.currentlyPlaying))&&(e.pauseTime=this.globalAudioElement.currentTime,e.isPlaying=!1,e.element.setAttribute("aria-label",this.options.playLabel),e.originalIcon.style.display="block",e=e.element.querySelector(".playing"))&&(e.style.display="none"),this.globalAudioElement.src!==t.audioSrc&&(this.globalAudioElement.src=t.audioSrc,t.pauseTime=0),this.globalAudioElement.currentTime=t.pauseTime,this.globalAudioElement.play().then(()=>{t.isPlaying=!0,this.currentlyPlaying=t.element,t.element.setAttribute("aria-label",this.options.pauseLabel);let e=t.element.querySelector(".playing");e?e.style.display="block":((e=document.createElement("img")).src=this.options.playingIconURL,e.classList.add("playing"),e.style.display="block",e.style.position="absolute",e.style.width="24px",e.style.height="24px",e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",t.element.appendChild(e)),t.originalIcon.style.display="none",this.updateProgress(t)}).catch(e=>{console.error("Error playing audio:",e)}))}updateProgress(t){this.globalAudioElement.ontimeupdate=null,this.globalAudioElement.ontimeupdate=()=>{var e;this.currentlyPlaying===t.element&&(e=this.globalAudioElement.currentTime/this.globalAudioElement.duration,e=t.circumference-e*t.circumference,t.progressCircle.style.strokeDashoffset=e)},this.globalAudioElement.onended=()=>{var e;this.currentlyPlaying===t.element&&(t.isPlaying=!1,this.currentlyPlaying=null,t.pauseTime=0,t.element.setAttribute("aria-label",this.options.playLabel),t.originalIcon.style.display="block",(e=t.element.querySelector(".playing"))&&(e.style.display="none"),t.progressCircle.style.strokeDashoffset=t.circumference)}}addPlayer(e){return!!e&&(this.setupAudioIcon(e),!0)}removePlayer(e){return!!this.players.has(e)&&(this.currentlyPlaying===e&&(this.globalAudioElement.pause(),this.currentlyPlaying=null),this.players.delete(e),!0)}}class ArticleChat{constructor(){this.chatButton=null,this.chatWindow=null,this.messagesContainer=null,this.questionCount=0,this.articleId=null,this.isSubscribed="1"===kan_vars.subscribe||1===kan_vars.subscribe||!0===kan_vars.subscribe,this.insights=kanews_chat.insights,this.subscriptionUrl=kanews_chat.subscription_url,this.maxQuestionsPerArticle=this.isSubscribed?kanews_chat.premium_limit:kanews_chat.free_limit,this.maxArticlesPerDay=this.isSubscribed?kanews_chat.premium_limit:kanews_chat.free_limit,this.init()}init(){if(jQuery("body").hasClass("single-post")){this.articleId=jQuery("body").attr("class").match(/postid-(\d+)/)[1],this.initializeChat(),this.bindEvents(),this.loadChatState();var t=window.kanews_chat_texts||{};if(this.isSubscribed){var a=(t.welcome_premium||"").replaceAll("{premium_limit}",kanews_chat.premium_limit);this.addMessage(a||`Hoş geldiniz, Premium üye olarak günlük ${kanews_chat.premium_limit} yazı için ${kanews_chat.premium_limit}'şer soru sorabilirsiniz.`,"bot")}else{let e=(t.welcome_free||"").replaceAll("{free_limit}",kanews_chat.free_limit);e=e||`Hoş geldiniz, günlük ${kanews_chat.free_limit} yazı için ${kanews_chat.free_limit}'er soru sorabilirsiniz.`,this.insights&&(a=(t.upgrade_text||"").replaceAll("{upgrade_url}",this.subscriptionUrl),e+=a?" "+a:` Daha fazlası için <a href="${this.subscriptionUrl}">premium üyelik</a> satın alın.`),this.addMessage(e,"bot")}}}initializeChat(){this.chatButton=jQuery(".kanews-chat-button"),this.chatWindow=jQuery(".kanews-chat-window"),this.messagesContainer=jQuery(".kanews-chat-messages"),this.chatButton.length&&this.chatWindow.length&&this.messagesContainer.length?this.updateRemainingQuestions():console.error("Chat elements not found")}bindEvents(){this.chatButton.on("click",()=>this.toggleChat()),jQuery(".close-chat").on("click",()=>this.toggleChat()),jQuery(".kanews-chat-input button").on("click",()=>this.handleUserMessage()),jQuery(".kanews-chat-input input").on("keypress",e=>{13===e.which&&this.handleUserMessage()})}toggleChat(){this.chatWindow.toggleClass("active")}async handleUserMessage(){var e=jQuery(".kanews-chat-input input"),t=e.val().trim();if(t)if(this.canAskQuestion()){e.val(""),this.addMessage(t,"user"),e.prop("disabled",!0),jQuery(".kanews-chat-input button").prop("disabled",!0);var a=this.addMessage('<span class="kanews-typing"><span></span><span></span><span></span></span>',"bot");try{var i=await this.sendMessageToBackend(t);this.removeMessage(a),i.success?(this.addMessage(i.data.message,"bot"),this.incrementQuestionCount(),this.updateRemainingQuestions()):this.showError(i.data.message||"Bir hata oluştu. Lütfen tekrar deneyin.")}catch(e){this.removeMessage(a),this.showError("Bir hata oluştu. Lütfen tekrar deneyin."),console.error("Chat error:",e)}e.prop("disabled",!1),jQuery(".kanews-chat-input button").prop("disabled",!1)}else this.showError("Günlük veya makale soru limitine ulaştınız.")}async sendMessageToBackend(e){var t=jQuery(".kanews-article-title").text().trim(),a=jQuery(".kanews-article-content").text().trim();let i=null;if(!(i=(i=(i=jQuery("#kanews_chat_nonce").val())||"undefined"==typeof kanews_chat?i:kanews_chat.nonce)||kan_vars.nonce))throw this.showError("Güvenlik doğrulaması yapılamadı. Lütfen sayfayı yenileyip tekrar deneyin."),new Error("Güvenlik anahtarı bulunamadı.");try{var s,n=await jQuery.ajax({url:kan_vars.ajax,type:"POST",data:{action:"kanews_chat_message",nonce:i,message:e,article_id:this.articleId,article_title:t,article_content:a}});if(n.success)return n;throw s=n.data?.message||"Bir hata oluştu.",this.showError(s),new Error(s)}catch(e){throw console.error("Backend error:",e),e}}addMessage(e,t,a=0){var i=Date.now();return this.messagesContainer.append(`
<div class="kanews-chat-message ${t}" data-id="${i}">
${e}
</div>
`),this.messagesContainer.scrollTop(this.messagesContainer[0].scrollHeight),i}removeMessage(e){jQuery(`.kanews-chat-message[data-id="${e}"]`).remove()}showError(e){this.addMessage(e,"bot")}canAskQuestion(){var e=this.getDailyChatData(),t=this.getArticleChatData();return Object.keys(e.articles).length>=this.maxArticlesPerDay&&!e.articles[this.articleId]?(e=this.isSubscribed?`Günlük ${kanews_chat.premium_limit} makale limitine ulaştınız.`:this.insights?`Günlük ${kanews_chat.free_limit} makale limitine ulaştınız. Daha fazlası için <a href="${this.subscriptionUrl}">premium üyelik</a> satın alın.`:`Günlük ${kanews_chat.free_limit} makale limitine ulaştınız.`,this.showError(e),!1):!(t.questionCount>=this.maxQuestionsPerArticle&&(e=this.isSubscribed?`Bu makale için ${kanews_chat.premium_limit} soru limitine ulaştınız.`:this.insights?`Bu makale için ${kanews_chat.free_limit} soru limitine ulaştınız. Daha fazlası için <a href="${this.subscriptionUrl}">premium üyelik</a> satın alın.`:`Bu makale için ${kanews_chat.free_limit} soru limitine ulaştınız.`,this.showError(e),1))}incrementQuestionCount(){var e=this.getDailyChatData(),e=(e.articles[this.articleId]||(e.articles[this.articleId]=0),e.articles[this.articleId]++,this.saveDailyChatData(e),this.getArticleChatData());e.questionCount++,this.saveArticleChatData(e)}updateRemainingQuestions(){var e=this.getArticleChatData(),e=this.maxQuestionsPerArticle-e.questionCount,e=this.isSubscribed?`Premium üye olarak ${e} soru hakkınız kaldı.`:this.insights?`Ücretsiz kullanıcı olarak ${e} soru hakkınız kaldı. Daha fazlası için <a href="${this.subscriptionUrl}">premium üyelik</a> satın alın.`:`Ücretsiz kullanıcı olarak ${e} soru hakkınız kaldı.`;jQuery(".kanews-chat-remaining").html(e)}getDailyChatData(){var e=Cookies.get("kanews_chat_daily");return e?JSON.parse(e):{date:(new Date).toDateString(),articles:{}}}saveDailyChatData(e){Cookies.set("kanews_chat_daily",JSON.stringify(e),{expires:1})}getArticleChatData(){var e="kanews_chat_article_"+this.articleId,e=Cookies.get(e);return e?JSON.parse(e):{questionCount:0}}saveArticleChatData(e){var t="kanews_chat_article_"+this.articleId;Cookies.set(t,JSON.stringify(e),{expires:7})}loadChatState(){this.getDailyChatData().date!==(new Date).toDateString()&&this.saveDailyChatData({date:(new Date).toDateString(),articles:{}})}}jQuery(document).ready(function(){new ArticleChat});
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
var $kan=jQuery(document),$window=jQuery(window),intialWidth=window.innerWidth,kan_loader='<div class="kanews-loader kanews-loader-sm">Loading...</div>';kan_loader2='<div class="kanews-loader kanews-loader-md">Loading...</div>',function(e){"use strict";const t={init(){this.setupCurrencyCalculator(),this.setupCryptoCalculator(),this.setupBMICalculator(),this.setupExchangeIconHandler(),this.updateCalculatorInfo(),this.setupHoroscopeCalculator(),this.setupCreditCalculator(),this.setupSavingsCalculator(),this.setupDefaultCalculator(),this.setupCalculatorSwitcher()},setupDefaultCalculator(){const t=new URLSearchParams(window.location.search).get("calculator")||"doviz",a=e(`.calculator-tab[data-calculator="${t}"]`);a.length?a.trigger("click"):e(".calculator-tab:first").trigger("click")},setupCalculatorSwitcher(){const t=this,a=new URLSearchParams(window.location.search).get("calculator")||"doviz";if(a){const t=e(`.calculator-tab[data-calculator="${a}"]`);t.length&&t.trigger("click")}e(".calculator-tab").on("click",(function(a){a.preventDefault();const r=e(this),n=r.data("calculator"),i=e(".kanews-calculator-container"),c=i.find("form");e(".calculator-tab").removeClass("active"),r.addClass("active");const o=e('<div class="kanews-loader-2 kanews-loader-sm">Loading...</div>');i.append(o),e.ajax({url:kan_vars.ajax,type:"POST",data:{action:"kanews_load_calculator",calculator:n,nonce:kan_vars.nonce},success:function(e){if(e.success){switch(o.remove(),c.remove(),i.html(e.data.html),n){case"doviz":t.setupCurrencyCalculator();break;case"coin":t.setupCryptoCalculator();break;case"emtia":t.setupCommodityCalculator();break;case"burc":t.setupHoroscopeCalculator();break;case"vki":t.setupBMICalculator();break;case"kredi":t.setupCreditCalculator();break;case"birikim":t.setupSavingsCalculator();break;case"vergi":t.setupTaxCalculator()}t.setupExchangeIconHandler(),t.updateCalculatorInfo()}else o.remove(),i.html('<div class="alert alert-danger">Hesaplayıcı yüklenirken bir hata oluştu.</div>')},error:function(){o.remove(),i.html('<div class="alert alert-danger">Hesaplayıcı yüklenirken bir hata oluştu.</div>')}})}))},updateCalculatorInfo(){const t=()=>{const t=e("#doviz_calc");if(!t.length)return;const a=t.find(".currency_switcher_x option:selected"),r=t.find(".currency_switcher_2 option:selected"),n=parseFloat(t.find(".currency3value").val()),i=(n*a.val()/r.val()).toLocaleString("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2}),c=parseFloat(a.val()).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");t.find(".selected-value").text(c),t.find(".conversion-info").text(`${n} ${a.text()}=${i} ${r.text()}`)},a=()=>{const t=e("#coin_calc");if(!t.length)return;const a=t.find(".currency_switcher_x option:selected"),r=t.find(".currency_switcher_3 option:selected"),n=parseFloat(t.find(".currency5value").val()),i=(n*a.val()/r.val()).toLocaleString("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2}),c=parseFloat(a.val()).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");t.find(".selected-value").text(c),t.find(".conversion-info").text(`${n} ${a.text()}=${i} ${r.text()}`)},r=()=>{const t=e("#emtia_calc");if(!t.length)return;const a=parseFloat(t.find(".currency3value").val().replace(/[^0-9.-]+/g,"")),r=parseFloat(t.find(".currency_switcher_x").val()),n=parseFloat(t.find(".currency_switcher_2").val());if(!isNaN(a)&&!isNaN(r)&&!isNaN(n)){const e=(a*r/n).toLocaleString("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2});t.find(".currency4value").val(e)}};t(),a(),r(),e(".currency_switcher_x, .currency_switcher_2, .currency_switcher_3").on("change",(function(){const n=e(this).closest("form"),i=n.attr("id");if("doviz_calc"===i){n.find('[value="XAU"]').length>0||n.hasClass("commodity-calculator")?r():t()}else"coin_calc"===i&&a()})),e(".currency3value, .currency5value").on("input",(function(){const n=e(this).closest("form"),i=n.attr("id");if("doviz_calc"===i){n.find('[value="XAU"]').length>0||n.hasClass("commodity-calculator")?r():t()}else"coin_calc"===i&&a()})),setInterval((()=>{t(),a(),r()}),6e4)},setupCurrencyCalculator(){const t=e("#doviz_calc");if(!t.length)return;const a=()=>{const e=parseFloat(t.find(".currency3value").val()),a=parseFloat(t.find(".currency_switcher_x").val()),r=parseFloat(t.find(".currency_switcher_2").val());if(!isNaN(e)&&!isNaN(a)&&!isNaN(r)){const n=(e*a/r).toLocaleString("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2});t.find(".currency4value").val(n)}};t.on("input change",".currency3value, .currency_switcher_x, .currency_switcher_2",a),a()},setupCryptoCalculator(){const t=e("#coin_calc");if(!t.length)return;const a=()=>{const e=parseFloat(t.find(".currency5value").val().replace(/\./g,"").replace(",",".")),a=parseFloat(t.find(".currency_switcher_x").val()),r=parseFloat(t.find(".currency_switcher_3").val());if(!isNaN(e)&&!isNaN(a)&&!isNaN(r)){const n=(e*a/r).toLocaleString("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2});t.find(".currency6value").val(n)}};t.on("input change",".currency5value, .currency_switcher_x, .currency_switcher_3",a),a()},setupBMICalculator(){const t=e('form[name="BedenKitleEndeksi"]');t.length&&(t.on("click",'[type="button"]',(()=>{const a=parseFloat(e("#kilosu").val()),r=parseFloat(e("#boyu").val());if(!a||!r||a<=0||r<=0)return void alert("Lütfen geçerli boy ve kilo değerleri girin.");const n=a/(r/100)**2,i=n.toFixed(2);let c;c=n<18.5?"Zayıf":n<25?"İdeal Kilo":n<30?"Fazla Kilolu":n<35?"1. Derece Obez":n<40?"2. Derece Obez":"3. Derece Morbid Obez",t.find(".bmi-value").text(i),t.find(".bmi-result").text(c)})),t.on("reset",(()=>{t.find(".bmi-value").text("-"),t.find(".bmi-result").text("-")})))},setupExchangeIconHandler(){e(".exchange-icon").on("click",(function(){const t=e(this).closest("form"),a=t.find("select").eq(0),r=t.find("select").eq(1);r.val(a.val()),r.trigger("change")}))},setupHoroscopeCalculator(){const e=document.getElementById("horoscope_calculate");e&&e.addEventListener("click",(function(){const e=document.getElementById("horoscope_sign"),t=document.getElementById("horoscope_period");if(!e.value)return void alert("Lütfen bir burç seçiniz.");const a=document.getElementById("horoscope-data"),r=JSON.parse(a.getAttribute("data-"+e.value)),n=t.value;document.getElementById("horoscope_icon").src=r.icon,document.getElementById("horoscope_title").textContent=r.name,document.getElementById("horoscope_date").textContent=r.date,document.getElementById("horoscope_text").textContent=r[n],document.getElementById("horoscope_result").style.display="block",document.querySelector(".selected-value").textContent=r.name;document.querySelector(".conversion-info").textContent={gunluk:"Günlük",haftalik:"Haftalık",aylik:"Aylık",yillik:"Yıllık"}[n]}))},setupCreditCalculator(){const t=e("#kredi_calc");if(!t.length)return;const a=e=>new Intl.NumberFormat("tr-TR",{style:"currency",currency:"TRY",minimumFractionDigits:2,maximumFractionDigits:2}).format(e),r=(e,t,a)=>{const r=t/100/12;return e*r*Math.pow(1+r,a)/(Math.pow(1+r,a)-1)};e("#kredi_calculate").on("click",(function(){const n=parseFloat(e("#kredi_amount").val().replace(/[^\d]/g,"")),i=parseFloat(e("#kredi_interest").val().replace(/[^\d.]/g,"")),c=parseInt(e("#kredi_term").val()),o=e("#kredi_type").val();if(isNaN(n)||isNaN(i)||isNaN(c)||!c)return void alert("Lütfen tüm alanları doğru formatta doldurunuz.");let l;l="esit_taksit"===o?r(n,i,c):((e,t,a)=>e/a+e*(t/100/12))(n,i,c);const s=((e,t,a,n)=>{const i=t/100/12;if("esit_taksit"===n)return r(e,t,a)*a;{let t=0;const r=e/a;let n=e;for(let e=0;e<a;e++)t+=r+n*i,n-=r;return t}})(n,i,c,o),u=s-n;t.find(".monthly-payment").text(a(l)),t.find(".total-payment").text(a(s)),t.find(".total-interest").text(a(u)),"esit_anapara"===o&&t.find(".monthly-payment").append(" <small>(ilk ay)</small>")})),e("#kredi_amount").on("input",(function(){let t=e(this).val().replace(/[^\d]/g,"");if(t){const a=parseInt(t);if(!isNaN(a)){const t=new Intl.NumberFormat("tr-TR",{maximumFractionDigits:0}).format(a);e(this).val(t)}}})),e("#kredi_interest").on("input",(function(){let t=e(this).val().replace(/[^\d.]/g,"");if(t){const a=t.split(".");if(a.length>2&&(t=a[0]+"."+a.slice(1).join("")),t.includes(".")){const e=t.split(".");t=e[0]+"."+e[1].substring(0,2)}e(this).val(t)}}))},setupSavingsCalculator:function(){if(!document.getElementById("birikim_calc"))return;document.getElementById("savings_calculate").addEventListener("click",(()=>{const e=parseFloat(document.getElementById("savings_initial").value.replace(/[^\d.]/g,""))||0,t=parseFloat(document.getElementById("savings_monthly").value.replace(/[^\d.]/g,"")),a=parseFloat(document.getElementById("savings_interest").value.replace(/[^\d.]/g,"")),r=parseFloat(document.getElementById("savings_years").value.replace(/[^\d.]/g,""));if(isNaN(t)||t<=0)return void alert("Lütfen geçerli bir aylık katkı tutarı giriniz.");if(isNaN(a)||a<=0)return void alert("Lütfen geçerli bir faiz oranı giriniz.");if(isNaN(r)||r<=0)return void alert("Lütfen geçerli bir birikim süresi giriniz.");const n=a/100/12,i=12*r,c=e*Math.pow(1+n,i)+t*((Math.pow(1+n,i)-1)/n),o=e+t*i,l=c-o;document.getElementById("total_savings_value").textContent=this.formatMoney(c.toFixed(2))+" TL",document.getElementById("total_contribution_value").textContent=this.formatMoney(o.toFixed(2))+" TL",document.getElementById("total_interest_value").textContent=this.formatMoney(l.toFixed(2))+" TL",document.querySelector(".savings-breakdown").style.display="block"}))},formatMoney:function(e){return new Intl.NumberFormat("tr-TR",{style:"currency",currency:"TRY",minimumFractionDigits:2,maximumFractionDigits:2}).format(e)},initCalculator(e){switch(e){case"doviz":this.setupCurrencyCalculator();break;case"coin":this.setupCryptoCalculator();break;case"emtia":this.setupCommodityCalculator();break;case"burc":this.setupHoroscopeCalculator();break;case"vki":this.setupBMICalculator();break;case"kredi":this.setupCreditCalculator();break;case"birikim":this.setupSavingsCalculator();break;case"birimcevir":this.setupUnitCalculator();break;case"enflasyon":this.setupInflationCalculator();break;case"vergi":this.setupTaxCalculator()}this.setupExchangeIconHandler(),this.updateCalculatorInfo()},setupCommodityCalculator(){const t=e("#emtia_calc");if(!t.length)return;const a=()=>{const e=parseFloat(t.find(".currency_switcher_x").val()),a=parseFloat(t.find(".currency_switcher_2").val()),r=parseFloat(t.find(".currency3value").val().replace(/[^0-9.-]+/g,""));if(isNaN(e)||isNaN(a)||isNaN(r))return t.find(".currency4value").val("?"),t.find(".conversion-info").text("-"),void t.find(".selected-value").text("0.00");const n=r*e/a;t.find(".currency4value").val(n.toFixed(2));const i=t.find(".currency_switcher_x option:selected").text().trim(),c=t.find(".currency_switcher_2 option:selected").text().trim();(e/a).toFixed(4);t.find(".conversion-info").text(`${r} ${i}=${(r*e).toFixed(2)} ${c}`),t.find(".selected-value").text(e.toFixed(2))};t.find(".currency_switcher_x, .currency_switcher_2").on("change",a),t.find(".currency3value").on("input",a),a()}};e(document).ready((()=>{t.init()}))}(jQuery);