/*
 * [y] hybris Platform
 *
 * Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
 *
 * This software is the confidential and proprietary information of SAP
 * ("Confidential Information"). You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the
 * license agreement you entered into with SAP.
 */
!function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b():"function"==typeof define&&define.amd?define(b):this[a]=b()}("$script",function(){function a(a,b){for(var c=0,d=a.length;d>c;++c)if(!b(a[c]))return i;return 1}function b(b,c){a(b,function(a){return!c(a)})}function c(f,g,h){function i(a){return a.call?a():m[a]}function k(){if(!--s){m[r]=1,q&&q();for(var c in o)a(c.split("|"),i)&&!b(o[c],i)&&(o[c]=[])}}f=f[j]?f:[f];var l=g&&g.call,q=l?g:h,r=l?f.join(""):g,s=f.length;return setTimeout(function(){b(f,function a(b,c){return null===b?k():(b=c||-1!==b.indexOf(".js")||/^https?:\/\//.test(b)||!e?b:e+b+".js",p[b]?(r&&(n[r]=1),2==p[b]?k():setTimeout(function(){a(b,!0)},0)):(p[b]=1,r&&(n[r]=1),void d(b,k)))})},0),c}function d(a,b){var c,d=g.createElement("script");d.onload=d.onerror=d[l]=function(){d[k]&&!/^c|loade/.test(d[k])||c||(d.onload=d[l]=null,c=1,p[a]=2,b())},d.async=1,d.src=f?a+(-1===a.indexOf("?")?"?":"&")+f:a,h.insertBefore(d,h.lastChild)}var e,f,g=document,h=g.getElementsByTagName("head")[0],i=!1,j="push",k="readyState",l="onreadystatechange",m={},n={},o={},p={};return c.get=d,c.order=function(a,b,d){!function e(f){f=a.shift(),a.length?c(f,e):c(f,b,d)}()},c.path=function(a){e=a},c.urlArgs=function(a){f=a},c.ready=function(d,e,f){d=d[j]?d:[d];var g=[];return!b(d,function(a){m[a]||g[j](a)})&&a(d,function(a){return m[a]})?e():!function(a){o[a]=o[a]||[],o[a][j](e),f&&f(g)}(d.join("|")),c},c.done=function(a){c([null],a)},c}),parent.postMessage({pk:Math.random(),gatewayId:"smartEditBootstrap",eventId:"loading",data:{location:document.location.href}},"*"),function a(){var b=500,c="heartBeatGateway",d="heartBeat";parent.postMessage({pk:Math.random(),gatewayId:c,eventId:d,data:{location:document.location.href}},"*"),setTimeout(a,b)}(),$(document).ready(function(){parent.postMessage({pk:Math.random(),gatewayId:"smartEditBootstrap",eventId:"bootstrapSmartEdit",data:{location:document.location.href}},"*")});var injectJS=function(a,b,c){c<b.length&&$script(b[c],function(){injectJS(a,b,c+1)})},injectCSS=function(a,b,c){var d=document.createElement("link");d.rel="stylesheet",d.href=b[c],a.appendChild(d),c+1<b.length&&injectCSS(a,b,c+1)},eventMethod=window.addEventListener?"addEventListener":"attachEvent",eventer=window[eventMethod],messageEvent="attachEvent"==eventMethod?"onmessage":"message";eventer(messageEvent,function(a){var b=a.data;if("smarteditBootstrap"==b.eventName){if(window.smartedit=window.smartedit||{},b.resources&&b.resources.properties)for(var c in b.resources.properties)window.smartedit[c]=b.resources.properties[c];var d=document.getElementsByTagName("head")[0];b.resources&&b.resources.js&&b.resources.js.length>0&&injectJS(d,b.resources.js,0),b.resources&&b.resources.css&&b.resources.css.length>0&&injectCSS(d,b.resources.css,0)}},!1);