/*! For license information please see dropins_sdk_v2.js.LICENSE */ !function(e,o){for(var t in o)e[t]=o[t]}(window,function(e){var o={};function t(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var i in e)t.d(n,i,function(o){return e[o]}.bind(null,i));return n},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=3)}([function(e,o,t){"use strict";t.d(o,"i",(function(){return n})),t.d(o,"g",(function(){return i})),t.d(o,"e",(function(){return r})),t.d(o,"j",(function(){return a})),t.d(o,"b",(function(){return p})),t.d(o,"d",(function(){return u})),t.d(o,"c",(function(){return d})),t.d(o,"f",(function(){return h})),t.d(o,"k",(function(){return b})),t.d(o,"a",(function(){return m})),t.d(o,"h",(function(){return v}));var n,i,r,s=t(1);function a(e,o){var t=window.screenX+((window.outerWidth||document.documentElement.offsetWidth)-e)/2,n=window.screenY+((window.outerHeight||document.documentElement.offsetHeight)-o)/2;return"width=".concat(e,",height=").concat(o,",left=").concat(t,",top=").concat(n)}function c(e,o,t){var n=-1===e.indexOf("?")?"?":"&";return"".concat(e).concat(n).concat(o,"=").concat(t)}function l(e){return c(e,"version",encodeURIComponent(Dropbox.VERSION))}function p(e,o){var t,n,i=encodeURIComponent(window.location.protocol+"//"+window.location.host),r=encodeURIComponent(Dropbox.appKey),s=Dropbox.productKey?encodeURIComponent(Dropbox.productKey):null,a=encodeURIComponent(e.linkType||""),p=encodeURIComponent(e._trigger||"js"),u=Boolean(e.multiselect),d=encodeURIComponent(m(e.extensions,"join",(function(e){return e.join(" ")}))||""),f=Boolean(e.folderselect);o=Boolean(o);var h="".concat(Dropbox.baseUrl,"/chooser?origin=").concat(i,"&app_key=").concat(r,"&link_type=").concat(a,"&trigger=").concat(p,"&multiselect=").concat(u,"&extensions=").concat(d,"&folderselect=").concat(f,"&iframe=").concat(o);if(void 0!==e.fileselect&&(h=c(h,"fileselect",Boolean(e.fileselect))),void 0!==e.sizeLimit&&(h=c(h,"size_limit",e.sizeLimit)),null!=e.initialNavigation){if(null!=e.initialNavigation.mode)h=c(h,"initial_navigation_mode",encodeURIComponent(e.initialNavigation.mode));if(null!=e.initialNavigation.role)h=c(h,"initial_navigation_role",encodeURIComponent(e.initialNavigation.role));if(e.initialNavigation.cursor)h=c(h,"initial_navigation_cursor",encodeURIComponent(e.initialNavigation.cursor))}null!=e.initialViewType&&(h=c(h,"initial_view_type",encodeURIComponent(e.initialViewType)));null!=e.fields&&(h=c(h,"fields",encodeURIComponent("function"==typeof e.fields.join?e.fields.join(" "):void 0)));(!1===e.showSignOut&&(h=c(h,"show_sign_out","false")),e.initialNavigationPath)&&(h=c(h,"initial_navigation_path",encodeURIComponent(e.initialNavigationPath)));e.requiredPermissions&&(h=c(h,"required_permissions",encodeURIComponent(m(e.requiredPermissions,"join",(function(e){return e.join(" ")}))||"")));(s&&(h=c(h,"product_key",s)),null===(t=e.suggestions)||void 0===t?void 0:t.experimentGroup)&&(h=c(h,"suggestions_experiment_group",encodeURIComponent(null===(n=e.suggestions)||void 0===n?void 0:n.experimentGroup)));return l(h)}function u(){/\bTrident\b/.test(navigator.userAgent)&&null!=document.body&&null==i&&((i=document.createElement("iframe")).setAttribute("id","dropbox_xcomm"),i.setAttribute("src",Dropbox.baseUrl+"/static/api/1/xcomm.html"),i.style.display="none",document.body.appendChild(i))}function d(e){var o={options:Object(s.a)(Object(s.a)({},e),{success:function(t,n){"function"==typeof e.success&&e.success(t,n),r===o&&(r=null)},cancel:function(t){"function"==typeof e.cancel&&e.cancel(t),r===o&&(r=null)}})};return r=o,o}function f(e,o){var t,n=encodeURIComponent(Dropbox.appKey),i="https://".concat("api.dropboxapi.com","/2/dropins/get_job_status"),r=JSON.stringify({app_key:n,job:o});if(!("withCredentials"in new XMLHttpRequest))throw new Error("Unable to find suitable means of cross domain communication");return t=function(){var o=new XMLHttpRequest;return o.onload=function(){return function(o){var n=o[".tag"];if("complete"===n){if("function"==typeof e.progress&&e.progress(1),"function"==typeof e.success)if(0!==e.success.length&&o.file_ids){var i={fileIds:o.file_ids};e.success(i)}else e.success()}else"pending"===n||"downloading"===n?(null!=o.progress&&"function"==typeof e.progress&&e.progress(o.progress/100),setTimeout(t,1500)):"failed"===n&&"function"==typeof e.error&&e.error(o.error_message)}(JSON.parse(o.responseText))},o.onerror=function(){return"function"==typeof e.error?e.error():void 0},o.open("POST",i,!0),o.setRequestHeader("Content-Type","application/json"),o.send(r)},"function"==typeof e.progress&&e.progress(0),t()}function h(e,o,t){var r,s=JSON.parse(e.data);switch(r=null!=i&&t._popup?i.contentWindow:e.source,void 0!==s.sequence_number&&r.postMessage(JSON.stringify({method:"ack",sequence_number:s.sequence_number}),Dropbox.baseUrl),s.method){case"origin_request":e.source.postMessage(JSON.stringify({method:"origin"}),Dropbox.baseUrl);break;case"ready":if(null!=t.files){var a=void 0;if(t._fetch_url_on_save){for(var c=[],l=0;l0))throw new Error("Old style url as callback is only supported for single files.");r.filename||(r.filename=l(r.url))}}return t};Dropbox.save=function(){for(var e=[],i=0;i=0||i.className.indexOf("dropbox-dropin-default")>=0||i.className.indexOf("dropbox-dropin-disabled")>=0){var o=("function"==typeof n.files?n.files():void 0)||n.files;if(!(null!=o?o.length:void 0))return i.className="dropbox-dropin-btn dropbox-dropin-error",void("function"==typeof n.error&&n.error("Missing files"));Dropbox.save({files:o,success:function(){i.className="dropbox-dropin-btn dropbox-dropin-success","function"==typeof n.success&&n.success()},progress:function(e){i.className="dropbox-dropin-btn dropbox-dropin-progress","function"==typeof n.progress&&n.progress(e)},cancel:function(){"function"==typeof n.cancel&&n.cancel()},error:function(e){i.className="dropbox-dropin-btn dropbox-dropin-error","function"==typeof n.error&&n.error(e)}})}})),i};var u=function(e,o){return" background: ".concat(e,";\n background: -moz-linear-gradient(top, ").concat(e," 0%, ").concat(o," 100%);\n background: -webkit-linear-gradient(top, ").concat(e," 0%, ").concat(o," 100%);\n background: linear-gradient(to bottom, ").concat(e," 0%, ").concat(o," 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='").concat(e,"', endColorstr='").concat(o,"',GradientType=0); ")},d=document.createElement("style");d.type="text/css";var f=' @-webkit-keyframes rotate {\n from { -webkit-transform: rotate(0deg); }\n to { -webkit-transform: rotate(360deg); }\n }\n\n @keyframes rotate {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n .dropbox-dropin-btn, .dropbox-dropin-btn:link, .dropbox-dropin-btn:hover {\n display: inline-block;\n height: 14px;\n font-family: "Lucida Grande", "Segoe UI", "Tahoma", "Helvetica Neue", "Helvetica", sans-serif;\n font-size: 11px;\n font-weight: 600;\n color: #636363;\n text-decoration: none;\n padding: 1px 7px 5px 3px;\n border: 1px solid #ebebeb;\n border-radius: 2px;\n border-bottom-color: #d4d4d4;\n '.concat(u("#fcfcfc","#f5f5f5"),"\n }\n\n .dropbox-dropin-default:hover, .dropbox-dropin-error:hover {\n border-color: #dedede;\n border-bottom-color: #cacaca;\n ").concat(u("#fdfdfd","#f5f5f5"),"\n }\n\n .dropbox-dropin-default:active, .dropbox-dropin-error:active {\n border-color: #d1d1d1;\n box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);\n }\n\n .dropbox-dropin-btn .dropin-btn-status {\n display: inline-block;\n width: 15px;\n height: 14px;\n vertical-align: bottom;\n margin: 0 5px 0 2px;\n background: transparent url('").concat(Dropbox.baseUrl,"/static/metaserver/static/images/widgets/dbx-saver-status.png') no-repeat;\n position: relative;\n top: 2px;\n }\n\n .dropbox-dropin-default .dropin-btn-status {\n background-position: 0px 0px;\n }\n\n .dropbox-dropin-progress .dropin-btn-status {\n width: 18px;\n margin: 0 4px 0 0;\n background: url('").concat(Dropbox.baseUrl,"/static/metaserver/static/images/widgets/dbx-progress.png') no-repeat center center;\n -webkit-animation-name: rotate;\n -webkit-animation-duration: 1.7s;\n -webkit-animation-iteration-count: infinite;\n -webkit-animation-timing-function: linear;\n animation-name: rotate;\n animation-duration: 1.7s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n }\n\n .dropbox-dropin-success .dropin-btn-status {\n background-position: -15px 0px;\n }\n\n .dropbox-dropin-disabled {\n background: #e0e0e0;\n border: 1px #dadada solid;\n border-bottom: 1px solid #ccc;\n box-shadow: none;\n }\n\n .dropbox-dropin-disabled .dropin-btn-status {\n background-position: -30px 0px;\n }\n\n .dropbox-dropin-error .dropin-btn-status {\n background-position: -45px 0px;\n }\n\n @media only screen and (-webkit-min-device-pixel-ratio: 1.4) {\n .dropbox-dropin-btn .dropin-btn-status {\n background-image: url('").concat(Dropbox.baseUrl,"/static/metaserver/static/images/widgets/dbx-saver-status-2x.png');\n background-size: 60px 14px;\n -webkit-background-size: 60px 14px;\n }\n\n .dropbox-dropin-progress .dropin-btn-status {\n background: url('").concat(Dropbox.baseUrl,"/static/metaserver/static/images/widgets/dbx-progress-2x.png') no-repeat center center;\n background-size: 20px 20px;\n -webkit-background-size: 20px 20px;\n }\n }\n\n .dropbox-saver:hover, .dropbox-chooser:hover {\n text-decoration: none;\n cursor: pointer;\n }\n\n .dropbox-chooser, .dropbox-dropin-btn {\n line-height: 11px !important;\n text-decoration: none !important;\n box-sizing: content-box !important;\n -webkit-box-sizing: content-box !important;\n -moz-box-sizing: content-box !important;\n }\n ");d.styleSheet?d.styleSheet.cssText=f:d.textContent=f,document.getElementsByTagName("head")[0].appendChild(d),setTimeout(n.d,0);var h=function(){document.removeEventListener?document.removeEventListener("DOMContentLoaded",h,!1):document.detachEvent&&document.detachEvent("onreadystatechange",h),Object(n.d)(),s.init()};"interactive"===document.readyState||"complete"===document.readyState?setTimeout(h,0):document.addEventListener?document.addEventListener("DOMContentLoaded",h,!1):document.attachEvent("onreadystatechange",h)}},function(e,o,t){"use strict";t.r(o),t.d(o,"Dropin",(function(){return x})),t.d(o,"Dropbox",(function(){return _}));var n=t(1),i=t(0),r=function(){function e(e,o){var t=this;this.popupWindow=e,this.onClose=o,this.stopInterval=function(){clearInterval(t.intervalId)},this.isWindowClosedByUser=function(){try{return t.popupWindow.closed}catch(e){}return!1},this.messagingWindow=function(){return void 0!==i.g&&null!==i.g?i.g.contentWindow:t.popupWindow},this.handleInterval=function(){t.isWindowClosedByUser()&&(t.onClose(),t.stopInterval())},this.intervalId=setInterval(this.handleInterval,100)}return e.open=function(o,t,n){var r=Object(i.j)(t.width,t.height),s="".concat(r,",resizable,scrollbars"),a=window.open(o,"_blank",s);if(null===a)throw new Error("Failed to open the window. Dropbox popups may only be attached to a user-triggered event handler such as a tap or click event.");return a.focus(),new e(a,n)},e}();function s(e){return function(){for(var o=0,t=e;o=0;o--){var t=e[o],n=(t.getAttribute("class")||"").split(" ");n.indexOf("dropbox-saver")>=0?function(e){Dropbox.createSaveButton({files:function(){return[{url:e.getAttribute("data-url")||e.href,filename:e.getAttribute("data-filename")||Object(p.b)(e.pathname)}]}},e)}(t):n.indexOf("dropbox-embed")>=0&&function(e){var o=e.getAttribute("data-url")||e.href;if(o&&e.parentElement){var t=e.getAttribute("data-file-zoom")||void 0,n=e.getAttribute("data-folder-view")||void 0,i=e.getAttribute("data-folder-header-size")||void 0,r=document.createElement("div");r.classList.add("dropbox-embed-container"),r.style.height=e.getAttribute("data-height")||"100%",r.style.width=e.getAttribute("data-width")||"100%",e.parentElement.replaceChild(r,e),Dropbox.embed({link:o,file:{zoom:t},folder:{view:n,headerSize:i}},r)}}(t)}}}();var x=function(){},_=window.Dropbox}]));