b0y-101 Mini Shell


Current Path : E:/www3/chiangrai/wp-content/plugins/popup-maker/assets/js/vendor/
File Upload :
Current File : E:/www3/chiangrai/wp-content/plugins/popup-maker/assets/js/vendor/iframeResizer.min.js

console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){var n,i,t,o,r,a,s,d,c,l,f,u,m,g;function h(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function p(e,n,i){e.addEventListener(n,i,!1)}function w(e,n,i){e.removeEventListener(n,i,!1)}function b(e){return f[e]?f[e].log:t}function y(e,n){I("log",e,n,b(e))}function v(e,n){I("info",e,n,b(e))}function z(e,n){I("warn",e,n,!0)}function I(e,n,i,t){!0===t&&"object"==typeof window.console&&console[e](function(e){return a+"["+(n="Host page: "+(e=e),n=window.top!==window.self?window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e:n)+"]";var n}(n),i)}function x(e){function n(){i("Height"),i("Width"),W(function(){N(j),O(H),b("onResized",j)},j,"init")}function i(e){var n=Number(f[H]["max"+e]),i=Number(f[H]["min"+e]),t=(e=e.toLowerCase(),Number(j[e]));y(H,"Checking "+e+" is in range "+i+"-"+n),t<i&&(t=i,y(H,"Set "+e+" to min value")),n<t&&(t=n,y(H,"Set "+e+" to max value")),j[e]=""+t}function t(e){return k.slice(k.indexOf(":")+r+e)}function o(e,n){var i,t;i=function(){var i,t;C("Send Page Info","pageInfo:"+(i=document.body.getBoundingClientRect(),t=j.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:t.height,iframeWidth:t.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(t.top-i.top,10),offsetLeft:parseInt(t.left-i.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},g[t=n]||(g[t]=setTimeout(function(){g[t]=null,i()},32))}function c(e){return e=e.getBoundingClientRect(),R(H),{x:Math.floor(Number(e.left)+Number(d.x)),y:Math.floor(Number(e.top)+Number(d.y))}}function l(e){var n=e?c(j.iframe):{x:0,y:0},i={x:Number(j.width)+n.x,y:Number(j.height)+n.y};y(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(d=i,u(),y(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):z(H,"Unable to scroll to requested position, window.parentIFrame not found")}function u(){!1===b("onScroll",d)?E():O(H)}function m(e){e=e.split("#")[1]||"";var n=decodeURIComponent(e);(n=document.getElementById(n)||document.getElementsByName(n)[0])?(n=c(n),y(H,"Moving to in page link (#"+e+") at x: "+n.x+" y: "+n.y),d={x:n.x,y:n.y},u(),y(H,"--")):window.top===window.self?y(H,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):y(H,"In page link #"+e+" not found and window.parentIFrame not found")}function h(e){var n,i;i=0===Number(j.width)&&0===Number(j.height)?{x:(n=t(9).split(":"))[1],y:n[0]}:{x:j.width,y:j.height},b(e,{iframe:j.iframe,screenX:Number(i.x),screenY:Number(i.y),type:j.type})}function b(e,n){return M(H,e,n)}var I,x,k=e.data,j={},H=null;if("[iFrameResizerChild]Ready"===k)for(var P in f)C("iFrame requested init",S(P),f[P].iframe,P);else a===(""+k).slice(0,s)&&k.slice(s).split(":")[0]in f?(j=function(){var e=k.slice(s).split(":"),n=e[1]?parseInt(e[1],10):0,i=f[e[0]]&&f[e[0]].iframe,t=getComputedStyle(i);return{iframe:i,id:e[0],height:n+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e=e.paddingBottom?parseInt(e.paddingBottom,10):0)}(t)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(t),width:e[2],type:e[3]}}(),H=j.id,f[H]&&(f[H].loaded=!0),(x=j.type in{true:1,false:1,undefined:1})&&y(H,"Ignoring init message from meta parent page"),!x&&(x=!0,f[I=H]||(x=!1,z(j.type+" No settings for "+I+". Message was: "+k)),x)&&(y(H,"Received: "+k),I=!0,null===j.iframe&&(z(H,"IFrame ("+j.id+") not found"),I=!1),I&&function(){var n=e.origin,i=f[H]&&f[H].checkOrigin;if(i&&""+n!="null"&&!function(){if(i.constructor!==Array)return e=f[H]&&f[H].remoteHost,y(H,"Checking connection is from: "+e),n===e;var e,t=0,o=!1;for(y(H,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===n){o=!0;break}return o}())throw new Error("Unexpected message received from: "+n+" for "+j.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return 1}()&&function(){switch(f[H]&&f[H].firstRun&&f[H]&&(f[H].firstRun=!1),j.type){case"close":F(j.iframe);break;case"message":a=t(6),y(H,"onMessage passed: {iframe: "+j.iframe.id+", message: "+a+"}"),b("onMessage",{iframe:j.iframe,message:JSON.parse(a)}),y(H,"--");break;case"mouseenter":h("onMouseEnter");break;case"mouseleave":h("onMouseLeave");break;case"autoResize":f[H].autoResize=JSON.parse(t(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":o(f[H]&&f[H].iframe,H),r=H,e("Add ",p),f[r]&&(f[r].stopPageInfo=i);break;case"pageInfoStop":f[H]&&f[H].stopPageInfo&&(f[H].stopPageInfo(),delete f[H].stopPageInfo);break;case"inPageLink":m(t(9));break;case"reset":T(j);break;case"init":n(),b("onInit",j.iframe);break;default:0===Number(j.width)&&0===Number(j.height)?z("Unsupported message received ("+j.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}function e(e,n){function t(){f[r]?o(f[r].iframe,r):i()}["scroll","resize"].forEach(function(i){y(r,e+i+" listener for sendPageInfo"),n(window,i,t)})}function i(){e("Remove ",w)}var r,a}())):v(H,"Ignored: "+k)}function M(e,n,i){var t=null,o=null;if(f[e]){if("function"!=typeof(t=f[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function k(e){e=e.id,delete f[e]}function F(e){var n=e.id;if(!1===M(n,"onClose",n))y(n,"Close iframe cancelled by onClose event");else{y(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){z(e)}M(n,"onClosed",n),y(n,"--"),k(e),i&&(i.disconnect(),i=null)}}function R(n){null===d&&y(n,"Get page position: "+(d={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+d.y)}function O(e){null!==d&&(window.scrollTo(d.x,d.y),y(e,"Set page position: "+d.x+","+d.y),E())}function E(){d=null}function T(e){y(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),R(e.id),W(function(){N(e),C("reset","reset",e.iframe,e.id)},e,"reset")}function N(e){function n(n){var t;t=n,e.id?(e.iframe.style[t]=e[t]+"px",y(e.id,"IFrame ("+i+") "+t+" set to "+e[t]+"px")):y("undefined","messageData id not set"),function(n){var t;function r(){Object.keys(f).forEach(function(e){function n(e){return"0px"===(f[i]&&f[i].iframe.style[e])}var i;f[i=e]&&null!==f[i].iframe.offsetParent&&(n("height")||n("width"))&&C("Visibility change","resize",f[i].iframe,i)})}!o&&"0"===e[n]&&(o=!0,y(i,"Hidden iFrame detected, creating visibility listener"),n=h())&&(t=document.querySelector("body"),new n(function(e){y("window","Mutation observed: "+e[0].target+" "+e[0].type),H(r,16)}).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}(n)}var i=e.iframe.id;f[i]&&(f[i].sizeHeight&&n("height"),f[i].sizeWidth)&&n("width")}function W(e,n,i){i!==n.type&&c&&!window.jasmine?(y(n.id,"Requesting animation frame"),c(e)):e()}function C(e,n,i,t,o){var r=!1;t=t||i.id,f[t]&&(function(){var o;i&&"contentWindow"in i&&null!==i.contentWindow?(o=f[t]&&f[t].targetOrigin,y(t,"["+e+"] Sending msg to iframe["+t+"] ("+n+") targetOrigin: "+o),i.contentWindow.postMessage(a+n,o)):z(t,"["+e+"] IFrame("+t+") not found")}(),o&&f[t]&&f[t].warningTimeout&&(f[t].msgTimeout=setTimeout(function(){!f[t]||f[t].loaded||r||(r=!0,z(t,"IFrame has not responded within "+f[t].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},f[t].warningTimeout)))}function S(e){return e+":"+f[e].bodyMarginV1+":"+f[e].sizeWidth+":"+f[e].log+":"+f[e].interval+":"+f[e].enablePublicMethods+":"+f[e].autoResize+":"+f[e].bodyMargin+":"+f[e].heightCalculationMethod+":"+f[e].bodyBackground+":"+f[e].bodyPadding+":"+f[e].tolerance+":"+f[e].inPageLinks+":"+f[e].resizeFrom+":"+f[e].widthCalculationMethod+":"+f[e].mouseEvents}function j(o,r){function a(e){var n=e.split("Callback");2===n.length&&(this[n="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1)]=this[e],delete this[e],z(s,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version."))}var s=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var i;return""===e&&(o.id=(i=r&&r.id||m.id+n++,null!==document.getElementById(i)&&(i+=n++),e=i),t=(r||{}).log,y(e,"Added missing iframe ID: "+e+" ("+o.src+")")),e}(o.id);if(s in f&&"iFrameResizer"in o)z(s,"Ignored iFrame, already setup.");else{switch(function(e){if(e=e||{},f[s]=Object.create(null),f[s].iframe=o,f[s].firstRun=!0,f[s].remoteHost=o.src&&o.src.split("/").slice(0,3).join("/"),"object"!=typeof e)throw new TypeError("Options is not an object");Object.keys(e).forEach(a,e);var n,i=e;for(n in m)Object.prototype.hasOwnProperty.call(m,n)&&(f[s][n]=(Object.prototype.hasOwnProperty.call(i,n)?i:m)[n]);f[s]&&(f[s].targetOrigin=!0!==f[s].checkOrigin||""===(e=f[s].remoteHost)||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e)}(r),y(s,"IFrame scrolling "+(f[s]&&f[s].scrolling?"enabled":"disabled")+" for "+s),o.style.overflow=!1===(f[s]&&f[s].scrolling)?"hidden":"auto",f[s]&&f[s].scrolling){case"omit":break;case!0:o.scrolling="yes";break;case!1:o.scrolling="no";break;default:o.scrolling=f[s]?f[s].scrolling:"no"}c("Height"),c("Width"),d("maxHeight"),d("minHeight"),d("maxWidth"),d("minWidth"),"number"!=typeof(f[s]&&f[s].bodyMargin)&&"0"!==(f[s]&&f[s].bodyMargin)||(f[s].bodyMarginV1=f[s].bodyMargin,f[s].bodyMargin=f[s].bodyMargin+"px"),function(n){var t=h();t&&(t=t,i=o.parentNode?((t=new t(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===o&&F(o)})})})).observe(o.parentNode,{childList:!0}),t):null),p(o,"load",function(){var i,t;C("iFrame.onload",n,o,e,!0),i=f[s]&&f[s].firstRun,t=f[s]&&f[s].heightCalculationMethod in l,!i&&t&&T({iframe:o,height:0,width:0,type:"init"})}),C("init",n,o,e,!0)}(S(s)),f[s]&&(f[s].iframe.iFrameResizer={close:F.bind(null,f[s].iframe),removeListeners:k.bind(null,f[s].iframe),resize:C.bind(null,"Window resize","resize",f[s].iframe),moveToAnchor:function(e){C("Move to anchor","moveToAnchor:"+e,f[s].iframe,s)},sendMessage:function(e){C("Send Message","message:"+(e=JSON.stringify(e)),f[s].iframe,s)}})}function d(e){var n=f[s][e];1/0!==n&&0!==n&&(o.style[e]="number"==typeof n?n+"px":n,y(s,"Set "+e+" = "+o.style[e]))}function c(e){if(f[s]["min"+e]>f[s]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}}function H(e,n){null===u&&(u=setTimeout(function(){u=null,e()},n))}function P(){"hidden"!==document.visibilityState&&(y("document","Trigger event: Visibility change"),H(function(){A("Tab Visible","resize")},16))}function A(e,n){Object.keys(f).forEach(function(i){var t;f[t=i]&&"parent"===f[t].resizeFrom&&f[t].autoResize&&!f[t].firstRun&&C(e,n,f[i].iframe,i)})}function L(){p(window,"message",x),p(window,"resize",function(){var e;y("window","Trigger event: "+(e="resize")),H(function(){A("Window "+e,"resize")},16)}),p(document,"visibilitychange",P),p(document,"-webkit-visibilitychange",P)}function B(){function n(e,n){if(n){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">");j(n,e),i.push(n)}}for(var i,t=["moz","webkit","o","ms"],o=0;o<t.length&&!c;o+=1)c=window[t[o]+"RequestAnimationFrame"];return c?c=c.bind(window):y("setup","RequestAnimationFrame not supported"),L(),function(t,o){var r;switch(i=[],(r=t)&&r.enablePublicMethods&&z("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,t));break;case"object":n(t,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return i}}"undefined"!=typeof window&&(n=0,o=t=!1,r="message".length,s=(a="[iFrameSizer]").length,d=null,c=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),f={},u=null,m=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){z("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),g={},window.jQuery!==e&&function(e){e.fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(e){return this.filter("iframe").each(function(n,i){j(i,e)}).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")}(window.jQuery),"function"==typeof define&&define.amd?define([],B):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=B()),window.iFrameResize=window.iFrameResize||B())}();

Copyright © 2019 by b0y-101