text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@lrnwebcomponents/es-global-bridge/es-global-bridge.js")):"function"==typeof define&&define.amd?define(["exports","@lrnwebcomponents/es-global-bridge/es-global-bridge.js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ExifData={},t.esGlobalBridge_js)}(this,(function(t,e){"use strict";function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function a(t,e,n){return a=r()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&o(r,n.prototype),r},a.apply(null,arguments)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)},l(t)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return s(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(y,t);var a,l,u,f,h,p=(a=y,l=r(),function(){var t,e=i(a);if(l){var n=i(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return c(this,t)});function y(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y),(t=p.call(this)).nodeData=[],window.WCGlobalBasePath?t.basePath=window.WCGlobalBasePath:t.basePath=new URL("./","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("exif-data.umd.js",document.baseURI).href).href,e.ESGlobalBridgeStore.imports["exif-js"]?setTimeout((function(){t.__ready=!0,t.updateExif()}),0):(e.ESGlobalBridgeStore.load("exif-js","".concat(t.basePath,"lib/exif-js.js")),window.addEventListener("es-bridge-exif-js-loaded",t._onExifJsLoaded.bind(s(t)))),t.template=document.createElement("template"),t.attachShadow({mode:"open"}),t.render(),t}return u=y,f=[{key:"html",get:function(){return'\n    <style>\n      ul.showdata {\n        z-index: 1;\n        visibility: visible;\n        opacity: .9;\n      }\n      ul {\n        position: absolute;\n        transition: 0.3s linear all;\n        background-color: #000000;\n        opacity: 0;\n        visibility: hidden;\n        overflow: scroll;\n        padding: 0;\n        margin: 0;\n      }\n      ul li {\n        padding: 8px;\n        font-size: 14px;\n        color: white;\n      }\n    </style>\n    <slot></slot>\n    <ul id="data"></ul>'}},{key:"render",value:function(){this.shadowRoot.innerHTML=null,this.template.innerHTML=this.html,this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}},{key:"_onExifJsLoaded",value:function(){window.removeEventListener("es-bridge-exif-js-loaded",this._onExifJsLoaded.bind(this)),this.__ready=!0,this.updateExif()}},{key:"showDetails",value:function(t){if(!t)return!1;var e=this.alignTarget;e||(e=t.node);var n=e.getBoundingClientRect(),i="";for(var o in t.data)""!=t.data[o]&&0!=t.data[o]&&" "!=t.data[o]&&0!=t.data[o]&&null!=t.data[o]&&(i+="<li><strong>".concat(o,"</strong>: ").concat(t.data[o],"</li>"));this.dataElement.innerHTML=i,this.alignTargetTop?this.dataElement.style.top=this.alignTargetTop:this.dataElement.style.top=n.top+"px",this.dataElement.style.height=n.height+"px",this.dataElement.style.width=n.width+"px",this.noLeft||(this.dataElement.style.left=n.left+"px"),this.dataElement.classList.add("showdata")}},{key:"clickImage",value:function(t){var e=this;"IMG"===t.target.tagName&&this.nodeData.forEach((function(n){n.node===t.target&&e.showDetails(n)}))}},{key:"getExifData",value:function(t,e){var n=this;window.EXIF&&window.EXIF.getData(t,(function(){var i=window.EXIF.getAllTags(t);delete i.MakerNote,delete i.thumbnail,n.nodeData.push({node:t,data:i}),e&&1===n.children.length&&n.showDetails(n.nodeData[0])}))}},{key:"updateExif",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.nodeData=[],this.dataElement.innerHTML="";var e,n=d(this.childNodes);try{for(n.s();!(e=n.n()).done;){var i=e.value;this.__ready&&i.tagName&&"IMG"===i.tagName&&this.getExifData(i,t)}}catch(t){n.e(t)}finally{n.f()}}},{key:"clickData",value:function(t){this.dataElement.classList.remove("showdata")}},{key:"connectedCallback",value:function(){var t=this;window.ShadyCSS&&window.ShadyCSS.styleElement(this),this.dataElement=this.shadowRoot.querySelector("#data"),null==this.getAttribute("no-events")&&(this.addEventListener("click",this.clickImage.bind(this)),this.dataElement.addEventListener("click",this.clickData.bind(this))),null==this.getAttribute("no-left")?this.noLeft=!1:this.noLeft=!0,this.observer=new MutationObserver((function(e){t.updateExif()})),this.observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){null==this.getAttribute("no-events")&&(this.removeEventListener("click",this.clickImage.bind(this)),this.dataElement.removeEventListener("click",this.clickData.bind(this))),this.observer.disconnect()}}],h=[{key:"tag",get:function(){return"exif-data"}}],f&&n(u.prototype,f),h&&n(u,h),y}(l(HTMLElement));window.customElements.define(f.tag,f),t.ExifData=f,Object.defineProperty(t,"__esModule",{value:!0})}));
  