@designcrowd/fe-shared-lib 1.5.23 → 1.5.24-upgradepkg
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +20 -1
- package/.storybook/main.ts +5 -2
- package/.storybook-static/assets/Auth-DT64t5h-.css +1 -0
- package/.storybook-static/assets/Auth.stories-C6eXcTSu.js +490 -0
- package/.storybook-static/assets/AuthCrazyDomains.stories-DGvEoWCa.js +73 -0
- package/.storybook-static/assets/Button-5UzSGUF6.css +1 -0
- package/.storybook-static/assets/Button-DKdQT6Fq.js +1 -0
- package/.storybook-static/assets/ButtonGroup-DDPXuhxR.css +1 -0
- package/.storybook-static/assets/ButtonGroup.stories-DlrYMRSk.js +504 -0
- package/.storybook-static/assets/ButtonPrimary-Bu6bXb_c.css +1 -0
- package/.storybook-static/assets/ButtonPrimary-BvWW6Duz.js +1 -0
- package/.storybook-static/assets/Buttons.stories-CKmd6hkZ.js +761 -0
- package/.storybook-static/assets/ButtonsCrazyDomains.stories-DdEuOUrn.js +199 -0
- package/.storybook-static/assets/Checkbox.mixin-DkHpdvGa.js +1 -0
- package/.storybook-static/assets/Checkbox.stories-DPBUC2Mx.js +246 -0
- package/.storybook-static/assets/Checktile.stories-ByaFwplD.js +88 -0
- package/.storybook-static/assets/CollapsiblePanel.stories-Y6q3gP9j.js +56 -0
- package/.storybook-static/assets/ColorPicker.stories-DdxPUB_R.js +73 -0
- package/.storybook-static/assets/CopyToClipboardText.stories-J9qndWxd.js +32 -0
- package/.storybook-static/assets/Dropdown.stories-1zKPATii.js +159 -0
- package/.storybook-static/assets/DropdownItem-BV-BdThU.css +1 -0
- package/.storybook-static/assets/DropdownItem-DA6TdpDb.js +1 -0
- package/.storybook-static/assets/FormControl.mixin-DcEBwrV3.js +1 -0
- package/.storybook-static/assets/HashRouteModal.stories-BGxvqE22.js +60 -0
- package/.storybook-static/assets/HelloBar-CYEZR2kQ.js +1 -0
- package/.storybook-static/assets/HelloBar.stories-597Kxj0W.js +342 -0
- package/.storybook-static/assets/Icon-C17LFvsP.js +145 -0
- package/.storybook-static/assets/Icon.stories-B9iAmcTU.js +151 -0
- package/.storybook-static/assets/Icon.stories-CR5vT9H7.js +791 -0
- package/.storybook-static/assets/Loader-BWGoT_xC.js +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours-CExzox1Z.js +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours-CeAaMKke.css +1 -0
- package/.storybook-static/assets/LogoBusinessBrandColours.stories-kuxAH8B8.js +36 -0
- package/.storybook-static/assets/Masonry-C2MNiGg0.css +1 -0
- package/.storybook-static/assets/Masonry.stories-CTXJLQ_i.js +71 -0
- package/.storybook-static/assets/Modal-CGwEIF5R.css +1 -0
- package/.storybook-static/assets/Modal-CydTNprT.js +1 -0
- package/.storybook-static/assets/Modal.stories-DZiG5NGM.js +345 -0
- package/.storybook-static/assets/Notice.stories-ChOj8CWm.js +222 -0
- package/.storybook-static/assets/NumberStepper-Blffv09R.css +1 -0
- package/.storybook-static/assets/NumberStepper.stories-CVbKJ_oJ.js +64 -0
- package/.storybook-static/assets/PaymentConfigList-BpUMV6cp.css +1 -0
- package/.storybook-static/assets/PaymentConfigList.stories-DUD7OZBS.js +130 -0
- package/.storybook-static/assets/Picture-B8m1I9xN.js +1 -0
- package/.storybook-static/assets/Picture.stories-MMzybhJ6.js +119 -0
- package/.storybook-static/assets/Pill-DLXZ_TL8.js +1 -0
- package/.storybook-static/assets/Pill.stories-DCP7szJm.js +18 -0
- package/.storybook-static/assets/PillBar-os4mJV3M.css +1 -0
- package/.storybook-static/assets/PillBar.stories-Bry-zQ6f.js +41 -0
- package/.storybook-static/assets/Price-C4GZbDSa.js +1 -0
- package/.storybook-static/assets/Price.stories-CMHly9V0.js +337 -0
- package/.storybook-static/assets/PromoCard.stories-xsbFtADE.js +299 -0
- package/.storybook-static/assets/PublishBrandPageModal-Q9-mNG1q.css +1 -0
- package/.storybook-static/assets/PublishBrandPageModal.stories-C9XzW_1m.js +324 -0
- package/.storybook-static/assets/SearchBar.stories-DaIneOSz.js +12 -0
- package/.storybook-static/assets/Select-DnioWQmi.css +1 -0
- package/.storybook-static/assets/Select.stories-BmGYB4pw.js +108 -0
- package/.storybook-static/assets/SellDomainNameList.fixtures-LC6fjr_b.js +1 -0
- package/.storybook-static/assets/SellDomainNameListModal-DH6khE10.css +1 -0
- package/.storybook-static/assets/SellDomainNameListModal-ymtVclFP.js +1 -0
- package/.storybook-static/assets/SellDomainNameListModal.stories-DvGvylgx.js +71 -0
- package/.storybook-static/assets/SellDomainNameListSearchResult-Cpxq0jDA.css +1 -0
- package/.storybook-static/assets/SellDomainNameListSearchResult-D-1CrQyf.js +1 -0
- package/.storybook-static/assets/SellDomainNameSearchWithResults-bX--zu97.js +1 -0
- package/.storybook-static/assets/SellDomainNameSearchWithResults.stories-DRUJjSdH.js +37 -0
- package/.storybook-static/assets/SellDomainNameWidget.stories-CC3LX10s.js +36 -0
- package/.storybook-static/assets/SignIn-CPjf8_2O.css +1 -0
- package/.storybook-static/assets/SignIn-DI0DSDFe.js +1 -0
- package/.storybook-static/assets/Slider-Cog2FFdj.css +1 -0
- package/.storybook-static/assets/Slider.stories-B2KGwnJy.js +141 -0
- package/.storybook-static/assets/SparkleIcon.stories-Dk904hVE.js +547 -0
- package/.storybook-static/assets/StarRating-BtKh7pzm.css +1 -0
- package/.storybook-static/assets/StarRating.stories-d2mgOuo2.js +45 -0
- package/.storybook-static/assets/TabMenu.stories-Cg2yenqj.js +47 -0
- package/.storybook-static/assets/TextCopyField-B66NKTk_.js +1 -0
- package/.storybook-static/assets/TextCopyField.stories-B4_ZlfLU.js +47 -0
- package/.storybook-static/assets/TextInput-CMoUjT_5.js +1 -0
- package/.storybook-static/assets/TextInput.stories-oyyxxf3j.js +233 -0
- package/.storybook-static/assets/Textarea.stories-BvhZR6K2.js +207 -0
- package/.storybook-static/assets/Toggle.stories-yT5-rL2k.js +161 -0
- package/.storybook-static/assets/Tooltip-DyXIgFQH.css +1 -0
- package/.storybook-static/assets/Tooltip-ZukyujG5.js +1 -0
- package/.storybook-static/assets/Tooltip.stories-sJFylRS_.js +953 -0
- package/.storybook-static/assets/UploadYourLogoApplication-Dmw8QcH3.css +1 -0
- package/.storybook-static/assets/UploadYourLogoApplication.stories-C9AvzHO_.js +186 -0
- package/.storybook-static/assets/UploadYourLogoDropzone-B1ffcicv.js +24 -0
- package/.storybook-static/assets/UploadYourLogoDropzone-DQqACf-e.css +1 -0
- package/.storybook-static/assets/UploadYourLogoDropzone.stories-D1Dt2ord.js +55 -0
- package/.storybook-static/assets/UploadedLogoSearchResultCard.stories-D8oF1Yrx.js +79 -0
- package/.storybook-static/assets/WebsiteContextualUpgradeModal-8u1zOZrW.css +1 -0
- package/.storybook-static/assets/WebsiteContextualUpgradeModal.stories-mtcvWOAg.js +211 -0
- package/.storybook-static/assets/_commonjsHelpers-CE1G-McA.js +1 -0
- package/.storybook-static/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/.storybook-static/assets/api-lSJGRrF2.js +1 -0
- package/.storybook-static/assets/axe-DrS73Vi2.js +20 -0
- package/.storybook-static/assets/brand-crowd-api.client-D45NKshX.js +1 -0
- package/.storybook-static/assets/bundled-translations-BoWhEDU_.js +1 -0
- package/.storybook-static/assets/bundled-translations.de-DE-C4lqla4O.js +1 -0
- package/.storybook-static/assets/bundled-translations.es-ES-BxMIllUH.js +1 -0
- package/.storybook-static/assets/bundled-translations.fr-CA-MxZpyz0w.js +1 -0
- package/.storybook-static/assets/bundled-translations.fr-FR-N7UPCZVr.js +1 -0
- package/.storybook-static/assets/bundled-translations.pt-BR-C8tscYuG.js +1 -0
- package/.storybook-static/assets/bundled-translations.pt-PT-Dszj5Xfa.js +1 -0
- package/.storybook-static/assets/carousel-BelyIYOK.css +1 -0
- package/.storybook-static/assets/carousel.stories-CJw3-Iy6.js +668 -0
- package/.storybook-static/assets/event-constants-CMO9VQVu.js +1 -0
- package/.storybook-static/assets/iframe-B3A6OXQU.js +1104 -0
- package/.storybook-static/assets/index-B-eiLVzF.js +7 -0
- package/.storybook-static/assets/index-QquxUozE.js +6 -0
- package/.storybook-static/assets/matchers-5TDFFDYO-HJu_DfWo.js +14 -0
- package/.storybook-static/assets/mediaQueryMixin-CISNqd93.js +1 -0
- package/.storybook-static/assets/preload-helper-PPVm8Dsz.js +1 -0
- package/.storybook-static/assets/tracking-ATsLLehC.js +1 -0
- package/.storybook-static/css/tailwind-brandCrowd.css +2508 -0
- package/.storybook-static/css/tailwind-brandPage.css +2188 -0
- package/.storybook-static/css/tailwind-crazyDomains.css +2508 -0
- package/.storybook-static/css/tailwind-designCom.css +2508 -0
- package/.storybook-static/css/tailwind-designCrowd.css +2508 -0
- package/.storybook-static/favicon-wrapper.svg +46 -0
- package/.storybook-static/favicon.svg +1 -0
- package/.storybook-static/iframe.html +713 -0
- package/.storybook-static/index.html +148 -0
- package/.storybook-static/index.json +1 -0
- package/.storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/.storybook-static/nunito-sans-bold.woff2 +0 -0
- package/.storybook-static/nunito-sans-italic.woff2 +0 -0
- package/.storybook-static/nunito-sans-regular.woff2 +0 -0
- package/.storybook-static/project.json +1 -0
- package/.storybook-static/sb-addons/a11y-1/manager-bundle.js +57 -0
- package/.storybook-static/sb-addons/links-2/manager-bundle.js +3 -0
- package/.storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
- package/.storybook-static/sb-addons/themes-3/manager-bundle.js +3 -0
- package/.storybook-static/sb-common-assets/favicon-wrapper.svg +46 -0
- package/.storybook-static/sb-common-assets/favicon.svg +1 -0
- package/.storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/.storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/.storybook-static/sb-manager/globals-runtime.js +77935 -0
- package/.storybook-static/sb-manager/globals.js +24 -0
- package/.storybook-static/sb-manager/manager-stores.js +23 -0
- package/.storybook-static/sb-manager/runtime.js +20404 -0
- package/.storybook-static/vite-inject-mocker-entry.js +2 -0
- package/CLAUDE.md +2 -4
- package/Dockerfile +1 -1
- package/dist/css/tailwind-brandCrowd.css +2599 -0
- package/dist/css/tailwind-brandPage.css +2279 -0
- package/dist/css/tailwind-crazyDomains.css +2599 -0
- package/dist/css/tailwind-designCom.css +2599 -0
- package/dist/css/tailwind-designCrowd.css +2599 -0
- package/docs/plans/2026-01-30-upgrade-vite7-storybook10-design.md +177 -0
- package/docs/plans/2026-01-30-upgrade-vite7-storybook10.md +388 -0
- package/package.json +32 -36
- package/public/css/tailwind-brandCrowd.css +2508 -0
- package/public/css/tailwind-brandPage.css +2188 -0
- package/public/css/tailwind-crazyDomains.css +2508 -0
- package/public/css/tailwind-designCom.css +2508 -0
- package/public/css/tailwind-designCrowd.css +2508 -0
- package/src/experiences/components/WebsitesContextualUpgradeModal/WebsiteContextualUpgradeModal.vue +2 -2
- package/vite.config.ts +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box{display:none}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{inset:0;position:absolute}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:#3399ffbf;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media(min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media(min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media(min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}.c-byo-cropper .cropper-bg{background-image:none}.c-byo-cropper .cropper-drag-box{background-color:transparent}.c-byo-cropper .cropper-view-box{outline:1px solid #fff;border:1px solid rgba(0,0,0,.2)!important}.c-byo-cropper .cropper-center:before,.c-byo-cropper .cropper-center:after{background-color:#eee}.c-byo-cropper .cropper-face{background-color:#fff}.c-byo-cropper .cropper-line{background-color:#b2b2b2}.c-byo-cropper .cropper-point{background-color:#7a7a7a;border:1px solid #fff;height:10px;width:10px}.c-byo-cropper .c-byo-cropper__container{width:300px;height:300px}.c-byo-cropper .c-byo-cropper__container>div{height:100%;width:100%}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import{a as Pe}from"./index-QquxUozE.js";import{M as ke}from"./index-B-eiLVzF.js";import{E as pe}from"./event-constants-CMO9VQVu.js";import{b as to}from"./brand-crowd-api.client-D45NKshX.js";import{t as be}from"./tracking-ATsLLehC.js";import{c as V,h as W,g as H,e as _,f as Zo,a as M,o as A,t as F,X as re,y as J,Y as Qo,b as vt,A as Zt,O as Qt,x as Jo}from"./iframe-B3A6OXQU.js";import{I as ea}from"./Icon-C17LFvsP.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{U as ta}from"./UploadYourLogoDropzone-B1ffcicv.js";import{h as oa,L as aa}from"./LogoBusinessBrandColours-CExzox1Z.js";import{B as Ne}from"./Button-DKdQT6Fq.js";import{a as na,g as ia}from"./_commonjsHelpers-CE1G-McA.js";import{A as z}from"./api-lSJGRrF2.js";import"./preload-helper-PPVm8Dsz.js";import"./HelloBar-CYEZR2kQ.js";import"./ButtonPrimary-BvWW6Duz.js";const ra={MAX_BYO_FILE_SIZE:26214400},oo={components:{Icon:ea},props:{showCancelButton:{type:Boolean,required:!1,default:!0}},methods:{cancel(){this.$emit("on-cancel")}}},sa={class:"tw-relative tw-h-full lg:tw-h-auto tw-bg-grayscale-200 lg:tw-rounded tw-shadow-md tw-w-full lg:tw-max-w-xl tw-flex-col tw-pt-12"},la={class:"tw-flex tw-items-center tw-justify-center tw-flex-col tw-text-center tw-h-full lg:tw-h-auto"};function ca(u,w,x,y,b,f){const v=M("Icon");return A(),V("div",sa,[x.showCancelButton?(A(),V("button",{key:0,class:"tw-absolute tw-top-0 tw-right-0 tw-pt-6 tw-pr-6 tw-cursor-pointer tw-border-none tw-bg-transparent","data-test-cancel-btn":"",onClick:w[0]||(w[0]=(...m)=>f.cancel&&f.cancel(...m))},[W(v,{name:"close",size:"sm"})])):H("",!0),_("div",la,[Zo(u.$slots,"content")])])}const ha=ae(oo,[["render",ca]]);oo.__docgenInfo={exportName:"default",displayName:"LogoUploadModal",description:"",tags:{},props:[{name:"showCancelButton",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"true"}}],events:[{name:"on-cancel"}],slots:[{name:"content"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoUploadModal.vue"]};const ao={props:{loadingText:{type:String,required:!0}}},pa={class:"tw-pt-12 tw-pb-16 tw-flex tw-flex-col tw-items-center tw-justify-center"},ua={class:"tw-text-black tw-text-2xl tw-font-bold tw-text-center"};function da(u,w,x,y,b,f){return A(),V("div",pa,[w[0]||(w[0]=_("img",{src:"https://dcstatic.com/images/brandcrowd/on-boarding/loading/preloader-1-d1cc0b885f.gif",alt:"Loading",class:"tw-block tw-mb-8"},null,-1)),_("p",ua,F(x.loadingText),1)])}const no=ae(ao,[["render",da]]);ao.__docgenInfo={exportName:"default",displayName:"LogoUploadingLoader",description:"",tags:{},props:[{name:"loadingText",type:{name:"string"},required:!0}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoUploadingLoader.vue"]};const io={components:{LogoUploadingLoader:no},props:{logoFile:{type:Object,required:!0,default:void 0},customUploadData:{type:Object,required:!1,default:null},eventCategory:{type:String,required:!0}},setup(){return{uploadYourLogoTr:re}},data(){return{isRunning:!1}},mounted(){this.uploadLogo()},methods:{async uploadLogo(){if(this.isRunning)return;this.isRunning=!0;let u=0;const w=Date.now(),x=setInterval(()=>{u=Date.now()-w},1),y=await to.uploadLogoAndGetDetails(this.logoFile,this.customUploadData);if(clearInterval(x),this.isRunning=!1,y.error){this.$emit("on-upload-error",y.error);return}y.success?this.$emit("on-upload-success",y.response):this.$emit("on-upload-error",y.response);const b=oa(y.response.data.logoImageDetails.textColors[0],y.response.data.logoImageDetails.backgroundColors[0]);be({eventCategory:this.eventCategory,eventAction:"timeTakenToUpload",eventLabel:`${u}`,event:"byoLogoUpload"}),be({eventCategory:this.eventCategory,eventAction:"logoSize",eventLabel:`${this.logoFile.file.size}`,event:"byoLogoUpload"}),be({eventCategory:this.eventCategory,eventAction:"colorDifference",eventLabel:`${b}`,event:"byoLogoUpload"})}}};function ga(u,w,x,y,b,f){const v=M("LogoUploadingLoader");return A(),J(v,{"loading-text":y.uploadYourLogoTr("uploadingAndConverting")},null,8,["loading-text"])}const fa=ae(io,[["render",ga]]);io.__docgenInfo={exportName:"default",displayName:"LogoUploader",description:"",tags:{},props:[{name:"logoFile",type:{name:"object"},required:!0,defaultValue:{func:!1,value:"undefined"}},{name:"customUploadData",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"null"}},{name:"eventCategory",type:{name:"string"},required:!0}],events:[{name:"on-upload-error",type:{names:["undefined"]}},{name:"on-upload-success",type:{names:["undefined"]}}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoUploader.vue"]};const ro={components:{Button:Ne},props:{errorMessage:{type:String,required:!1,default:null}},setup(){return{uploadYourLogoTr:re}},methods:{cancel(){this.$emit("on-cancel")},openFileSelector(){this.$refs.fileInput.click()},onFileInputChange(u){u.target.files.length&&this.$emit("on-logo-file-change",u.target.files[0])}}},ma={class:"tw-w-full"},va={class:"tw-px-8 tw-pb-8"},wa={class:"tw-mb-8 tw-text-4xl tw-font-bold"},ba={class:"tw-mt-0 tw-text-grayscale-600 tw-text-base tw-text-center"},ya={class:"tw-flex tw-w-full tw-items-center tw-justify-center tw-border-0 tw-border-t tw-border-black/10 tw-border-solid tw-py-4 tw-px-8"};function xa(u,w,x,y,b,f){const v=M("Button");return A(),V("div",ma,[_("div",va,[_("h2",wa,F(y.uploadYourLogoTr("uploadError")),1),_("p",ba,F(x.errorMessage),1)]),_("div",ya,[W(v,{label:y.uploadYourLogoTr("cancel"),size:"large",variant:"outline","container-classes":"tw-mx-2","data-test-cancel-btn":"",onOnClick:f.cancel},null,8,["label","onOnClick"]),_("input",{ref:"fileInput",class:"tw-sr-only",type:"file",accept:".jpg,.jpeg,.png,.svg,.eps",onChange:w[0]||(w[0]=(...m)=>f.onFileInputChange&&f.onFileInputChange(...m))},null,544),W(v,{label:y.uploadYourLogoTr("uploadYourLogoText"),size:"large",variant:"primary-with-icon",icon:"chevron-right-wide","container-classes":"tw-mx-2",onOnClick:f.openFileSelector},null,8,["label","onOnClick"])])])}const _a=ae(ro,[["render",xa]]);ro.__docgenInfo={exportName:"default",displayName:"LogoUploadError",description:"",tags:{},props:[{name:"errorMessage",type:{name:"string"},required:!1,defaultValue:{func:!1,value:"null"}}],events:[{name:"on-cancel"},{name:"on-logo-file-change",type:{names:["undefined"]}}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoUploadError.vue"]};const so={components:{Button:Ne},setup(){return{uploadYourLogoTr:re}},methods:{goBack(){this.$emit("on-go-back")},confirm(){this.$emit("on-confirm")}}},Oa={class:"tw-w-full"},Ca={class:"tw-px-8 tw-pb-8"},La={class:"tw-mb-4 tw-text-4xl tw-text-black tw-font-bold"},Da={class:"tw-mt-0 tw-text-grayscale-600 tw-text-base tw-text-center"},Ea={class:"tw-flex tw-w-full tw-items-center tw-justify-center tw-border-0 tw-border-t tw-border-black/10 tw-border-solid tw-py-4 tw-px-8"};function Ta(u,w,x,y,b,f){const v=M("Button");return A(),V("div",Oa,[_("div",Ca,[_("h2",La,F(y.uploadYourLogoTr("exitConfirmationTitle")),1),_("p",Da,F(y.uploadYourLogoTr("exitConfirmationDescription")),1)]),_("div",Ea,[W(v,{label:y.uploadYourLogoTr("no"),size:"large",variant:"outline","container-classes":"tw-mx-2","data-test-cancel-no-btn":"",onOnClick:f.goBack},null,8,["label","onOnClick"]),W(v,{label:y.uploadYourLogoTr("yes"),size:"large",variant:"primary-with-icon",icon:"chevron-right-wide","container-classes":"tw-mx-2","data-test-cancel-yes-btn":"",onOnClick:f.confirm},null,8,["label","onOnClick"])])])}const Sa=ae(so,[["render",Ta]]);so.__docgenInfo={exportName:"default",displayName:"LogoUploadExitConfirmation",description:"",tags:{},events:[{name:"on-go-back"},{name:"on-confirm"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoUploadExitConfirmation.vue"]};var je={};const Ba=na(Qo);var $e={exports:{}};var Aa=$e.exports,Jt;function Ua(){return Jt||(Jt=1,(function(u,w){(function(x,y){u.exports=y()})(Aa,(function(){function x(a,e){var o=Object.keys(a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(a);e&&(t=t.filter(function(r){return Object.getOwnPropertyDescriptor(a,r).enumerable})),o.push.apply(o,t)}return o}function y(a){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?x(Object(o),!0).forEach(function(t){U(a,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(o)):x(Object(o)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(o,t))})}return a}function b(a){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(a)}function f(a,e){if(!(a instanceof e))throw new TypeError("Cannot call a class as a function")}function v(a,e){for(var o=0;o<e.length;o++){var t=e[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,bt(t.key),t)}}function m(a,e,o){return e&&v(a.prototype,e),o&&v(a,o),Object.defineProperty(a,"prototype",{writable:!1}),a}function U(a,e,o){return e=bt(e),e in a?Object.defineProperty(a,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[e]=o,a}function $(a){return ue(a)||Ke(a)||Ze(a)||Qe()}function ue(a){if(Array.isArray(a))return De(a)}function Ke(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Ze(a,e){if(a){if(typeof a=="string")return De(a,e);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return De(a,e)}}function De(a,e){(e==null||e>a.length)&&(e=a.length);for(var o=0,t=new Array(e);o<e;o++)t[o]=a[o];return t}function Qe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(a,e){if(typeof a!="object"||a===null)return a;var o=a[Symbol.toPrimitive];if(o!==void 0){var t=o.call(a,e);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function bt(a){var e=Je(a,"string");return typeof e=="symbol"?e:String(e)}var Ye=typeof window<"u"&&typeof window.document<"u",ee=Ye?window:{},et=Ye&&ee.document.documentElement?"ontouchstart"in ee.document.documentElement:!1,tt=Ye?"PointerEvent"in ee:!1,T="cropper",ot="all",yt="crop",xt="move",_t="zoom",de="e",ge="w",ye="s",se="n",Ee="ne",Te="nw",Se="se",Be="sw",at="".concat(T,"-crop"),Ot="".concat(T,"-disabled"),G="".concat(T,"-hidden"),Ct="".concat(T,"-hide"),go="".concat(T,"-invisible"),Re="".concat(T,"-modal"),nt="".concat(T,"-move"),Ae="".concat(T,"Action"),ze="".concat(T,"Preview"),it="crop",Lt="move",Dt="none",rt="crop",st="cropend",lt="cropmove",ct="cropstart",Et="dblclick",fo=et?"touchstart":"mousedown",mo=et?"touchmove":"mousemove",vo=et?"touchend touchcancel":"mouseup",Tt=tt?"pointerdown":fo,St=tt?"pointermove":mo,Bt=tt?"pointerup pointercancel":vo,At="ready",Ut="resize",It="wheel",ht="zoom",Pt="image/jpeg",wo=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,bo=/^data:/,yo=/^data:image\/jpeg;base64,/,xo=/^img|canvas$/i,kt=200,Nt=100,Mt={viewMode:0,dragMode:it,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:kt,minContainerHeight:Nt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},_o='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Oo=Number.isNaN||ee.isNaN;function O(a){return typeof a=="number"&&!Oo(a)}var Yt=function(e){return e>0&&e<1/0};function pt(a){return typeof a>"u"}function fe(a){return b(a)==="object"&&a!==null}var Co=Object.prototype.hasOwnProperty;function xe(a){if(!fe(a))return!1;try{var e=a.constructor,o=e.prototype;return e&&o&&Co.call(o,"isPrototypeOf")}catch{return!1}}function j(a){return typeof a=="function"}var Lo=Array.prototype.slice;function Rt(a){return Array.from?Array.from(a):Lo.call(a)}function I(a,e){return a&&j(e)&&(Array.isArray(a)||O(a.length)?Rt(a).forEach(function(o,t){e.call(a,o,t,a)}):fe(a)&&Object.keys(a).forEach(function(o){e.call(a,a[o],o,a)})),a}var S=Object.assign||function(e){for(var o=arguments.length,t=new Array(o>1?o-1:0),r=1;r<o;r++)t[r-1]=arguments[r];return fe(e)&&t.length>0&&t.forEach(function(n){fe(n)&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e},Do=/\.\d*(?:0|9){12}\d*$/;function _e(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Do.test(a)?Math.round(a*e)/e:a}var Eo=/^width|height|left|top|marginLeft|marginTop$/;function le(a,e){var o=a.style;I(e,function(t,r){Eo.test(r)&&O(t)&&(t="".concat(t,"px")),o[r]=t})}function To(a,e){return a.classList?a.classList.contains(e):a.className.indexOf(e)>-1}function Y(a,e){if(e){if(O(a.length)){I(a,function(t){Y(t,e)});return}if(a.classList){a.classList.add(e);return}var o=a.className.trim();o?o.indexOf(e)<0&&(a.className="".concat(o," ").concat(e)):a.className=e}}function te(a,e){if(e){if(O(a.length)){I(a,function(o){te(o,e)});return}if(a.classList){a.classList.remove(e);return}a.className.indexOf(e)>=0&&(a.className=a.className.replace(e,""))}}function Oe(a,e,o){if(e){if(O(a.length)){I(a,function(t){Oe(t,e,o)});return}o?Y(a,e):te(a,e)}}var So=/([a-z\d])([A-Z])/g;function ut(a){return a.replace(So,"$1-$2").toLowerCase()}function dt(a,e){return fe(a[e])?a[e]:a.dataset?a.dataset[e]:a.getAttribute("data-".concat(ut(e)))}function Ue(a,e,o){fe(o)?a[e]=o:a.dataset?a.dataset[e]=o:a.setAttribute("data-".concat(ut(e)),o)}function Bo(a,e){if(fe(a[e]))try{delete a[e]}catch{a[e]=void 0}else if(a.dataset)try{delete a.dataset[e]}catch{a.dataset[e]=void 0}else a.removeAttribute("data-".concat(ut(e)))}var zt=/\s\s*/,Ft=(function(){var a=!1;if(Ye){var e=!1,o=function(){},t=Object.defineProperty({},"once",{get:function(){return a=!0,e},set:function(n){e=n}});ee.addEventListener("test",o,t),ee.removeEventListener("test",o,t)}return a})();function Q(a,e,o){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=o;e.trim().split(zt).forEach(function(n){if(!Ft){var i=a.listeners;i&&i[n]&&i[n][o]&&(r=i[n][o],delete i[n][o],Object.keys(i[n]).length===0&&delete i[n],Object.keys(i).length===0&&delete a.listeners)}a.removeEventListener(n,r,t)})}function K(a,e,o){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=o;e.trim().split(zt).forEach(function(n){if(t.once&&!Ft){var i=a.listeners,s=i===void 0?{}:i;r=function(){delete s[n][o],a.removeEventListener(n,r,t);for(var h=arguments.length,l=new Array(h),c=0;c<h;c++)l[c]=arguments[c];o.apply(a,l)},s[n]||(s[n]={}),s[n][o]&&a.removeEventListener(n,s[n][o],t),s[n][o]=r,a.listeners=s}a.addEventListener(n,r,t)})}function Ce(a,e,o){var t;return j(Event)&&j(CustomEvent)?t=new CustomEvent(e,{detail:o,bubbles:!0,cancelable:!0}):(t=document.createEvent("CustomEvent"),t.initCustomEvent(e,!0,!0,o)),a.dispatchEvent(t)}function Gt(a){var e=a.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var gt=ee.location,Ao=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function jt(a){var e=a.match(Ao);return e!==null&&(e[1]!==gt.protocol||e[2]!==gt.hostname||e[3]!==gt.port)}function Xt(a){var e="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+e}function Ie(a){var e=a.rotate,o=a.scaleX,t=a.scaleY,r=a.translateX,n=a.translateY,i=[];O(r)&&r!==0&&i.push("translateX(".concat(r,"px)")),O(n)&&n!==0&&i.push("translateY(".concat(n,"px)")),O(e)&&e!==0&&i.push("rotate(".concat(e,"deg)")),O(o)&&o!==1&&i.push("scaleX(".concat(o,")")),O(t)&&t!==1&&i.push("scaleY(".concat(t,")"));var s=i.length?i.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Uo(a){var e=y({},a),o=0;return I(a,function(t,r){delete e[r],I(e,function(n){var i=Math.abs(t.startX-n.startX),s=Math.abs(t.startY-n.startY),d=Math.abs(t.endX-n.endX),h=Math.abs(t.endY-n.endY),l=Math.sqrt(i*i+s*s),c=Math.sqrt(d*d+h*h),p=(c-l)/l;Math.abs(p)>Math.abs(o)&&(o=p)})}),o}function Fe(a,e){var o=a.pageX,t=a.pageY,r={endX:o,endY:t};return e?r:y({startX:o,startY:t},r)}function Io(a){var e=0,o=0,t=0;return I(a,function(r){var n=r.startX,i=r.startY;e+=n,o+=i,t+=1}),e/=t,o/=t,{pageX:e,pageY:o}}function ce(a){var e=a.aspectRatio,o=a.height,t=a.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",n=Yt(t),i=Yt(o);if(n&&i){var s=o*e;r==="contain"&&s>t||r==="cover"&&s<t?o=t/e:t=o*e}else n?o=t/e:i&&(t=o*e);return{width:t,height:o}}function Po(a){var e=a.width,o=a.height,t=a.degree;if(t=Math.abs(t)%180,t===90)return{width:o,height:e};var r=t%90*Math.PI/180,n=Math.sin(r),i=Math.cos(r),s=e*i+o*n,d=e*n+o*i;return t>90?{width:d,height:s}:{width:s,height:d}}function ko(a,e,o,t){var r=e.aspectRatio,n=e.naturalWidth,i=e.naturalHeight,s=e.rotate,d=s===void 0?0:s,h=e.scaleX,l=h===void 0?1:h,c=e.scaleY,p=c===void 0?1:c,L=o.aspectRatio,C=o.naturalWidth,B=o.naturalHeight,D=t.fillColor,k=D===void 0?"transparent":D,R=t.imageSmoothingEnabled,P=R===void 0?!0:R,ne=t.imageSmoothingQuality,q=ne===void 0?"low":ne,g=t.maxWidth,E=g===void 0?1/0:g,N=t.maxHeight,Z=N===void 0?1/0:N,ie=t.minWidth,me=ie===void 0?0:ie,ve=t.minHeight,he=ve===void 0?0:ve,oe=document.createElement("canvas"),X=oe.getContext("2d"),we=ce({aspectRatio:L,width:E,height:Z}),Ge=ce({aspectRatio:L,width:me,height:he},"cover"),ft=Math.min(we.width,Math.max(Ge.width,C)),mt=Math.min(we.height,Math.max(Ge.height,B)),Vt=ce({aspectRatio:r,width:E,height:Z}),Wt=ce({aspectRatio:r,width:me,height:he},"cover"),$t=Math.min(Vt.width,Math.max(Wt.width,n)),Kt=Math.min(Vt.height,Math.max(Wt.height,i)),$o=[-$t/2,-Kt/2,$t,Kt];return oe.width=_e(ft),oe.height=_e(mt),X.fillStyle=k,X.fillRect(0,0,ft,mt),X.save(),X.translate(ft/2,mt/2),X.rotate(d*Math.PI/180),X.scale(l,p),X.imageSmoothingEnabled=P,X.imageSmoothingQuality=q,X.drawImage.apply(X,[a].concat($($o.map(function(Ko){return Math.floor(_e(Ko))})))),X.restore(),oe}var Ht=String.fromCharCode;function No(a,e,o){var t="";o+=e;for(var r=e;r<o;r+=1)t+=Ht(a.getUint8(r));return t}var Mo=/^data:.*,/;function Yo(a){var e=a.replace(Mo,""),o=atob(e),t=new ArrayBuffer(o.length),r=new Uint8Array(t);return I(r,function(n,i){r[i]=o.charCodeAt(i)}),t}function Ro(a,e){for(var o=[],t=8192,r=new Uint8Array(a);r.length>0;)o.push(Ht.apply(null,Rt(r.subarray(0,t)))),r=r.subarray(t);return"data:".concat(e,";base64,").concat(btoa(o.join("")))}function zo(a){var e=new DataView(a),o;try{var t,r,n;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var i=e.byteLength,s=2;s+1<i;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){r=s;break}s+=1}if(r){var d=r+4,h=r+10;if(No(e,d,4)==="Exif"){var l=e.getUint16(h);if(t=l===18761,(t||l===19789)&&e.getUint16(h+2,t)===42){var c=e.getUint32(h+4,t);c>=8&&(n=h+c)}}}if(n){var p=e.getUint16(n,t),L,C;for(C=0;C<p;C+=1)if(L=n+C*12+2,e.getUint16(L,t)===274){L+=8,o=e.getUint16(L,t),e.setUint16(L,1,t);break}}}catch{o=1}return o}function Fo(a){var e=0,o=1,t=1;switch(a){case 2:o=-1;break;case 3:e=-180;break;case 4:t=-1;break;case 5:e=90,t=-1;break;case 6:e=90;break;case 7:e=90,o=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:o,scaleY:t}}var Go={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,o=this.options,t=this.container,r=this.cropper,n=Number(o.minContainerWidth),i=Number(o.minContainerHeight);Y(r,G),te(e,G);var s={width:Math.max(t.offsetWidth,n>=0?n:kt),height:Math.max(t.offsetHeight,i>=0?i:Nt)};this.containerData=s,le(r,{width:s.width,height:s.height}),Y(e,G),te(r,G)},initCanvas:function(){var e=this.containerData,o=this.imageData,t=this.options.viewMode,r=Math.abs(o.rotate)%180===90,n=r?o.naturalHeight:o.naturalWidth,i=r?o.naturalWidth:o.naturalHeight,s=n/i,d=e.width,h=e.height;e.height*s>e.width?t===3?d=e.height*s:h=e.width/s:t===3?h=e.width/s:d=e.height*s;var l={aspectRatio:s,naturalWidth:n,naturalHeight:i,width:d,height:h};this.canvasData=l,this.limited=t===1||t===2,this.limitCanvas(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.left=(e.width-l.width)/2,l.top=(e.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCanvasData=S({},l)},limitCanvas:function(e,o){var t=this.options,r=this.containerData,n=this.canvasData,i=this.cropBoxData,s=t.viewMode,d=n.aspectRatio,h=this.cropped&&i;if(e){var l=Number(t.minCanvasWidth)||0,c=Number(t.minCanvasHeight)||0;s>1?(l=Math.max(l,r.width),c=Math.max(c,r.height),s===3&&(c*d>l?l=c*d:c=l/d)):s>0&&(l?l=Math.max(l,h?i.width:0):c?c=Math.max(c,h?i.height:0):h&&(l=i.width,c=i.height,c*d>l?l=c*d:c=l/d));var p=ce({aspectRatio:d,width:l,height:c});l=p.width,c=p.height,n.minWidth=l,n.minHeight=c,n.maxWidth=1/0,n.maxHeight=1/0}if(o)if(s>(h?0:1)){var L=r.width-n.width,C=r.height-n.height;n.minLeft=Math.min(0,L),n.minTop=Math.min(0,C),n.maxLeft=Math.max(0,L),n.maxTop=Math.max(0,C),h&&this.limited&&(n.minLeft=Math.min(i.left,i.left+(i.width-n.width)),n.minTop=Math.min(i.top,i.top+(i.height-n.height)),n.maxLeft=i.left,n.maxTop=i.top,s===2&&(n.width>=r.width&&(n.minLeft=Math.min(0,L),n.maxLeft=Math.max(0,L)),n.height>=r.height&&(n.minTop=Math.min(0,C),n.maxTop=Math.max(0,C))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=r.width,n.maxTop=r.height},renderCanvas:function(e,o){var t=this.canvasData,r=this.imageData;if(o){var n=Po({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=n.width,s=n.height,d=t.width*(i/t.naturalWidth),h=t.height*(s/t.naturalHeight);t.left-=(d-t.width)/2,t.top-=(h-t.height)/2,t.width=d,t.height=h,t.aspectRatio=i/s,t.naturalWidth=i,t.naturalHeight=s,this.limitCanvas(!0,!1)}(t.width>t.maxWidth||t.width<t.minWidth)&&(t.left=t.oldLeft),(t.height>t.maxHeight||t.height<t.minHeight)&&(t.top=t.oldTop),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),this.limitCanvas(!1,!0),t.left=Math.min(Math.max(t.left,t.minLeft),t.maxLeft),t.top=Math.min(Math.max(t.top,t.minTop),t.maxTop),t.oldLeft=t.left,t.oldTop=t.top,le(this.canvas,S({width:t.width,height:t.height},Ie({translateX:t.left,translateY:t.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var o=this.canvasData,t=this.imageData,r=t.naturalWidth*(o.width/o.naturalWidth),n=t.naturalHeight*(o.height/o.naturalHeight);S(t,{width:r,height:n,left:(o.width-r)/2,top:(o.height-n)/2}),le(this.image,S({width:t.width,height:t.height},Ie(S({translateX:t.left,translateY:t.top},t)))),e&&this.output()},initCropBox:function(){var e=this.options,o=this.canvasData,t=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,n={width:o.width,height:o.height};t&&(o.height*t>o.width?n.height=n.width/t:n.width=n.height*t),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*r),n.height=Math.max(n.minHeight,n.height*r),n.left=o.left+(o.width-n.width)/2,n.top=o.top+(o.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=S({},n)},limitCropBox:function(e,o){var t=this.options,r=this.containerData,n=this.canvasData,i=this.cropBoxData,s=this.limited,d=t.aspectRatio;if(e){var h=Number(t.minCropBoxWidth)||0,l=Number(t.minCropBoxHeight)||0,c=s?Math.min(r.width,n.width,n.width+n.left,r.width-n.left):r.width,p=s?Math.min(r.height,n.height,n.height+n.top,r.height-n.top):r.height;h=Math.min(h,r.width),l=Math.min(l,r.height),d&&(h&&l?l*d>h?l=h/d:h=l*d:h?l=h/d:l&&(h=l*d),p*d>c?p=c/d:c=p*d),i.minWidth=Math.min(h,c),i.minHeight=Math.min(l,p),i.maxWidth=c,i.maxHeight=p}o&&(s?(i.minLeft=Math.max(0,n.left),i.minTop=Math.max(0,n.top),i.maxLeft=Math.min(r.width,n.left+n.width)-i.width,i.maxTop=Math.min(r.height,n.top+n.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,o=this.containerData,t=this.cropBoxData;(t.width>t.maxWidth||t.width<t.minWidth)&&(t.left=t.oldLeft),(t.height>t.maxHeight||t.height<t.minHeight)&&(t.top=t.oldTop),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),this.limitCropBox(!1,!0),t.left=Math.min(Math.max(t.left,t.minLeft),t.maxLeft),t.top=Math.min(Math.max(t.top,t.minTop),t.maxTop),t.oldLeft=t.left,t.oldTop=t.top,e.movable&&e.cropBoxMovable&&Ue(this.face,Ae,t.width>=o.width&&t.height>=o.height?xt:ot),le(this.cropBox,S({width:t.width,height:t.height},Ie({translateX:t.left,translateY:t.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ce(this.element,rt,this.getData())}},jo={initPreview:function(){var e=this.element,o=this.crossOrigin,t=this.options.preview,r=o?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",i=document.createElement("img");if(o&&(i.crossOrigin=o),i.src=r,i.alt=n,this.viewBox.appendChild(i),this.viewBoxImage=i,!!t){var s=t;typeof t=="string"?s=e.ownerDocument.querySelectorAll(t):t.querySelector&&(s=[t]),this.previews=s,I(s,function(d){var h=document.createElement("img");Ue(d,ze,{width:d.offsetWidth,height:d.offsetHeight,html:d.innerHTML}),o&&(h.crossOrigin=o),h.src=r,h.alt=n,h.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',d.innerHTML="",d.appendChild(h)})}},resetPreview:function(){I(this.previews,function(e){var o=dt(e,ze);le(e,{width:o.width,height:o.height}),e.innerHTML=o.html,Bo(e,ze)})},preview:function(){var e=this.imageData,o=this.canvasData,t=this.cropBoxData,r=t.width,n=t.height,i=e.width,s=e.height,d=t.left-o.left-e.left,h=t.top-o.top-e.top;!this.cropped||this.disabled||(le(this.viewBoxImage,S({width:i,height:s},Ie(S({translateX:-d,translateY:-h},e)))),I(this.previews,function(l){var c=dt(l,ze),p=c.width,L=c.height,C=p,B=L,D=1;r&&(D=p/r,B=n*D),n&&B>L&&(D=L/n,C=r*D,B=L),le(l,{width:C,height:B}),le(l.getElementsByTagName("img")[0],S({width:i*D,height:s*D},Ie(S({translateX:-d*D,translateY:-h*D},e))))}))}},Xo={bind:function(){var e=this.element,o=this.options,t=this.cropper;j(o.cropstart)&&K(e,ct,o.cropstart),j(o.cropmove)&&K(e,lt,o.cropmove),j(o.cropend)&&K(e,st,o.cropend),j(o.crop)&&K(e,rt,o.crop),j(o.zoom)&&K(e,ht,o.zoom),K(t,Tt,this.onCropStart=this.cropStart.bind(this)),o.zoomable&&o.zoomOnWheel&&K(t,It,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&K(t,Et,this.onDblclick=this.dblclick.bind(this)),K(e.ownerDocument,St,this.onCropMove=this.cropMove.bind(this)),K(e.ownerDocument,Bt,this.onCropEnd=this.cropEnd.bind(this)),o.responsive&&K(window,Ut,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,o=this.options,t=this.cropper;j(o.cropstart)&&Q(e,ct,o.cropstart),j(o.cropmove)&&Q(e,lt,o.cropmove),j(o.cropend)&&Q(e,st,o.cropend),j(o.crop)&&Q(e,rt,o.crop),j(o.zoom)&&Q(e,ht,o.zoom),Q(t,Tt,this.onCropStart),o.zoomable&&o.zoomOnWheel&&Q(t,It,this.onWheel,{passive:!1,capture:!0}),o.toggleDragModeOnDblclick&&Q(t,Et,this.onDblclick),Q(e.ownerDocument,St,this.onCropMove),Q(e.ownerDocument,Bt,this.onCropEnd),o.responsive&&Q(window,Ut,this.onResize)}},Ho={resize:function(){if(!this.disabled){var e=this.options,o=this.container,t=this.containerData,r=o.offsetWidth/t.width,n=o.offsetHeight/t.height,i=Math.abs(r-1)>Math.abs(n-1)?r:n;if(i!==1){var s,d;e.restore&&(s=this.getCanvasData(),d=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(I(s,function(h,l){s[l]=h*i})),this.setCropBoxData(I(d,function(h,l){d[l]=h*i})))}}},dblclick:function(){this.disabled||this.options.dragMode===Dt||this.setDragMode(To(this.dragBox,at)?Lt:it)},wheel:function(e){var o=this,t=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){o.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*t,e)))},cropStart:function(e){var o=e.buttons,t=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(O(o)&&o!==1||O(t)&&t!==0||e.ctrlKey))){var r=this.options,n=this.pointers,i;e.changedTouches?I(e.changedTouches,function(s){n[s.identifier]=Fe(s)}):n[e.pointerId||0]=Fe(e),Object.keys(n).length>1&&r.zoomable&&r.zoomOnTouch?i=_t:i=dt(e.target,Ae),wo.test(i)&&Ce(this.element,ct,{originalEvent:e,action:i})!==!1&&(e.preventDefault(),this.action=i,this.cropping=!1,i===yt&&(this.cropping=!0,Y(this.dragBox,Re)))}},cropMove:function(e){var o=this.action;if(!(this.disabled||!o)){var t=this.pointers;e.preventDefault(),Ce(this.element,lt,{originalEvent:e,action:o})!==!1&&(e.changedTouches?I(e.changedTouches,function(r){S(t[r.identifier]||{},Fe(r,!0))}):S(t[e.pointerId||0]||{},Fe(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var o=this.action,t=this.pointers;e.changedTouches?I(e.changedTouches,function(r){delete t[r.identifier]}):delete t[e.pointerId||0],o&&(e.preventDefault(),Object.keys(t).length||(this.action=""),this.cropping&&(this.cropping=!1,Oe(this.dragBox,Re,this.cropped&&this.options.modal)),Ce(this.element,st,{originalEvent:e,action:o}))}}},qo={change:function(e){var o=this.options,t=this.canvasData,r=this.containerData,n=this.cropBoxData,i=this.pointers,s=this.action,d=o.aspectRatio,h=n.left,l=n.top,c=n.width,p=n.height,L=h+c,C=l+p,B=0,D=0,k=r.width,R=r.height,P=!0,ne;!d&&e.shiftKey&&(d=c&&p?c/p:1),this.limited&&(B=n.minLeft,D=n.minTop,k=B+Math.min(r.width,t.width,t.left+t.width),R=D+Math.min(r.height,t.height,t.top+t.height));var q=i[Object.keys(i)[0]],g={x:q.endX-q.startX,y:q.endY-q.startY},E=function(Z){switch(Z){case de:L+g.x>k&&(g.x=k-L);break;case ge:h+g.x<B&&(g.x=B-h);break;case se:l+g.y<D&&(g.y=D-l);break;case ye:C+g.y>R&&(g.y=R-C);break}};switch(s){case ot:h+=g.x,l+=g.y;break;case de:if(g.x>=0&&(L>=k||d&&(l<=D||C>=R))){P=!1;break}E(de),c+=g.x,c<0&&(s=ge,c=-c,h-=c),d&&(p=c/d,l+=(n.height-p)/2);break;case se:if(g.y<=0&&(l<=D||d&&(h<=B||L>=k))){P=!1;break}E(se),p-=g.y,l+=g.y,p<0&&(s=ye,p=-p,l-=p),d&&(c=p*d,h+=(n.width-c)/2);break;case ge:if(g.x<=0&&(h<=B||d&&(l<=D||C>=R))){P=!1;break}E(ge),c-=g.x,h+=g.x,c<0&&(s=de,c=-c,h-=c),d&&(p=c/d,l+=(n.height-p)/2);break;case ye:if(g.y>=0&&(C>=R||d&&(h<=B||L>=k))){P=!1;break}E(ye),p+=g.y,p<0&&(s=se,p=-p,l-=p),d&&(c=p*d,h+=(n.width-c)/2);break;case Ee:if(d){if(g.y<=0&&(l<=D||L>=k)){P=!1;break}E(se),p-=g.y,l+=g.y,c=p*d}else E(se),E(de),g.x>=0?L<k?c+=g.x:g.y<=0&&l<=D&&(P=!1):c+=g.x,g.y<=0?l>D&&(p-=g.y,l+=g.y):(p-=g.y,l+=g.y);c<0&&p<0?(s=Be,p=-p,c=-c,l-=p,h-=c):c<0?(s=Te,c=-c,h-=c):p<0&&(s=Se,p=-p,l-=p);break;case Te:if(d){if(g.y<=0&&(l<=D||h<=B)){P=!1;break}E(se),p-=g.y,l+=g.y,c=p*d,h+=n.width-c}else E(se),E(ge),g.x<=0?h>B?(c-=g.x,h+=g.x):g.y<=0&&l<=D&&(P=!1):(c-=g.x,h+=g.x),g.y<=0?l>D&&(p-=g.y,l+=g.y):(p-=g.y,l+=g.y);c<0&&p<0?(s=Se,p=-p,c=-c,l-=p,h-=c):c<0?(s=Ee,c=-c,h-=c):p<0&&(s=Be,p=-p,l-=p);break;case Be:if(d){if(g.x<=0&&(h<=B||C>=R)){P=!1;break}E(ge),c-=g.x,h+=g.x,p=c/d}else E(ye),E(ge),g.x<=0?h>B?(c-=g.x,h+=g.x):g.y>=0&&C>=R&&(P=!1):(c-=g.x,h+=g.x),g.y>=0?C<R&&(p+=g.y):p+=g.y;c<0&&p<0?(s=Ee,p=-p,c=-c,l-=p,h-=c):c<0?(s=Se,c=-c,h-=c):p<0&&(s=Te,p=-p,l-=p);break;case Se:if(d){if(g.x>=0&&(L>=k||C>=R)){P=!1;break}E(de),c+=g.x,p=c/d}else E(ye),E(de),g.x>=0?L<k?c+=g.x:g.y>=0&&C>=R&&(P=!1):c+=g.x,g.y>=0?C<R&&(p+=g.y):p+=g.y;c<0&&p<0?(s=Te,p=-p,c=-c,l-=p,h-=c):c<0?(s=Be,c=-c,h-=c):p<0&&(s=Ee,p=-p,l-=p);break;case xt:this.move(g.x,g.y),P=!1;break;case _t:this.zoom(Uo(i),e),P=!1;break;case yt:if(!g.x||!g.y){P=!1;break}ne=Gt(this.cropper),h=q.startX-ne.left,l=q.startY-ne.top,c=n.minWidth,p=n.minHeight,g.x>0?s=g.y>0?Se:Ee:g.x<0&&(h-=c,s=g.y>0?Be:Te),g.y<0&&(l-=p),this.cropped||(te(this.cropBox,G),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}P&&(n.width=c,n.height=p,n.left=h,n.top=l,this.action=s,this.renderCropBox()),I(i,function(N){N.startX=N.endX,N.startY=N.endY})}},Vo={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Y(this.dragBox,Re),te(this.cropBox,G),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=S({},this.initialImageData),this.canvasData=S({},this.initialCanvasData),this.cropBoxData=S({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(S(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),te(this.dragBox,Re),Y(this.cropBox,G)),this},replace:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),o?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,I(this.previews,function(t){t.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,te(this.cropper,Ot)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Y(this.cropper,Ot)),this},destroy:function(){var e=this.element;return e[T]?(e[T]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,t=this.canvasData,r=t.left,n=t.top;return this.moveTo(pt(e)?e:r+Number(e),pt(o)?o:n+Number(o))},moveTo:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,t=this.canvasData,r=!1;return e=Number(e),o=Number(o),this.ready&&!this.disabled&&this.options.movable&&(O(e)&&(t.left=e,r=!0),O(o)&&(t.top=o,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,o){var t=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(t.width*e/t.naturalWidth,null,o)},zoomTo:function(e,o,t){var r=this.options,n=this.canvasData,i=n.width,s=n.height,d=n.naturalWidth,h=n.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var l=d*e,c=h*e;if(Ce(this.element,ht,{ratio:e,oldRatio:i/d,originalEvent:t})===!1)return this;if(t){var p=this.pointers,L=Gt(this.cropper),C=p&&Object.keys(p).length?Io(p):{pageX:t.pageX,pageY:t.pageY};n.left-=(l-i)*((C.pageX-L.left-n.left)/i),n.top-=(c-s)*((C.pageY-L.top-n.top)/s)}else xe(o)&&O(o.x)&&O(o.y)?(n.left-=(l-i)*((o.x-n.left)/i),n.top-=(c-s)*((o.y-n.top)/s)):(n.left-=(l-i)/2,n.top-=(c-s)/2);n.width=l,n.height=c,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),O(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var o=this.imageData.scaleY;return this.scale(e,O(o)?o:1)},scaleY:function(e){var o=this.imageData.scaleX;return this.scale(O(o)?o:1,e)},scale:function(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,t=this.imageData,r=!1;return e=Number(e),o=Number(o),this.ready&&!this.disabled&&this.options.scalable&&(O(e)&&(t.scaleX=e,r=!0),O(o)&&(t.scaleY=o,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.options,t=this.imageData,r=this.canvasData,n=this.cropBoxData,i;if(this.ready&&this.cropped){i={x:n.left-r.left,y:n.top-r.top,width:n.width,height:n.height};var s=t.width/t.naturalWidth;if(I(i,function(l,c){i[c]=l/s}),e){var d=Math.round(i.y+i.height),h=Math.round(i.x+i.width);i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=h-i.x,i.height=d-i.y}}else i={x:0,y:0,width:0,height:0};return o.rotatable&&(i.rotate=t.rotate||0),o.scalable&&(i.scaleX=t.scaleX||1,i.scaleY=t.scaleY||1),i},setData:function(e){var o=this.options,t=this.imageData,r=this.canvasData,n={};if(this.ready&&!this.disabled&&xe(e)){var i=!1;o.rotatable&&O(e.rotate)&&e.rotate!==t.rotate&&(t.rotate=e.rotate,i=!0),o.scalable&&(O(e.scaleX)&&e.scaleX!==t.scaleX&&(t.scaleX=e.scaleX,i=!0),O(e.scaleY)&&e.scaleY!==t.scaleY&&(t.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var s=t.width/t.naturalWidth;O(e.x)&&(n.left=e.x*s+r.left),O(e.y)&&(n.top=e.y*s+r.top),O(e.width)&&(n.width=e.width*s),O(e.height)&&(n.height=e.height*s),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?S({},this.containerData):{}},getImageData:function(){return this.sized?S({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,o={};return this.ready&&I(["left","top","width","height","naturalWidth","naturalHeight"],function(t){o[t]=e[t]}),o},setCanvasData:function(e){var o=this.canvasData,t=o.aspectRatio;return this.ready&&!this.disabled&&xe(e)&&(O(e.left)&&(o.left=e.left),O(e.top)&&(o.top=e.top),O(e.width)?(o.width=e.width,o.height=e.width/t):O(e.height)&&(o.height=e.height,o.width=e.height*t),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,o;return this.ready&&this.cropped&&(o={left:e.left,top:e.top,width:e.width,height:e.height}),o||{}},setCropBoxData:function(e){var o=this.cropBoxData,t=this.options.aspectRatio,r,n;return this.ready&&this.cropped&&!this.disabled&&xe(e)&&(O(e.left)&&(o.left=e.left),O(e.top)&&(o.top=e.top),O(e.width)&&e.width!==o.width&&(r=!0,o.width=e.width),O(e.height)&&e.height!==o.height&&(n=!0,o.height=e.height),t&&(r?o.height=o.width/t:n&&(o.width=o.height*t)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var o=this.canvasData,t=ko(this.image,this.imageData,o,e);if(!this.cropped)return t;var r=this.getData(e.rounded),n=r.x,i=r.y,s=r.width,d=r.height,h=t.width/Math.floor(o.naturalWidth);h!==1&&(n*=h,i*=h,s*=h,d*=h);var l=s/d,c=ce({aspectRatio:l,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=ce({aspectRatio:l,width:e.minWidth||0,height:e.minHeight||0},"cover"),L=ce({aspectRatio:l,width:e.width||(h!==1?t.width:s),height:e.height||(h!==1?t.height:d)}),C=L.width,B=L.height;C=Math.min(c.width,Math.max(p.width,C)),B=Math.min(c.height,Math.max(p.height,B));var D=document.createElement("canvas"),k=D.getContext("2d");D.width=_e(C),D.height=_e(B),k.fillStyle=e.fillColor||"transparent",k.fillRect(0,0,C,B);var R=e.imageSmoothingEnabled,P=R===void 0?!0:R,ne=e.imageSmoothingQuality;k.imageSmoothingEnabled=P,ne&&(k.imageSmoothingQuality=ne);var q=t.width,g=t.height,E=n,N=i,Z,ie,me,ve,he,oe;E<=-s||E>q?(E=0,Z=0,me=0,he=0):E<=0?(me=-E,E=0,Z=Math.min(q,s+E),he=Z):E<=q&&(me=0,Z=Math.min(s,q-E),he=Z),Z<=0||N<=-d||N>g?(N=0,ie=0,ve=0,oe=0):N<=0?(ve=-N,N=0,ie=Math.min(g,d+N),oe=ie):N<=g&&(ve=0,ie=Math.min(d,g-N),oe=ie);var X=[E,N,Z,ie];if(he>0&&oe>0){var we=C/s;X.push(me*we,ve*we,he*we,oe*we)}return k.drawImage.apply(k,[t].concat($(X.map(function(Ge){return Math.floor(_e(Ge))})))),D},setAspectRatio:function(e){var o=this.options;return!this.disabled&&!pt(e)&&(o.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var o=this.options,t=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var n=e===it,i=o.movable&&e===Lt;e=n||i?e:Dt,o.dragMode=e,Ue(t,Ae,e),Oe(t,at,n),Oe(t,nt,i),o.cropBoxMovable||(Ue(r,Ae,e),Oe(r,at,n),Oe(r,nt,i))}return this}},Wo=ee.Cropper,qt=(function(){function a(e){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(f(this,a),!e||!xo.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=S({},Mt,xe(o)&&o),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return m(a,[{key:"init",value:function(){var o=this.element,t=o.tagName.toLowerCase(),r;if(!o[T]){if(o[T]=this,t==="img"){if(this.isImg=!0,r=o.getAttribute("src")||"",this.originalUrl=r,!r)return;r=o.src}else t==="canvas"&&window.HTMLCanvasElement&&(r=o.toDataURL());this.load(r)}}},{key:"load",value:function(o){var t=this;if(o){this.url=o,this.imageData={};var r=this.element,n=this.options;if(!n.rotatable&&!n.scalable&&(n.checkOrientation=!1),!n.checkOrientation||!window.ArrayBuffer){this.clone();return}if(bo.test(o)){yo.test(o)?this.read(Yo(o)):this.clone();return}var i=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=s,i.onerror=s,i.ontimeout=s,i.onprogress=function(){i.getResponseHeader("content-type")!==Pt&&i.abort()},i.onload=function(){t.read(i.response)},i.onloadend=function(){t.reloading=!1,t.xhr=null},n.checkCrossOrigin&&jt(o)&&r.crossOrigin&&(o=Xt(o)),i.open("GET",o,!0),i.responseType="arraybuffer",i.withCredentials=r.crossOrigin==="use-credentials",i.send()}}},{key:"read",value:function(o){var t=this.options,r=this.imageData,n=zo(o),i=0,s=1,d=1;if(n>1){this.url=Ro(o,Pt);var h=Fo(n);i=h.rotate,s=h.scaleX,d=h.scaleY}t.rotatable&&(r.rotate=i),t.scalable&&(r.scaleX=s,r.scaleY=d),this.clone()}},{key:"clone",value:function(){var o=this.element,t=this.url,r=o.crossOrigin,n=t;this.options.checkCrossOrigin&&jt(t)&&(r||(r="anonymous"),n=Xt(t)),this.crossOrigin=r,this.crossOriginUrl=n;var i=document.createElement("img");r&&(i.crossOrigin=r),i.src=n||t,i.alt=o.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),Y(i,Ct),o.parentNode.insertBefore(i,o.nextSibling)}},{key:"start",value:function(){var o=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var r=ee.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ee.navigator.userAgent),n=function(h,l){S(o.imageData,{naturalWidth:h,naturalHeight:l,aspectRatio:h/l}),o.initialImageData=S({},o.imageData),o.sizing=!1,o.sized=!0,o.build()};if(t.naturalWidth&&!r){n(t.naturalWidth,t.naturalHeight);return}var i=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){n(i.width,i.height),r||s.removeChild(i)},i.src=t.src,r||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(i))}},{key:"stop",value:function(){var o=this.image;o.onload=null,o.onerror=null,o.parentNode.removeChild(o),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var o=this.element,t=this.options,r=this.image,n=o.parentNode,i=document.createElement("div");i.innerHTML=_o;var s=i.querySelector(".".concat(T,"-container")),d=s.querySelector(".".concat(T,"-canvas")),h=s.querySelector(".".concat(T,"-drag-box")),l=s.querySelector(".".concat(T,"-crop-box")),c=l.querySelector(".".concat(T,"-face"));this.container=n,this.cropper=s,this.canvas=d,this.dragBox=h,this.cropBox=l,this.viewBox=s.querySelector(".".concat(T,"-view-box")),this.face=c,d.appendChild(r),Y(o,G),n.insertBefore(s,o.nextSibling),te(r,Ct),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Y(l,G),t.guides||Y(l.getElementsByClassName("".concat(T,"-dashed")),G),t.center||Y(l.getElementsByClassName("".concat(T,"-center")),G),t.background&&Y(s,"".concat(T,"-bg")),t.highlight||Y(c,go),t.cropBoxMovable&&(Y(c,nt),Ue(c,Ae,ot)),t.cropBoxResizable||(Y(l.getElementsByClassName("".concat(T,"-line")),G),Y(l.getElementsByClassName("".concat(T,"-point")),G)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),j(t.ready)&&K(o,At,t.ready,{once:!0}),Ce(o,At)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var o=this.cropper.parentNode;o&&o.removeChild(this.cropper),te(this.element,G)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Wo,a}},{key:"setDefaults",value:function(o){S(Mt,xe(o)&&o)}}]),a})();return S(qt.prototype,Go,jo,Xo,Ho,qo,Vo),qt}))})($e)),$e.exports}var eo;function Ia(){if(eo)return je;eo=1,Object.defineProperty(je,"__esModule",{value:!0});var u=Ba,w=Ua(),x=y(w);function y(v){return v&&v.__esModule?v:{default:v}}function b(v,m){var U={};for(var $ in v)m.indexOf($)>=0||Object.prototype.hasOwnProperty.call(v,$)&&(U[$]=v[$]);return U}var f=typeof window>"u"?[String,Array]:[String,Array,Element,NodeList];return je.default={render:function(){var m=this.crossorigin||void 0;return(0,u.h)("div",{style:this.containerStyle},[(0,u.h)("img",{ref:"img",src:this.src,alt:this.alt||"image",style:[{"max-width":"100%"},this.imgStyle],crossorigin:m})])},props:{containerStyle:Object,src:{type:String,default:""},alt:String,imgStyle:Object,viewMode:Number,dragMode:String,initialAspectRatio:Number,aspectRatio:Number,data:Object,preview:f,responsive:{type:Boolean,default:!0},restore:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},crossorigin:{type:String},modal:{type:Boolean,default:!0},guides:{type:Boolean,default:!0},center:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},background:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!0},autoCropArea:Number,movable:{type:Boolean,default:!0},rotatable:{type:Boolean,default:!0},scalable:{type:Boolean,default:!0},zoomable:{type:Boolean,default:!0},zoomOnTouch:{type:Boolean,default:!0},zoomOnWheel:{type:Boolean,default:!0},wheelZoomRatio:Number,cropBoxMovable:{type:Boolean,default:!0},cropBoxResizable:{type:Boolean,default:!0},toggleDragModeOnDblclick:{type:Boolean,default:!0},minCanvasWidth:Number,minCanvasHeight:Number,minCropBoxWidth:Number,minCropBoxHeight:Number,minContainerWidth:Number,minContainerHeight:Number,ready:Function,cropstart:Function,cropmove:Function,cropend:Function,crop:Function,zoom:Function},mounted:function(){var m=this.$options.props;m.containerStyle,m.src,m.alt,m.imgStyle;var U=b(m,["containerStyle","src","alt","imgStyle"]),$={};for(var ue in U)this[ue]!==void 0&&($[ue]=this[ue]);this.cropper=new x.default(this.$refs.img,$)},methods:{reset:function(){return this.cropper.reset()},clear:function(){return this.cropper.clear()},initCrop:function(){return this.cropper.crop()},replace:function(m){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.cropper.replace(m,U)},enable:function(){return this.cropper.enable()},disable:function(){return this.cropper.disable()},destroy:function(){return this.cropper.destroy()},move:function(m,U){return this.cropper.move(m,U)},moveTo:function(m){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;return this.cropper.moveTo(m,U)},relativeZoom:function(m,U){return this.cropper.zoom(m,U)},zoomTo:function(m,U){return this.cropper.zoomTo(m,U)},rotate:function(m){return this.cropper.rotate(m)},rotateTo:function(m){return this.cropper.rotateTo(m)},scaleX:function(m){return this.cropper.scaleX(m)},scaleY:function(m){return this.cropper.scaleY(m)},scale:function(m){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m;return this.cropper.scale(m,U)},getData:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.cropper.getData(m)},setData:function(m){return this.cropper.setData(m)},getContainerData:function(){return this.cropper.getContainerData()},getImageData:function(){return this.cropper.getImageData()},getCanvasData:function(){return this.cropper.getCanvasData()},setCanvasData:function(m){return this.cropper.setCanvasData(m)},getCropBoxData:function(){return this.cropper.getCropBoxData()},setCropBoxData:function(m){return this.cropper.setCropBoxData(m)},getCroppedCanvas:function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.cropper.getCroppedCanvas(m)},setAspectRatio:function(m){return this.cropper.setAspectRatio(m)},setDragMode:function(m){return this.cropper.setDragMode(m)}}},je}var Pa=Ia();const ka=ia(Pa),lo={components:{Button:Ne,VueCropper:ka},props:{logoData:{type:Object,required:!0,default:null},progressLabel:{type:String,required:!0},eventCategory:{type:String,required:!0}},setup(){return{uploadYourLogoTr:re}},data(){return{cropperToolReady:!1}},methods:{cropImage(){if(!this.cropperToolReady)return;const{x:u,y:w,width:x,height:y}=this.$refs.cropper.getData(!0),b={left:u,top:w,width:x,height:y},{naturalHeight:f,naturalWidth:v}=this.$refs.cropper.getImageData(),m=u!==0||w!==0||x!==v||y!==f;this.$emit("on-image-cropped",{bounds:b,dataUrl:this.$refs.cropper.getCroppedCanvas().toDataURL(),isCropped:m}),be({eventCategory:this.eventCategory,eventAction:"cropLogo",eventLabel:"Clicked_Continue",event:"click"})},cancel(){this.$emit("on-cancel")},onCropReady(){this.cropperToolReady=!0}}},Na={class:"c-byo-cropper tw-relative tw-w-full tw-h-full lg:tw-h-auto tw-flex tw-flex-col"},Ma={class:"tw-h-full tw-pb-24 lg:tw-pb-0 tw-overflow-scroll"},Ya={class:"tw-pb-8"},Ra={class:"tw-text-grayscale-600 tw-font-bold tw-text-xs tw-mb-2 tw-uppercase"},za={class:"tw-mb-4 tw-text-4xl tw-text-black tw-font-bold"},Fa={class:"tw-mt-0"},Ga={class:"tw-fixed tw-rounded-b tw-bottom-0 tw-left-0 tw-z-10 tw-bg-grayscale-200 lg:tw-static tw-flex tw-w-full tw-items-center tw-justify-center tw-border-0 tw-border-t tw-border-black/10 tw-border-solid tw-py-4 tw-px-8 tw-box-border"};function ja(u,w,x,y,b,f){const v=M("vue-cropper"),m=M("Button");return A(),V("div",Na,[_("div",Ma,[_("div",Ya,[_("p",Ra,F(x.progressLabel),1),_("h2",za,F(y.uploadYourLogoTr("cropYourLogo")),1),_("p",Fa,F(y.uploadYourLogoTr("cropDescription")),1)]),_("div",{class:vt(["c-byo-cropper__container lg:tw-pb-8 tw-mx-auto",{"tw-opacity-0":!b.cropperToolReady}])},[x.logoData&&x.logoData.logoImageUrl?(A(),J(v,{key:0,ref:"cropper","view-mode":2,zoomable:!1,movable:!1,src:x.logoData.logoImageUrl,ready:f.onCropReady,"auto-crop-area":1},null,8,["src","ready"])):H("",!0)],2)]),_("div",Ga,[W(m,{label:y.uploadYourLogoTr("cancel"),size:"large",variant:"outline","container-classes":"tw-mx-2","data-test-cancel-btn":"",onOnClick:f.cancel},null,8,["label","onOnClick"]),W(m,{label:y.uploadYourLogoTr("continue"),size:"large",variant:"primary-with-icon",icon:"chevron-right-wide","container-classes":"tw-mx-2","data-test-continue-btn":"",onOnClick:f.cropImage},null,8,["label","onOnClick"])])])}const Xa=ae(lo,[["render",ja]]);lo.__docgenInfo={exportName:"default",displayName:"LogoCropper",description:"",tags:{},props:[{name:"logoData",type:{name:"object"},required:!0,defaultValue:{func:!1,value:"null"}},{name:"progressLabel",type:{name:"string"},required:!0},{name:"eventCategory",type:{name:"string"},required:!0}],events:[{name:"on-image-cropped",type:{names:["undefined"]}},{name:"on-cancel"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoCropper.vue"]};const co={components:{Button:Ne},props:{logoData:{type:Object,required:!0,default:null},progressLabel:{type:String,required:!0},eventCategory:{type:String,required:!0}},setup(){return{uploadYourLogoTr:re}},methods:{cropImage(){if(!this.$refs.preview.complete)return;const u={left:0,top:0,width:this.$refs.preview.naturalWidth,height:this.$refs.preview.naturalHeight};this.$emit("on-continue",{bounds:u,dataUrl:this.logoData.logoImageUrl}),be({eventCategory:this.eventCategory,eventAction:"previewLogo",eventLabel:"Clicked_Continue",event:"click"})},cancel(){this.$emit("on-cancel")}}},Ha={class:"tw-relative tw-w-full tw-h-full lg:tw-h-auto tw-flex tw-flex-col"},qa={class:"tw-h-full tw-pb-24 lg:tw-pb-0"},Va={class:"lg:tw-pb-8"},Wa={class:"tw-text-grayscale-600 tw-font-bold tw-text-xs tw-mb-2 tw-uppercase"},$a={class:"tw-mb-4 tw-text-4xl tw-text-black tw-font-bold"},Ka={class:"tw-mt-0"},Za={class:"lg:tw-pb-8 lg:tw-px-8"},Qa=["src"],Ja={class:"tw-fixed tw-rounded-b tw-bottom-0 tw-left-0 tw-z-10 tw-bg-grayscale-200 lg:tw-static tw-flex tw-w-full tw-items-center tw-justify-center tw-border-0 tw-border-t tw-border-black/10 tw-border-solid tw-py-4 tw-px-8 tw-box-border"};function en(u,w,x,y,b,f){const v=M("Button");return A(),V("div",Ha,[_("div",qa,[_("div",Va,[_("p",Wa,F(x.progressLabel),1),_("h2",$a,F(y.uploadYourLogoTr("logoPreview")),1),_("p",Ka,F(y.uploadYourLogoTr("logoPreviewDescription")),1)]),_("div",Za,[x.logoData&&x.logoData.logoImageUrl?(A(),V("img",{key:0,ref:"preview",class:"tw-inline tw-max-h-72",src:x.logoData.logoImageUrl,alt:"preview"},null,8,Qa)):H("",!0)])]),_("div",Ja,[W(v,{label:y.uploadYourLogoTr("cancel"),size:"large",variant:"outline","container-classes":"tw-mx-2","data-test-cancel-btn":"",onOnClick:f.cancel},null,8,["label","onOnClick"]),W(v,{label:y.uploadYourLogoTr("continue"),size:"large",variant:"primary-with-icon",icon:"chevron-right-wide","container-classes":"tw-mx-2","data-test-continue-btn":"",onOnClick:f.cropImage},null,8,["label","onOnClick"])])])}const tn=ae(co,[["render",en]]);co.__docgenInfo={exportName:"default",displayName:"LogoPreview",description:"",tags:{},props:[{name:"logoData",type:{name:"object"},required:!0,defaultValue:{func:!1,value:"null"}},{name:"progressLabel",type:{name:"string"},required:!0},{name:"eventCategory",type:{name:"string"},required:!0}],events:[{name:"on-continue",type:{names:["undefined"]}},{name:"on-cancel"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoPreview.vue"]};const ho={components:{Button:Ne},props:{logoData:{type:Object,required:!0,default:null},savedBusinessText:{type:Object,required:!1,default:null},progressLabel:{type:String,required:!0},eventCategory:{type:String,required:!0}},setup(){return{uploadYourLogoTr:re}},data(){return{businessText:null,sloganText:null}},mounted(){this.savedBusinessText?this.businessText=this.savedBusinessText.businessText:this.businessText=this.logoData.logoImageDetails.businessText,this.savedBusinessText?this.sloganText=this.savedBusinessText.sloganText:this.logoData.logoImageDetails.sloganText&&(this.sloganText=this.logoData.logoImageDetails.sloganText)},methods:{back(){this.$emit("on-go-back")},onSloganTextKeyUp(u){u.keyCode===13&&this.save()},onBusinessTextKeyUp(u){u.keyCode===13&&this.save()},save(){const u={businessText:this.businessText};this.sloganText&&(u.sloganText=this.sloganText),this.$emit("on-save",u),be({eventCategory:this.eventCategory,eventAction:"businessName",eventLabel:"Clicked_Continue",event:"click"})}}},on={class:"tw-w-full tw-flex tw-flex-col tw-h-full lg:tw-h-auto"},an={class:"tw-h-full tw-pb-24 lg:tw-pb-0"},nn={class:"tw-pb-8"},rn={class:"tw-text-grayscale-600 tw-font-bold tw-text-xs tw-mb-2 tw-uppercase"},sn={class:"tw-mb-4 tw-text-4xl tw-text-black tw-font-bold"},ln={class:"tw-mt-0"},cn={class:"tw-pb-8 tw-px-8"},hn={class:"tw-fixed tw-rounded-b tw-bottom-0 tw-left-0 tw-z-10 tw-bg-grayscale-200 lg:tw-static tw-flex tw-w-full tw-items-center tw-justify-center tw-border-0 tw-border-t tw-border-black/10 tw-border-solid tw-py-4 tw-px-8 tw-box-border"};function pn(u,w,x,y,b,f){const v=M("Button");return A(),V("div",on,[_("div",an,[_("div",nn,[_("p",rn,F(x.progressLabel),1),_("h2",sn,F(y.uploadYourLogoTr("businessName")),1),_("p",ln,F(y.uploadYourLogoTr("businessNameDescription")),1)]),_("div",cn,[_("div",{class:vt({"tw-mb-4":x.logoData.logoImageDetails.sloganText})},[Zt(_("input",{"onUpdate:modelValue":w[0]||(w[0]=m=>b.businessText=m),class:"tw-w-full tw-py-3.5 tw-px-4 tw-rounded tw-box-border tw-border tw-border-solid tw-border-grayscale-500 tw-text-grayscale-600",onKeyup:w[1]||(w[1]=(...m)=>f.onBusinessTextKeyUp&&f.onBusinessTextKeyUp(...m))},null,544),[[Qt,b.businessText]])],2),_("div",null,[x.logoData.logoImageDetails.sloganText?Zt((A(),V("input",{key:0,"onUpdate:modelValue":w[2]||(w[2]=m=>b.sloganText=m),class:"tw-w-full tw-py-3.5 tw-px-4 tw-rounded tw-box-border tw-border tw-border-solid tw-border-grayscale-500 tw-text-grayscale-600",onKeyup:w[3]||(w[3]=(...m)=>f.onSloganTextKeyUp&&f.onSloganTextKeyUp(...m))},null,544)),[[Qt,b.sloganText]]):H("",!0)])])]),_("div",hn,[W(v,{label:y.uploadYourLogoTr("back"),size:"large",variant:"outline","container-classes":"tw-mx-2","data-test-back-btn":"",onOnClick:f.back},null,8,["label","onOnClick"]),W(v,{label:y.uploadYourLogoTr("continue"),size:"large",variant:"primary-with-icon",icon:"chevron-right-wide","container-classes":"tw-mx-2","data-test-continue-btn":"",onOnClick:f.save},null,8,["label","onOnClick"])])])}const un=ae(ho,[["render",pn]]);ho.__docgenInfo={exportName:"default",displayName:"LogoBusinessText",description:"",tags:{},props:[{name:"logoData",type:{name:"object"},required:!0,defaultValue:{func:!1,value:"null"}},{name:"savedBusinessText",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"null"}},{name:"progressLabel",type:{name:"string"},required:!0},{name:"eventCategory",type:{name:"string"},required:!0}],events:[{name:"on-go-back"},{name:"on-save",type:{names:["undefined"]}}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/LogoBusinessText.vue"]};const po={components:{LogoUploadModal:ha,UploadYourLogoDropzone:ta,LogoUploader:fa,LogoUploadError:_a,LogoUploadExitConfirmation:Sa,LogoCropper:Xa,LogoPreview:tn,LogoBusinessText:un,LogoBusinessBrandColours:aa,LogoUploadingLoader:no},props:{logoFile:{type:Object,required:!1,default:void 0},useDropzone:{type:Boolean,required:!1,default:!1},isPostPurchaseUserUpload:{type:Boolean,required:!1,default:!1},customUploadData:{type:Object,required:!1,default:void 0}},setup(){return{uploadYourLogoTr:re}},data(){return{currentStep:this.useDropzone?0:1,includeDropzoneInModal:this.useDropzone,totalNumSteps:this.useDropzone?5:4,errorMessage:null,isAttemptingToExit:!1,uploadedLogoData:null,croppedImageBoxBounds:null,savedBusinessText:null,brandColourData:null,isCurrentlySaving:!1}},computed:{currentStepProgressLabel(){if(this.includeDropzoneInModal){const u=this.currentStep===0?1:this.currentStep;return this.uploadYourLogoTr("stepOf",{CURRENT:u,TOTAL:5})}return this.uploadYourLogoTr("stepOf",{CURRENT:this.currentStep-1,TOTAL:4})},hasError(){return!!this.errorMessage},canCropImage(){return!this.uploadedLogoData.logoImageUrl.split(".").pop().startsWith("svg")},currentStepTrackingLabel(){return["logoUploader",this.currentStep===2&&!this.canCropImage?"previewLogo":"cropLogo","businessName","brandColors"][this.currentStep-1]},eventCategory(){return this.isPostPurchaseUserUpload?"BYO-PostPurchase":"BYO-PrePurchase"}},watch:{logoFile:{immediate:!0,handler(){this.logoFile&&(this.errorMessage=this.logoFile.file.size>ra.MAX_BYO_FILE_SIZE?re("maxByoFileErrorMessage"):null)}}},methods:{onUploadSuccess(u){this.$emit("on-logo-upload-success"),this.uploadedLogoData=u.data,this.currentStep=2},onUploadError(u){this.$emit("on-logo-upload-error"),typeof u.response?.data?.errorMessage=="string"&&u.response?.data?.errorMessage!==""?this.errorMessage=u.response.data.errorMessage:this.errorMessage=re("genericByoErrorMessage"),this.currentStep=null},onImageCropped(u){this.$emit("on-image-cropped",{isCropped:u.isCropped});const{bounds:w,dataUrl:x}=u;this.croppedImageBoxBounds=w,this.croppedImageBoxDataUrl=x,this.currentStep=3},onCancel(){this.isAttemptingToExit=!0,(this.currentStep===0||this.hasError)&&this.onExitConfirm(),be({eventCategory:this.eventCategory,eventAction:this.currentStepTrackingLabel,eventLabel:"Clicked_Cancel",event:"click"})},onLogoFileChange(u){this.$emit("on-file-change",u),this.reset()},onExitConfirm(){const{currentStepTrackingLabel:u}=this;this.reset(),this.$emit("on-exit",{currentStepTrackingLabel:u})},onAbortExitConfirmation(){this.isAttemptingToExit=!1},onGoBackToCropper(){this.$emit("on-back",{currentStepTrackingLabel:this.currentStepTrackingLabel}),this.currentStep=2},onGoBackToBusinessText(){this.$emit("on-back",{currentStepTrackingLabel:this.currentStepTrackingLabel}),this.currentStep=3},onSaveBusinessText(u){this.$emit("on-save-business-text",{businessText:u.businessText}),this.savedBusinessText=u,this.currentStep=4},onBrandColoursSave(u){this.$emit("on-brand-colors-save",{textColorUserSelected:u.textColorUserSelected,backgroundColorUserSelected:u.backgroundColorUserSelected}),this.brandColourData=u,this.save()},async save(){if(this.isCurrentlySaving)return;this.isCurrentlySaving=!0;const u={templateUploadToken:this.uploadedLogoData.templateUploadToken,businessText:this.savedBusinessText.businessText,businessSlogin:this.savedBusinessText.sloganText,textColor:this.brandColourData.textColor,backgroundColor:this.brandColourData.backgroundColor,cropBoundingBox:JSON.parse(JSON.stringify(this.croppedImageBoxBounds)),isPostPurchaseUserUpload:this.isPostPurchaseUserUpload},w=await to.createUserLogo(u);if(this.isCurrentlySaving=!1,w.error){this.onUploadError(w.error);return}this.$emit("on-finish",w.response)},reset(){this.currentStep=1,this.errorMessage=null,this.isAttemptingToExit=!1,this.isCurrentlySaving=!1,this.uploadedLogoData=null,this.croppedImageBoxBounds=null,this.savedBusinessText=null,this.brandColourData=null}}},dn={class:"tw-fixed tw-w-full tw-h-full tw-z-50 tw-top-0 tw-left-0 tw-bg-black tw-bg-opacity-80 lg:tw-flex tw-items-start tw-justify-center lg:tw-pt-20"},gn={key:0,class:"tw-w-full"},fn={class:"tw-text-grayscale-600 tw-font-bold tw-text-xs tw-mb-2 tw-uppercase"},mn={class:"tw-mb-4 tw-text-4xl tw-text-black tw-font-bold"},vn={class:"tw-mt-0 tw-pb-8"};function wn(u,w,x,y,b,f){const v=M("UploadYourLogoDropzone"),m=M("LogoUploader"),U=M("LogoCropper"),$=M("LogoPreview"),ue=M("LogoBusinessText"),Ke=M("LogoBusinessBrandColours"),Ze=M("LogoUploadError"),De=M("LogoUploadingLoader"),Qe=M("LogoUploadExitConfirmation"),Je=M("LogoUploadModal");return A(),V("div",dn,[W(Je,{"show-cancel-button":(b.currentStep===0||b.currentStep>1||f.hasError)&&!b.isAttemptingToExit,class:vt({"tw-p-6":b.currentStep===0}),onOnCancel:f.onCancel},{content:Jo(()=>[b.currentStep===0&&!b.isAttemptingToExit?(A(),V("div",gn,[_("p",fn,F(f.currentStepProgressLabel),1),_("h2",mn,F(y.uploadYourLogoTr("uploadYourLogoText")),1),_("p",vn,F(y.uploadYourLogoTr("disclaimerText")),1),W(v,{"is-modal":!0,onOnUploadSuccess:f.onLogoFileChange},null,8,["onOnUploadSuccess"])])):H("",!0),x.logoFile&&!b.isAttemptingToExit&&!f.hasError&&b.currentStep===1?(A(),J(m,{key:1,"logo-file":x.logoFile,"custom-upload-data":x.customUploadData,"event-category":f.eventCategory,onOnUploadSuccess:f.onUploadSuccess,onOnUploadError:f.onUploadError},null,8,["logo-file","custom-upload-data","event-category","onOnUploadSuccess","onOnUploadError"])):H("",!0),!b.isAttemptingToExit&&b.currentStep===2&&b.uploadedLogoData&&f.canCropImage?(A(),J(U,{key:2,"logo-data":b.uploadedLogoData,"progress-label":f.currentStepProgressLabel,"event-category":f.eventCategory,onOnCancel:f.onCancel,onOnImageCropped:f.onImageCropped},null,8,["logo-data","progress-label","event-category","onOnCancel","onOnImageCropped"])):H("",!0),!b.isAttemptingToExit&&b.currentStep===2&&b.uploadedLogoData&&!f.canCropImage?(A(),J($,{key:3,"logo-data":b.uploadedLogoData,"progress-label":f.currentStepProgressLabel,"event-category":f.eventCategory,onOnCancel:f.onCancel,onOnContinue:f.onImageCropped},null,8,["logo-data","progress-label","event-category","onOnCancel","onOnContinue"])):H("",!0),!b.isAttemptingToExit&&b.currentStep===3&&b.uploadedLogoData?(A(),J(ue,{key:4,"logo-data":b.uploadedLogoData,"saved-business-text":b.savedBusinessText,"progress-label":f.currentStepProgressLabel,"event-category":f.eventCategory,onOnGoBack:f.onGoBackToCropper,onOnSave:f.onSaveBusinessText},null,8,["logo-data","saved-business-text","progress-label","event-category","onOnGoBack","onOnSave"])):H("",!0),!b.isAttemptingToExit&&b.currentStep===4&&b.uploadedLogoData&&!b.isCurrentlySaving?(A(),J(Ke,{key:5,"logo-data":b.uploadedLogoData,"cropped-logo-image":u.croppedImageBoxDataUrl,"total-num-steps":b.totalNumSteps,"event-category":f.eventCategory,onOnGoBack:f.onGoBackToBusinessText,onOnSave:f.onBrandColoursSave},null,8,["logo-data","cropped-logo-image","total-num-steps","event-category","onOnGoBack","onOnSave"])):H("",!0),f.hasError&&!b.isAttemptingToExit?(A(),J(Ze,{key:6,"error-message":b.errorMessage,onOnCancel:f.onCancel,onOnLogoFileChange:f.onLogoFileChange},null,8,["error-message","onOnCancel","onOnLogoFileChange"])):H("",!0),b.isCurrentlySaving?(A(),J(De,{key:7,"loading-text":y.uploadYourLogoTr("generatingDesigns")},null,8,["loading-text"])):H("",!0),b.isAttemptingToExit&&b.currentStep>1?(A(),J(Qe,{key:8,onOnConfirm:f.onExitConfirm,onOnGoBack:f.onAbortExitConfirmation},null,8,["onOnConfirm","onOnGoBack"])):H("",!0)]),_:1},8,["show-cancel-button","class","onOnCancel"])])}const bn=ae(po,[["render",wn]]);po.__docgenInfo={exportName:"default",displayName:"UploadYourLogoOnBoarding",description:"",tags:{},props:[{name:"logoFile",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"undefined"}},{name:"useDropzone",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"isPostPurchaseUserUpload",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"customUploadData",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"undefined"}}],events:[{name:"on-logo-upload-success"},{name:"on-logo-upload-error"},{name:"on-image-cropped",type:{names:["undefined"]}},{name:"on-file-change",type:{names:["undefined"]}},{name:"on-exit",type:{names:["undefined"]}},{name:"on-back",type:{names:["undefined"]}},{name:"on-save-business-text",type:{names:["undefined"]}},{name:"on-brand-colors-save",type:{names:["undefined"]}},{name:"on-finish",type:{names:["undefined"]}}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoOnBoarding/UploadYourLogoOnBoarding.vue"]};const uo={components:{UploadYourLogoOnBoarding:bn},props:{useDropzone:{type:Boolean,required:!1,default:!1},isPostPurchaseUserUpload:{type:Boolean,required:!1,default:!1},customUploadData:{type:Object,required:!1,default:null}},data(){return{logoData:{logoFile:null},active:this.useDropzone}},watch:{useDropzone:{immediate:!0,handler(){this.useDropzone&&(this.active=!0)}}},mounted(){window&&window.addEventListener(pe.BeginUploadLogoExperience,u=>{this.onBeginUploadLogoExperience(u.detail.file)})},beforeDestroy(){window.removeEventListener(pe.BeginUploadLogoExperience,u=>{this.onBeginUploadLogoExperience(u.detail.file)})},methods:{onBeginUploadLogoExperience(u){this.active=!0,this.logoData.logoFile={file:u}},onExit({currentStepTrackingLabel:u}){this.$emit("on-exit",{currentStepTrackingLabel:u}),this.reset()},reset(){this.active=!1,this.logoData.logoFile=null},onUploadError(){this.logoData.logoFile=null},onFileChange(u){this.logoData.logoFile={file:u}},onFinish(u){this.$emit("on-finish",u),window.dispatchEvent(new CustomEvent(pe.UploadLogoSuccess)),this.reset()},onBack({currentStepTrackingLabel:u}){this.$emit("on-back",{currentStepTrackingLabel:u})},onImageCropped({isCropped:u}){this.$emit("on-image-cropped",{isCropped:u})},onSaveBusinessText({businessText:u}){this.$emit("on-save-business-text",{businessText:u})},onBrandColorsSave({textColorUserSelected:u,backgroundColorUserSelected:w}){this.$emit("on-brand-colors-save",{textColorUserSelected:u,backgroundColorUserSelected:w})},onLogoUploadSuccess(){this.$emit("on-logo-upload-success")}}};function yn(u,w,x,y,b,f){const v=M("UploadYourLogoOnBoarding");return A(),V("div",null,[b.active?(A(),J(v,{key:0,"logo-file":b.logoData.logoFile,"custom-upload-data":x.customUploadData,"use-dropzone":x.useDropzone,"is-post-purchase-user-upload":x.isPostPurchaseUserUpload,onOnExit:f.onExit,onOnUploadError:f.onUploadError,onOnFileChange:f.onFileChange,onOnFinish:f.onFinish,onOnImageCropped:f.onImageCropped,onOnSaveBusinessText:f.onSaveBusinessText,onOnBrandColorsSave:f.onBrandColorsSave,onOnBack:f.onBack,onOnLogoUploadSuccess:f.onLogoUploadSuccess},null,8,["logo-file","custom-upload-data","use-dropzone","is-post-purchase-user-upload","onOnExit","onOnUploadError","onOnFileChange","onOnFinish","onOnImageCropped","onOnSaveBusinessText","onOnBrandColorsSave","onOnBack","onOnLogoUploadSuccess"])):H("",!0)])}const Le=ae(uo,[["render",yn]]);uo.__docgenInfo={exportName:"default",displayName:"UploadYourLogoApplication",description:"",tags:{},props:[{name:"useDropzone",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"isPostPurchaseUserUpload",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"customUploadData",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"null"}}],events:[{name:"on-exit",type:{names:["undefined"]}},{name:"on-finish",type:{names:["undefined"]}},{name:"on-back",type:{names:["undefined"]}},{name:"on-image-cropped",type:{names:["undefined"]}},{name:"on-save-business-text",type:{names:["undefined"]}},{name:"on-brand-colors-save",type:{names:["undefined"]}},{name:"on-logo-upload-success"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoApplication/UploadYourLogoApplication.vue"]};const Yn={title:"Components/UploadYourLogoApplication",component:Le},Me=2e3,wt={templateUploadToken:"6bc3885c-7e5c-4c9e-9b54-21dcd06ca647",logoImageUrl:"/images/logos/coke.jpeg",logoImageDetails:{businessText:"LOGO TEXT HERE",sloganText:"Slogan Text Here",textColors:["#2ab1f8","#ff0000","#00ff00","#0fb0fb","#87adbb","#7ef99f"],backgroundColors:["#041444"]}},xn={templateUploadToken:"6bc3885c-7e5c-4c9e-9b54-21dcd06ca647",logoImageUrl:"https://cdn.worldvectorlogo.com/logos/raspberry-pi.svg",logoImageDetails:{businessText:"LOGO TEXT HERE",textColors:["#cd003f"],backgroundColors:["#000000"]}},Xe=()=>{const u=new ke(Pe,{delayResponse:Me});return u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200,wt),u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_SAVE_ENDPOINT).reply(200,{success:!0}),{components:{UploadYourLogoApplication:Le},template:`
|
|
3
|
+
<div>
|
|
4
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
5
|
+
<UploadYourLogoApplication :use-dropzone="true" @on-finish="onFinish" />
|
|
6
|
+
</div>
|
|
7
|
+
`,methods:{onFileInputChange(w){w.target.files.length&&window.dispatchEvent(new CustomEvent(pe.BeginUploadLogoExperience,{detail:{file:w.target.files[0]}}))},onFinish(w){alert("on finish"),console.log(w)}}}},He=()=>{const u=new ke(Pe,{delayResponse:Me});return u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200,wt),u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_SAVE_ENDPOINT).reply(200,{success:!0}),{components:{UploadYourLogoApplication:Le},template:`
|
|
8
|
+
<div>
|
|
9
|
+
<UploadYourLogoApplication :active="true" :use-dropzone="true" @on-file-change="onFileChange" />
|
|
10
|
+
</div>
|
|
11
|
+
`,methods:{onFileChange(w){w&&window.dispatchEvent(new CustomEvent(pe.BeginUploadLogoExperience,{detail:{file:w}}))}}}},qe=()=>{const u=new ke(Pe,{delayResponse:Me});return u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200,xn),u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_SAVE_ENDPOINT).reply(200,{success:!0}),{components:{UploadYourLogoApplication:Le},template:`
|
|
12
|
+
<div>
|
|
13
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
14
|
+
<UploadYourLogoApplication :is-user-authenticated="true" @on-finish="onFinish" />
|
|
15
|
+
</div>
|
|
16
|
+
`,methods:{onFileInputChange(w){w.target.files.length&&window.dispatchEvent(new CustomEvent(pe.BeginUploadLogoExperience,{detail:{file:w.target.files[0]}}))},onFinish(w){alert("on finish"),console.log(w)}}}},Ve=()=>(new ke(Pe,{delayResponse:Me}).onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(500,"An error occured when extracting details from the image. Please try again."),{components:{UploadYourLogoApplication:Le},template:`
|
|
17
|
+
<div>
|
|
18
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
19
|
+
<UploadYourLogoApplication @on-finish="onFinish" />
|
|
20
|
+
</div>
|
|
21
|
+
`,methods:{onFileInputChange(w){w.target.files.length&&window.dispatchEvent(new CustomEvent(pe.BeginUploadLogoExperience,{detail:{file:w.target.files[0]}}))},onFinish(w){alert("on finish"),console.log(w)}}}),We=()=>{const u=new ke(Pe,{delayResponse:Me});return u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200,wt),u.onPost(z.BYO_LOGO_API_URL+z.BYO_LOGO_API_SAVE_ENDPOINT).reply(500,"An error occured when creating a logo from the provided details. Please try again."),{components:{UploadYourLogoApplication:Le},template:`
|
|
22
|
+
<div>
|
|
23
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
24
|
+
<UploadYourLogoApplication :is-user-authenticated="true" @on-finish="onFinish" />
|
|
25
|
+
</div>
|
|
26
|
+
`,methods:{onFileInputChange(w){w.target.files.length&&window.dispatchEvent(new CustomEvent(pe.BeginUploadLogoExperience,{detail:{file:w.target.files[0]}}))},onFinish(w){alert("on finish"),console.log(w)}}}};Xe.parameters={...Xe.parameters,docs:{...Xe.parameters?.docs,source:{originalSource:`() => {
|
|
27
|
+
const mock = new MockAdapter(axios, {
|
|
28
|
+
delayResponse: MOCK_RESPONSE_DELAY
|
|
29
|
+
});
|
|
30
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200, UPLOAD_SUCCESS_RESPONSE);
|
|
31
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_SAVE_ENDPOINT).reply(200, {
|
|
32
|
+
success: true
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
components: {
|
|
36
|
+
UploadYourLogoApplication
|
|
37
|
+
},
|
|
38
|
+
template: \`
|
|
39
|
+
<div>
|
|
40
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
41
|
+
<UploadYourLogoApplication :use-dropzone="true" @on-finish="onFinish" />
|
|
42
|
+
</div>
|
|
43
|
+
\`,
|
|
44
|
+
methods: {
|
|
45
|
+
onFileInputChange(e) {
|
|
46
|
+
if (e.target.files.length) {
|
|
47
|
+
window.dispatchEvent(new CustomEvent(Events.BeginUploadLogoExperience, {
|
|
48
|
+
detail: {
|
|
49
|
+
file: e.target.files[0]
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
onFinish(e) {
|
|
55
|
+
alert('on finish');
|
|
56
|
+
console.log(e);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}`,...Xe.parameters?.docs?.source}}};He.parameters={...He.parameters,docs:{...He.parameters?.docs,source:{originalSource:`() => {
|
|
61
|
+
const mock = new MockAdapter(axios, {
|
|
62
|
+
delayResponse: MOCK_RESPONSE_DELAY
|
|
63
|
+
});
|
|
64
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200, UPLOAD_SUCCESS_RESPONSE);
|
|
65
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_SAVE_ENDPOINT).reply(200, {
|
|
66
|
+
success: true
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
components: {
|
|
70
|
+
UploadYourLogoApplication
|
|
71
|
+
},
|
|
72
|
+
template: \`
|
|
73
|
+
<div>
|
|
74
|
+
<UploadYourLogoApplication :active="true" :use-dropzone="true" @on-file-change="onFileChange" />
|
|
75
|
+
</div>
|
|
76
|
+
\`,
|
|
77
|
+
methods: {
|
|
78
|
+
onFileChange(fileInput) {
|
|
79
|
+
if (fileInput) {
|
|
80
|
+
window.dispatchEvent(new CustomEvent(Events.BeginUploadLogoExperience, {
|
|
81
|
+
detail: {
|
|
82
|
+
file: fileInput
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}`,...He.parameters?.docs?.source}}};qe.parameters={...qe.parameters,docs:{...qe.parameters?.docs,source:{originalSource:`() => {
|
|
90
|
+
const mock = new MockAdapter(axios, {
|
|
91
|
+
delayResponse: MOCK_RESPONSE_DELAY
|
|
92
|
+
});
|
|
93
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200, UPLOAD_SUCCESS_RESPONSE_SVG);
|
|
94
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_SAVE_ENDPOINT).reply(200, {
|
|
95
|
+
success: true
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
components: {
|
|
99
|
+
UploadYourLogoApplication
|
|
100
|
+
},
|
|
101
|
+
template: \`
|
|
102
|
+
<div>
|
|
103
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
104
|
+
<UploadYourLogoApplication :is-user-authenticated="true" @on-finish="onFinish" />
|
|
105
|
+
</div>
|
|
106
|
+
\`,
|
|
107
|
+
methods: {
|
|
108
|
+
onFileInputChange(e) {
|
|
109
|
+
if (e.target.files.length) {
|
|
110
|
+
window.dispatchEvent(new CustomEvent(Events.BeginUploadLogoExperience, {
|
|
111
|
+
detail: {
|
|
112
|
+
file: e.target.files[0]
|
|
113
|
+
}
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
onFinish(e) {
|
|
118
|
+
alert('on finish');
|
|
119
|
+
console.log(e);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}`,...qe.parameters?.docs?.source}}};Ve.parameters={...Ve.parameters,docs:{...Ve.parameters?.docs,source:{originalSource:`() => {
|
|
124
|
+
const mock = new MockAdapter(axios, {
|
|
125
|
+
delayResponse: MOCK_RESPONSE_DELAY
|
|
126
|
+
});
|
|
127
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(500, 'An error occured when extracting details from the image. Please try again.');
|
|
128
|
+
return {
|
|
129
|
+
components: {
|
|
130
|
+
UploadYourLogoApplication
|
|
131
|
+
},
|
|
132
|
+
template: \`
|
|
133
|
+
<div>
|
|
134
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
135
|
+
<UploadYourLogoApplication @on-finish="onFinish" />
|
|
136
|
+
</div>
|
|
137
|
+
\`,
|
|
138
|
+
methods: {
|
|
139
|
+
onFileInputChange(e) {
|
|
140
|
+
if (e.target.files.length) {
|
|
141
|
+
window.dispatchEvent(new CustomEvent(Events.BeginUploadLogoExperience, {
|
|
142
|
+
detail: {
|
|
143
|
+
file: e.target.files[0]
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
onFinish(e) {
|
|
149
|
+
alert('on finish');
|
|
150
|
+
console.log(e);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}`,...Ve.parameters?.docs?.source}}};We.parameters={...We.parameters,docs:{...We.parameters?.docs,source:{originalSource:`() => {
|
|
155
|
+
const mock = new MockAdapter(axios, {
|
|
156
|
+
delayResponse: MOCK_RESPONSE_DELAY
|
|
157
|
+
});
|
|
158
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_UPLOAD_LOGO_ENDPOINT).reply(200, UPLOAD_SUCCESS_RESPONSE);
|
|
159
|
+
mock.onPost(API.BYO_LOGO_API_URL + API.BYO_LOGO_API_SAVE_ENDPOINT).reply(500, 'An error occured when creating a logo from the provided details. Please try again.');
|
|
160
|
+
return {
|
|
161
|
+
components: {
|
|
162
|
+
UploadYourLogoApplication
|
|
163
|
+
},
|
|
164
|
+
template: \`
|
|
165
|
+
<div>
|
|
166
|
+
<input type="file" @change="onFileInputChange" accept=".png,.svg,.eps" />
|
|
167
|
+
<UploadYourLogoApplication :is-user-authenticated="true" @on-finish="onFinish" />
|
|
168
|
+
</div>
|
|
169
|
+
\`,
|
|
170
|
+
methods: {
|
|
171
|
+
onFileInputChange(e) {
|
|
172
|
+
if (e.target.files.length) {
|
|
173
|
+
window.dispatchEvent(new CustomEvent(Events.BeginUploadLogoExperience, {
|
|
174
|
+
detail: {
|
|
175
|
+
file: e.target.files[0]
|
|
176
|
+
}
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
onFinish(e) {
|
|
181
|
+
alert('on finish');
|
|
182
|
+
console.log(e);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}`,...We.parameters?.docs?.source}}};const Rn=["Success","SuccessNotLoggedIn","SuccessSvg","FailOnUpload","FailOnCreate"];export{We as FailOnCreate,Ve as FailOnUpload,Xe as Success,He as SuccessNotLoggedIn,qe as SuccessSvg,Rn as __namedExportsOrder,Yn as default};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{c as y,f as R,g as w,b as f,o as v,z as x,y as P,x as _,X as F,a as q,e as g,t as z}from"./iframe-B3A6OXQU.js";import{_ as k}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{E as O,T as N}from"./event-constants-CMO9VQVu.js";var E=L;function L(){var s=[].slice.call(arguments),e=!1;typeof s[0]=="boolean"&&(e=s.shift());var t=s[0];if(b(t))throw new Error("extendee must be an object");for(var i=s.slice(1),n=i.length,o=0;o<n;o++){var r=i[o];for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){var d=r[l];if(e&&I(d)){var u=Array.isArray(d)?[]:{};t[l]=L(!0,Object.prototype.hasOwnProperty.call(t,l)&&!b(t[l])?t[l]:u,d)}else t[l]=d}}return t}function I(s){return Array.isArray(s)||{}.toString.call(s)=="[object Object]"}function b(s){return!s||typeof s!="object"&&typeof s!="function"}function B(s){return s&&s.__esModule?s.default:s}class C{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};let i=this._callbacks[e];if(i)for(let n of i)n.apply(this,t);return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:t})),this}makeEvent(e,t){let i={bubbles:!0,cancelable:!0,detail:t};if(typeof window.CustomEvent=="function")return new CustomEvent(e,i);var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,i.bubbles,i.cancelable,i.detail),n}off(e,t){if(!this._callbacks||arguments.length===0)return this._callbacks={},this;let i=this._callbacks[e];if(!i)return this;if(arguments.length===1)return delete this._callbacks[e],this;for(let n=0;n<i.length;n++)if(i[n]===t){i.splice(n,1);break}return this}}var T={};T=`<div class="dz-preview dz-file-preview">
|
|
2
|
+
<div class="dz-image"><img data-dz-thumbnail=""></div>
|
|
3
|
+
<div class="dz-details">
|
|
4
|
+
<div class="dz-size"><span data-dz-size=""></span></div>
|
|
5
|
+
<div class="dz-filename"><span data-dz-name=""></span></div>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="dz-progress">
|
|
8
|
+
<span class="dz-upload" data-dz-uploadprogress=""></span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="dz-error-message"><span data-dz-errormessage=""></span></div>
|
|
11
|
+
<div class="dz-success-mark">
|
|
12
|
+
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<path d="M10.2071 29.7929L14.2929 25.7071C14.6834 25.3166 15.3166 25.3166 15.7071 25.7071L21.2929 31.2929C21.6834 31.6834 22.3166 31.6834 22.7071 31.2929L38.2929 15.7071C38.6834 15.3166 39.3166 15.3166 39.7071 15.7071L43.7929 19.7929C44.1834 20.1834 44.1834 20.8166 43.7929 21.2071L22.7071 42.2929C22.3166 42.6834 21.6834 42.6834 21.2929 42.2929L10.2071 31.2071C9.81658 30.8166 9.81658 30.1834 10.2071 29.7929Z"></path>
|
|
14
|
+
</svg>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="dz-error-mark">
|
|
17
|
+
<svg width="54" height="54" viewBox="0 0 54 54" fill="white" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
+
<path d="M26.2929 20.2929L19.2071 13.2071C18.8166 12.8166 18.1834 12.8166 17.7929 13.2071L13.2071 17.7929C12.8166 18.1834 12.8166 18.8166 13.2071 19.2071L20.2929 26.2929C20.6834 26.6834 20.6834 27.3166 20.2929 27.7071L13.2071 34.7929C12.8166 35.1834 12.8166 35.8166 13.2071 36.2071L17.7929 40.7929C18.1834 41.1834 18.8166 41.1834 19.2071 40.7929L26.2929 33.7071C26.6834 33.3166 27.3166 33.3166 27.7071 33.7071L34.7929 40.7929C35.1834 41.1834 35.8166 41.1834 36.2071 40.7929L40.7929 36.2071C41.1834 35.8166 41.1834 35.1834 40.7929 34.7929L33.7071 27.7071C33.3166 27.3166 33.3166 26.6834 33.7071 26.2929L40.7929 19.2071C41.1834 18.8166 41.1834 18.1834 40.7929 17.7929L36.2071 13.2071C35.8166 12.8166 35.1834 12.8166 34.7929 13.2071L27.7071 20.2929C27.3166 20.6834 26.6834 20.6834 26.2929 20.2929Z"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
`;let H={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2097152,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,defaultHeaders:!0,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(s,e,t){if(t)return{dzuuid:t.file.upload.uuid,dzchunkindex:t.index,dztotalfilesize:t.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:t.file.upload.totalChunkCount,dzchunkbyteoffset:t.index*this.options.chunkSize}},accept(s,e){return e()},chunksUploaded:function(s,e){e()},binaryBody:!1,fallback(){let s;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let t of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(t.className)){s=t,t.className="dz-message";break}s||(s=a.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(s));let e=s.getElementsByTagName("span")[0];return e&&(e.textContent!=null?e.textContent=this.options.dictFallbackMessage:e.innerText!=null&&(e.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(s,e,t,i){let n={srcX:0,srcY:0,srcWidth:s.width,srcHeight:s.height},o=s.width/s.height;e==null&&t==null?(e=n.srcWidth,t=n.srcHeight):e==null?e=t*o:t==null&&(t=e/o),e=Math.min(e,n.srcWidth),t=Math.min(t,n.srcHeight);let r=e/t;if(n.srcWidth>e||n.srcHeight>t)if(i==="crop")o>r?(n.srcHeight=s.height,n.srcWidth=n.srcHeight*r):(n.srcWidth=s.width,n.srcHeight=n.srcWidth/r);else if(i==="contain")o>r?t=e/o:e=t*o;else throw new Error(`Unknown resizeMethod '${i}'`);return n.srcX=(s.width-n.srcWidth)/2,n.srcY=(s.height-n.srcHeight)/2,n.trgWidth=e,n.trgHeight=t,n},transformFile(s,e){return(this.options.resizeWidth||this.options.resizeHeight)&&s.type.match(/image.*/)?this.resizeImage(s,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(s)},previewTemplate:B(T),drop(s){return this.element.classList.remove("dz-drag-hover")},dragstart(s){},dragend(s){return this.element.classList.remove("dz-drag-hover")},dragenter(s){return this.element.classList.add("dz-drag-hover")},dragover(s){return this.element.classList.add("dz-drag-hover")},dragleave(s){return this.element.classList.remove("dz-drag-hover")},paste(s){},reset(){return this.element.classList.remove("dz-started")},addedfile(s){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){s.previewElement=a.createElement(this.options.previewTemplate.trim()),s.previewTemplate=s.previewElement,this.previewsContainer.appendChild(s.previewElement);for(var e of s.previewElement.querySelectorAll("[data-dz-name]"))e.textContent=s.name;for(e of s.previewElement.querySelectorAll("[data-dz-size]"))e.innerHTML=this.filesize(s.size);this.options.addRemoveLinks&&(s._removeLink=a.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),s.previewElement.appendChild(s._removeLink));let t=i=>(i.preventDefault(),i.stopPropagation(),s.status===a.UPLOADING?a.confirm(this.options.dictCancelUploadConfirmation,()=>this.removeFile(s)):this.options.dictRemoveFileConfirmation?a.confirm(this.options.dictRemoveFileConfirmation,()=>this.removeFile(s)):this.removeFile(s));for(let i of s.previewElement.querySelectorAll("[data-dz-remove]"))i.addEventListener("click",t)}},removedfile(s){return s.previewElement!=null&&s.previewElement.parentNode!=null&&s.previewElement.parentNode.removeChild(s.previewElement),this._updateMaxFilesReachedClass()},thumbnail(s,e){if(s.previewElement){s.previewElement.classList.remove("dz-file-preview");for(let t of s.previewElement.querySelectorAll("[data-dz-thumbnail]"))t.alt=s.name,t.src=e;return setTimeout(()=>s.previewElement.classList.add("dz-image-preview"),1)}},error(s,e){if(s.previewElement){s.previewElement.classList.add("dz-error"),typeof e!="string"&&e.error&&(e=e.error);for(let t of s.previewElement.querySelectorAll("[data-dz-errormessage]"))t.textContent=e}},errormultiple(){},processing(s){if(s.previewElement&&(s.previewElement.classList.add("dz-processing"),s._removeLink))return s._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(s,e,t){if(s.previewElement)for(let i of s.previewElement.querySelectorAll("[data-dz-uploadprogress]"))i.nodeName==="PROGRESS"?i.value=e:i.style.width=`${e}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(s){if(s.previewElement)return s.previewElement.classList.add("dz-success")},successmultiple(){},canceled(s){return this.emit("error",s,this.options.dictUploadCanceled)},canceledmultiple(){},complete(s){if(s._removeLink&&(s._removeLink.innerHTML=this.options.dictRemoveFile),s.previewElement)return s.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}};var Q=H;class a extends C{static initClass(){this.prototype.Emitter=C,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}getAcceptedFiles(){return this.files.filter(e=>e.accepted).map(e=>e)}getRejectedFiles(){return this.files.filter(e=>!e.accepted).map(e=>e)}getFilesWithStatus(e){return this.files.filter(t=>t.status===e).map(t=>t)}getQueuedFiles(){return this.getFilesWithStatus(a.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(a.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(a.ADDED)}getActiveFiles(){return this.files.filter(e=>e.status===a.UPLOADING||e.status===a.QUEUED).map(e=>e)}init(){if(this.element.tagName==="form"&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(a.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let i=()=>{this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),(this.options.maxFiles===null||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",this.options.acceptedFiles!==null&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),this.options.capture!==null&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.setAttribute("tabindex","-1"),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",a.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",()=>{let{files:n}=this.hiddenFileInput;if(n.length)for(let o of n)this.addFile(o);this.emit("addedfiles",n),i()})};i()}this.URL=window.URL!==null?window.URL:window.webkitURL;for(let i of this.events)this.on(i,this.options[i]);this.on("uploadprogress",()=>this.updateTotalUploadProgress()),this.on("removedfile",()=>this.updateTotalUploadProgress()),this.on("canceled",i=>this.emit("complete",i)),this.on("complete",i=>{if(this.getAddedFiles().length===0&&this.getUploadingFiles().length===0&&this.getQueuedFiles().length===0)return setTimeout(()=>this.emit("queuecomplete"),0)});const e=function(i){if(i.dataTransfer.types){for(var n=0;n<i.dataTransfer.types.length;n++)if(i.dataTransfer.types[n]==="Files")return!0}return!1};let t=function(i){if(e(i))return i.stopPropagation(),i.preventDefault?i.preventDefault():i.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:i=>this.emit("dragstart",i),dragenter:i=>(t(i),this.emit("dragenter",i)),dragover:i=>{let n;try{n=i.dataTransfer.effectAllowed}catch{}return i.dataTransfer.dropEffect=n==="move"||n==="linkMove"?"move":"copy",t(i),this.emit("dragover",i)},dragleave:i=>this.emit("dragleave",i),drop:i=>(t(i),this.drop(i)),dragend:i=>this.emit("dragend",i)}}],this.clickableElements.forEach(i=>this.listeners.push({element:i,events:{click:n=>((i!==this.element||n.target===this.element||a.elementInside(n.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}})),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),this.hiddenFileInput!=null&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,a.instances.splice(a.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,i=0;if(this.getActiveFiles().length){for(let o of this.getActiveFiles())t+=o.upload.bytesSent,i+=o.upload.total;e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}_getParamName(e){return typeof this.options.paramName=="function"?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){return typeof this.options.renameFile!="function"?e.name:this.options.renameFile(e)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let i='<div class="dz-fallback">';this.options.dictFallbackText&&(i+=`<p>${this.options.dictFallbackText}</p>`),i+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let n=a.createElement(i);return this.element.tagName!=="FORM"?(t=a.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`),t.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),t??n}getExistingFallback(){let e=function(i){for(let n of i)if(/(^| )fallback($| )/.test(n.className))return n};for(let i of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(i)))return t}}setupEventListeners(){return this.listeners.map(e=>(()=>{let t=[];for(let i in e.events){let n=e.events[i];t.push(e.element.addEventListener(i,n,!1))}return t})())}removeEventListeners(){return this.listeners.map(e=>(()=>{let t=[];for(let i in e.events){let n=e.events[i];t.push(e.element.removeEventListener(i,n,!1))}return t})())}disable(){return this.clickableElements.forEach(e=>e.classList.remove("dz-clickable")),this.removeEventListeners(),this.disabled=!0,this.files.map(e=>this.cancelUpload(e))}enable(){return delete this.disabled,this.clickableElements.forEach(e=>e.classList.add("dz-clickable")),this.setupEventListeners()}filesize(e){let t=0,i="b";if(e>0){let n=["tb","gb","mb","kb","b"];for(let o=0;o<n.length;o++){let r=n[o],l=Math.pow(this.options.filesizeBase,4-o)/10;if(e>=l){t=e/Math.pow(this.options.filesizeBase,4-o),i=r;break}}t=Math.round(10*t)/10}return`<strong>${t}</strong> ${this.options.dictFileSizeUnits[i]}`}_updateMaxFilesReachedClass(){return this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let i=0;i<e.dataTransfer.files.length;i++)t[i]=e.dataTransfer.files[i];if(t.length){let{items:i}=e.dataTransfer;i&&i.length&&i[0].webkitGetAsEntry!=null?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}paste(e){if(G(e?.clipboardData,i=>i.items)==null)return;this.emit("paste",e);let{items:t}=e.clipboardData;if(t.length)return this._addFilesFromItems(t)}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let n of e){var i;n.webkitGetAsEntry!=null&&(i=n.webkitGetAsEntry())?i.isFile?t.push(this.addFile(n.getAsFile())):i.isDirectory?t.push(this._addFilesFromDirectory(i,i.name)):t.push(void 0):n.getAsFile!=null&&(n.kind==null||n.kind==="file")?t.push(this.addFile(n.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let i=e.createReader(),n=r=>X(console,"log",l=>l.log(r));var o=()=>i.readEntries(r=>{if(r.length>0){for(let l of r)l.isFile?l.file(d=>{if(!(this.options.ignoreHiddenFiles&&d.name.substring(0,1)==="."))return d.fullPath=`${t}/${d.name}`,this.addFile(d)}):l.isDirectory&&this._addFilesFromDirectory(l,`${t}/${l.name}`);o()}return null},n);return o()}accept(e,t){this.options.maxFilesize&&e.size>this.options.maxFilesize*1048576?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):a.isValidFile(e,this.options.acceptedFiles)?this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:a.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=a.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()})}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status===a.ADDED&&e.accepted===!0){if(e.status=a.QUEUED,this.options.autoProcessQueue)return setTimeout(()=>this.processQueue(),0)}else throw new Error("This file can't be queued because it has already been processed or was rejected.")}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=this.options.maxThumbnailFilesize*1048576)return this._thumbnailQueue.push(e),setTimeout(()=>this._processThumbnailQueue(),0)}_processThumbnailQueue(){if(this._processingThumbnail||this._thumbnailQueue.length===0)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue()))}removeFile(e){if(e.status===a.UPLOADING&&this.cancelUpload(e),this.files=j(this.files,e),this.emit("removedfile",e),this.files.length===0)return this.emit("reset")}removeAllFiles(e){e==null&&(e=!1);for(let t of this.files.slice())(t.status!==a.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,i,n,o){return this.createThumbnail(e,t,i,n,!0,(r,l)=>{if(l==null)return o(e);{let{resizeMimeType:d}=this.options;d==null&&(d=e.type);let u=l.toDataURL(d,this.options.resizeQuality);return(d==="image/jpeg"||d==="image/jpg")&&(u=U.restore(e.dataURL,u)),o(a.dataURItoBlob(u))}})}createThumbnail(e,t,i,n,o,r){let l=new FileReader;l.onload=()=>{if(e.dataURL=l.result,e.type==="image/svg+xml"){r?.(l.result);return}this.createThumbnailFromUrl(e,t,i,n,o,r)},l.readAsDataURL(e)}displayExistingFile(e,t,i,n,o=!0){if(this.emit("addedfile",e),this.emit("complete",e),!o)this.emit("thumbnail",e,t),i&&i();else{let r=l=>{this.emit("thumbnail",e,l),i&&i()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,r,n)}}createThumbnailFromUrl(e,t,i,n,o,r,l){let d=document.createElement("img");return l&&(d.crossOrigin=l),o=getComputedStyle(document.body).imageOrientation=="from-image"?!1:o,d.onload=()=>{let u=p=>p(1);return typeof EXIF<"u"&&EXIF!==null&&o&&(u=p=>EXIF.getData(d,function(){return p(EXIF.getTag(this,"Orientation"))})),u(p=>{e.width=d.width,e.height=d.height;let h=this.options.resize.call(this,e,t,i,n),c=document.createElement("canvas"),m=c.getContext("2d");switch(c.width=h.trgWidth,c.height=h.trgHeight,p>4&&(c.width=h.trgHeight,c.height=h.trgWidth),p){case 2:m.translate(c.width,0),m.scale(-1,1);break;case 3:m.translate(c.width,c.height),m.rotate(Math.PI);break;case 4:m.translate(0,c.height),m.scale(1,-1);break;case 5:m.rotate(.5*Math.PI),m.scale(1,-1);break;case 6:m.rotate(.5*Math.PI),m.translate(0,-c.width);break;case 7:m.rotate(.5*Math.PI),m.translate(c.height,-c.width),m.scale(-1,1);break;case 8:m.rotate(-.5*Math.PI),m.translate(-c.height,0);break}V(m,d,h.srcX!=null?h.srcX:0,h.srcY!=null?h.srcY:0,h.srcWidth,h.srcHeight,h.trgX!=null?h.trgX:0,h.trgY!=null?h.trgY:0,h.trgWidth,h.trgHeight);let D=c.toDataURL("image/png");if(r!=null)return r(D,c)})},r!=null&&(d.onerror=r),d.src=e.dataURL}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,i=t;if(t>=e)return;let n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));for(;i<e;){if(!n.length)return;this.processFile(n.shift()),i++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let t of e)t.processing=!0,t.status=a.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter(t=>t.xhr===e).map(t=>t)}cancelUpload(e){if(e.status===a.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let i of t)i.status=a.CANCELED;typeof e.xhr<"u"&&e.xhr.abort();for(let i of t)this.emit("canceled",i);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else(e.status===a.ADDED||e.status===a.QUEUED)&&(e.status=a.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return typeof e=="function"?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,t=>{if(this.options.chunking){let i=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||i.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(i.size/this.options.chunkSize)}if(e[0].upload.chunked){let i=e[0],n=t[0];i.upload.chunks=[];let o=()=>{let r=0;for(;i.upload.chunks[r]!==void 0;)r++;if(r>=i.upload.totalChunkCount)return;let l=r*this.options.chunkSize,d=Math.min(l+this.options.chunkSize,n.size),u={name:this._getParamName(0),data:n.webkitSlice?n.webkitSlice(l,d):n.slice(l,d),filename:i.upload.filename,chunkIndex:r};i.upload.chunks[r]={file:i,index:r,dataBlock:u,status:a.UPLOADING,progress:0,retries:0},this._uploadData(e,[u])};if(i.upload.finishedChunkUpload=(r,l)=>{let d=!0;r.status=a.SUCCESS,r.dataBlock=null,r.response=r.xhr.responseText,r.responseHeaders=r.xhr.getAllResponseHeaders(),r.xhr=null;for(let u=0;u<i.upload.totalChunkCount;u++){if(i.upload.chunks[u]===void 0)return o();i.upload.chunks[u].status!==a.SUCCESS&&(d=!1)}d&&this.options.chunksUploaded(i,()=>{this._finished(e,l,null)})},this.options.parallelChunkUploads)for(let r=0;r<i.upload.totalChunkCount;r++)o();else o()}else{let i=[];for(let n=0;n<e.length;n++)i[n]={name:this._getParamName(n),data:t[n],filename:e[n].upload.filename};this._uploadData(e,i)}})}_getChunk(e,t){for(let i=0;i<e.upload.totalChunkCount;i++)if(e.upload.chunks[i]!==void 0&&e.upload.chunks[i].xhr===t)return e.upload.chunks[i]}_uploadData(e,t){let i=new XMLHttpRequest;for(let u of e)u.xhr=i;e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=i);let n=this.resolveOption(this.options.method,e,t),o=this.resolveOption(this.options.url,e,t);i.open(n,o,!0),this.resolveOption(this.options.timeout,e)&&(i.timeout=this.resolveOption(this.options.timeout,e)),i.withCredentials=!!this.options.withCredentials,i.onload=u=>{this._finishedUploading(e,i,u)},i.ontimeout=()=>{this._handleUploadError(e,i,`Request timedout after ${this.options.timeout/1e3} seconds`)},i.onerror=()=>{this._handleUploadError(e,i)};let l=i.upload!=null?i.upload:i;l.onprogress=u=>this._updateFilesUploadProgress(e,i,u);let d=this.options.defaultHeaders?{Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"}:{};this.options.binaryBody&&(d["Content-Type"]=e[0].type),this.options.headers&&E(d,this.options.headers);for(let u in d){let p=d[u];p&&i.setRequestHeader(u,p)}if(this.options.binaryBody){for(let u of e)this.emit("sending",u,i);this.options.uploadMultiple&&this.emit("sendingmultiple",e,i),this.submitRequest(i,null,e)}else{let u=new FormData;if(this.options.params){let p=this.options.params;typeof p=="function"&&(p=p.call(this,e,i,e[0].upload.chunked?this._getChunk(e[0],i):null));for(let h in p){let c=p[h];if(Array.isArray(c))for(let m=0;m<c.length;m++)u.append(h,c[m]);else u.append(h,c)}}for(let p of e)this.emit("sending",p,i,u);this.options.uploadMultiple&&this.emit("sendingmultiple",e,i,u),this._addFormElementData(u);for(let p=0;p<t.length;p++){let h=t[p];u.append(h.name,h.data,h.filename)}this.submitRequest(i,u,e)}}_transformFiles(e,t){let i=[],n=0;for(let o=0;o<e.length;o++)this.options.transformFile.call(this,e[o],r=>{i[o]=r,++n===e.length&&t(i)})}_addFormElementData(e){if(this.element.tagName==="FORM")for(let t of this.element.querySelectorAll("input, textarea, select, button")){let i=t.getAttribute("name"),n=t.getAttribute("type");if(n&&(n=n.toLowerCase()),!(typeof i>"u"||i===null))if(t.tagName==="SELECT"&&t.hasAttribute("multiple"))for(let o of t.options)o.selected&&e.append(i,o.value);else(!n||n!=="checkbox"&&n!=="radio"||t.checked)&&e.append(i,t.value)}}_updateFilesUploadProgress(e,t,i){if(e[0].upload.chunked){let n=e[0],o=this._getChunk(n,t);i?(o.progress=100*i.loaded/i.total,o.total=i.total,o.bytesSent=i.loaded):(o.progress=100,o.bytesSent=o.total),n.upload.progress=0,n.upload.total=0,n.upload.bytesSent=0;for(let r=0;r<n.upload.totalChunkCount;r++)n.upload.chunks[r]&&typeof n.upload.chunks[r].progress<"u"&&(n.upload.progress+=n.upload.chunks[r].progress,n.upload.total+=n.upload.chunks[r].total,n.upload.bytesSent+=n.upload.chunks[r].bytesSent);n.upload.progress=n.upload.progress/n.upload.totalChunkCount,this.emit("uploadprogress",n,n.upload.progress,n.upload.bytesSent)}else for(let n of e)n.upload.total&&n.upload.bytesSent&&n.upload.bytesSent==n.upload.total||(i?(n.upload.progress=100*i.loaded/i.total,n.upload.total=i.total,n.upload.bytesSent=i.loaded):(n.upload.progress=100,n.upload.bytesSent=n.upload.total),this.emit("uploadprogress",n,n.upload.progress,n.upload.bytesSent))}_finishedUploading(e,t,i){let n;if(e[0].status!==a.CANCELED&&t.readyState===4){if(t.responseType!=="arraybuffer"&&t.responseType!=="blob"&&(n=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{n=JSON.parse(n)}catch(o){i=o,n="Invalid JSON response from server."}this._updateFilesUploadProgress(e,t),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t),n):this._finished(e,n,i):this._handleUploadError(e,t,n)}}_handleUploadError(e,t,i){if(e[0].status!==a.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let n=this._getChunk(e[0],t);if(n.retries++<this.options.retryChunksLimit){this._uploadData(e,[n.dataBlock]);return}else console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,i||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}submitRequest(e,t,i){if(e.readyState!=1){console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");return}if(this.options.binaryBody)if(i[0].upload.chunked){const n=this._getChunk(i[0],e);e.send(n.dataBlock.data)}else e.send(i[0]);else e.send(t)}_finished(e,t,i){for(let n of e)n.status=a.SUCCESS,this.emit("success",n,t,i),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,i),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,t,i){for(let n of e)n.status=a.ERROR,this.emit("error",n,t,i),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,i),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}constructor(e,t){super();let i,n;if(this.element=e,this.clickableElements=[],this.listeners=[],this.files=[],typeof this.element=="string"&&(this.element=document.querySelector(this.element)),!this.element||this.element.nodeType==null)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");a.instances.push(this),this.element.dropzone=this;let o=(n=a.optionsForElement(this.element))!=null?n:{};if(this.options=E(!0,{},Q,o,t??{}),this.options.previewTemplate=this.options.previewTemplate.replace(/\n*/g,""),this.options.forceFallback||!a.isBrowserSupported())return this.options.fallback.call(this);if(this.options.url==null&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");if(this.options.binaryBody&&this.options.uploadMultiple)throw new Error("You cannot set both: binaryBody and uploadMultiple.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.renameFilename!=null&&(this.options.renameFile=r=>this.options.renameFilename.call(this,r.name,r)),typeof this.options.method=="string"&&(this.options.method=this.options.method.toUpperCase()),(i=this.getExistingFallback())&&i.parentNode&&i.parentNode.removeChild(i),this.options.previewsContainer!==!1&&(this.options.previewsContainer?this.previewsContainer=a.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(this.options.clickable===!0?this.clickableElements=[this.element]:this.clickableElements=a.getElements(this.options.clickable,"clickable")),this.init()}}a.initClass();a.options={};a.optionsForElement=function(s){if(s.getAttribute("id"))return a.options[W(s.getAttribute("id"))]};a.instances=[];a.forElement=function(s){if(typeof s=="string"&&(s=document.querySelector(s)),s?.dropzone==null)throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return s.dropzone};a.discover=function(){let s;if(document.querySelectorAll)s=document.querySelectorAll(".dropzone");else{s=[];let e=t=>(()=>{let i=[];for(let n of t)/(^| )dropzone($| )/.test(n.className)?i.push(s.push(n)):i.push(void 0);return i})();e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return(()=>{let e=[];for(let t of s)a.optionsForElement(t)!==!1?e.push(new a(t)):e.push(void 0);return e})()};a.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i];a.isBrowserSupported=function(){let s=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if(!("classList"in document.createElement("a")))s=!1;else{a.blacklistedBrowsers!==void 0&&(a.blockedBrowsers=a.blacklistedBrowsers);for(let e of a.blockedBrowsers)if(e.test(navigator.userAgent)){s=!1;continue}}else s=!1;return s};a.dataURItoBlob=function(s){let e=atob(s.split(",")[1]),t=s.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(e.length),n=new Uint8Array(i);for(let o=0,r=e.length,l=0<=r;l?o<=r:o>=r;l?o++:o--)n[o]=e.charCodeAt(o);return new Blob([i],{type:t})};const j=(s,e)=>s.filter(t=>t!==e).map(t=>t),W=s=>s.replace(/[\-_](\w)/g,e=>e.charAt(1).toUpperCase());a.createElement=function(s){let e=document.createElement("div");return e.innerHTML=s,e.childNodes[0]};a.elementInside=function(s,e){if(s===e)return!0;for(;s=s.parentNode;)if(s===e)return!0;return!1};a.getElement=function(s,e){let t;if(typeof s=="string"?t=document.querySelector(s):s.nodeType!=null&&(t=s),t==null)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector or a plain HTML element.`);return t};a.getElements=function(s,e){let t,i;if(s instanceof Array){i=[];try{for(t of s)i.push(this.getElement(t,e))}catch{i=null}}else if(typeof s=="string"){i=[];for(t of document.querySelectorAll(s))i.push(t)}else s.nodeType!=null&&(i=[s]);if(i==null||!i.length)throw new Error(`Invalid \`${e}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return i};a.confirm=function(s,e,t){if(window.confirm(s))return e();if(t!=null)return t()};a.isValidFile=function(s,e){if(!e)return!0;e=e.split(",");let t=s.type,i=t.replace(/\/.*$/,"");for(let n of e)if(n=n.trim(),n.charAt(0)==="."){if(s.name.toLowerCase().indexOf(n.toLowerCase(),s.name.length-n.length)!==-1)return!0}else if(/\/\*$/.test(n)){if(i===n.replace(/\/.*$/,""))return!0}else if(t===n)return!0;return!1};typeof jQuery<"u"&&jQuery!==null&&(jQuery.fn.dropzone=function(s){return this.each(function(){return new a(this,s)})});a.ADDED="added";a.QUEUED="queued";a.ACCEPTED=a.QUEUED;a.UPLOADING="uploading";a.PROCESSING=a.UPLOADING;a.CANCELED="canceled";a.ERROR="error";a.SUCCESS="success";let Y=function(s){s.naturalWidth;let e=s.naturalHeight,t=document.createElement("canvas");t.width=1,t.height=e;let i=t.getContext("2d");i.drawImage(s,0,0);let{data:n}=i.getImageData(1,0,1,e),o=0,r=e,l=e;for(;l>o;)n[(l-1)*4+3]===0?r=l:o=l,l=r+o>>1;let d=l/e;return d===0?1:d};var V=function(s,e,t,i,n,o,r,l,d,u){let p=Y(e);return s.drawImage(e,t,i,n,o,r,l,d,u/p)};class U{static initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}static encode64(e){let t="",i,n,o="",r,l,d,u="",p=0;for(;i=e[p++],n=e[p++],o=e[p++],r=i>>2,l=(i&3)<<4|n>>4,d=(n&15)<<2|o>>6,u=o&63,isNaN(n)?d=u=64:isNaN(o)&&(u=64),t=t+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(d)+this.KEY_STR.charAt(u),i=n=o="",r=l=d=u="",p<e.length;);return t}static restore(e,t){if(!e.match("data:image/jpeg;base64,"))return t;let i=this.decode64(e.replace("data:image/jpeg;base64,","")),n=this.slice2Segments(i),o=this.exifManipulation(t,n);return`data:image/jpeg;base64,${this.encode64(o)}`}static exifManipulation(e,t){let i=this.getExifArray(t),n=this.insertExif(e,i);return new Uint8Array(n)}static getExifArray(e){let t,i=0;for(;i<e.length;){if(t=e[i],t[0]===255&t[1]===225)return t;i++}return[]}static insertExif(e,t){let i=e.replace("data:image/jpeg;base64,",""),n=this.decode64(i),o=n.indexOf(255,3),r=n.slice(0,o),l=n.slice(o),d=r;return d=d.concat(t),d=d.concat(l),d}static slice2Segments(e){let t=0,i=[];for(;;){var n;if(e[t]===255&e[t+1]===218)break;if(e[t]===255&e[t+1]===216)t+=2;else{n=e[t+2]*256+e[t+3];let o=t+n+2,r=e.slice(t,o);i.push(r),t=o}if(t>e.length)break}return i}static decode64(e){let t,i,n="",o,r,l,d="",u=0,p=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn(`There were invalid base64 characters in the input text.
|
|
23
|
+
Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='
|
|
24
|
+
Expect errors in decoding.`),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");o=this.KEY_STR.indexOf(e.charAt(u++)),r=this.KEY_STR.indexOf(e.charAt(u++)),l=this.KEY_STR.indexOf(e.charAt(u++)),d=this.KEY_STR.indexOf(e.charAt(u++)),t=o<<2|r>>4,i=(r&15)<<4|l>>2,n=(l&3)<<6|d,p.push(t),l!==64&&p.push(i),d!==64&&p.push(n),t=i=n="",o=r=l=d="",u<e.length;);return p}}U.initClass();function G(s,e){return typeof s<"u"&&s!==null?e(s):void 0}function X(s,e,t){if(typeof s<"u"&&s!==null&&typeof s[e]=="function")return t(s,e)}const K={getSignedURL(s,e){let t={filePath:s.name,contentType:s.type};return new Promise((i,n)=>{var o=new FormData;let r=new XMLHttpRequest,l=typeof e.signingURL=="function"?e.signingURL(s):e.signingURL;r.open("POST",l),r.onload=function(){r.status==200?i(JSON.parse(r.response)):n(r.statusText)},r.onerror=function(d){console.error("Network Error : Could not send request to AWS (Maybe CORS errors)"),n(d)},e.withCredentials===!0&&(r.withCredentials=!0),Object.entries(e.headers||{}).forEach(([d,u])=>{r.setRequestHeader(d,u)}),t=Object.assign(t,e.params||{}),Object.entries(t).forEach(([d,u])=>{o.append(d,u)}),r.send(o)})},sendFile(s,e,t){var i=t?this.setResponseHandler:this.sendS3Handler;return this.getSignedURL(s,e).then(n=>i(n,s)).catch(n=>n)},setResponseHandler(s,e){e.s3Signature=s.signature,e.s3Url=s.postEndpoint},sendS3Handler(s,e){let t=new FormData,i=s.signature;return Object.keys(i).forEach(function(n){t.append(n,i[n])}),t.append("file",e),new Promise((n,o)=>{let r=new XMLHttpRequest;r.open("POST",s.postEndpoint),r.onload=function(){if(r.status==201){var l=new window.DOMParser().parseFromString(r.response,"text/xml"),d=l.firstChild.children[0].innerHTML;n({success:!0,message:d})}else{var l=new window.DOMParser().parseFromString(r.response,"text/xml"),u=l.firstChild.children[0].innerHTML;o({success:!1,message:u+". Request is marked as resolved when returns as status 201"})}},r.onerror=function(){var l=new window.DOMParser().parseFromString(r.response,"text/xml"),d=l.firstChild.children[1].innerHTML;o({success:!1,message:d})},r.send(t)})}},A={props:{id:{type:String,required:!0,default:"dropzone"},options:{type:Object,required:!0},includeStyling:{type:Boolean,default:!0,required:!1},awss3:{type:Object,required:!1,default:null},destroyDropzone:{type:Boolean,default:!0,required:!1},duplicateCheck:{type:Boolean,default:!1,required:!1},useCustomSlot:{type:Boolean,default:!1,required:!1}},emits:["vdropzone-thumbnail","vdropzone-duplicate-file","vdropzone-file-added","vdropzone-files-added","vdropzone-removed-file","vdropzone-success","vdropzone-error","vdropzone-s3-upload-success","vdropzone-s3-upload-error","vdropzone-success-multiple","vdropzone-error-multiple","vdropzone-sending","vdropzone-sending-multiple","vdropzone-complete","vdropzone-complete-multiple","vdropzone-canceled","vdropzone-canceled-multiple","vdropzone-max-files-reached","vdropzone-max-files-exceeded","vdropzone-processing","vdropzone-processing-multiple","vdropzone-upload-progress","vdropzone-total-upload-progress","vdropzone-reset","vdropzone-queue-complete","vdropzone-drop","vdropzone-drag-start","vdropzone-drag-end","vdropzone-drag-enter","vdropzone-drag-over","vdropzone-drag-leave","vdropzone-mounted","vdropzone-file-added-manually"],data(){return{aws:null,isS3:!1,isS3OverridesServerPropagation:!1,wasQueueAutoProcess:!0,files:[],dropzoneSettings:{thumbnailWidth:200,thumbnailHeight:200}}},watch:{options:{handler(){this.updateSettings()},deep:!0},awss3:{handler(){this.updateAWSSettings()},deep:!0}},beforeMount(){this.updateSettings(),this.updateAWSSettings()},mounted(){this.$isServer&&this.hasBeenMounted||(this.hasBeenMounted=!0,this.dropzone=new a(this.$refs.dropzoneElement,this.dropzoneSettings),this.dropzone.on("thumbnail",(s,e)=>{this.$emit("vdropzone-thumbnail",s,e)}),this.dropzone.on("addedfile",s=>{this.duplicateCheck&&this.dropzone.getQueuedFiles().length&&this.getQueuedFiles().forEach(e=>{e.name===s.name&&e.size===s.size&&e.lastModifiedDate.toString()===s.lastModifiedDate.toString()&&e.dataUrl===s.dataUrl&&(this.removeFile(s),this.$emit("vdropzone-duplicate-file",s))}),this.$emit("vdropzone-file-added",s),this.isS3&&this.wasQueueAutoProcess&&!s.manuallyAdded&&this.getSignedAndUploadToS3(s)}),this.dropzone.on("addedfiles",s=>{this.$emit("vdropzone-files-added",s)}),this.dropzone.on("removedfile",s=>{this.$emit("vdropzone-removed-file",s),s.manuallyAdded&&this.dropzone.options.maxFiles!==null&&this.dropzone.options.maxFiles++}),this.dropzone.on("success",(s,e)=>{if(this.$emit("vdropzone-success",s,e),this.isS3){if(this.isS3OverridesServerPropagation){let i=new window.DOMParser().parseFromString(e,"text/xml").firstChild.children[0].innerHTML;this.$emit("vdropzone-s3-upload-success",i)}this.wasQueueAutoProcess&&this.setOption("autoProcessQueue",!1)}}),this.dropzone.on("successmultiple",(s,e)=>{this.$emit("vdropzone-success-multiple",s,e)}),this.dropzone.on("error",(s,e,t)=>{this.$emit("vdropzone-error",s,e,t),this.isS3&&this.$emit("vdropzone-s3-upload-error")}),this.dropzone.on("errormultiple",(s,e,t)=>{this.$emit("vdropzone-error-multiple",s,e,t)}),this.dropzone.on("sending",(s,e,t)=>{if(this.isS3)if(this.isS3OverridesServerPropagation){let i=s.s3Signature;Object.keys(i).forEach(function(n){t.append(n,i[n])})}else t.append("s3ObjectLocation",s.s3ObjectLocation);this.$emit("vdropzone-sending",s,e,t)}),this.dropzone.on("sendingmultiple",(s,e,t)=>{this.$emit("vdropzone-sending-multiple",s,e,t)}),this.dropzone.on("complete",s=>{this.$emit("vdropzone-complete",s)}),this.dropzone.on("completemultiple",s=>{this.$emit("vdropzone-complete-multiple",s)}),this.dropzone.on("canceled",s=>{this.$emit("vdropzone-canceled",s)}),this.dropzone.on("canceledmultiple",s=>{this.$emit("vdropzone-canceled-multiple",s)}),this.dropzone.on("maxfilesreached",s=>{this.$emit("vdropzone-max-files-reached",s)}),this.dropzone.on("maxfilesexceeded",s=>{this.$emit("vdropzone-max-files-exceeded",s)}),this.dropzone.on("processing",s=>{this.$emit("vdropzone-processing",s)}),this.dropzone.on("processingmultiple",s=>{this.$emit("vdropzone-processing-multiple",s)}),this.dropzone.on("uploadprogress",(s,e,t)=>{this.$emit("vdropzone-upload-progress",s,e,t)}),this.dropzone.on("totaluploadprogress",(s,e,t)=>{this.$emit("vdropzone-total-upload-progress",s,e,t)}),this.dropzone.on("reset",()=>{this.$emit("vdropzone-reset")}),this.dropzone.on("queuecomplete",()=>{this.$emit("vdropzone-queue-complete")}),this.dropzone.on("drop",s=>{this.$emit("vdropzone-drop",s)}),this.dropzone.on("dragstart",s=>{this.$emit("vdropzone-drag-start",s)}),this.dropzone.on("dragend",s=>{this.$emit("vdropzone-drag-end",s)}),this.dropzone.on("dragenter",s=>{this.$emit("vdropzone-drag-enter",s)}),this.dropzone.on("dragover",s=>{this.$emit("vdropzone-drag-over",s)}),this.dropzone.on("dragleave",s=>{this.$emit("vdropzone-drag-leave",s)}),this.$emit("vdropzone-mounted"))},beforeUnmount(){this.destroyDropzone&&this.dropzone.destroy()},methods:{updateAWSSettings(){this.awss3!==null&&(this.aws={...this.awss3},this.dropzoneSettings.autoProcessQueue=!1,this.isS3=!0,this.isS3OverridesServerPropagation=this.aws.sendFileToServer===!1,this.options.autoProcessQueue!==void 0&&(this.wasQueueAutoProcess=this.options.autoProcessQueue),this.isS3OverridesServerPropagation&&(this.dropzoneSettings.url=s=>s[0].s3Url))},updateSettings(){this.dropzoneSettings=Object.assign(this.dropzoneSettings,this.options)},manuallyAddFile:function(s,e){s.manuallyAdded=!0,this.dropzone.emit("addedfile",s);let t=!1;if((e.indexOf(".svg")>-1||e.indexOf(".png")>-1||e.indexOf(".jpg")>-1||e.indexOf(".jpeg")>-1||e.indexOf(".gif")>-1||e.indexOf(".webp")>-1)&&(t=!0),this.dropzone.options.createImageThumbnails&&t&&s.size<=this.dropzone.options.maxThumbnailFilesize*1024*1024){e&&this.dropzone.emit("thumbnail",s,e);let i=s.previewElement.querySelectorAll("[data-dz-thumbnail]");for(let n=0;n<i.length;n++)i[n].style.width=this.dropzoneSettings.thumbnailWidth+"px",i[n].style.height=this.dropzoneSettings.thumbnailHeight+"px",i[n].style["object-fit"]="contain"}this.dropzone.emit("complete",s),this.dropzone.options.maxFiles&&this.dropzone.options.maxFiles--,this.dropzone.files.push(s),this.$emit("vdropzone-file-added-manually",s)},setOption:function(s,e){this.dropzone.options[s]=e},removeAllFiles:function(s){this.dropzone.removeAllFiles(s)},processQueue:function(){let s=this.dropzone;this.isS3&&!this.wasQueueAutoProcess?this.getQueuedFiles().forEach(e=>{this.getSignedAndUploadToS3(e)}):this.dropzone.processQueue(),this.dropzone.on("success",function(){s.options.autoProcessQueue=!0}),this.dropzone.on("queuecomplete",function(){s.options.autoProcessQueue=!1})},init:function(){return this.dropzone.init()},destroy:function(){return this.dropzone.destroy()},updateTotalUploadProgress:function(){return this.dropzone.updateTotalUploadProgress()},getFallbackForm:function(){return this.dropzone.getFallbackForm()},getExistingFallback:function(){return this.dropzone.getExistingFallback()},setupEventListeners:function(){return this.dropzone.setupEventListeners()},removeEventListeners:function(){return this.dropzone.removeEventListeners()},disable:function(){return this.dropzone.disable()},enable:function(){return this.dropzone.enable()},filesize:function(s){return this.dropzone.filesize(s)},accept:function(s,e){return this.dropzone.accept(s,e)},addFile:function(s){return this.dropzone.addFile(s)},removeFile:function(s){this.dropzone.removeFile(s)},getAcceptedFiles:function(){return this.dropzone.getAcceptedFiles()},getRejectedFiles:function(){return this.dropzone.getRejectedFiles()},getFilesWithStatus:function(){return this.dropzone.getFilesWithStatus()},getQueuedFiles:function(){return this.dropzone.getQueuedFiles()},getUploadingFiles:function(){return this.dropzone.getUploadingFiles()},getAddedFiles:function(){return this.dropzone.getAddedFiles()},getActiveFiles:function(){return this.dropzone.getActiveFiles()},getSignedAndUploadToS3(s){let e=K.sendFile(s,this.aws,this.isS3OverridesServerPropagation);this.isS3OverridesServerPropagation?e.then(()=>{setTimeout(()=>this.dropzone.processFile(s))}):e.then(t=>{t.success?(s.s3ObjectLocation=t.message,setTimeout(()=>this.dropzone.processFile(s)),this.$emit("vdropzone-s3-upload-success",t.message)):typeof t.message<"u"?this.$emit("vdropzone-s3-upload-error",t.message):this.$emit("vdropzone-s3-upload-error","Network Error : Could not send request to AWS. (Maybe CORS error)")}),e.catch(t=>{alert(t)})},setAWSSigningURL(s){this.isS3&&this.aws&&(this.aws.signingURL=s)}}},Z=["id"],J={key:0,class:"dz-message"};function $(s,e,t,i,n,o){return v(),y("div",{id:t.id,ref:"dropzoneElement",class:f({"vue-dropzone dropzone":t.includeStyling})},[t.useCustomSlot?(v(),y("div",J,[R(s.$slots,"default",{},()=>[e[0]||(e[0]=x("Drop files here to upload",-1))])])):w("",!0)],10,Z)}const ee=k(A,[["render",$]]);A.__docgenInfo={exportName:"default",displayName:"vue-dropzone",description:"",tags:{},props:[{name:"id",type:{name:"string"},required:!0,defaultValue:{func:!1,value:"'dropzone'"}},{name:"options",type:{name:"object"},required:!0},{name:"includeStyling",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"true"}},{name:"awss3",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"null"}},{name:"destroyDropzone",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"true"}},{name:"duplicateCheck",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"useCustomSlot",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}}],events:[{name:"vdropzone-thumbnail",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"}]},{name:"vdropzone-duplicate-file",type:{names:["undefined"]}},{name:"vdropzone-file-added",type:{names:["undefined"]}},{name:"vdropzone-files-added",type:{names:["undefined"]}},{name:"vdropzone-removed-file",type:{names:["undefined"]}},{name:"vdropzone-success",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"}]},{name:"vdropzone-error",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-s3-upload-success",type:{names:["undefined"]}},{name:"vdropzone-s3-upload-error",type:{names:["undefined"]}},{name:"vdropzone-success-multiple",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"}]},{name:"vdropzone-error-multiple",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-sending",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-sending-multiple",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-complete",type:{names:["undefined"]}},{name:"vdropzone-complete-multiple",type:{names:["undefined"]}},{name:"vdropzone-canceled",type:{names:["undefined"]}},{name:"vdropzone-canceled-multiple",type:{names:["undefined"]}},{name:"vdropzone-max-files-reached",type:{names:["undefined"]}},{name:"vdropzone-max-files-exceeded",type:{names:["undefined"]}},{name:"vdropzone-processing",type:{names:["undefined"]}},{name:"vdropzone-processing-multiple",type:{names:["undefined"]}},{name:"vdropzone-upload-progress",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-total-upload-progress",type:{names:["undefined"]},properties:[{type:{names:["undefined"]},name:"<anonymous1>"},{type:{names:["undefined"]},name:"<anonymous2>"}]},{name:"vdropzone-reset"},{name:"vdropzone-queue-complete"},{name:"vdropzone-drop",type:{names:["undefined"]}},{name:"vdropzone-drag-start",type:{names:["undefined"]}},{name:"vdropzone-drag-end",type:{names:["undefined"]}},{name:"vdropzone-drag-enter",type:{names:["undefined"]}},{name:"vdropzone-drag-over",type:{names:["undefined"]}},{name:"vdropzone-drag-leave",type:{names:["undefined"]}},{name:"vdropzone-mounted"},{name:"vdropzone-file-added-manually",type:{names:["undefined"]}}],slots:[{name:"default"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/node_modules/dropzone-vue3/src/components/vue-dropzone.vue"]};const S={UploadUserLogo:"UploadUserLogo"},te=["image/jpeg","image/png","image/svg+xml","application/postscript"],M={components:{Dropzone:ee},props:{isUserAuthenticated:{type:Boolean,required:!1,default:!0},trackingData:{type:Object,required:!1,default:void 0},shouldOpenUploadWhenMounted:{type:Boolean,required:!1,default:!1},isModal:{type:Boolean,required:!1,default:!1},useLandscapeTile:{type:Boolean,required:!1,default:!1},smallLayout:{type:Boolean,required:!1,default:!1},shouldUseCompactLayout:{type:Boolean,default:!1},isDesignCom:{type:Boolean,required:!1,default:!1},assetType:{type:Number,default:null},templateTypeFriendlyName:{type:String,default:null}},setup(){return{uploadYourLogoTr:F}},computed:{options(){const s=this,e=F("wrongUploadType");return{url:"#",autoProcessQueue:!1,maxFiles:1,uploadMultiple:!1,acceptedFiles:te.join(","),dictInvalidFileType:e,accept(t){const i=new FileReader,n=this;i.addEventListener("loadend",()=>{t.status="success",n.emit("success",t),n.emit("complete",t)}),i.readAsText(t)},init(){this.hiddenFileInput.addEventListener("click",i=>{s.isUserAuthenticated||(i.preventDefault(),s.showLoginModal())})}}}},data(){return{}},mounted(){window&&this.shouldOpenUploadWhenMounted&&this.$refs.dropzone&&this.$refs.dropzone?.$refs.dropzoneElement&&this.$refs?.dropzone?.$refs?.dropzoneElement.click()},methods:{pushTrackingData(){this.trackingData&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push(this.trackingData))},onUploadSuccess(s){if(this.$refs.dropzone.removeAllFiles(),this.pushTrackingData(),!this.isUserAuthenticated){this.showLoginModal();return}this.$emit("on-upload-success",s)},showLoginModal(){this.$refs.dropzone.removeAllFiles(),this.$emit("on-login-modal-open",S.UploadUserLogo),window.dispatchEvent(new CustomEvent(O.ShowLoginModal,{detail:{isSave:!0,regoSource:S.UploadUserLogo,emailCapturedCallback:this.handleEmailCapturedForLogoUpload,shouldReloadPageOnSuccess:!1,assetType:this.assetType,templateTypeName:this.templateTypeFriendlyName,userTriggered:N.Automatic}}))},handleEmailCapturedForLogoUpload(){this.$emit("logo-dropzone-login-callback")},displayError(s){if(this.$refs?.dropzone?.$refs?.dropzoneElement){const e=this.$refs.dropzone.$refs.dropzoneElement.querySelector(".dz-error-message");e&&(e.innerText=s)}}}},ie={class:"tw-text-info-500"};function se(s,e,t,i,n,o){const r=q("dropzone");return v(),P(r,{id:`upload-your-logo-dropzone-${s._uid}`,ref:"dropzone",class:f(["c-upload-your-logo tw-group tw-transition-colors tw-duration-200 tw-flex tw-justify-center tw-flex-col tw-cursor-pointer",{"tw-items-center tw-py-8":!t.shouldUseCompactLayout,"tw-w-full tw-bg-grayscale-400 tw-flex tw-items-center tw-justify-center tw-flex-col tw-cursor-pointer":t.isModal,"hover:tw-bg-grayscale-200 tw-bg-white tw-border tw-border-dashed tw-border-secondary-300 tw-rounded":!t.isModal,"md:tw-py-2 md:tw-pr-2 md:tw-items-start":t.useLandscapeTile,"tw-py-4 md:tw-py-2 tw-pr-2 tw-items-start":t.shouldUseCompactLayout}]),options:o.options,"include-styling":!1,"use-custom-slot":!0,"data-test-byo-upload-dropzone":"",onVdropzoneSuccess:o.onUploadSuccess},{default:_(()=>[g("div",{class:f(["tw-px-2",{"tw-text-center":!t.shouldUseCompactLayout,"md:tw-flex md:tw-flex-row md:tw-items-center md:tw-text-left md:tw-text-xs md:tw-px-4":t.useLandscapeTile,"md:tw-px-8":t.smallLayout&&!t.useLandscapeTile,"tw-flex tw-flex-row tw-items-center tw-text-left tw-text-xs tw-px-4":t.shouldUseCompactLayout}])},[g("div",{class:f(["group-hover:tw-text-info-500 tw-flex tw-items-center tw-justify-center tw-mx-auto",{"tw-w-full tw-mb-2":!t.shouldUseCompactLayout,"tw-text-secondary-500":!t.isDesignCom,"tw-text-secondary-400":t.isDesignCom,"md:tw-mb-0":t.useLandscapeTile,"md:tw-w-10 md:tw-h-10":t.smallLayout,"tw-w-8 tw-h-8":t.shouldUseCompactLayout}])},[...e[0]||(e[0]=[g("svg",{class:"tw-fill-current tw-w-24 tw-h-24 tw-transition-colors tw-duration-200",viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},[g("path",{d:"M61.393 5c.5922 0 1.1635.261 1.5802.6956l22.3903 23.2608c.373.4133.6365.9565.6365 1.5216v52.7172C86 89.6737 80.6002 95 74.0585 95h-48.117C19.3998 95 14 89.6737 14 83.1952v-66.391C14 10.3262 19.3998 5 25.9415 5zm-2.1736 4.3478H25.9415c-4.1268 0-7.5512 3.3914-7.5512 7.4563v66.391c0 4.0877 3.4466 7.457 7.5512 7.457h48.117c4.1268 0 7.5512-3.3693 7.5512-7.457V32.6087H68.8563c-5.334 0-9.6369-4.2393-9.6369-9.5217V9.348zM67.8124 76C69.0252 76 70 76.8996 70 78c0 1.0998-.9748 2-2.1657 2H32.1657C30.9747 80 30 79.0998 30 78c0-1.1004.9748-2 2.1657-2zM50 35c.6121 0 1.1807.264 1.5965.7037l12.8169 13.8331c.831.8794.7654 2.2652-.1099 3.1009-.4152.396-.9623.5939-1.4873.5939-.59 0-1.1592-.2424-1.5965-.7037l-9.0111-9.743v24.0159c0 1.2093-.9837 2.1992-2.1871 2.1992-1.2028 0-2.1872-.9899-2.1872-2.1992v-24.016l-9.011 9.7431c-.8311.8794-2.2086.9454-3.1274.1098-.8746-.8141-.9402-2.2215-.1092-3.1009l12.8168-13.8331C48.8187 35.264 49.3873 35 50 35zm13.6097-22.326v10.413c0 2.8694 2.349 5.1738 5.2466 5.1738h9.7464L63.6097 12.674z","fill-rule":"nonzero"})],-1)])],2),g("div",{class:f({"md:tw-flex md:tw-flex-col md:tw-ml-2":t.useLandscapeTile,"tw-flex tw-flex-col tw-ml-4 md:tw-ml-2":t.shouldUseCompactLayout})},[t.isModal?w("",!0):(v(),y("p",{key:0,class:f(["tw-font-bold tw-text-black tw-text-lg",{"tw-mb-2":!t.shouldUseCompactLayout,"md:tw-text-sm md:tw-mb-0":t.smallLayout,"tw-text-sm tw-mb-0":t.shouldUseCompactLayout}])},z(i.uploadYourLogoTr("uploadYourLogoText")),3)),g("p",{class:f(["tw-text-secondary-600 tw-text-sm",{"tw-mb-0":!t.isDesignCom,"tw-mb-3":t.isDesignCom,"md:tw-hidden":t.shouldUseCompactLayout}])},[x(z(i.uploadYourLogoTr("dropYourFileHere"))+" ",1),g("span",ie,z(i.uploadYourLogoTr("clickToUpload")),1)],2),!t.smallLayout&&!t.shouldUseCompactLayout?(v(),y("p",{key:1,class:f(["tw-text-sm",{"tw-text-secondary-600":!t.isDesignCom,"tw-text-secondary-400":t.isDesignCom}])},z(i.uploadYourLogoTr("acceptedFiles")),3)):w("",!0)],2)],2)]),_:1},8,["id","class","options","onVdropzoneSuccess"])}const ae=k(M,[["render",se]]);M.__docgenInfo={exportName:"default",displayName:"UploadYourLogoDropzone",description:"",tags:{},props:[{name:"isUserAuthenticated",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"true"}},{name:"trackingData",type:{name:"object"},required:!1,defaultValue:{func:!1,value:"undefined"}},{name:"shouldOpenUploadWhenMounted",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"isModal",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"useLandscapeTile",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"smallLayout",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"shouldUseCompactLayout",type:{name:"boolean"},defaultValue:{func:!1,value:"false"}},{name:"isDesignCom",type:{name:"boolean"},required:!1,defaultValue:{func:!1,value:"false"}},{name:"assetType",type:{name:"number"},defaultValue:{func:!1,value:"null"}},{name:"templateTypeFriendlyName",type:{name:"string"},defaultValue:{func:!1,value:"null"}}],events:[{name:"on-upload-success",type:{names:["undefined"]}},{name:"on-login-modal-open",type:{names:["undefined"]}},{name:"logo-dropzone-login-callback"}],sourceFiles:["/home/zknowles/repos/fe-shared-lib/src/experiences/components/UploadYourLogoDropzone/UploadYourLogoDropzone.vue"]};export{ae as U};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes passing-through{0%{opacity:0;transform:translateY(40px)}30%,70%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-40px)}}@keyframes slide-in{0%{opacity:0;transform:translateY(40px)}30%{opacity:1;transform:translateY(0)}}@keyframes pulse{0%{transform:scale(1)}10%{transform:scale(1.1)}20%{transform:scale(1)}}.dropzone,.dropzone *{box-sizing:border-box}.dropzone{min-height:150px;border:1px solid rgba(0,0,0,.8);border-radius:5px;padding:20px}.dropzone.dz-clickable{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message *{cursor:pointer}.dropzone.dz-started .dz-message{display:none}.dropzone.dz-drag-hover{border-style:solid}.dropzone.dz-drag-hover .dz-message{opacity:.5}.dropzone .dz-message{text-align:center;margin:3em 0}.dropzone .dz-message .dz-button{background:none;color:inherit;border:none;padding:0;font:inherit;cursor:pointer;outline:inherit}.dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:16px;min-height:100px}.dropzone .dz-preview:hover{z-index:1000}.dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:linear-gradient(to bottom,#eee,#ddd)}.dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.dropzone .dz-preview.dz-image-preview{background:#fff}.dropzone .dz-preview.dz-image-preview .dz-details{transition:opacity .2s linear}.dropzone .dz-preview .dz-remove{font-size:14px;text-align:center;display:block;cursor:pointer;border:none}.dropzone .dz-preview .dz-remove:hover{text-decoration:underline}.dropzone .dz-preview:hover .dz-details{opacity:1}.dropzone .dz-preview .dz-details{z-index:20;position:absolute;top:0;left:0;opacity:0;font-size:13px;min-width:100%;max-width:100%;padding:2em 1em;text-align:center;color:#000000e6;line-height:150%}.dropzone .dz-preview .dz-details .dz-size{margin-bottom:1em;font-size:16px}.dropzone .dz-preview .dz-details .dz-filename{white-space:nowrap}.dropzone .dz-preview .dz-details .dz-filename:hover span{border:1px solid rgba(200,200,200,.8);background-color:#fffc}.dropzone .dz-preview .dz-details .dz-filename:not(:hover){overflow:hidden;text-overflow:ellipsis}.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span{border:1px solid transparent}.dropzone .dz-preview .dz-details .dz-filename span,.dropzone .dz-preview .dz-details .dz-size span{background-color:#fff6;padding:0 .4em;border-radius:3px}.dropzone .dz-preview:hover .dz-image img{transform:scale(1.05);filter:blur(8px)}.dropzone .dz-preview .dz-image{border-radius:20px;overflow:hidden;width:120px;height:120px;position:relative;display:block;z-index:10}.dropzone .dz-preview .dz-image img{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{animation:passing-through 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;animation:slide-in 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview .dz-success-mark,.dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;top:50%;left:50%;margin-left:-27px;margin-top:-27px;background:#000c;border-radius:50%}.dropzone .dz-preview .dz-success-mark svg,.dropzone .dz-preview .dz-error-mark svg{display:block;width:54px;height:54px;fill:#fff}.dropzone .dz-preview.dz-processing .dz-progress{opacity:1;transition:all .2s linear}.dropzone .dz-preview.dz-complete .dz-progress{opacity:0;transition:opacity .4s ease-in}.dropzone .dz-preview:not(.dz-processing) .dz-progress{animation:pulse 6s ease infinite}.dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:20px;top:50%;margin-top:-10px;left:15%;right:15%;border:3px solid rgba(0,0,0,.8);background:#000c;border-radius:10px;overflow:hidden}.dropzone .dz-preview .dz-progress .dz-upload{background:#fff;display:block;position:relative;height:100%;width:0;transition:width .3s ease-in-out;border-radius:17px}.dropzone .dz-preview.dz-error .dz-error-message{display:block}.dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;transition:opacity .3s ease;border-radius:8px;font-size:13px;top:130px;left:-10px;width:140px;background:#b10606;padding:.5em 1em;color:#fff}.dropzone .dz-preview .dz-error-message:after{content:"";position:absolute;top:-6px;left:64px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #b10606}.vue-dropzone{border:2px solid #e5e5e5;font-family:Arial,sans-serif;letter-spacing:.2px;color:#777;transition:.2s linear}.vue-dropzone:hover{background-color:#f6f6f6}.vue-dropzone>i{color:#ccc}.vue-dropzone>.dz-preview .dz-image{border-radius:0;width:100%;height:100%}.vue-dropzone>.dz-preview .dz-image img:not([src]){width:200px;height:200px}.vue-dropzone>.dz-preview .dz-image:hover img{transform:none;-webkit-filter:none}.vue-dropzone>.dz-preview .dz-details{bottom:0;top:0;color:#fff;background-color:#2196f3cc;transition:opacity .2s linear;text-align:left}.vue-dropzone>.dz-preview .dz-details .dz-filename{overflow:hidden}.vue-dropzone>.dz-preview .dz-details .dz-filename span,.vue-dropzone>.dz-preview .dz-details .dz-size span{background-color:transparent}.vue-dropzone>.dz-preview .dz-details .dz-filename:not(:hover) span{border:none}.vue-dropzone>.dz-preview .dz-details .dz-filename:hover span{background-color:transparent;border:none}.vue-dropzone>.dz-preview .dz-progress .dz-upload{background:#ccc}.vue-dropzone>.dz-preview .dz-remove{position:absolute;z-index:30;color:#fff;margin-left:15px;padding:10px;top:inherit;bottom:15px;border:2px white solid;text-decoration:none;text-transform:uppercase;font-size:.8rem;font-weight:800;letter-spacing:1.1px;opacity:0}.vue-dropzone>.dz-preview:hover .dz-remove{opacity:1}.vue-dropzone>.dz-preview .dz-success-mark svg,.vue-dropzone>.dz-preview .dz-error-mark svg{margin-left:auto;margin-right:auto}.vue-dropzone>.dz-preview .dz-error-message{margin-left:auto;margin-right:auto;left:0;width:100%;text-align:center}.vue-dropzone>.dz-preview .dz-error-message:after{display:none}.c-upload-your-logo .dz-success-mark,.c-upload-your-logo .dz-error-mark,.c-upload-your-logo .dz-details{display:none}.c-upload-your-logo .dz-error-message{color:#f21b3f;font-size:.875rem;line-height:1.25rem}
|