diff --git a/assets/AdminHome-KZuu6OHd.js b/assets/AdminHome-KZuu6OHd.js deleted file mode 100644 index 58f3b0c..0000000 --- a/assets/AdminHome-KZuu6OHd.js +++ /dev/null @@ -1 +0,0 @@ -import{L as b,D as k}from"./DashboardFooter--gNTGxaO.js";import{L as f}from"./AdministratorIcon-_MZnotyN.js";import{m as x}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as v}from"./mixinSwalToast-NfEYWmdB.js";import{_ as y,S as l,c as L,a as t,b as e,w as n,F as I,z as T,d as i,o as C,e as c,p as w,k as S}from"./index-ZKny8dII.js";var B={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:D}=B,V={data(){return{tokenChecked:!1}},methods:{checkToken(){this.showFullScreenLoading({canCancel:!1,opacity:.8});const o=document.cookie.replace(/(?:(?:^|.*;\s*)dreamboostAdminToken\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.post(`${D}/dreamboost/administrator/checktoken`,null,{headers:{Authorization:o}}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"登入驗證:成功"}),this.tokenChecked=!0,this.$http.defaults.headers.common.Authorization=o}).catch(()=>{this.hideFullScreenLoading(),l.fire({title:"請正確登入再訪問後台頁面",text:"回到登入頁面",icon:"error",allowOutsideClick:!1,timer:3e3,timerProgressBar:!0,confirmButtonText:"OK"}).then(s=>{s.dismiss===l.DismissReason.timer&&this.$router.push("/admin/login"),s.isConfirmed&&this.$router.push("/admin/login")})})},logout(){l.fire({title:"確定要登出嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(o=>{o.isConfirmed&&(document.cookie="dreamboostAdminToken=;expires=;",this.addToast({content:"登出成功"}),this.$router.push("/admin/login")),o.isDismissed}).catch(()=>{this.addToast({content:"登出過程出現錯誤",style:"error"})})}},components:{LogoIcon:b,LogoAvatar:f,DashboardFooter:k},mixins:[x,v],mounted(){this.checkToken()}},d=o=>(w("data-v-499fecca"),o=o(),S(),o),M={class:"sticky-top"},R={class:"navbar navbar-expand-sm border-bottom border-5 border-dark-pr bg-gray-800"},E={class:"container-fluid"},F=d(()=>t("button",{class:"navbar-toggler",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbar-toggle","aria-controls":"navbar-toggle","aria-expanded":"false","aria-label":"Toggle navigation"},[t("span",{class:"navbar-toggler-icon"})],-1)),N={class:"collapse navbar-collapse",id:"navbar-toggle"},O={class:"navbar-nav ms-auto mb-0 align-items-sm-center"},U={class:"nav-item flex-shrink-0 d-none d-sm-flex align-items-center"},$=d(()=>t("span",{class:"ms-4 me-2 mb-0 text-white fs-5"},"管理員,您好",-1)),A={class:"nav-item"},z={class:"bg-gray-800"},J={class:"bg-white bg-opacity-25",style:{"--bs-bg-opacity":".2"}},j={class:"mb-0 list-unstyled d-flex px-2 justify-content-around justify-content-lg-center py-4 l-ListGap"},W={class:"flex-grow-1"};function Y(o,s,G,P,m,r){const p=i("LogoIcon"),a=i("RouterLink"),h=i("LogoAvatar"),u=i("RouterView"),_=i("DashboardFooter");return m.tokenChecked?(C(),L(I,{key:0},[t("div",M,[t("nav",R,[t("div",E,[e(a,{to:"/admin/home/manageaccount",class:"p-0 d-block"},{default:n(()=>[e(p,{style:{height:"72px"}})]),_:1}),F,t("div",N,[t("ul",O,[t("li",U,[e(h,{style:{height:"45px"}}),$]),t("li",A,[t("button",{class:"l-logout btn px-4 py-2 text-white",onClick:s[0]||(s[0]=(...g)=>r.logout&&r.logout(...g))},"登出")])])])])]),t("div",z,[t("div",J,[t("ul",j,[t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/manageaccount"},{default:n(()=>[c("管理帳號 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/reviewproposals"},{default:n(()=>[c("方案審核 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/salesdata"},{default:n(()=>[c("銷售數據 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/updatebanner"},{default:n(()=>[c("更換BN ")]),_:1})])])])])]),t("div",W,[e(u)]),e(_)],64)):T("",!0)}const K=y(V,[["render",Y],["__scopeId","data-v-499fecca"]]);export{K as default}; diff --git a/assets/AdminHome-Vx_QgT6D.js b/assets/AdminHome-Vx_QgT6D.js new file mode 100644 index 0000000..2123b4e --- /dev/null +++ b/assets/AdminHome-Vx_QgT6D.js @@ -0,0 +1 @@ +import{L as f,D as b}from"./DashboardFooter-jm-kNJ3_.js";import{L as k}from"./AdministratorIcon-Ukv12rhY.js";import{m as x}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as v}from"./mixinSwalToast--n5GZdOL.js";import{_ as y,S as l,c as L,a as t,b as e,w as n,F as w,z as T,d as i,o as S,e as c,p as C,k as B}from"./index-sWoFWHUv.js";var D={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:R}=D,$={data(){return{tokenChecked:!1}},methods:{checkToken(){this.showFullScreenLoading({canCancel:!1,opacity:.8});const o=document.cookie.replace(/(?:(?:^|.*;\s*)dreamboostAdminToken\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.post(`${R}/dreamboost/administrator/checktoken`,null,{headers:{Authorization:o}}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"登入驗證:成功"}),this.tokenChecked=!0,this.$http.defaults.headers.common.Authorization=o}).catch(()=>{this.hideFullScreenLoading(),l.fire({title:"請正確登入再訪問後台頁面",text:"回到登入頁面",icon:"error",allowOutsideClick:!1,timer:3e3,timerProgressBar:!0,confirmButtonText:"OK"}).then(s=>{s.dismiss===l.DismissReason.timer&&this.$router.push("/admin/login"),s.isConfirmed&&this.$router.push("/admin/login")})})},logout(){l.fire({title:"確定要登出嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(o=>{o.isConfirmed&&(document.cookie="dreamboostAdminToken=;expires=;",this.addToast({content:"登出成功"}),this.$router.push("/admin/login")),o.isDismissed}).catch(()=>{this.addToast({content:"登出過程出現錯誤",style:"error"})})}},components:{LogoIcon:f,LogoAvatar:k,DashboardFooter:b},mixins:[x,v],mounted(){this.checkToken()}},d=o=>(C("data-v-499fecca"),o=o(),B(),o),A={class:"sticky-top"},F={class:"navbar navbar-expand-sm border-bottom border-5 border-dark-pr bg-gray-800"},I={class:"container-fluid"},N=d(()=>t("button",{class:"navbar-toggler",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbar-toggle","aria-controls":"navbar-toggle","aria-expanded":"false","aria-label":"Toggle navigation"},[t("span",{class:"navbar-toggler-icon"})],-1)),V={class:"collapse navbar-collapse",id:"navbar-toggle"},E={class:"navbar-nav ms-auto mb-0 align-items-sm-center"},O={class:"nav-item flex-shrink-0 d-none d-sm-flex align-items-center"},z=d(()=>t("span",{class:"ms-4 me-2 mb-0 text-white fs-5"},"管理員,您好",-1)),U={class:"nav-item"},j={class:"bg-gray-800"},P={class:"bg-white bg-opacity-25",style:{"--bs-bg-opacity":".2"}},q={class:"mb-0 list-unstyled d-flex px-2 justify-content-around justify-content-lg-center py-4 l-ListGap"},G={class:"flex-grow-1"};function H(o,s,K,M,m,r){const p=i("LogoIcon"),a=i("RouterLink"),h=i("LogoAvatar"),u=i("RouterView"),_=i("DashboardFooter");return m.tokenChecked?(S(),L(w,{key:0},[t("div",A,[t("nav",F,[t("div",I,[e(a,{to:"/admin/home/manageaccount",class:"p-0 d-block"},{default:n(()=>[e(p,{style:{height:"72px"}})]),_:1}),N,t("div",V,[t("ul",E,[t("li",O,[e(h,{style:{height:"45px"}}),z]),t("li",U,[t("button",{class:"l-logout btn px-4 py-2 text-white",onClick:s[0]||(s[0]=(...g)=>r.logout&&r.logout(...g))},"登出")])])])])]),t("div",j,[t("div",P,[t("ul",q,[t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/manageaccount"},{default:n(()=>[c("管理帳號 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/reviewproposals"},{default:n(()=>[c("方案審核 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/salesdata"},{default:n(()=>[c("銷售數據 ")]),_:1})]),t("li",null,[e(a,{class:"py-2 d-block px-1 px-sm-4 px-lg-8 l-NavLink",to:"/admin/home/updatebanner"},{default:n(()=>[c("更換BN ")]),_:1})])])])])]),t("div",G,[e(u)]),e(_)],64)):T("",!0)}const Z=y($,[["render",H],["__scopeId","data-v-499fecca"]]);export{Z as default}; diff --git a/assets/AdminLogin-HbwhdOUi.js b/assets/AdminLogin-HbwhdOUi.js new file mode 100644 index 0000000..1a41640 --- /dev/null +++ b/assets/AdminLogin-HbwhdOUi.js @@ -0,0 +1 @@ +import{L as u,D as _}from"./DashboardFooter-jm-kNJ3_.js";import{m as h}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as x}from"./mixinSwalToast--n5GZdOL.js";import{_ as g,c as f,a as e,b as n,w as y,u as l,B as c,F as w,e as v,d as r,o as L}from"./index-sWoFWHUv.js";var k={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:D}=k,S={data(){return{userdata:{username:"",password:""}}},components:{LogoIcon:u,DashboardFooter:_},methods:{login(){this.showFullScreenLoading({canCancel:!1,opacity:.2}),this.$http.post(`${D}/dreamboost/administrator/login`,this.userdata).then(s=>{this.hideFullScreenLoading();const{token:o,expired:d}=s.data.data;document.cookie=`dreamboostAdminToken=${o};expires=${new Date(d*1e3)};`,this.$router.push("/admin/home/manageaccount")}).catch(s=>{this.hideFullScreenLoading(),this.addToast({content:s.response.data.message,style:"error"})})}},mounted(){},mixins:[h,x]},F={class:"navbar navbar-expand-md container-fluid border-bottom border-5 border-dark-pr bg-gray-800 p-0"},E={class:"container"},V={class:"container flex-grow-1 d-flex flex-column"},R={class:"flex-grow-1 row justify-content-center align-items-center"},T={class:"col-12 col-sm-10 col-md-8 col-lg-6 col-xl-5 pt-8"},B={class:"px-4 px-md-10 py-5 py-md-10 py-xxl-16 border border-white bg-gray-700 rounded rounded-3"},I=e("p",{class:"mb-5 fs-3 text-white text-center text-md-start"},[v("管理員登入"),e("span",{class:"lh-1 fs-6 ms-2 text-dark-pr d-none d-md-inline-block"},"Sign In")],-1),U={class:"mb-6"},A=e("label",{for:"adminEmail",class:"form-label text-gray-300"},"帳號",-1),C={class:"mb-8 mb-md-16 mb-xxl-24"},N=e("label",{for:"adminPwd",class:"form-label text-gray-300"},"密碼",-1),P=e("button",{type:"submit",class:"btn btn-dark-pr d-block mx-auto px-21 mb-6"},"登入 ",-1),$=e("p",{class:"fs-6 text-primary text-center user-select-none"},[e("span",{class:"border-bottom border-primary"},"不可能忘記密碼吧!")],-1);function H(s,o,d,M,a,i){const m=r("LogoIcon"),p=r("RouterLink"),b=r("DashboardFooter");return L(),f(w,null,[e("nav",F,[e("div",E,[n(p,{to:"/admin/login",class:"p-0"},{default:y(()=>[n(m,{style:{height:"72px"}})]),_:1})])]),e("div",V,[e("div",R,[e("div",T,[e("div",B,[I,e("form",{onSubmit:o[2]||(o[2]=(...t)=>i.login&&i.login(...t))},[e("div",U,[A,l(e("input",{type:"email",class:"form-control borderl bg-white text-white",style:{"--bs-bg-opacity":".15"},placeholder:"電子郵件",id:"adminEmail","aria-describedby":"emailHelp","onUpdate:modelValue":o[0]||(o[0]=t=>a.userdata.username=t)},null,512),[[c,a.userdata.username]])]),e("div",C,[N,l(e("input",{type:"password",class:"form-control borderl bg-white text-white",style:{"--bs-bg-opacity":".15"},placeholder:"密碼",id:"adminPwd","aria-describedby":"emailHelp","onUpdate:modelValue":o[1]||(o[1]=t=>a.userdata.password=t)},null,512),[[c,a.userdata.password]])]),P,$],32)])])])]),n(b)],64)}const G=g(S,[["render",H]]);export{G as default}; diff --git a/assets/AdminLogin-tkNGmyTZ.js b/assets/AdminLogin-tkNGmyTZ.js deleted file mode 100644 index 470e789..0000000 --- a/assets/AdminLogin-tkNGmyTZ.js +++ /dev/null @@ -1 +0,0 @@ -import{L as u,D as h}from"./DashboardFooter--gNTGxaO.js";import{m as _}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as x}from"./mixinSwalToast-NfEYWmdB.js";import{_ as g,c as f,a as e,b as n,w as y,u as l,B as c,F as w,e as k,d as r,o as I}from"./index-ZKny8dII.js";var L={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:v}=L,D={data(){return{userdata:{username:"",password:""}}},components:{LogoIcon:u,DashboardFooter:h},methods:{login(){this.showFullScreenLoading({canCancel:!1,opacity:.2}),this.$http.post(`${v}/dreamboost/administrator/login`,this.userdata).then(s=>{this.hideFullScreenLoading();const{token:o,expired:i}=s.data.data;document.cookie=`dreamboostAdminToken=${o};expires=${new Date(i*1e3)};`,this.$router.push("/admin/home/manageaccount")}).catch(s=>{this.hideFullScreenLoading(),this.addToast({content:s.response.data.message,style:"error"})})}},mounted(){},mixins:[_,x]},E={class:"navbar navbar-expand-md container-fluid border-bottom border-5 border-dark-pr bg-gray-800 p-0"},M={class:"container"},V={class:"container flex-grow-1 d-flex flex-column"},F={class:"flex-grow-1 row justify-content-center align-items-center"},T={class:"col-12 col-sm-10 col-md-8 col-lg-6 col-xl-5 pt-8"},S={class:"px-4 px-md-10 py-5 py-md-10 py-xxl-16 border border-white bg-gray-700 rounded rounded-3"},U=e("p",{class:"mb-5 fs-3 text-white text-center text-md-start"},[k("管理員登入"),e("span",{class:"lh-1 fs-6 ms-2 text-dark-pr d-none d-md-inline-block"},"Sign In")],-1),R={class:"mb-6"},B=e("label",{for:"adminEmail",class:"form-label text-gray-300"},"帳號",-1),C={class:"mb-8 mb-md-16 mb-xxl-24"},O=e("label",{for:"adminPwd",class:"form-label text-gray-300"},"密碼",-1),J=e("button",{type:"submit",class:"btn btn-dark-pr d-block mx-auto px-21 mb-6"},"登入 ",-1),N=e("p",{class:"fs-6 text-primary text-center user-select-none"},[e("span",{class:"border-bottom border-primary"},"不可能忘記密碼吧!")],-1);function W(s,o,i,Y,a,d){const m=r("LogoIcon"),p=r("RouterLink"),b=r("DashboardFooter");return I(),f(w,null,[e("nav",E,[e("div",M,[n(p,{to:"/admin/login",class:"p-0"},{default:y(()=>[n(m,{style:{height:"72px"}})]),_:1})])]),e("div",V,[e("div",F,[e("div",T,[e("div",S,[U,e("form",{onSubmit:o[2]||(o[2]=(...t)=>d.login&&d.login(...t))},[e("div",R,[B,l(e("input",{type:"email",class:"form-control borderl bg-white text-white",style:{"--bs-bg-opacity":".15"},placeholder:"電子郵件",id:"adminEmail","aria-describedby":"emailHelp","onUpdate:modelValue":o[0]||(o[0]=t=>a.userdata.username=t)},null,512),[[c,a.userdata.username]])]),e("div",C,[O,l(e("input",{type:"password",class:"form-control borderl bg-white text-white",style:{"--bs-bg-opacity":".15"},placeholder:"密碼",id:"adminPwd","aria-describedby":"emailHelp","onUpdate:modelValue":o[1]||(o[1]=t=>a.userdata.password=t)},null,512),[[c,a.userdata.password]])]),J,N],32)])])])]),n(b)],64)}const H=g(D,[["render",W]]);export{H as default}; diff --git a/assets/AdminManageAccount-NAI7DB42.js b/assets/AdminManageAccount-EGVpfUk7.js similarity index 96% rename from assets/AdminManageAccount-NAI7DB42.js rename to assets/AdminManageAccount-EGVpfUk7.js index 33054c3..fd2469e 100644 --- a/assets/AdminManageAccount-NAI7DB42.js +++ b/assets/AdminManageAccount-EGVpfUk7.js @@ -1 +1 @@ -import{L as o}from"./AdministratorIcon-_MZnotyN.js";import{_ as l,c as i,a as e,b as d,l as c,o as n,p as r,k as p,d as v}from"./index-ZKny8dII.js";const h={data(){return{}},methods:{},components:{LogoAvatar:o}},a=t=>(r("data-v-64d92690"),t=t(),p(),t),b={class:"container"},m={class:"row justify-content-center"},f={class:"col-12 col-lg-10"},_=a(()=>e("button",{class:"btn btn-outline-dark-pr px-9 d-block ms-auto mt-19 me-3 mb-4",type:"button"},"新增",-1)),u={class:"l-CardGapY"},x={class:"card bg-transparent"},k={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},g={class:"d-flex align-items-center h-100"},y=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"主要管理員"),e("p",{class:"mb-0 fs-5"},"樂樂")],-1)),w={class:"card bg-transparent"},A={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},B={class:"d-flex align-items-center h-100"},N=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"一般管理員"),e("p",{class:"mb-0 fs-5"},"Eero")],-1)),j=c('

權限設定

',1),I={class:"card bg-transparent"},L={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},S={class:"d-flex align-items-center h-100"},$=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"一般管理員"),e("p",{class:"mb-0 fs-5"},"Eero")],-1)),E=c('

權限設定

',1);function V(t,C,G,M,Y,q){const s=v("LogoAvatar");return n(),i("div",b,[e("div",m,[e("div",f,[_,e("div",u,[e("div",x,[e("div",k,[e("div",g,[d(s,{width:"48",height:"48",class:"me-10"}),y])])]),e("div",w,[e("div",A,[e("div",B,[d(s,{width:"48",height:"48",class:"me-10"}),N]),j])]),e("div",I,[e("div",L,[e("div",S,[d(s,{width:"48",height:"48",class:"me-10"}),$]),E])])])])])])}const F=l(h,[["render",V],["__scopeId","data-v-64d92690"]]);export{F as default}; +import{L as o}from"./AdministratorIcon-Ukv12rhY.js";import{_ as l,c as i,a as e,b as d,l as c,o as n,p as r,k as p,d as v}from"./index-sWoFWHUv.js";const h={data(){return{}},methods:{},components:{LogoAvatar:o}},a=t=>(r("data-v-64d92690"),t=t(),p(),t),b={class:"container"},m={class:"row justify-content-center"},f={class:"col-12 col-lg-10"},_=a(()=>e("button",{class:"btn btn-outline-dark-pr px-9 d-block ms-auto mt-19 me-3 mb-4",type:"button"},"新增",-1)),u={class:"l-CardGapY"},x={class:"card bg-transparent"},k={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},g={class:"d-flex align-items-center h-100"},y=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"主要管理員"),e("p",{class:"mb-0 fs-5"},"樂樂")],-1)),w={class:"card bg-transparent"},A={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},B={class:"d-flex align-items-center h-100"},N=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"一般管理員"),e("p",{class:"mb-0 fs-5"},"Eero")],-1)),j=c('

權限設定

',1),I={class:"card bg-transparent"},L={class:"card-body bg-transparent py-3 ps-8 pe-3 border rounded d-flex justify-content-between align-items-center"},S={class:"d-flex align-items-center h-100"},$=a(()=>e("div",{class:"d-flex flex-column h-100 text-white"},[e("p",{class:"mb-0 fs-12 lh-sm mb-1"},"一般管理員"),e("p",{class:"mb-0 fs-5"},"Eero")],-1)),E=c('

權限設定

',1);function V(t,C,G,M,Y,q){const s=v("LogoAvatar");return n(),i("div",b,[e("div",m,[e("div",f,[_,e("div",u,[e("div",x,[e("div",k,[e("div",g,[d(s,{width:"48",height:"48",class:"me-10"}),y])])]),e("div",w,[e("div",A,[e("div",B,[d(s,{width:"48",height:"48",class:"me-10"}),N]),j])]),e("div",I,[e("div",L,[e("div",S,[d(s,{width:"48",height:"48",class:"me-10"}),$]),E])])])])])])}const F=l(h,[["render",V],["__scopeId","data-v-64d92690"]]);export{F as default}; diff --git a/assets/AdminReviewProposals-7CF5-sIu.js b/assets/AdminReviewProposals-7CF5-sIu.js new file mode 100644 index 0000000..8fcfdd7 --- /dev/null +++ b/assets/AdminReviewProposals-7CF5-sIu.js @@ -0,0 +1 @@ +import{A as I,m as T,_ as m,o as i,c as d,a as t,t as C,z as M,S as v,g as L,u as E,B,p as y,k as x,b as U,F as c,r as u,d as b,j as f}from"./index-sWoFWHUv.js";import{m as D}from"./mixinSwalToast--n5GZdOL.js";import{m as w}from"./mixinFullScreenLoading-9dNja2ki.js";const $=I("adminStore",{state:()=>({denyProposalData:"",name:"adminStore"}),getters:{getUserName:e=>`傳出的內容為${e.name}`},actions:{updateDenyModalData(e){this.denyProposalData=e}}}),A={props:["proposalData"],data(){return{}},methods:{...T($,["updateDenyModalData"]),emitActive(){this.$emit("emitActive",this.proposalData.proposalID,this.proposalData.proposalTitle)},emitDeny(){this.updateDenyModalData(this.proposalData),this.$emit("emitDeny")}}},R={class:"card bg-transparent border-0"},F={class:"card-body bg-transparent py-2 px-3 py-md-3 px-md-6 px-lg-8 border rounded d-flex justify-content-between align-items-center"},j={class:"w-100 row align-items-center g-0"},V={class:"col-12 col-sm-7"},O={class:"d-flex align-items-center"},N=["src"],q={class:"flex-grow-1 text-white text-truncate"},G={class:"mb-0 fs-14 fs-md-5 text-truncate"},Y={class:"col-12 col-sm-5"},z={key:0,class:"d-flex justify-content-sm-end align-items-center"},H=t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6"},"查看",-1),J={key:1,class:"d-flex justify-content-end align-items-center"},K=t("p",{class:"mb-0 text-secondary-light"},"審查通過",-1),Q=["href"];function W(e,s,a,h,l,o){return i(),d("div",R,[t("div",F,[t("div",j,[t("div",V,[t("div",O,[t("img",{src:a.proposalData.proposalMainImage,alt:"",class:"object-fit-cover rounded-pill me-2 me-md-4 me-lg-8",width:"48",height:"48"},null,8,N),t("div",q,[t("p",G,C(a.proposalData.proposalTitle),1)])])]),t("div",Y,[a.proposalData.proposalStatus==="review"?(i(),d("div",z,[H,t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",onClick:s[0]||(s[0]=(...n)=>o.emitActive&&o.emitActive(...n))},"通過"),t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",onClick:s[1]||(s[1]=(...n)=>o.emitDeny&&o.emitDeny(...n))},"退回")])):a.proposalData.proposalStatus==="active"?(i(),d("div",J,[K,t("a",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",href:`/#/product/${a.proposalData.proposalID}/info`,target:"_blank"},"查看",8,Q)])):M("",!0)])])])])}const X=m(A,[["render",W]]);var Z={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:g}=Z,tt={data(){return{modalInstance:"",denyMessages:""}},methods:{show(){this.denyMessages="",this.modalInstance.show()},hide(){this.modalInstance.hide()},doubleCheck(){v.fire({title:"確定要退回提案嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(e=>{e.isConfirmed&&this.denyProposal(),e.isDismissed}).catch(()=>{this.addToast({content:"退回提案過程出現錯誤",style:"error"})})},denyProposal(){this.showFullScreenLoading(),Promise.all([this.$http.post(`${g}/dreamboost/proposal/admin/changeToDraft`,{proposalID:this.denyProposalData.proposalID}),this.$http.post(`${g}/dreamboost/message/admin/message`,{messageToUserID:`${this.denyProposalData.proposalByUserID}`,messageTitle:"提案審核失敗",messageContent:`退回原因:${this.denyMessages}`,messageTime:new Date().getTime()})]).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"已經提案退回",style:"info"}),this.hide(),this.$emit("updateProposalDatas")}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"退回提案過程出現錯誤,請聯繫工程師",style:"error"})})}},mounted(){this.modalInstance=new this.$bs.Modal(this.$refs.modalInstance,{focus:!1})},computed:{...L($,["denyProposalData"])},components:{},watch:{},mixins:[D,w]},P=e=>(y("data-v-8a99af03"),e=e(),x(),e),et={class:"modal fade",ref:"modalInstance","data-bs-backdrop":"static","data-bs-keyboard":"false",tabindex:"-1","aria-labelledby":"staticBackdropLabel","aria-hidden":"true",style:{"background-color":"rgba(11, 17, 28, 0.6)"}},st={class:"modal-dialog modal-lg modal-dialog-centered"},ot={class:"modal-content bg-gray-700 border border-light"},at={class:"modal-header border-bottom-0"},nt={class:"modal-body"},it=P(()=>t("div",{class:"border-bottom"},[t("h2",{class:"mb-4 text-white fw-nromal text-center"},"退回專案"),t("p",{class:"mb-8 text-dark-pr text-center fs-18"},"請輸入退回原因")],-1)),dt={class:"mt-12 px-10"},lt={class:"card bg-transparent border-0"},rt={class:"card-body bg-transparent pt-3 pb-6 ps-8 pe-3 border-gray-500 border-bottom d-flex justify-content-between"},ct={class:"d-flex align-items-stretch"},pt=["src"],mt=P(()=>t("div",{class:"d-flex flex-column justify-content-center text-white"},[t("p",{class:"mb-0 fs-12 lh-sm mb-1"},"2024.02.13"),t("p",{class:"mb-0"},"小智的 MIT 夢 - 台灣學生的教育之旅")],-1)),ht={class:"modal-footer border-top-0"};function _t(e,s,a,h,l,o){return i(),d("div",et,[t("div",st,[t("div",ot,[t("div",at,[t("button",{type:"button",class:"btn-close","aria-label":"Close",onClick:s[0]||(s[0]=(...n)=>o.hide&&o.hide(...n))})]),t("div",nt,[it,t("div",dt,[t("div",lt,[t("div",rt,[t("div",ct,[t("img",{src:e.denyProposalData.proposalMainImage,alt:"主要圖片",class:"rounded-pill me-10",width:"48",height:"48"},null,8,pt),mt])])]),E(t("textarea",{class:"form-control bg-transparent text-white mt-16",placeholder:"輸入退回原因",id:"",style:{height:"150px"},"onUpdate:modelValue":s[1]||(s[1]=n=>l.denyMessages=n)},null,512),[[B,l.denyMessages]])])]),t("div",ht,[t("button",{type:"button",class:"btn btn-dark-pr py-3 px-16",onClick:s[2]||(s[2]=(...n)=>o.doubleCheck&&o.doubleCheck(...n))},"儲存並關閉")])])])],512)}const ut=m(tt,[["render",_t],["__scopeId","data-v-8a99af03"]]);var bt={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:p}=bt,ft={data(){return{reviewProposals:[],activeProposals:[]}},methods:{showDenyProposalModal(){this.$refs.proposalModal.show()},getDatas(){this.showFullScreenLoading({canCancel:!1,loader:"dots"}),Promise.all([this.$http.get(`${p}/dreamboost/proposal/admin/inReviewProposals`),this.$http.get(`${p}/dreamboost/proposal/guest/inActiveProposals`)]).then(e=>{this.reviewProposals=e[0].data.data.result,this.activeProposals=e[1].data.data.result,this.addToast({content:"提案資料取得完畢"}),this.hideFullScreenLoading()}).catch(()=>{this.addToast({content:"取得API資料過程出現錯誤,請嘗試重新整理畫面再次取得。",style:"error"}),this.hideFullScreenLoading()})},activateProposal(e,s){v.fire({title:"確認審核?",text:`${s}`,footer:"注意,一旦審核通過即不可再修改狀態了。",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(a=>a.isConfirmed?(this.showFullScreenLoading(),this.$http.post(`${p}/dreamboost/proposal/admin/changeToActive`,{proposalID:e})):a.isDismissed?Promise.reject(new Error("User cancelled")):Promise.reject(new Error("其他錯誤狀況"))).then(()=>{this.hideFullScreenLoading(),this.addToast({content:`${s} 已上架完成`}),this.getDatas()}).catch(a=>{this.hideFullScreenLoading(),a.message!=="User cancelled"&&this.addToast({content:"審核過程出現錯誤,請重新整理後再次操作。如果重複出現此提示請洽工程師。",style:"error"})})}},components:{ProposalCard:X,ProposalModal:ut},mounted(){this.getDatas()},watched:{},mixins:[w,D]},S=e=>(y("data-v-cd942516"),e=e(),x(),e),gt={class:"container"},vt={class:"row justify-content-center"},yt={class:"col-12 col-lg-10"},xt=S(()=>t("div",{class:"d-flex mb-4"},[t("p",{class:"mb-0 fs-3 text-white mt-19"},"待審查方案")],-1)),Dt={class:"l-CardGapY"},wt={class:"row justify-content-center"},$t={class:"col-12 col-lg-10"},Pt=S(()=>t("div",{class:"d-flex mb-4"},[t("p",{class:"mb-0 fs-3 text-white mt-19"},"審查成功方案")],-1)),St={class:"l-CardGapY"};function kt(e,s,a,h,l,o){const n=b("ProposalModal"),_=b("ProposalCard");return i(),d(c,null,[U(n,{ref:"proposalModal",onUpdateProposalDatas:o.getDatas},null,8,["onUpdateProposalDatas"]),t("div",gt,[t("div",vt,[t("div",yt,[xt,t("div",Dt,[(i(!0),d(c,null,u(l.reviewProposals,r=>(i(),f(_,{"proposal-data":r,key:r.proposalID,onEmitActive:o.activateProposal,onEmitDeny:o.showDenyProposalModal},null,8,["proposal-data","onEmitActive","onEmitDeny"]))),128))])])]),t("div",wt,[t("div",$t,[Pt,t("div",St,[(i(!0),d(c,null,u(l.activeProposals,(r,k)=>(i(),f(_,{"proposal-data":r,key:`${k}-list`},null,8,["proposal-data"]))),128))])])])])],64)}const Mt=m(ft,[["render",kt],["__scopeId","data-v-cd942516"]]);export{Mt as default}; diff --git a/assets/AdminReviewProposals-NVHAffhO.js b/assets/AdminReviewProposals-NVHAffhO.js deleted file mode 100644 index 4ada1fb..0000000 --- a/assets/AdminReviewProposals-NVHAffhO.js +++ /dev/null @@ -1 +0,0 @@ -import{A as P,m as T,_ as m,o as i,c as l,a as t,t as C,z as S,S as y,g as E,u as U,B,p as D,k as x,b as L,F as c,r as u,d as b,j as g}from"./index-ZKny8dII.js";import{m as v}from"./mixinSwalToast-NfEYWmdB.js";import{m as I}from"./mixinFullScreenLoading-9dNja2ki.js";const w=P("adminStore",{state:()=>({denyProposalData:"",name:"adminStore"}),getters:{getUserName:e=>`傳出的內容為${e.name}`},actions:{updateDenyModalData(e){this.denyProposalData=e}}}),V={props:["proposalData"],data(){return{}},methods:{...T(w,["updateDenyModalData"]),emitActive(){this.$emit("emitActive",this.proposalData.proposalID,this.proposalData.proposalTitle)},emitDeny(){this.updateDenyModalData(this.proposalData),this.$emit("emitDeny")}}},R={class:"card bg-transparent border-0"},F={class:"card-body bg-transparent py-2 px-3 py-md-3 px-md-6 px-lg-8 border rounded d-flex justify-content-between align-items-center"},O={class:"w-100 row align-items-center g-0"},j={class:"col-12 col-sm-7"},A={class:"d-flex align-items-center"},J=["src"],N={class:"flex-grow-1 text-white text-truncate"},Y={class:"mb-0 fs-14 fs-md-5 text-truncate"},W={class:"col-12 col-sm-5"},z={key:0,class:"d-flex justify-content-sm-end align-items-center"},G=t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6"},"查看",-1),Q={key:1,class:"d-flex justify-content-end align-items-center"},X=t("p",{class:"mb-0 text-secondary-light"},"審查通過",-1),Z=["href"];function q(e,s,a,h,d,o){return i(),l("div",R,[t("div",F,[t("div",O,[t("div",j,[t("div",A,[t("img",{src:a.proposalData.proposalMainImage,alt:"",class:"object-fit-cover rounded-pill me-2 me-md-4 me-lg-8",width:"48",height:"48"},null,8,J),t("div",N,[t("p",Y,C(a.proposalData.proposalTitle),1)])])]),t("div",W,[a.proposalData.proposalStatus==="review"?(i(),l("div",z,[G,t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",onClick:s[0]||(s[0]=(...n)=>o.emitActive&&o.emitActive(...n))},"通過"),t("button",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",onClick:s[1]||(s[1]=(...n)=>o.emitDeny&&o.emitDeny(...n))},"退回")])):a.proposalData.proposalStatus==="active"?(i(),l("div",Q,[X,t("a",{class:"btn btn-outline-dark-pr px-2 px-md-4 px-lg-6 ms-1 ms-sm-2 ms-md-4",href:`/#/product/${a.proposalData.proposalID}/info`,target:"_blank"},"查看",8,Z)])):S("",!0)])])])])}const H=m(V,[["render",q]]);var K={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:f}=K,tt={data(){return{modalInstance:"",denyMessages:""}},methods:{show(){this.denyMessages="",this.modalInstance.show()},hide(){this.modalInstance.hide()},doubleCheck(){y.fire({title:"確定要退回提案嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(e=>{e.isConfirmed&&this.denyProposal(),e.isDismissed}).catch(()=>{this.addToast({content:"退回提案過程出現錯誤",style:"error"})})},denyProposal(){this.showFullScreenLoading(),Promise.all([this.$http.post(`${f}/dreamboost/proposal/admin/changeToDraft`,{proposalID:this.denyProposalData.proposalID}),this.$http.post(`${f}/dreamboost/message/admin/message`,{messageToUserID:`${this.denyProposalData.proposalByUserID}`,messageTitle:"提案審核失敗",messageContent:`退回原因:${this.denyMessages}`,messageTime:new Date().getTime()})]).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"已經提案退回",style:"info"}),this.hide(),this.$emit("updateProposalDatas")}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"退回提案過程出現錯誤,請聯繫工程師",style:"error"})})}},mounted(){this.modalInstance=new this.$bs.Modal(this.$refs.modalInstance,{focus:!1})},computed:{...E(w,["denyProposalData"])},components:{},watch:{},mixins:[v,I]},M=e=>(D("data-v-8a99af03"),e=e(),x(),e),et={class:"modal fade",ref:"modalInstance","data-bs-backdrop":"static","data-bs-keyboard":"false",tabindex:"-1","aria-labelledby":"staticBackdropLabel","aria-hidden":"true",style:{"background-color":"rgba(11, 17, 28, 0.6)"}},st={class:"modal-dialog modal-lg modal-dialog-centered"},ot={class:"modal-content bg-gray-700 border border-light"},at={class:"modal-header border-bottom-0"},nt={class:"modal-body"},it=M(()=>t("div",{class:"border-bottom"},[t("h2",{class:"mb-4 text-white fw-nromal text-center"},"退回專案"),t("p",{class:"mb-8 text-dark-pr text-center fs-18"},"請輸入退回原因")],-1)),lt={class:"mt-12 px-10"},dt={class:"card bg-transparent border-0"},rt={class:"card-body bg-transparent pt-3 pb-6 ps-8 pe-3 border-gray-500 border-bottom d-flex justify-content-between"},ct={class:"d-flex align-items-stretch"},pt=["src"],mt=M(()=>t("div",{class:"d-flex flex-column justify-content-center text-white"},[t("p",{class:"mb-0 fs-12 lh-sm mb-1"},"2024.02.13"),t("p",{class:"mb-0"},"小智的 MIT 夢 - 台灣學生的教育之旅")],-1)),ht={class:"modal-footer border-top-0"};function _t(e,s,a,h,d,o){return i(),l("div",et,[t("div",st,[t("div",ot,[t("div",at,[t("button",{type:"button",class:"btn-close","aria-label":"Close",onClick:s[0]||(s[0]=(...n)=>o.hide&&o.hide(...n))})]),t("div",nt,[it,t("div",lt,[t("div",dt,[t("div",rt,[t("div",ct,[t("img",{src:e.denyProposalData.proposalMainImage,alt:"主要圖片",class:"rounded-pill me-10",width:"48",height:"48"},null,8,pt),mt])])]),U(t("textarea",{class:"form-control bg-transparent text-white mt-16",placeholder:"輸入退回原因",id:"",style:{height:"150px"},"onUpdate:modelValue":s[1]||(s[1]=n=>d.denyMessages=n)},null,512),[[B,d.denyMessages]])])]),t("div",ht,[t("button",{type:"button",class:"btn btn-dark-pr py-3 px-16",onClick:s[2]||(s[2]=(...n)=>o.doubleCheck&&o.doubleCheck(...n))},"儲存並關閉")])])])],512)}const ut=m(tt,[["render",_t],["__scopeId","data-v-8a99af03"]]);var bt={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:p}=bt,gt={data(){return{reviewProposals:[],activeProposals:[]}},methods:{showDenyProposalModal(){this.$refs.proposalModal.show()},getDatas(){this.showFullScreenLoading({canCancel:!1,loader:"dots"}),Promise.all([this.$http.get(`${p}/dreamboost/proposal/admin/inReviewProposals`),this.$http.get(`${p}/dreamboost/proposal/guest/inActiveProposals`)]).then(e=>{this.reviewProposals=e[0].data.data.result,this.activeProposals=e[1].data.data.result,this.addToast({content:"提案資料取得完畢"}),this.hideFullScreenLoading()}).catch(()=>{this.addToast({content:"取得API資料過程出現錯誤,請嘗試重新整理畫面再次取得。",style:"error"}),this.hideFullScreenLoading()})},activateProposal(e,s){y.fire({title:"確認審核?",text:`${s}`,footer:"注意,一旦審核通過即不可再修改狀態了。",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(a=>a.isConfirmed?(this.showFullScreenLoading(),this.$http.post(`${p}/dreamboost/proposal/admin/changeToActive`,{proposalID:e})):a.isDismissed?Promise.reject(new Error("User cancelled")):Promise.reject(new Error("其他錯誤狀況"))).then(()=>{this.hideFullScreenLoading(),this.addToast({content:`${s} 已上架完成`}),this.getDatas()}).catch(a=>{this.hideFullScreenLoading(),a.message!=="User cancelled"&&this.addToast({content:"審核過程出現錯誤,請重新整理後再次操作。如果重複出現此提示請洽工程師。",style:"error"})})}},components:{ProposalCard:H,ProposalModal:ut},mounted(){this.getDatas()},watched:{},mixins:[I,v]},k=e=>(D("data-v-cd942516"),e=e(),x(),e),ft={class:"container"},yt={class:"row justify-content-center"},Dt={class:"col-12 col-lg-10"},xt=k(()=>t("div",{class:"d-flex mb-4"},[t("p",{class:"mb-0 fs-3 text-white mt-19"},"待審查方案")],-1)),vt={class:"l-CardGapY"},It={class:"row justify-content-center"},wt={class:"col-12 col-lg-10"},Mt=k(()=>t("div",{class:"d-flex mb-4"},[t("p",{class:"mb-0 fs-3 text-white mt-19"},"審查成功方案")],-1)),kt={class:"l-CardGapY"};function $t(e,s,a,h,d,o){const n=b("ProposalModal"),_=b("ProposalCard");return i(),l(c,null,[L(n,{ref:"proposalModal",onUpdateProposalDatas:o.getDatas},null,8,["onUpdateProposalDatas"]),t("div",ft,[t("div",yt,[t("div",Dt,[xt,t("div",vt,[(i(!0),l(c,null,u(d.reviewProposals,r=>(i(),g(_,{"proposal-data":r,key:r.proposalID,onEmitActive:o.activateProposal,onEmitDeny:o.showDenyProposalModal},null,8,["proposal-data","onEmitActive","onEmitDeny"]))),128))])])]),t("div",It,[t("div",wt,[Mt,t("div",kt,[(i(!0),l(c,null,u(d.activeProposals,(r,$)=>(i(),g(_,{"proposal-data":r,key:`${$}-list`},null,8,["proposal-data"]))),128))])])])])],64)}const St=m(gt,[["render",$t],["__scopeId","data-v-cd942516"]]);export{St as default}; diff --git a/assets/AdminSalesData-03R54mnT.js b/assets/AdminSalesData-8oMtrl2A.js similarity index 73% rename from assets/AdminSalesData-03R54mnT.js rename to assets/AdminSalesData-8oMtrl2A.js index e271302..1de4ca9 100644 --- a/assets/AdminSalesData-03R54mnT.js +++ b/assets/AdminSalesData-8oMtrl2A.js @@ -1 +1 @@ -import{_ as t,c as e,o as s}from"./index-ZKny8dII.js";const o={data(){return{}},methods:{}},a={class:"mb-0 text-white text-center fs-1"};function c(n,r,_,p,d,f){return s(),e("p",a,"銷售數據")}const m=t(o,[["render",c]]);export{m as default}; +import{_ as t,c as e,o as s}from"./index-sWoFWHUv.js";const o={data(){return{}},methods:{}},a={class:"mb-0 text-white text-center fs-1"};function c(n,r,_,p,d,f){return s(),e("p",a,"銷售數據")}const m=t(o,[["render",c]]);export{m as default}; diff --git a/assets/AdminUpdateBanner-9Bafk1ZG.js b/assets/AdminUpdateBanner-Sw1Slrlq.js similarity index 55% rename from assets/AdminUpdateBanner-9Bafk1ZG.js rename to assets/AdminUpdateBanner-Sw1Slrlq.js index 3a5304d..f615abf 100644 --- a/assets/AdminUpdateBanner-9Bafk1ZG.js +++ b/assets/AdminUpdateBanner-Sw1Slrlq.js @@ -1,13 +1,13 @@ -import{m as __}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as d_}from"./mixinSwalToast-NfEYWmdB.js";import{K as he,J as v_,_ as lr,o as ut,c as Ht,a as P,q as _o,N as w_,P as m_,E as x_,h as A_,i as y_,b as ge,w as Bi,F as vo,r as wo,j as mo,e as I_,d as xt,p as S_,k as b_,S as L_,z as R_,f as C_}from"./index-ZKny8dII.js";import{R as E_}from"./RightArrow-WNYavUu6.js";/* empty css */import{_ as T_}from"./w-biglogo--vR3noKG.js";var sr={exports:{}};/** +import{m as __}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as d_}from"./mixinSwalToast--n5GZdOL.js";import{K as he,J as v_,_ as lr,o as ut,c as Ht,a as P,q as _o,N as w_,P as m_,E as x_,h as A_,i as y_,b as ge,w as Bi,F as vo,r as wo,j as mo,e as S_,d as xt,p as I_,k as b_,S as L_,z as R_,f as C_}from"./index-sWoFWHUv.js";import{R as E_}from"./RightArrow-8a6ZPEaq.js";/* empty css */import{_ as T_}from"./w-biglogo--vR3noKG.js";var sr={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */sr.exports;(function(D,F){(function(){var o,At="4.17.21",j=200,nn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",G="Expected a function",ft="Invalid `variable` option passed into `_.template`",ot="__lodash_hash_undefined__",st=500,ln="__lodash_placeholder__",an=1,Di=2,yt=4,It=1,pe=2,vn=1,lt=2,Ui=4,Bn=8,St=16,Pn=32,bt=64,Wn=128,qt=256,ar=512,xo=30,Ao="...",yo=800,Io=16,Fi=1,So=2,bo=3,at=1/0,Xn=9007199254740991,Lo=17976931348623157e292,_e=NaN,Dn=4294967295,Ro=Dn-1,Co=Dn>>>1,Eo=[["ary",Wn],["bind",vn],["bindKey",lt],["curry",Bn],["curryRight",St],["flip",ar],["partial",Pn],["partialRight",bt],["rearg",qt]],Lt="[object Arguments]",de="[object Array]",To="[object AsyncFunction]",Kt="[object Boolean]",zt="[object Date]",Oo="[object DOMException]",ve="[object Error]",we="[object Function]",Mi="[object GeneratorFunction]",Ln="[object Map]",Zt="[object Number]",Bo="[object Null]",Nn="[object Object]",Wi="[object Promise]",Po="[object Proxy]",Yt="[object RegExp]",Rn="[object Set]",Jt="[object String]",me="[object Symbol]",Do="[object Undefined]",Xt="[object WeakMap]",Uo="[object WeakSet]",Qt="[object ArrayBuffer]",Rt="[object DataView]",cr="[object Float32Array]",hr="[object Float64Array]",gr="[object Int8Array]",pr="[object Int16Array]",_r="[object Int32Array]",dr="[object Uint8Array]",vr="[object Uint8ClampedArray]",wr="[object Uint16Array]",mr="[object Uint32Array]",Fo=/\b__p \+= '';/g,Mo=/\b(__p \+=) '' \+/g,Wo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ni=/&(?:amp|lt|gt|quot|#39);/g,$i=/[&<>"']/g,No=RegExp(Ni.source),$o=RegExp($i.source),Go=/<%-([\s\S]+?)%>/g,Ho=/<%([\s\S]+?)%>/g,Gi=/<%=([\s\S]+?)%>/g,qo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ko=/^\w*$/,zo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xr=/[\\^$.*+?()[\]{}|]/g,Zo=RegExp(xr.source),Ar=/^\s+/,Yo=/\s/,Jo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xo=/\{\n\/\* \[wrapped with (.+)\] \*/,Qo=/,? & /,Vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ko=/[()=,{}\[\]\/\s]/,jo=/\\(\\)?/g,ns=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hi=/\w*$/,ts=/^[-+]0x[0-9a-f]+$/i,es=/^0b[01]+$/i,rs=/^\[object .+?Constructor\]$/,is=/^0o[0-7]+$/i,us=/^(?:0|[1-9]\d*)$/,fs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe=/($^)/,os=/['\n\r\u2028\u2029\\]/g,Ae="\\ud800-\\udfff",ss="\\u0300-\\u036f",ls="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",qi=ss+ls+as,Ki="\\u2700-\\u27bf",zi="a-z\\xdf-\\xf6\\xf8-\\xff",cs="\\xac\\xb1\\xd7\\xf7",hs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gs="\\u2000-\\u206f",ps=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zi="A-Z\\xc0-\\xd6\\xd8-\\xde",Yi="\\ufe0e\\ufe0f",Ji=cs+hs+gs+ps,yr="['’]",_s="["+Ae+"]",Xi="["+Ji+"]",ye="["+qi+"]",Qi="\\d+",ds="["+Ki+"]",Vi="["+zi+"]",ki="[^"+Ae+Ji+Qi+Ki+zi+Zi+"]",Ir="\\ud83c[\\udffb-\\udfff]",vs="(?:"+ye+"|"+Ir+")",ji="[^"+Ae+"]",Sr="(?:\\ud83c[\\udde6-\\uddff]){2}",br="[\\ud800-\\udbff][\\udc00-\\udfff]",Ct="["+Zi+"]",nu="\\u200d",tu="(?:"+Vi+"|"+ki+")",ws="(?:"+Ct+"|"+ki+")",eu="(?:"+yr+"(?:d|ll|m|re|s|t|ve))?",ru="(?:"+yr+"(?:D|LL|M|RE|S|T|VE))?",iu=vs+"?",uu="["+Yi+"]?",ms="(?:"+nu+"(?:"+[ji,Sr,br].join("|")+")"+uu+iu+")*",xs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",As="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fu=uu+iu+ms,ys="(?:"+[ds,Sr,br].join("|")+")"+fu,Is="(?:"+[ji+ye+"?",ye,Sr,br,_s].join("|")+")",Ss=RegExp(yr,"g"),bs=RegExp(ye,"g"),Lr=RegExp(Ir+"(?="+Ir+")|"+Is+fu,"g"),Ls=RegExp([Ct+"?"+Vi+"+"+eu+"(?="+[Xi,Ct,"$"].join("|")+")",ws+"+"+ru+"(?="+[Xi,Ct+tu,"$"].join("|")+")",Ct+"?"+tu+"+"+eu,Ct+"+"+ru,As,xs,Qi,ys].join("|"),"g"),Rs=RegExp("["+nu+Ae+qi+Yi+"]"),Cs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Es=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ts=-1,N={};N[cr]=N[hr]=N[gr]=N[pr]=N[_r]=N[dr]=N[vr]=N[wr]=N[mr]=!0,N[Lt]=N[de]=N[Qt]=N[Kt]=N[Rt]=N[zt]=N[ve]=N[we]=N[Ln]=N[Zt]=N[Nn]=N[Yt]=N[Rn]=N[Jt]=N[Xt]=!1;var W={};W[Lt]=W[de]=W[Qt]=W[Rt]=W[Kt]=W[zt]=W[cr]=W[hr]=W[gr]=W[pr]=W[_r]=W[Ln]=W[Zt]=W[Nn]=W[Yt]=W[Rn]=W[Jt]=W[me]=W[dr]=W[vr]=W[wr]=W[mr]=!0,W[ve]=W[we]=W[Xt]=!1;var Os={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Bs={"&":"&","<":"<",">":">",'"':""","'":"'"},Ps={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ds={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Us=parseFloat,Fs=parseInt,ou=typeof he=="object"&&he&&he.Object===Object&&he,Ms=typeof self=="object"&&self&&self.Object===Object&&self,X=ou||Ms||Function("return this")(),Rr=F&&!F.nodeType&&F,ct=Rr&&!0&&D&&!D.nodeType&&D,su=ct&&ct.exports===Rr,Cr=su&&ou.process,wn=function(){try{var a=ct&&ct.require&&ct.require("util").types;return a||Cr&&Cr.binding&&Cr.binding("util")}catch{}}(),lu=wn&&wn.isArrayBuffer,au=wn&&wn.isDate,cu=wn&&wn.isMap,hu=wn&&wn.isRegExp,gu=wn&&wn.isSet,pu=wn&&wn.isTypedArray;function cn(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Ws(a,g,h,w){for(var I=-1,O=a==null?0:a.length;++I-1}function Er(a,g,h){for(var w=-1,I=a==null?0:a.length;++w-1;);return h}function yu(a,g){for(var h=a.length;h--&&Et(g,a[h],0)>-1;);return h}function Ys(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Js=Pr(Os),Xs=Pr(Bs);function Qs(a){return"\\"+Ds[a]}function Vs(a,g){return a==null?o:a[g]}function Tt(a){return Rs.test(a)}function ks(a){return Cs.test(a)}function js(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function Mr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,I){h[++g]=[I,w]}),h}function Iu(a,g){return function(h){return a(g(h))}}function kn(a,g){for(var h=-1,w=a.length,I=0,O=[];++h-1}function $l(n,t){var e=this.__data__,r=$e(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}$n.prototype.clear=Fl,$n.prototype.delete=Ml,$n.prototype.get=Wl,$n.prototype.has=Nl,$n.prototype.set=$l;function Gn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function yn(n,t,e,r,i,f){var s,l=t&an,c=t&Di,p=t&yt;if(e&&(s=i?e(n,r,i,f):e(n)),s!==o)return s;if(!H(n))return n;var _=S(n);if(_){if(s=Ka(n),!l)return un(n,s)}else{var d=k(n),v=d==we||d==Mi;if(it(n))return ff(n,l);if(d==Nn||d==Lt||v&&!i){if(s=c||v?{}:bf(n),!l)return c?Pa(n,ea(s,n)):Ba(n,Uu(s,n))}else{if(!W[d])return i?n:{};s=za(n,d,l)}}f||(f=new En);var m=f.get(n);if(m)return m;f.set(n,s),no(n)?n.forEach(function(y){s.add(yn(y,t,e,y,n,f))}):kf(n)&&n.forEach(function(y,C){s.set(C,yn(y,t,e,C,n,f))});var A=p?c?li:si:c?on:J,L=_?o:A(n);return mn(L||n,function(y,C){L&&(C=y,y=n[C]),re(s,C,yn(y,t,e,C,n,f))}),s}function ra(n){var t=J(n);return function(e){return Fu(e,n,t)}}function Fu(n,t,e){var r=e.length;if(n==null)return!r;for(n=M(n);r--;){var i=e[r],f=t[i],s=n[i];if(s===o&&!(i in n)||!f(s))return!1}return!0}function Mu(n,t,e){if(typeof n!="function")throw new xn(G);return ae(function(){n.apply(o,e)},t)}function ie(n,t,e,r){var i=-1,f=Ie,s=!0,l=n.length,c=[],p=t.length;if(!l)return c;e&&(t=$(t,hn(e))),r?(f=Er,s=!1):t.length>=j&&(f=Vt,s=!1,t=new pt(t));n:for(;++ii?0:i+e),r=r===o||r>i?i:b(r),r<0&&(r+=i),r=e>r?0:eo(r);e0&&e(l)?t>1?Q(l,t-1,e,r,i):Vn(i,l):r||(i[i.length]=l)}return i}var Kr=hf(),$u=hf(!0);function Un(n,t){return n&&Kr(n,t,J)}function zr(n,t){return n&&$u(n,t,J)}function He(n,t){return Qn(t,function(e){return Zn(n[e])})}function dt(n,t){t=et(t,n);for(var e=0,r=t.length;n!=null&&et}function fa(n,t){return n!=null&&U.call(n,t)}function oa(n,t){return n!=null&&t in M(n)}function sa(n,t,e){return n>=V(t,e)&&n=120&&_.length>=120)?new pt(s&&_):o}_=n[0];var d=-1,v=l[0];n:for(;++d-1;)l!==n&&Pe.call(l,c,1),Pe.call(n,c,1);return n}function Vu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;zn(i)?Pe.call(n,i,1):ti(n,i)}}return n}function kr(n,t){return n+Fe(Ou()*(t-n+1))}function Aa(n,t,e,r){for(var i=-1,f=Y(Ue((t-n)/(e||1)),0),s=h(f);f--;)s[r?f:++i]=n,n+=e;return s}function jr(n,t){var e="";if(!n||t<1||t>Xn)return e;do t%2&&(e+=n),t=Fe(t/2),t&&(n+=n);while(t);return e}function R(n,t){return di(Cf(n,t,sn),n+"")}function ya(n){return Du(Gt(n))}function Ia(n,t){var e=Gt(n);return je(e,_t(t,0,e.length))}function oe(n,t,e,r){if(!H(n))return n;t=et(t,n);for(var i=-1,f=t.length,s=f-1,l=n;l!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r>>1,s=n[f];s!==null&&!pn(s)&&(e?s<=t:s=j){var p=t?null:Ma(n);if(p)return be(p);s=!1,i=Vt,c=new pt}else c=t?[]:l;n:for(;++r=r?n:In(n,t,e)}var uf=pl||function(n){return X.clearTimeout(n)};function ff(n,t){if(t)return n.slice();var e=n.length,r=Lu?Lu(e):new n.constructor(e);return n.copy(r),r}function ui(n){var t=new n.constructor(n.byteLength);return new Oe(t).set(new Oe(n)),t}function Ca(n,t){var e=t?ui(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function Ea(n){var t=new n.constructor(n.source,Hi.exec(n));return t.lastIndex=n.lastIndex,t}function Ta(n){return ee?M(ee.call(n)):{}}function of(n,t){var e=t?ui(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function sf(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=pn(n),s=t!==o,l=t===null,c=t===t,p=pn(t);if(!l&&!p&&!f&&n>t||f&&s&&c&&!l&&!p||r&&s&&c||!e&&c||!i)return 1;if(!r&&!f&&!p&&n=l)return c;var p=e[r];return c*(p=="desc"?-1:1)}}return n.index-t.index}function lf(n,t,e,r){for(var i=-1,f=n.length,s=e.length,l=-1,c=t.length,p=Y(f-s,0),_=h(c+p),d=!r;++l1?e[i-1]:o,s=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,s&&en(e[0],e[1],s)&&(f=i<3?o:f,i=1),t=M(t);++r-1?i[f?t[s]:s]:o}}function _f(n){return Kn(function(t){var e=t.length,r=e,i=An.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new xn(G);if(i&&!s&&Ve(f)=="wrapper")var s=new An([],!0)}for(r=s?r:e;++r1&&T.reverse(),_&&cl))return!1;var p=f.get(n),_=f.get(t);if(p&&_)return p==t&&_==n;var d=-1,v=!0,m=e&pe?new pt:o;for(f.set(n,t),f.set(t,n);++d1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Jo,`{ + */sr.exports;(function(D,U){(function(){var o,At="4.17.21",j=200,nn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",G="Expected a function",ft="Invalid `variable` option passed into `_.template`",ot="__lodash_hash_undefined__",st=500,ln="__lodash_placeholder__",an=1,Di=2,yt=4,St=1,pe=2,vn=1,lt=2,Fi=4,Bn=8,It=16,Pn=32,bt=64,Mn=128,qt=256,ar=512,xo=30,Ao="...",yo=800,So=16,Ui=1,Io=2,bo=3,at=1/0,Jn=9007199254740991,Lo=17976931348623157e292,_e=NaN,Dn=4294967295,Ro=Dn-1,Co=Dn>>>1,Eo=[["ary",Mn],["bind",vn],["bindKey",lt],["curry",Bn],["curryRight",It],["flip",ar],["partial",Pn],["partialRight",bt],["rearg",qt]],Lt="[object Arguments]",de="[object Array]",To="[object AsyncFunction]",Kt="[object Boolean]",zt="[object Date]",Oo="[object DOMException]",ve="[object Error]",we="[object Function]",Wi="[object GeneratorFunction]",Ln="[object Map]",Zt="[object Number]",Bo="[object Null]",$n="[object Object]",Mi="[object Promise]",Po="[object Proxy]",Yt="[object RegExp]",Rn="[object Set]",Xt="[object String]",me="[object Symbol]",Do="[object Undefined]",Jt="[object WeakMap]",Fo="[object WeakSet]",Qt="[object ArrayBuffer]",Rt="[object DataView]",cr="[object Float32Array]",hr="[object Float64Array]",gr="[object Int8Array]",pr="[object Int16Array]",_r="[object Int32Array]",dr="[object Uint8Array]",vr="[object Uint8ClampedArray]",wr="[object Uint16Array]",mr="[object Uint32Array]",Uo=/\b__p \+= '';/g,Wo=/\b(__p \+=) '' \+/g,Mo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$i=/&(?:amp|lt|gt|quot|#39);/g,Ni=/[&<>"']/g,$o=RegExp($i.source),No=RegExp(Ni.source),Go=/<%-([\s\S]+?)%>/g,Ho=/<%([\s\S]+?)%>/g,Gi=/<%=([\s\S]+?)%>/g,qo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ko=/^\w*$/,zo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xr=/[\\^$.*+?()[\]{}|]/g,Zo=RegExp(xr.source),Ar=/^\s+/,Yo=/\s/,Xo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jo=/\{\n\/\* \[wrapped with (.+)\] \*/,Qo=/,? & /,Vo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ko=/[()=,{}\[\]\/\s]/,jo=/\\(\\)?/g,ns=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Hi=/\w*$/,ts=/^[-+]0x[0-9a-f]+$/i,es=/^0b[01]+$/i,rs=/^\[object .+?Constructor\]$/,is=/^0o[0-7]+$/i,us=/^(?:0|[1-9]\d*)$/,fs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe=/($^)/,os=/['\n\r\u2028\u2029\\]/g,Ae="\\ud800-\\udfff",ss="\\u0300-\\u036f",ls="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",qi=ss+ls+as,Ki="\\u2700-\\u27bf",zi="a-z\\xdf-\\xf6\\xf8-\\xff",cs="\\xac\\xb1\\xd7\\xf7",hs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gs="\\u2000-\\u206f",ps=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zi="A-Z\\xc0-\\xd6\\xd8-\\xde",Yi="\\ufe0e\\ufe0f",Xi=cs+hs+gs+ps,yr="['’]",_s="["+Ae+"]",Ji="["+Xi+"]",ye="["+qi+"]",Qi="\\d+",ds="["+Ki+"]",Vi="["+zi+"]",ki="[^"+Ae+Xi+Qi+Ki+zi+Zi+"]",Sr="\\ud83c[\\udffb-\\udfff]",vs="(?:"+ye+"|"+Sr+")",ji="[^"+Ae+"]",Ir="(?:\\ud83c[\\udde6-\\uddff]){2}",br="[\\ud800-\\udbff][\\udc00-\\udfff]",Ct="["+Zi+"]",nu="\\u200d",tu="(?:"+Vi+"|"+ki+")",ws="(?:"+Ct+"|"+ki+")",eu="(?:"+yr+"(?:d|ll|m|re|s|t|ve))?",ru="(?:"+yr+"(?:D|LL|M|RE|S|T|VE))?",iu=vs+"?",uu="["+Yi+"]?",ms="(?:"+nu+"(?:"+[ji,Ir,br].join("|")+")"+uu+iu+")*",xs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",As="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fu=uu+iu+ms,ys="(?:"+[ds,Ir,br].join("|")+")"+fu,Ss="(?:"+[ji+ye+"?",ye,Ir,br,_s].join("|")+")",Is=RegExp(yr,"g"),bs=RegExp(ye,"g"),Lr=RegExp(Sr+"(?="+Sr+")|"+Ss+fu,"g"),Ls=RegExp([Ct+"?"+Vi+"+"+eu+"(?="+[Ji,Ct,"$"].join("|")+")",ws+"+"+ru+"(?="+[Ji,Ct+tu,"$"].join("|")+")",Ct+"?"+tu+"+"+eu,Ct+"+"+ru,As,xs,Qi,ys].join("|"),"g"),Rs=RegExp("["+nu+Ae+qi+Yi+"]"),Cs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Es=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ts=-1,$={};$[cr]=$[hr]=$[gr]=$[pr]=$[_r]=$[dr]=$[vr]=$[wr]=$[mr]=!0,$[Lt]=$[de]=$[Qt]=$[Kt]=$[Rt]=$[zt]=$[ve]=$[we]=$[Ln]=$[Zt]=$[$n]=$[Yt]=$[Rn]=$[Xt]=$[Jt]=!1;var M={};M[Lt]=M[de]=M[Qt]=M[Rt]=M[Kt]=M[zt]=M[cr]=M[hr]=M[gr]=M[pr]=M[_r]=M[Ln]=M[Zt]=M[$n]=M[Yt]=M[Rn]=M[Xt]=M[me]=M[dr]=M[vr]=M[wr]=M[mr]=!0,M[ve]=M[we]=M[Jt]=!1;var Os={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Bs={"&":"&","<":"<",">":">",'"':""","'":"'"},Ps={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ds={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Fs=parseFloat,Us=parseInt,ou=typeof he=="object"&&he&&he.Object===Object&&he,Ws=typeof self=="object"&&self&&self.Object===Object&&self,J=ou||Ws||Function("return this")(),Rr=U&&!U.nodeType&&U,ct=Rr&&!0&&D&&!D.nodeType&&D,su=ct&&ct.exports===Rr,Cr=su&&ou.process,wn=function(){try{var a=ct&&ct.require&&ct.require("util").types;return a||Cr&&Cr.binding&&Cr.binding("util")}catch{}}(),lu=wn&&wn.isArrayBuffer,au=wn&&wn.isDate,cu=wn&&wn.isMap,hu=wn&&wn.isRegExp,gu=wn&&wn.isSet,pu=wn&&wn.isTypedArray;function cn(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Ms(a,g,h,w){for(var S=-1,O=a==null?0:a.length;++S-1}function Er(a,g,h){for(var w=-1,S=a==null?0:a.length;++w-1;);return h}function yu(a,g){for(var h=a.length;h--&&Et(g,a[h],0)>-1;);return h}function Ys(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Xs=Pr(Os),Js=Pr(Bs);function Qs(a){return"\\"+Ds[a]}function Vs(a,g){return a==null?o:a[g]}function Tt(a){return Rs.test(a)}function ks(a){return Cs.test(a)}function js(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function Wr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,S){h[++g]=[S,w]}),h}function Su(a,g){return function(h){return a(g(h))}}function kn(a,g){for(var h=-1,w=a.length,S=0,O=[];++h-1}function Nl(n,t){var e=this.__data__,r=Ne(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}Nn.prototype.clear=Ul,Nn.prototype.delete=Wl,Nn.prototype.get=Ml,Nn.prototype.has=$l,Nn.prototype.set=Nl;function Gn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function yn(n,t,e,r,i,f){var s,l=t&an,c=t&Di,p=t&yt;if(e&&(s=i?e(n,r,i,f):e(n)),s!==o)return s;if(!H(n))return n;var _=I(n);if(_){if(s=Ka(n),!l)return un(n,s)}else{var d=k(n),v=d==we||d==Wi;if(it(n))return ff(n,l);if(d==$n||d==Lt||v&&!i){if(s=c||v?{}:bf(n),!l)return c?Pa(n,ea(s,n)):Ba(n,Fu(s,n))}else{if(!M[d])return i?n:{};s=za(n,d,l)}}f||(f=new En);var m=f.get(n);if(m)return m;f.set(n,s),no(n)?n.forEach(function(y){s.add(yn(y,t,e,y,n,f))}):kf(n)&&n.forEach(function(y,C){s.set(C,yn(y,t,e,C,n,f))});var A=p?c?li:si:c?on:X,L=_?o:A(n);return mn(L||n,function(y,C){L&&(C=y,y=n[C]),re(s,C,yn(y,t,e,C,n,f))}),s}function ra(n){var t=X(n);return function(e){return Uu(e,n,t)}}function Uu(n,t,e){var r=e.length;if(n==null)return!r;for(n=W(n);r--;){var i=e[r],f=t[i],s=n[i];if(s===o&&!(i in n)||!f(s))return!1}return!0}function Wu(n,t,e){if(typeof n!="function")throw new xn(G);return ae(function(){n.apply(o,e)},t)}function ie(n,t,e,r){var i=-1,f=Se,s=!0,l=n.length,c=[],p=t.length;if(!l)return c;e&&(t=N(t,hn(e))),r?(f=Er,s=!1):t.length>=j&&(f=Vt,s=!1,t=new pt(t));n:for(;++ii?0:i+e),r=r===o||r>i?i:b(r),r<0&&(r+=i),r=e>r?0:eo(r);e0&&e(l)?t>1?Q(l,t-1,e,r,i):Vn(i,l):r||(i[i.length]=l)}return i}var Kr=hf(),Nu=hf(!0);function Fn(n,t){return n&&Kr(n,t,X)}function zr(n,t){return n&&Nu(n,t,X)}function He(n,t){return Qn(t,function(e){return Zn(n[e])})}function dt(n,t){t=et(t,n);for(var e=0,r=t.length;n!=null&&et}function fa(n,t){return n!=null&&F.call(n,t)}function oa(n,t){return n!=null&&t in W(n)}function sa(n,t,e){return n>=V(t,e)&&n=120&&_.length>=120)?new pt(s&&_):o}_=n[0];var d=-1,v=l[0];n:for(;++d-1;)l!==n&&Pe.call(l,c,1),Pe.call(n,c,1);return n}function Vu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;zn(i)?Pe.call(n,i,1):ti(n,i)}}return n}function kr(n,t){return n+Ue(Ou()*(t-n+1))}function Aa(n,t,e,r){for(var i=-1,f=Y(Fe((t-n)/(e||1)),0),s=h(f);f--;)s[r?f:++i]=n,n+=e;return s}function jr(n,t){var e="";if(!n||t<1||t>Jn)return e;do t%2&&(e+=n),t=Ue(t/2),t&&(n+=n);while(t);return e}function R(n,t){return di(Cf(n,t,sn),n+"")}function ya(n){return Du(Gt(n))}function Sa(n,t){var e=Gt(n);return je(e,_t(t,0,e.length))}function oe(n,t,e,r){if(!H(n))return n;t=et(t,n);for(var i=-1,f=t.length,s=f-1,l=n;l!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r>>1,s=n[f];s!==null&&!pn(s)&&(e?s<=t:s=j){var p=t?null:Wa(n);if(p)return be(p);s=!1,i=Vt,c=new pt}else c=t?[]:l;n:for(;++r=r?n:Sn(n,t,e)}var uf=pl||function(n){return J.clearTimeout(n)};function ff(n,t){if(t)return n.slice();var e=n.length,r=Lu?Lu(e):new n.constructor(e);return n.copy(r),r}function ui(n){var t=new n.constructor(n.byteLength);return new Oe(t).set(new Oe(n)),t}function Ca(n,t){var e=t?ui(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function Ea(n){var t=new n.constructor(n.source,Hi.exec(n));return t.lastIndex=n.lastIndex,t}function Ta(n){return ee?W(ee.call(n)):{}}function of(n,t){var e=t?ui(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function sf(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=pn(n),s=t!==o,l=t===null,c=t===t,p=pn(t);if(!l&&!p&&!f&&n>t||f&&s&&c&&!l&&!p||r&&s&&c||!e&&c||!i)return 1;if(!r&&!f&&!p&&n=l)return c;var p=e[r];return c*(p=="desc"?-1:1)}}return n.index-t.index}function lf(n,t,e,r){for(var i=-1,f=n.length,s=e.length,l=-1,c=t.length,p=Y(f-s,0),_=h(c+p),d=!r;++l1?e[i-1]:o,s=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,s&&en(e[0],e[1],s)&&(f=i<3?o:f,i=1),t=W(t);++r-1?i[f?t[s]:s]:o}}function _f(n){return Kn(function(t){var e=t.length,r=e,i=An.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new xn(G);if(i&&!s&&Ve(f)=="wrapper")var s=new An([],!0)}for(r=s?r:e;++r1&&T.reverse(),_&&cl))return!1;var p=f.get(n),_=f.get(t);if(p&&_)return p==t&&_==n;var d=-1,v=!0,m=e&pe?new pt:o;for(f.set(n,t),f.set(t,n);++d1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Xo,`{ /* [wrapped with `+t+`] */ -`)}function Ya(n){return S(n)||mt(n)||!!(Eu&&n&&n[Eu])}function zn(n,t){var e=typeof n;return t=t??Xn,!!t&&(e=="number"||e!="symbol"&&us.test(n))&&n>-1&&n%1==0&&n0){if(++t>=yo)return arguments[0]}else t=0;return n.apply(o,arguments)}}function je(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,$f(n,e)});function Gf(n){var t=u(n);return t.__chain__=!0,t}function ih(n,t){return t(n),n}function nr(n,t){return t(n)}var uh=Kn(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return qr(f,n)};return t>1||this.__actions__.length||!(r instanceof E)||!zn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:nr,args:[i],thisArg:o}),new An(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function fh(){return Gf(this)}function oh(){return new An(this.value(),this.__chain__)}function sh(){this.__values__===o&&(this.__values__=to(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function lh(){return this}function ah(n){for(var t,e=this;e instanceof Ne;){var r=Df(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function ch(){var n=this.__wrapped__;if(n instanceof E){var t=n;return this.__actions__.length&&(t=new E(this)),t=t.reverse(),t.__actions__.push({func:nr,args:[vi],thisArg:o}),new An(t,this.__chain__)}return this.thru(vi)}function hh(){return ef(this.__wrapped__,this.__actions__)}var gh=Ze(function(n,t,e){U.call(n,e)?++n[e]:Hn(n,e,1)});function ph(n,t,e){var r=S(n)?_u:ia;return e&&en(n,t,e)&&(t=o),r(n,x(t,3))}function _h(n,t){var e=S(n)?Qn:Nu;return e(n,x(t,3))}var dh=pf(Uf),vh=pf(Ff);function wh(n,t){return Q(tr(n,t),1)}function mh(n,t){return Q(tr(n,t),at)}function xh(n,t,e){return e=e===o?1:b(e),Q(tr(n,t),e)}function Hf(n,t){var e=S(n)?mn:nt;return e(n,x(t,3))}function qf(n,t){var e=S(n)?Ns:Wu;return e(n,x(t,3))}var Ah=Ze(function(n,t,e){U.call(n,e)?n[e].push(t):Hn(n,e,[t])});function yh(n,t,e,r){n=fn(n)?n:Gt(n),e=e&&!r?b(e):0;var i=n.length;return e<0&&(e=Y(i+e,0)),fr(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&Et(n,t,e)>-1}var Ih=R(function(n,t,e){var r=-1,i=typeof t=="function",f=fn(n)?h(n.length):[];return nt(n,function(s){f[++r]=i?cn(t,s,e):ue(s,t,e)}),f}),Sh=Ze(function(n,t,e){Hn(n,e,t)});function tr(n,t){var e=S(n)?$:zu;return e(n,x(t,3))}function bh(n,t,e,r){return n==null?[]:(S(t)||(t=t==null?[]:[t]),e=r?o:e,S(e)||(e=e==null?[]:[e]),Xu(n,t,e))}var Lh=Ze(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function Rh(n,t,e){var r=S(n)?Tr:mu,i=arguments.length<3;return r(n,x(t,4),e,i,nt)}function Ch(n,t,e){var r=S(n)?$s:mu,i=arguments.length<3;return r(n,x(t,4),e,i,Wu)}function Eh(n,t){var e=S(n)?Qn:Nu;return e(n,ir(x(t,3)))}function Th(n){var t=S(n)?Du:ya;return t(n)}function Oh(n,t,e){(e?en(n,t,e):t===o)?t=1:t=b(t);var r=S(n)?jl:Ia;return r(n,t)}function Bh(n){var t=S(n)?na:ba;return t(n)}function Ph(n){if(n==null)return 0;if(fn(n))return fr(n)?Ot(n):n.length;var t=k(n);return t==Ln||t==Rn?n.size:Xr(n).length}function Dh(n,t,e){var r=S(n)?Or:La;return e&&en(n,t,e)&&(t=o),r(n,x(t,3))}var Uh=R(function(n,t){if(n==null)return[];var e=t.length;return e>1&&en(n,t[0],t[1])?t=[]:e>2&&en(t[0],t[1],t[2])&&(t=[t[0]]),Xu(n,Q(t,1),[])}),er=_l||function(){return X.Date.now()};function Fh(n,t){if(typeof t!="function")throw new xn(G);return n=b(n),function(){if(--n<1)return t.apply(this,arguments)}}function Kf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,qn(n,Wn,o,o,o,o,t)}function zf(n,t){var e;if(typeof t!="function")throw new xn(G);return n=b(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var mi=R(function(n,t,e){var r=vn;if(e.length){var i=kn(e,Nt(mi));r|=Pn}return qn(n,r,t,e,i)}),Zf=R(function(n,t,e){var r=vn|lt;if(e.length){var i=kn(e,Nt(Zf));r|=Pn}return qn(t,r,n,e,i)});function Yf(n,t,e){t=e?o:t;var r=qn(n,Bn,o,o,o,o,o,t);return r.placeholder=Yf.placeholder,r}function Jf(n,t,e){t=e?o:t;var r=qn(n,St,o,o,o,o,o,t);return r.placeholder=Jf.placeholder,r}function Xf(n,t,e){var r,i,f,s,l,c,p=0,_=!1,d=!1,v=!0;if(typeof n!="function")throw new xn(G);t=bn(t)||0,H(e)&&(_=!!e.leading,d="maxWait"in e,f=d?Y(bn(e.maxWait)||0,t):f,v="trailing"in e?!!e.trailing:v);function m(z){var On=r,Jn=i;return r=i=o,p=z,s=n.apply(Jn,On),s}function A(z){return p=z,l=ae(C,t),_?m(z):s}function L(z){var On=z-c,Jn=z-p,po=t-On;return d?V(po,f-Jn):po}function y(z){var On=z-c,Jn=z-p;return c===o||On>=t||On<0||d&&Jn>=f}function C(){var z=er();if(y(z))return T(z);l=ae(C,L(z))}function T(z){return l=o,v&&r?m(z):(r=i=o,s)}function _n(){l!==o&&uf(l),p=0,r=c=i=l=o}function rn(){return l===o?s:T(er())}function dn(){var z=er(),On=y(z);if(r=arguments,i=this,c=z,On){if(l===o)return A(c);if(d)return uf(l),l=ae(C,t),m(c)}return l===o&&(l=ae(C,t)),s}return dn.cancel=_n,dn.flush=rn,dn}var Mh=R(function(n,t){return Mu(n,1,t)}),Wh=R(function(n,t,e){return Mu(n,bn(t)||0,e)});function Nh(n){return qn(n,ar)}function rr(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new xn(G);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var s=n.apply(this,r);return e.cache=f.set(i,s)||f,s};return e.cache=new(rr.Cache||Gn),e}rr.Cache=Gn;function ir(n){if(typeof n!="function")throw new xn(G);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function $h(n){return zf(2,n)}var Gh=Ra(function(n,t){t=t.length==1&&S(t[0])?$(t[0],hn(x())):$(Q(t,1),hn(x()));var e=t.length;return R(function(r){for(var i=-1,f=V(r.length,e);++i=t}),mt=Hu(function(){return arguments}())?Hu:function(n){return q(n)&&U.call(n,"callee")&&!Cu.call(n,"callee")},S=h.isArray,eg=lu?hn(lu):aa;function fn(n){return n!=null&&ur(n.length)&&!Zn(n)}function K(n){return q(n)&&fn(n)}function rg(n){return n===!0||n===!1||q(n)&&tn(n)==Kt}var it=vl||Oi,ig=au?hn(au):ca;function ug(n){return q(n)&&n.nodeType===1&&!ce(n)}function fg(n){if(n==null)return!0;if(fn(n)&&(S(n)||typeof n=="string"||typeof n.splice=="function"||it(n)||$t(n)||mt(n)))return!n.length;var t=k(n);if(t==Ln||t==Rn)return!n.size;if(le(n))return!Xr(n).length;for(var e in n)if(U.call(n,e))return!1;return!0}function og(n,t){return fe(n,t)}function sg(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?fe(n,t,o,e):!!r}function Ai(n){if(!q(n))return!1;var t=tn(n);return t==ve||t==Oo||typeof n.message=="string"&&typeof n.name=="string"&&!ce(n)}function lg(n){return typeof n=="number"&&Tu(n)}function Zn(n){if(!H(n))return!1;var t=tn(n);return t==we||t==Mi||t==To||t==Po}function Vf(n){return typeof n=="number"&&n==b(n)}function ur(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Xn}function H(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function q(n){return n!=null&&typeof n=="object"}var kf=cu?hn(cu):ga;function ag(n,t){return n===t||Jr(n,t,ci(t))}function cg(n,t,e){return e=typeof e=="function"?e:o,Jr(n,t,ci(t),e)}function hg(n){return jf(n)&&n!=+n}function gg(n){if(Qa(n))throw new I(nn);return qu(n)}function pg(n){return n===null}function _g(n){return n==null}function jf(n){return typeof n=="number"||q(n)&&tn(n)==Zt}function ce(n){if(!q(n)||tn(n)!=Nn)return!1;var t=Be(n);if(t===null)return!0;var e=U.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Ce.call(e)==cl}var yi=hu?hn(hu):pa;function dg(n){return Vf(n)&&n>=-Xn&&n<=Xn}var no=gu?hn(gu):_a;function fr(n){return typeof n=="string"||!S(n)&&q(n)&&tn(n)==Jt}function pn(n){return typeof n=="symbol"||q(n)&&tn(n)==me}var $t=pu?hn(pu):da;function vg(n){return n===o}function wg(n){return q(n)&&k(n)==Xt}function mg(n){return q(n)&&tn(n)==Uo}var xg=Qe(Qr),Ag=Qe(function(n,t){return n<=t});function to(n){if(!n)return[];if(fn(n))return fr(n)?Cn(n):un(n);if(kt&&n[kt])return js(n[kt]());var t=k(n),e=t==Ln?Mr:t==Rn?be:Gt;return e(n)}function Yn(n){if(!n)return n===0?n:0;if(n=bn(n),n===at||n===-at){var t=n<0?-1:1;return t*Lo}return n===n?n:0}function b(n){var t=Yn(n),e=t%1;return t===t?e?t-e:t:0}function eo(n){return n?_t(b(n),0,Dn):0}function bn(n){if(typeof n=="number")return n;if(pn(n))return _e;if(H(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=H(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=xu(n);var e=es.test(n);return e||is.test(n)?Fs(n.slice(2),e?2:8):ts.test(n)?_e:+n}function ro(n){return Fn(n,on(n))}function yg(n){return n?_t(b(n),-Xn,Xn):n===0?n:0}function B(n){return n==null?"":gn(n)}var Ig=Mt(function(n,t){if(le(t)||fn(t)){Fn(t,J(t),n);return}for(var e in t)U.call(t,e)&&re(n,e,t[e])}),io=Mt(function(n,t){Fn(t,on(t),n)}),or=Mt(function(n,t,e,r){Fn(t,on(t),n,r)}),Sg=Mt(function(n,t,e,r){Fn(t,J(t),n,r)}),bg=Kn(qr);function Lg(n,t){var e=Ft(n);return t==null?e:Uu(e,t)}var Rg=R(function(n,t){n=M(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&en(t[0],t[1],i)&&(r=1);++e1),f}),Fn(n,li(n),e),r&&(e=yn(e,an|Di|yt,Wa));for(var i=t.length;i--;)ti(e,t[i]);return e});function zg(n,t){return fo(n,ir(x(t)))}var Zg=Kn(function(n,t){return n==null?{}:ma(n,t)});function fo(n,t){if(n==null)return{};var e=$(li(n),function(r){return[r]});return t=x(t),Qu(n,e,function(r,i){return t(r,i[0])})}function Yg(n,t,e){t=et(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=Ou();return V(n+i*(t-n+Us("1e-"+((i+"").length-1))),t)}return kr(n,t)}var ip=Wt(function(n,t,e){return t=t.toLowerCase(),n+(e?lo(t):t)});function lo(n){return bi(B(n).toLowerCase())}function ao(n){return n=B(n),n&&n.replace(fs,Js).replace(bs,"")}function up(n,t,e){n=B(n),t=gn(t);var r=n.length;e=e===o?r:_t(b(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function fp(n){return n=B(n),n&&$o.test(n)?n.replace($i,Xs):n}function op(n){return n=B(n),n&&Zo.test(n)?n.replace(xr,"\\$&"):n}var sp=Wt(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),lp=Wt(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),ap=gf("toLowerCase");function cp(n,t,e){n=B(n),t=b(t);var r=t?Ot(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Xe(Fe(i),e)+n+Xe(Ue(i),e)}function hp(n,t,e){n=B(n),t=b(t);var r=t?Ot(n):0;return t&&r>>0,e?(n=B(n),n&&(typeof t=="string"||t!=null&&!yi(t))&&(t=gn(t),!t&&Tt(n))?rt(Cn(n),0,e):n.split(t,e)):[]}var mp=Wt(function(n,t,e){return n+(e?" ":"")+bi(t)});function xp(n,t,e){return n=B(n),e=e==null?0:_t(b(e),0,n.length),t=gn(t),n.slice(e,e+t.length)==t}function Ap(n,t,e){var r=u.templateSettings;e&&en(n,t,e)&&(t=o),n=B(n),t=or({},t,r,xf);var i=or({},t.imports,r.imports,xf),f=J(i),s=Fr(i,f),l,c,p=0,_=t.interpolate||xe,d="__p += '",v=Wr((t.escape||xe).source+"|"+_.source+"|"+(_===Gi?ns:xe).source+"|"+(t.evaluate||xe).source+"|$","g"),m="//# sourceURL="+(U.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ts+"]")+` +`)}function Ya(n){return I(n)||mt(n)||!!(Eu&&n&&n[Eu])}function zn(n,t){var e=typeof n;return t=t??Jn,!!t&&(e=="number"||e!="symbol"&&us.test(n))&&n>-1&&n%1==0&&n0){if(++t>=yo)return arguments[0]}else t=0;return n.apply(o,arguments)}}function je(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,Nf(n,e)});function Gf(n){var t=u(n);return t.__chain__=!0,t}function ih(n,t){return t(n),n}function nr(n,t){return t(n)}var uh=Kn(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return qr(f,n)};return t>1||this.__actions__.length||!(r instanceof E)||!zn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:nr,args:[i],thisArg:o}),new An(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function fh(){return Gf(this)}function oh(){return new An(this.value(),this.__chain__)}function sh(){this.__values__===o&&(this.__values__=to(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function lh(){return this}function ah(n){for(var t,e=this;e instanceof $e;){var r=Df(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function ch(){var n=this.__wrapped__;if(n instanceof E){var t=n;return this.__actions__.length&&(t=new E(this)),t=t.reverse(),t.__actions__.push({func:nr,args:[vi],thisArg:o}),new An(t,this.__chain__)}return this.thru(vi)}function hh(){return ef(this.__wrapped__,this.__actions__)}var gh=Ze(function(n,t,e){F.call(n,e)?++n[e]:Hn(n,e,1)});function ph(n,t,e){var r=I(n)?_u:ia;return e&&en(n,t,e)&&(t=o),r(n,x(t,3))}function _h(n,t){var e=I(n)?Qn:$u;return e(n,x(t,3))}var dh=pf(Ff),vh=pf(Uf);function wh(n,t){return Q(tr(n,t),1)}function mh(n,t){return Q(tr(n,t),at)}function xh(n,t,e){return e=e===o?1:b(e),Q(tr(n,t),e)}function Hf(n,t){var e=I(n)?mn:nt;return e(n,x(t,3))}function qf(n,t){var e=I(n)?$s:Mu;return e(n,x(t,3))}var Ah=Ze(function(n,t,e){F.call(n,e)?n[e].push(t):Hn(n,e,[t])});function yh(n,t,e,r){n=fn(n)?n:Gt(n),e=e&&!r?b(e):0;var i=n.length;return e<0&&(e=Y(i+e,0)),fr(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&Et(n,t,e)>-1}var Sh=R(function(n,t,e){var r=-1,i=typeof t=="function",f=fn(n)?h(n.length):[];return nt(n,function(s){f[++r]=i?cn(t,s,e):ue(s,t,e)}),f}),Ih=Ze(function(n,t,e){Hn(n,e,t)});function tr(n,t){var e=I(n)?N:zu;return e(n,x(t,3))}function bh(n,t,e,r){return n==null?[]:(I(t)||(t=t==null?[]:[t]),e=r?o:e,I(e)||(e=e==null?[]:[e]),Ju(n,t,e))}var Lh=Ze(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function Rh(n,t,e){var r=I(n)?Tr:mu,i=arguments.length<3;return r(n,x(t,4),e,i,nt)}function Ch(n,t,e){var r=I(n)?Ns:mu,i=arguments.length<3;return r(n,x(t,4),e,i,Mu)}function Eh(n,t){var e=I(n)?Qn:$u;return e(n,ir(x(t,3)))}function Th(n){var t=I(n)?Du:ya;return t(n)}function Oh(n,t,e){(e?en(n,t,e):t===o)?t=1:t=b(t);var r=I(n)?jl:Sa;return r(n,t)}function Bh(n){var t=I(n)?na:ba;return t(n)}function Ph(n){if(n==null)return 0;if(fn(n))return fr(n)?Ot(n):n.length;var t=k(n);return t==Ln||t==Rn?n.size:Jr(n).length}function Dh(n,t,e){var r=I(n)?Or:La;return e&&en(n,t,e)&&(t=o),r(n,x(t,3))}var Fh=R(function(n,t){if(n==null)return[];var e=t.length;return e>1&&en(n,t[0],t[1])?t=[]:e>2&&en(t[0],t[1],t[2])&&(t=[t[0]]),Ju(n,Q(t,1),[])}),er=_l||function(){return J.Date.now()};function Uh(n,t){if(typeof t!="function")throw new xn(G);return n=b(n),function(){if(--n<1)return t.apply(this,arguments)}}function Kf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,qn(n,Mn,o,o,o,o,t)}function zf(n,t){var e;if(typeof t!="function")throw new xn(G);return n=b(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var mi=R(function(n,t,e){var r=vn;if(e.length){var i=kn(e,$t(mi));r|=Pn}return qn(n,r,t,e,i)}),Zf=R(function(n,t,e){var r=vn|lt;if(e.length){var i=kn(e,$t(Zf));r|=Pn}return qn(t,r,n,e,i)});function Yf(n,t,e){t=e?o:t;var r=qn(n,Bn,o,o,o,o,o,t);return r.placeholder=Yf.placeholder,r}function Xf(n,t,e){t=e?o:t;var r=qn(n,It,o,o,o,o,o,t);return r.placeholder=Xf.placeholder,r}function Jf(n,t,e){var r,i,f,s,l,c,p=0,_=!1,d=!1,v=!0;if(typeof n!="function")throw new xn(G);t=bn(t)||0,H(e)&&(_=!!e.leading,d="maxWait"in e,f=d?Y(bn(e.maxWait)||0,t):f,v="trailing"in e?!!e.trailing:v);function m(z){var On=r,Xn=i;return r=i=o,p=z,s=n.apply(Xn,On),s}function A(z){return p=z,l=ae(C,t),_?m(z):s}function L(z){var On=z-c,Xn=z-p,po=t-On;return d?V(po,f-Xn):po}function y(z){var On=z-c,Xn=z-p;return c===o||On>=t||On<0||d&&Xn>=f}function C(){var z=er();if(y(z))return T(z);l=ae(C,L(z))}function T(z){return l=o,v&&r?m(z):(r=i=o,s)}function _n(){l!==o&&uf(l),p=0,r=c=i=l=o}function rn(){return l===o?s:T(er())}function dn(){var z=er(),On=y(z);if(r=arguments,i=this,c=z,On){if(l===o)return A(c);if(d)return uf(l),l=ae(C,t),m(c)}return l===o&&(l=ae(C,t)),s}return dn.cancel=_n,dn.flush=rn,dn}var Wh=R(function(n,t){return Wu(n,1,t)}),Mh=R(function(n,t,e){return Wu(n,bn(t)||0,e)});function $h(n){return qn(n,ar)}function rr(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new xn(G);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var s=n.apply(this,r);return e.cache=f.set(i,s)||f,s};return e.cache=new(rr.Cache||Gn),e}rr.Cache=Gn;function ir(n){if(typeof n!="function")throw new xn(G);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Nh(n){return zf(2,n)}var Gh=Ra(function(n,t){t=t.length==1&&I(t[0])?N(t[0],hn(x())):N(Q(t,1),hn(x()));var e=t.length;return R(function(r){for(var i=-1,f=V(r.length,e);++i=t}),mt=Hu(function(){return arguments}())?Hu:function(n){return q(n)&&F.call(n,"callee")&&!Cu.call(n,"callee")},I=h.isArray,eg=lu?hn(lu):aa;function fn(n){return n!=null&&ur(n.length)&&!Zn(n)}function K(n){return q(n)&&fn(n)}function rg(n){return n===!0||n===!1||q(n)&&tn(n)==Kt}var it=vl||Oi,ig=au?hn(au):ca;function ug(n){return q(n)&&n.nodeType===1&&!ce(n)}function fg(n){if(n==null)return!0;if(fn(n)&&(I(n)||typeof n=="string"||typeof n.splice=="function"||it(n)||Nt(n)||mt(n)))return!n.length;var t=k(n);if(t==Ln||t==Rn)return!n.size;if(le(n))return!Jr(n).length;for(var e in n)if(F.call(n,e))return!1;return!0}function og(n,t){return fe(n,t)}function sg(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?fe(n,t,o,e):!!r}function Ai(n){if(!q(n))return!1;var t=tn(n);return t==ve||t==Oo||typeof n.message=="string"&&typeof n.name=="string"&&!ce(n)}function lg(n){return typeof n=="number"&&Tu(n)}function Zn(n){if(!H(n))return!1;var t=tn(n);return t==we||t==Wi||t==To||t==Po}function Vf(n){return typeof n=="number"&&n==b(n)}function ur(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Jn}function H(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function q(n){return n!=null&&typeof n=="object"}var kf=cu?hn(cu):ga;function ag(n,t){return n===t||Xr(n,t,ci(t))}function cg(n,t,e){return e=typeof e=="function"?e:o,Xr(n,t,ci(t),e)}function hg(n){return jf(n)&&n!=+n}function gg(n){if(Qa(n))throw new S(nn);return qu(n)}function pg(n){return n===null}function _g(n){return n==null}function jf(n){return typeof n=="number"||q(n)&&tn(n)==Zt}function ce(n){if(!q(n)||tn(n)!=$n)return!1;var t=Be(n);if(t===null)return!0;var e=F.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Ce.call(e)==cl}var yi=hu?hn(hu):pa;function dg(n){return Vf(n)&&n>=-Jn&&n<=Jn}var no=gu?hn(gu):_a;function fr(n){return typeof n=="string"||!I(n)&&q(n)&&tn(n)==Xt}function pn(n){return typeof n=="symbol"||q(n)&&tn(n)==me}var Nt=pu?hn(pu):da;function vg(n){return n===o}function wg(n){return q(n)&&k(n)==Jt}function mg(n){return q(n)&&tn(n)==Fo}var xg=Qe(Qr),Ag=Qe(function(n,t){return n<=t});function to(n){if(!n)return[];if(fn(n))return fr(n)?Cn(n):un(n);if(kt&&n[kt])return js(n[kt]());var t=k(n),e=t==Ln?Wr:t==Rn?be:Gt;return e(n)}function Yn(n){if(!n)return n===0?n:0;if(n=bn(n),n===at||n===-at){var t=n<0?-1:1;return t*Lo}return n===n?n:0}function b(n){var t=Yn(n),e=t%1;return t===t?e?t-e:t:0}function eo(n){return n?_t(b(n),0,Dn):0}function bn(n){if(typeof n=="number")return n;if(pn(n))return _e;if(H(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=H(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=xu(n);var e=es.test(n);return e||is.test(n)?Us(n.slice(2),e?2:8):ts.test(n)?_e:+n}function ro(n){return Un(n,on(n))}function yg(n){return n?_t(b(n),-Jn,Jn):n===0?n:0}function B(n){return n==null?"":gn(n)}var Sg=Wt(function(n,t){if(le(t)||fn(t)){Un(t,X(t),n);return}for(var e in t)F.call(t,e)&&re(n,e,t[e])}),io=Wt(function(n,t){Un(t,on(t),n)}),or=Wt(function(n,t,e,r){Un(t,on(t),n,r)}),Ig=Wt(function(n,t,e,r){Un(t,X(t),n,r)}),bg=Kn(qr);function Lg(n,t){var e=Ut(n);return t==null?e:Fu(e,t)}var Rg=R(function(n,t){n=W(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&en(t[0],t[1],i)&&(r=1);++e1),f}),Un(n,li(n),e),r&&(e=yn(e,an|Di|yt,Ma));for(var i=t.length;i--;)ti(e,t[i]);return e});function zg(n,t){return fo(n,ir(x(t)))}var Zg=Kn(function(n,t){return n==null?{}:ma(n,t)});function fo(n,t){if(n==null)return{};var e=N(li(n),function(r){return[r]});return t=x(t),Qu(n,e,function(r,i){return t(r,i[0])})}function Yg(n,t,e){t=et(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=Ou();return V(n+i*(t-n+Fs("1e-"+((i+"").length-1))),t)}return kr(n,t)}var ip=Mt(function(n,t,e){return t=t.toLowerCase(),n+(e?lo(t):t)});function lo(n){return bi(B(n).toLowerCase())}function ao(n){return n=B(n),n&&n.replace(fs,Xs).replace(bs,"")}function up(n,t,e){n=B(n),t=gn(t);var r=n.length;e=e===o?r:_t(b(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function fp(n){return n=B(n),n&&No.test(n)?n.replace(Ni,Js):n}function op(n){return n=B(n),n&&Zo.test(n)?n.replace(xr,"\\$&"):n}var sp=Mt(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),lp=Mt(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),ap=gf("toLowerCase");function cp(n,t,e){n=B(n),t=b(t);var r=t?Ot(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Je(Ue(i),e)+n+Je(Fe(i),e)}function hp(n,t,e){n=B(n),t=b(t);var r=t?Ot(n):0;return t&&r>>0,e?(n=B(n),n&&(typeof t=="string"||t!=null&&!yi(t))&&(t=gn(t),!t&&Tt(n))?rt(Cn(n),0,e):n.split(t,e)):[]}var mp=Mt(function(n,t,e){return n+(e?" ":"")+bi(t)});function xp(n,t,e){return n=B(n),e=e==null?0:_t(b(e),0,n.length),t=gn(t),n.slice(e,e+t.length)==t}function Ap(n,t,e){var r=u.templateSettings;e&&en(n,t,e)&&(t=o),n=B(n),t=or({},t,r,xf);var i=or({},t.imports,r.imports,xf),f=X(i),s=Ur(i,f),l,c,p=0,_=t.interpolate||xe,d="__p += '",v=Mr((t.escape||xe).source+"|"+_.source+"|"+(_===Gi?ns:xe).source+"|"+(t.evaluate||xe).source+"|$","g"),m="//# sourceURL="+(F.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ts+"]")+` `;n.replace(v,function(y,C,T,_n,rn,dn){return T||(T=_n),d+=n.slice(p,dn).replace(os,Qs),C&&(l=!0,d+=`' + __e(`+C+`) + '`),rn&&(c=!0,d+=`'; @@ -15,13 +15,13 @@ __e(`+C+`) + __p += '`),T&&(d+=`' + ((__t = (`+T+`)) == null ? '' : __t) + '`),p=dn+y.length,y}),d+=`'; -`;var A=U.call(t,"variable")&&t.variable;if(!A)d=`with (obj) { +`;var A=F.call(t,"variable")&&t.variable;if(!A)d=`with (obj) { `+d+` } -`;else if(ko.test(A))throw new I(ft);d=(c?d.replace(Fo,""):d).replace(Mo,"$1").replace(Wo,"$1;"),d="function("+(A||"obj")+`) { +`;else if(ko.test(A))throw new S(ft);d=(c?d.replace(Uo,""):d).replace(Wo,"$1").replace(Mo,"$1;"),d="function("+(A||"obj")+`) { `+(A?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+d+`return __p -}`;var L=ho(function(){return O(f,m+"return "+d).apply(o,s)});if(L.source=d,Ai(L))throw L;return L}function yp(n){return B(n).toLowerCase()}function Ip(n){return B(n).toUpperCase()}function Sp(n,t,e){if(n=B(n),n&&(e||t===o))return xu(n);if(!n||!(t=gn(t)))return n;var r=Cn(n),i=Cn(t),f=Au(r,i),s=yu(r,i)+1;return rt(r,f,s).join("")}function bp(n,t,e){if(n=B(n),n&&(e||t===o))return n.slice(0,Su(n)+1);if(!n||!(t=gn(t)))return n;var r=Cn(n),i=yu(r,Cn(t))+1;return rt(r,0,i).join("")}function Lp(n,t,e){if(n=B(n),n&&(e||t===o))return n.replace(Ar,"");if(!n||!(t=gn(t)))return n;var r=Cn(n),i=Au(r,Cn(t));return rt(r,i).join("")}function Rp(n,t){var e=xo,r=Ao;if(H(t)){var i="separator"in t?t.separator:i;e="length"in t?b(t.length):e,r="omission"in t?gn(t.omission):r}n=B(n);var f=n.length;if(Tt(n)){var s=Cn(n);f=s.length}if(e>=f)return n;var l=e-Ot(r);if(l<1)return r;var c=s?rt(s,0,l).join(""):n.slice(0,l);if(i===o)return c+r;if(s&&(l+=c.length-l),yi(i)){if(n.slice(l).search(i)){var p,_=c;for(i.global||(i=Wr(i.source,B(Hi.exec(i))+"g")),i.lastIndex=0;p=i.exec(_);)var d=p.index;c=c.slice(0,d===o?l:d)}}else if(n.indexOf(gn(i),l)!=l){var v=c.lastIndexOf(i);v>-1&&(c=c.slice(0,v))}return c+r}function Cp(n){return n=B(n),n&&No.test(n)?n.replace(Ni,rl):n}var Ep=Wt(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),bi=gf("toUpperCase");function co(n,t,e){return n=B(n),t=e?o:t,t===o?ks(n)?fl(n):qs(n):n.match(t)||[]}var ho=R(function(n,t){try{return cn(n,o,t)}catch(e){return Ai(e)?e:new I(e)}}),Tp=Kn(function(n,t){return mn(t,function(e){e=Mn(e),Hn(n,e,mi(n[e],n))}),n});function Op(n){var t=n==null?0:n.length,e=x();return n=t?$(n,function(r){if(typeof r[1]!="function")throw new xn(G);return[e(r[0]),r[1]]}):[],R(function(r){for(var i=-1;++iXn)return[];var e=Dn,r=V(n,Dn);t=x(t),n-=Dn;for(var i=Ur(r,t);++e0||t<0)?new E(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=b(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},E.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},E.prototype.toArray=function(){return this.take(Dn)},Un(E.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var s=this.__wrapped__,l=r?[1]:arguments,c=s instanceof E,p=l[0],_=c||S(s),d=function(C){var T=i.apply(u,Vn([C],l));return r&&v?T[0]:T};_&&e&&typeof p=="function"&&p.length!=1&&(c=_=!1);var v=this.__chain__,m=!!this.__actions__.length,A=f&&!v,L=c&&!m;if(!f&&_){s=L?s:new E(this);var y=n.apply(s,l);return y.__actions__.push({func:nr,args:[d],thisArg:o}),new An(y,v)}return A&&L?n.apply(this,l):(y=this.thru(d),A?r?y.value()[0]:y.value():y)})}),mn(["pop","push","shift","sort","splice","unshift"],function(n){var t=Le[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(S(f)?f:[],i)}return this[e](function(s){return t.apply(S(s)?s:[],i)})}}),Un(E.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";U.call(Ut,r)||(Ut[r]=[]),Ut[r].push({name:t,func:e})}}),Ut[Ye(o,lt).name]=[{name:"wrapper",func:o}],E.prototype.clone=Cl,E.prototype.reverse=El,E.prototype.value=Tl,u.prototype.at=uh,u.prototype.chain=fh,u.prototype.commit=oh,u.prototype.next=sh,u.prototype.plant=ah,u.prototype.reverse=ch,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=hh,u.prototype.first=u.prototype.head,kt&&(u.prototype[kt]=lh),u},Bt=ol();ct?((ct.exports=Bt)._=Bt,Rr._=Bt):X._=Bt}).call(he)})(sr,sr.exports);var O_=sr.exports;const B_=v_(O_),P_={props:["imgUrl","isFirst","isLast"],data(){return{url:"",imgLoadStatus:!1}},methods:{onImageLoad(){this.imgLoadStatus=!0}}},D_={class:"px-10 py-8 d-flex align-items-center justify-content-between border-bottom border-dark-pr"},U_={class:"placeholder-glow"},F_=["src"],M_={class:"d-flex align-items-center"},W_=["disabled"],N_=P("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"14",fill:"none",viewBox:"0 0 24 14"},[P("path",{fill:"currentColor","fill-rule":"evenodd",d:"M.82.821a1.668 1.668 0 0 1 2.357 0L12 9.643 20.82.82a1.667 1.667 0 1 1 2.357 2.357l-10 10a1.666 1.666 0 0 1-2.357 0l-10-10A1.667 1.667 0 0 1 .82.82Z","clip-rule":"evenodd"})],-1),$_=[N_],G_=["disabled"],H_=P("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"14",fill:"none",viewBox:"0 0 24 14"},[P("path",{fill:"currentColor","fill-rule":"evenodd",d:"M10.82.821a1.668 1.668 0 0 1 2.357 0l10 10a1.667 1.667 0 1 1-2.357 2.357L12 4.357l-8.822 8.821A1.667 1.667 0 1 1 .82 10.821l10-10Z","clip-rule":"evenodd"})],-1),q_=[H_];function K_(D,F,o,At,j,nn){return ut(),Ht("div",D_,[P("div",U_,[P("img",{src:o.imgUrl,alt:"Banner圖片",ref:"image",class:_o(["mw-100 object-fit-cover",{"d-none":!j.imgLoadStatus}]),height:"130",width:"196",onLoad:F[0]||(F[0]=(...G)=>nn.onImageLoad&&nn.onImageLoad(...G))},null,42,F_),P("div",{class:_o(["placeholder bg-primary",{"d-none":j.imgLoadStatus}]),style:{height:"130px",width:"196px"}},null,2)]),P("div",M_,[P("button",{class:"btn btn-outline-dark-pr px-2 px-md-17 py-5",type:"button",onClick:F[1]||(F[1]=G=>this.$emit("remove"))},"移除照片"),P("button",{class:"btn btn-dark-pr p-5 ms-7 l-IconHoverEffect",type:"button",onClick:F[2]||(F[2]=G=>this.$emit("move-down")),disabled:o.isLast},$_,8,W_),P("button",{class:"btn btn-dark-pr p-5 ms-3 l-IconHoverEffect",type:"button",onClick:F[3]||(F[3]=G=>this.$emit("move-up")),disabled:o.isFirst},q_,8,G_)])])}const z_=lr(P_,[["render",K_]]),Z_={},Y_={xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},J_=P("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M24.5 20.352c0 .481-.201.943-.56 1.283a1.96 1.96 0 0 1-1.35.532H5.41a1.96 1.96 0 0 1-1.35-.532 1.77 1.77 0 0 1-.56-1.283V10.37c0-.481.201-.943.56-1.283a1.96 1.96 0 0 1 1.35-.532h3.817l1.91-2.722h5.727l1.909 2.722h3.818c.506 0 .992.192 1.35.532.358.34.559.802.559 1.283v9.982Z"},null,-1),X_=P("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14 18.667a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"},null,-1),Q_=[J_,X_];function V_(D,F){return ut(),Ht("svg",Y_,Q_)}const k_=lr(Z_,[["render",V_]]),j_={props:["bannerData"],data(){return{modules:[w_,m_],bnData:[],EffectFade:x_}},methods:{onSlideChange(){}},components:{RightArrow:E_,Swiper:A_,SwiperSlide:y_},mounted(){},created(){}},nd=D=>(S_("data-v-b93dd1f7"),D=D(),b_(),D),td={class:"container py-15"},ed={class:"rounded-5"},rd={class:"d-flex flex-column justify-content-center align-items-center"},id=["src"],ud={class:"bg-primary-dark col-12 py-7 rounded-bottom-5 position-absolute bottom-0"},fd={class:"text-secondary-light text-center lterSpc-10 mb-0 mx-8 bn-hover"},od=nd(()=>P("div",{class:"d-flex flex-column align-items-center position-absolute top-24 top-sm-24 px-10"},[P("img",{src:T_,class:"img-fluid mb-5 col-12",alt:""}),P("p",{class:"fs-3 fw-light text-white mb-0 lterSpc-10"},"推動夢想不是夢 !")],-1));function sd(D,F,o,At,j,nn){const G=xt("RightArrow"),ft=xt("RouterLink"),ot=xt("swiper-slide"),st=xt("swiper");return ut(),Ht("div",td,[ge(st,{ref:"swiper",modules:[j.EffectFade],effect:"fade","slides-per-view":3,"space-between":120,"centered-slides":!0,breakpoints:{390:{slidesPerView:1}},autoplay:{delay:5e3,disableOnInteraction:!1},onSwiperslidechange:nn.onSlideChange,class:"rounded-5 col-12 object-fit-cover",style:{height:"650px"}},{default:Bi(()=>[(ut(!0),Ht(vo,null,wo(o.bannerData,(ln,an)=>(ut(),mo(ot,{key:`${an}-bn`},{default:Bi(()=>[P("div",ed,[P("div",rd,[ge(ft,{to:"/member",class:"position-relative col-12 rounded-5 shadow"},{default:Bi(()=>[P("img",{src:ln.imgUrl,class:"img-fluid rounded-5 w-100 object-fit-cover",style:{height:"650px"},alt:"推動夢想不是夢概念圖"},null,8,id),P("div",ud,[P("h4",fd,[I_(" 立刻加入會員,一起追夢去 "),P("span",null,[ge(G,{style:{width:"24px",color:"var(--bs-secondary-light)","margin-top":"-2 px"}})])])])]),_:2},1024),od])])]),_:2},1024))),128))]),_:1},8,["modules","onSwiperslidechange"])])}const ld=lr(j_,[["render",sd],["__scopeId","data-v-b93dd1f7"]]);var ad={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:Pi}=ad,cd={data(){return{bannerAry:[]}},methods:{getBannerData(){this.showFullScreenLoading({canCancel:!1,loader:"dots"}),this.$http.get("https://api.dreamboost.shop/dreamboost/banner/guest/banner").then(F=>{this.bannerAry=F.data.data.result,this.hideFullScreenLoading(),this.addToast({content:"取得Banner圖片資料完成。"})}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"取得Banner圖片過程出現錯誤。",style:"error"})})},updateBannerDataDebounced:B_.debounce(function(){this.updateBannerDataImmediate()},1e3),updateBannerDataImmediate(){this.showFullScreenLoading({canCancel:!1,loader:"dots"});const D=`${Pi}/dreamboost/banner/admin/banner`;this.$http.post(D,{bannerUrlArray:this.bannerAry}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"已更新首頁Banner圖片",style:"success"}),this.getBannerData()}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"更新或上傳圖片過程出現錯誤",style:"warning"})})},removePhoto(D){L_.fire({title:"確認移除?",icon:"warning",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(F=>{F.isConfirmed&&(this.bannerAry.splice(D,1),this.updateBannerDataImmediate())})},movePhotoUp(D){if(D>0){const F=this.bannerAry[D];this.bannerAry.splice(D,1),this.bannerAry.splice(D-1,0,F)}this.updateBannerDataDebounced()},movePhotoDown(D){if(D{const j=At.target.files[0],nn=new FormData;nn.append("image",j),this.showFullScreenLoading({canCancel:!1,style:"dots"}),this.$http.post(D,nn).then(G=>{const ft={imgUrl:G.data.data.result,orderBy:this.bannerAry.length+1};return this.$http.post(F,{bannerUrlArray:[...this.bannerAry,ft]})}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"上傳圖片完成。"}),this.getBannerData()}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"過程出現錯誤,請重新整理",style:"error"})})}),o.click()},onImageLoad(){this.imgLoadStatus=!0}},components:{UpdateBannerImgCard:z_,CameraIcon:k_,RealtimeBannerPreview:ld},mounted(){this.getBannerData()},mixins:[d_,__]},hd={class:"container mt-20"},gd={class:"row"},pd={class:"col-12"},_d=P("p",{class:"text-white text-center fs-3 mb-0"},"即時預覽",-1),dd={class:"row justify-content-center mt-21"},vd={class:"col-12 col-lg-10"},wd={class:"px-10 text-end"},md=P("span",{class:"ms-2"},"新增封面照片",-1);function xd(D,F,o,At,j,nn){const G=xt("RealtimeBannerPreview"),ft=xt("UpdateBannerImgCard"),ot=xt("CameraIcon");return ut(),Ht("div",hd,[P("div",gd,[P("div",pd,[_d,ge(G,{"banner-data":j.bannerAry},null,8,["banner-data"])])]),P("div",dd,[P("div",vd,[j.bannerAry?(ut(!0),Ht(vo,{key:0},wo(j.bannerAry,(st,ln)=>(ut(),mo(ft,{key:`${ln}-img`,"img-url":st.imgUrl,"is-first":ln===0,"is-last":ln===j.bannerAry.length-1,onRemove:an=>nn.removePhoto(ln),onMoveUp:an=>nn.movePhotoUp(ln),onMoveDown:an=>nn.movePhotoDown(ln)},null,8,["img-url","is-first","is-last","onRemove","onMoveUp","onMoveDown"]))),128)):R_("",!0),P("div",wd,[P("button",{type:"button",href:"#",class:"btn btn-dark-pr mt-9 ms-auto py-5 px-11",onClick:F[0]||(F[0]=C_((...st)=>nn.uploadNewPicture&&nn.uploadNewPicture(...st),["prevent"]))},[ge(ot,{width:"28",height:"28"}),md])])])])])}const Rd=lr(cd,[["render",xd]]);export{Rd as default}; +}`;var L=ho(function(){return O(f,m+"return "+d).apply(o,s)});if(L.source=d,Ai(L))throw L;return L}function yp(n){return B(n).toLowerCase()}function Sp(n){return B(n).toUpperCase()}function Ip(n,t,e){if(n=B(n),n&&(e||t===o))return xu(n);if(!n||!(t=gn(t)))return n;var r=Cn(n),i=Cn(t),f=Au(r,i),s=yu(r,i)+1;return rt(r,f,s).join("")}function bp(n,t,e){if(n=B(n),n&&(e||t===o))return n.slice(0,Iu(n)+1);if(!n||!(t=gn(t)))return n;var r=Cn(n),i=yu(r,Cn(t))+1;return rt(r,0,i).join("")}function Lp(n,t,e){if(n=B(n),n&&(e||t===o))return n.replace(Ar,"");if(!n||!(t=gn(t)))return n;var r=Cn(n),i=Au(r,Cn(t));return rt(r,i).join("")}function Rp(n,t){var e=xo,r=Ao;if(H(t)){var i="separator"in t?t.separator:i;e="length"in t?b(t.length):e,r="omission"in t?gn(t.omission):r}n=B(n);var f=n.length;if(Tt(n)){var s=Cn(n);f=s.length}if(e>=f)return n;var l=e-Ot(r);if(l<1)return r;var c=s?rt(s,0,l).join(""):n.slice(0,l);if(i===o)return c+r;if(s&&(l+=c.length-l),yi(i)){if(n.slice(l).search(i)){var p,_=c;for(i.global||(i=Mr(i.source,B(Hi.exec(i))+"g")),i.lastIndex=0;p=i.exec(_);)var d=p.index;c=c.slice(0,d===o?l:d)}}else if(n.indexOf(gn(i),l)!=l){var v=c.lastIndexOf(i);v>-1&&(c=c.slice(0,v))}return c+r}function Cp(n){return n=B(n),n&&$o.test(n)?n.replace($i,rl):n}var Ep=Mt(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),bi=gf("toUpperCase");function co(n,t,e){return n=B(n),t=e?o:t,t===o?ks(n)?fl(n):qs(n):n.match(t)||[]}var ho=R(function(n,t){try{return cn(n,o,t)}catch(e){return Ai(e)?e:new S(e)}}),Tp=Kn(function(n,t){return mn(t,function(e){e=Wn(e),Hn(n,e,mi(n[e],n))}),n});function Op(n){var t=n==null?0:n.length,e=x();return n=t?N(n,function(r){if(typeof r[1]!="function")throw new xn(G);return[e(r[0]),r[1]]}):[],R(function(r){for(var i=-1;++iJn)return[];var e=Dn,r=V(n,Dn);t=x(t),n-=Dn;for(var i=Fr(r,t);++e0||t<0)?new E(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=b(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},E.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},E.prototype.toArray=function(){return this.take(Dn)},Fn(E.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var s=this.__wrapped__,l=r?[1]:arguments,c=s instanceof E,p=l[0],_=c||I(s),d=function(C){var T=i.apply(u,Vn([C],l));return r&&v?T[0]:T};_&&e&&typeof p=="function"&&p.length!=1&&(c=_=!1);var v=this.__chain__,m=!!this.__actions__.length,A=f&&!v,L=c&&!m;if(!f&&_){s=L?s:new E(this);var y=n.apply(s,l);return y.__actions__.push({func:nr,args:[d],thisArg:o}),new An(y,v)}return A&&L?n.apply(this,l):(y=this.thru(d),A?r?y.value()[0]:y.value():y)})}),mn(["pop","push","shift","sort","splice","unshift"],function(n){var t=Le[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(I(f)?f:[],i)}return this[e](function(s){return t.apply(I(s)?s:[],i)})}}),Fn(E.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";F.call(Ft,r)||(Ft[r]=[]),Ft[r].push({name:t,func:e})}}),Ft[Ye(o,lt).name]=[{name:"wrapper",func:o}],E.prototype.clone=Cl,E.prototype.reverse=El,E.prototype.value=Tl,u.prototype.at=uh,u.prototype.chain=fh,u.prototype.commit=oh,u.prototype.next=sh,u.prototype.plant=ah,u.prototype.reverse=ch,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=hh,u.prototype.first=u.prototype.head,kt&&(u.prototype[kt]=lh),u},Bt=ol();ct?((ct.exports=Bt)._=Bt,Rr._=Bt):J._=Bt}).call(he)})(sr,sr.exports);var O_=sr.exports;const B_=v_(O_),P_={props:["imgUrl","isFirst","isLast"],data(){return{url:"",imgLoadStatus:!1}},methods:{onImageLoad(){this.imgLoadStatus=!0}}},D_={class:"px-10 py-8 d-flex align-items-center justify-content-between border-bottom border-dark-pr"},F_={class:"placeholder-glow"},U_=["src"],W_={class:"d-flex align-items-center"},M_=["disabled"],$_=P("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"14",fill:"none",viewBox:"0 0 24 14"},[P("path",{fill:"currentColor","fill-rule":"evenodd",d:"M.82.821a1.668 1.668 0 0 1 2.357 0L12 9.643 20.82.82a1.667 1.667 0 1 1 2.357 2.357l-10 10a1.666 1.666 0 0 1-2.357 0l-10-10A1.667 1.667 0 0 1 .82.82Z","clip-rule":"evenodd"})],-1),N_=[$_],G_=["disabled"],H_=P("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"14",fill:"none",viewBox:"0 0 24 14"},[P("path",{fill:"currentColor","fill-rule":"evenodd",d:"M10.82.821a1.668 1.668 0 0 1 2.357 0l10 10a1.667 1.667 0 1 1-2.357 2.357L12 4.357l-8.822 8.821A1.667 1.667 0 1 1 .82 10.821l10-10Z","clip-rule":"evenodd"})],-1),q_=[H_];function K_(D,U,o,At,j,nn){return ut(),Ht("div",D_,[P("div",F_,[P("img",{src:o.imgUrl,alt:"Banner圖片",ref:"image",class:_o(["mw-100 object-fit-cover",{"d-none":!j.imgLoadStatus}]),height:"130",width:"196",onLoad:U[0]||(U[0]=(...G)=>nn.onImageLoad&&nn.onImageLoad(...G))},null,42,U_),P("div",{class:_o(["placeholder bg-primary",{"d-none":j.imgLoadStatus}]),style:{height:"130px",width:"196px"}},null,2)]),P("div",W_,[P("button",{class:"btn btn-outline-dark-pr px-2 px-md-17 py-5",type:"button",onClick:U[1]||(U[1]=G=>this.$emit("remove"))},"移除照片"),P("button",{class:"btn btn-dark-pr p-5 ms-7 l-IconHoverEffect",type:"button",onClick:U[2]||(U[2]=G=>this.$emit("move-down")),disabled:o.isLast},N_,8,M_),P("button",{class:"btn btn-dark-pr p-5 ms-3 l-IconHoverEffect",type:"button",onClick:U[3]||(U[3]=G=>this.$emit("move-up")),disabled:o.isFirst},q_,8,G_)])])}const z_=lr(P_,[["render",K_]]),Z_={},Y_={xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none",viewBox:"0 0 28 28"},X_=P("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M24.5 20.352c0 .481-.201.943-.56 1.283a1.96 1.96 0 0 1-1.35.532H5.41a1.96 1.96 0 0 1-1.35-.532 1.77 1.77 0 0 1-.56-1.283V10.37c0-.481.201-.943.56-1.283a1.96 1.96 0 0 1 1.35-.532h3.817l1.91-2.722h5.727l1.909 2.722h3.818c.506 0 .992.192 1.35.532.358.34.559.802.559 1.283v9.982Z"},null,-1),J_=P("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14 18.667a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z"},null,-1),Q_=[X_,J_];function V_(D,U){return ut(),Ht("svg",Y_,Q_)}const k_=lr(Z_,[["render",V_]]),j_={props:["bannerData"],data(){return{modules:[w_,m_],bnData:[],EffectFade:x_}},methods:{onSlideChange(){}},components:{RightArrow:E_,Swiper:A_,SwiperSlide:y_},mounted(){},created(){}},nd=D=>(I_("data-v-b93dd1f7"),D=D(),b_(),D),td={class:"container py-15"},ed={class:"rounded-5"},rd={class:"d-flex flex-column justify-content-center align-items-center"},id=["src"],ud={class:"bg-primary-dark col-12 py-7 rounded-bottom-5 position-absolute bottom-0"},fd={class:"text-secondary-light text-center lterSpc-10 mb-0 mx-8 bn-hover"},od=nd(()=>P("div",{class:"d-flex flex-column align-items-center position-absolute top-24 top-sm-24 px-10"},[P("img",{src:T_,class:"img-fluid mb-5 col-12",alt:""}),P("p",{class:"fs-3 fw-light text-white mb-0 lterSpc-10"},"推動夢想不是夢 !")],-1));function sd(D,U,o,At,j,nn){const G=xt("RightArrow"),ft=xt("RouterLink"),ot=xt("swiper-slide"),st=xt("swiper");return ut(),Ht("div",td,[ge(st,{ref:"swiper",modules:[j.EffectFade],effect:"fade","slides-per-view":3,"space-between":120,"centered-slides":!0,breakpoints:{390:{slidesPerView:1}},autoplay:{delay:5e3,disableOnInteraction:!1},onSwiperslidechange:nn.onSlideChange,class:"rounded-5 col-12 object-fit-cover",style:{height:"650px"}},{default:Bi(()=>[(ut(!0),Ht(vo,null,wo(o.bannerData,(ln,an)=>(ut(),mo(ot,{key:`${an}-bn`},{default:Bi(()=>[P("div",ed,[P("div",rd,[ge(ft,{to:"/member",class:"position-relative col-12 rounded-5 shadow"},{default:Bi(()=>[P("img",{src:ln.imgUrl,class:"img-fluid rounded-5 w-100 object-fit-cover",style:{height:"650px"},alt:"推動夢想不是夢概念圖"},null,8,id),P("div",ud,[P("h4",fd,[S_(" 立刻加入會員,一起追夢去 "),P("span",null,[ge(G,{style:{width:"24px",color:"var(--bs-secondary-light)","margin-top":"-2 px"}})])])])]),_:2},1024),od])])]),_:2},1024))),128))]),_:1},8,["modules","onSwiperslidechange"])])}const ld=lr(j_,[["render",sd],["__scopeId","data-v-b93dd1f7"]]);var ad={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:Pi}=ad,cd={data(){return{bannerAry:[]}},methods:{getBannerData(){this.showFullScreenLoading({canCancel:!1,loader:"dots"}),this.$http.get("https://api.dreamboost.shop/dreamboost/banner/guest/banner").then(U=>{this.bannerAry=U.data.data.result,this.hideFullScreenLoading(),this.addToast({content:"取得Banner圖片資料完成。"})}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"取得Banner圖片過程出現錯誤。",style:"error"})})},updateBannerDataDebounced:B_.debounce(function(){this.updateBannerDataImmediate()},1e3),updateBannerDataImmediate(){this.showFullScreenLoading({canCancel:!1,loader:"dots"});const D=`${Pi}/dreamboost/banner/admin/banner`;this.$http.post(D,{bannerUrlArray:this.bannerAry}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"已更新首頁Banner圖片",style:"success"}),this.getBannerData()}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"更新或上傳圖片過程出現錯誤",style:"warning"})})},removePhoto(D){L_.fire({title:"確認移除?",icon:"warning",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(U=>{U.isConfirmed&&(this.bannerAry.splice(D,1),this.updateBannerDataImmediate())})},movePhotoUp(D){if(D>0){const U=this.bannerAry[D];this.bannerAry.splice(D,1),this.bannerAry.splice(D-1,0,U)}this.updateBannerDataDebounced()},movePhotoDown(D){if(D{const j=At.target.files[0],nn=new FormData;nn.append("image",j),this.showFullScreenLoading({canCancel:!1,style:"dots"}),this.$http.post(D,nn).then(G=>{const ft={imgUrl:G.data.data.result,orderBy:this.bannerAry.length+1};return this.$http.post(U,{bannerUrlArray:[...this.bannerAry,ft]})}).then(()=>{this.hideFullScreenLoading(),this.addToast({content:"上傳圖片完成。"}),this.getBannerData()}).catch(()=>{this.hideFullScreenLoading(),this.addToast({content:"過程出現錯誤,請重新整理",style:"error"})})}),o.click()},onImageLoad(){this.imgLoadStatus=!0}},components:{UpdateBannerImgCard:z_,CameraIcon:k_,RealtimeBannerPreview:ld},mounted(){this.getBannerData()},mixins:[d_,__]},hd={class:"container mt-20"},gd={class:"row"},pd={class:"col-12"},_d=P("p",{class:"text-white text-center fs-3 mb-0"},"即時預覽",-1),dd={class:"row justify-content-center mt-21"},vd={class:"col-12 col-lg-10"},wd={class:"px-10 text-end"},md=P("span",{class:"ms-2"},"新增封面照片",-1);function xd(D,U,o,At,j,nn){const G=xt("RealtimeBannerPreview"),ft=xt("UpdateBannerImgCard"),ot=xt("CameraIcon");return ut(),Ht("div",hd,[P("div",gd,[P("div",pd,[_d,ge(G,{"banner-data":j.bannerAry},null,8,["banner-data"])])]),P("div",dd,[P("div",vd,[j.bannerAry?(ut(!0),Ht(vo,{key:0},wo(j.bannerAry,(st,ln)=>(ut(),mo(ft,{key:`${ln}-img`,"img-url":st.imgUrl,"is-first":ln===0,"is-last":ln===j.bannerAry.length-1,onRemove:an=>nn.removePhoto(ln),onMoveUp:an=>nn.movePhotoUp(ln),onMoveDown:an=>nn.movePhotoDown(ln)},null,8,["img-url","is-first","is-last","onRemove","onMoveUp","onMoveDown"]))),128)):R_("",!0),P("div",wd,[P("button",{type:"button",href:"#",class:"btn btn-dark-pr mt-9 ms-auto py-5 px-11",onClick:U[0]||(U[0]=C_((...st)=>nn.uploadNewPicture&&nn.uploadNewPicture(...st),["prevent"]))},[ge(ot,{width:"28",height:"28"}),md])])])])])}const Rd=lr(cd,[["render",xd]]);export{Rd as default}; diff --git a/assets/AdministratorIcon-_MZnotyN.js b/assets/AdministratorIcon-Ukv12rhY.js similarity index 97% rename from assets/AdministratorIcon-_MZnotyN.js rename to assets/AdministratorIcon-Ukv12rhY.js index 4fe0797..0e7955d 100644 --- a/assets/AdministratorIcon-_MZnotyN.js +++ b/assets/AdministratorIcon-Ukv12rhY.js @@ -1 +1 @@ -import{_ as c,o as a,c as t,l as e}from"./index-ZKny8dII.js";const l={},o={xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",fill:"none",viewBox:"0 0 45 45"},s=e('',3),i=[s];function r(h,n){return a(),t("svg",o,i)}const f=c(l,[["render",r]]);export{f as L}; +import{_ as c,o as a,c as t,l as e}from"./index-sWoFWHUv.js";const l={},o={xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",fill:"none",viewBox:"0 0 45 45"},s=e('',3),i=[s];function r(h,n){return a(),t("svg",o,i)}const f=c(l,[["render",r]]);export{f as L}; diff --git a/assets/CameraIcon-_QaDyJKU.js b/assets/CameraIcon-_QaDyJKU.js new file mode 100644 index 0000000..3a74806 --- /dev/null +++ b/assets/CameraIcon-_QaDyJKU.js @@ -0,0 +1 @@ +import{s as m}from"./sweetAlert2Store-M-KFz2Pq.js";import{_ as d,o as l,c as p,a as _}from"./index-sWoFWHUv.js";var h={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{successAlert:f}=m(),v={methods:{async uploadImage(o){var s;let t="";const{VITE_URL:c}=h;try{const e=(s=document.cookie.split("; ").find(i=>i.startsWith("db")))==null?void 0:s.split("=")[1];this.$http.defaults.headers.common.Authorization=e;const n=o.target.files[0],a=new FormData;a.append("image",n);const r=await this.$http.post(`${c}/dreamboost/upload`,a);t=r.data.data.result,f(r.data.message)}catch(e){throw new Error(e)}return t}}},u={},w={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},g=_("path",{d:"M149.1 64.8L138.7 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H373.3L362.9 64.8C356.4 45.2 338.1 32 317.4 32H194.6c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z",fill:"currentColor"},null,-1),E=[g];function x(o,t){return l(),p("svg",w,E)}const C=d(u,[["render",x]]);export{C,v as m}; diff --git a/assets/CameraIcon-zd3qWGoZ.js b/assets/CameraIcon-zd3qWGoZ.js deleted file mode 100644 index 789ab47..0000000 --- a/assets/CameraIcon-zd3qWGoZ.js +++ /dev/null @@ -1 +0,0 @@ -import{s as m}from"./sweetAlert2Store-vFUo6cdB.js";import{_ as l,o as d,c as p,a as _}from"./index-ZKny8dII.js";var h={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{successAlert:I}=m(),U={methods:{async uploadImage(o){var s;let t="";const{VITE_URL:r}=h;try{const e=(s=document.cookie.split("; ").find(i=>i.startsWith("db")))==null?void 0:s.split("=")[1];this.$http.defaults.headers.common.Authorization=e;const n=o.target.files[0],a=new FormData;a.append("image",n);const c=await this.$http.post(`${r}/dreamboost/upload`,a);t=c.data.data.result,I(c.data.message)}catch(e){throw new Error(e)}return t}}},f={},M={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},u=_("path",{d:"M149.1 64.8L138.7 96H64C28.7 96 0 124.7 0 160V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H373.3L362.9 64.8C356.4 45.2 338.1 32 317.4 32H194.6c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z",fill:"currentColor"},null,-1),E=[u];function k(o,t){return d(),p("svg",M,E)}const V=l(f,[["render",k]]);export{V as C,U as m}; diff --git a/assets/CheckIcon-p907IZ-C.js b/assets/CheckIcon-mXt6_GXv.js similarity index 86% rename from assets/CheckIcon-p907IZ-C.js rename to assets/CheckIcon-mXt6_GXv.js index 7dc3066..42884c2 100644 --- a/assets/CheckIcon-p907IZ-C.js +++ b/assets/CheckIcon-mXt6_GXv.js @@ -1 +1 @@ -import{_ as c,o as e,c as o,a as s}from"./index-ZKny8dII.js";const t={},n={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"bi bi-check-lg",viewBox:"0 0 16 16"},a=s("path",{d:"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z"},null,-1),r=[a];function _(l,i){return e(),o("svg",n,r)}const d=c(t,[["render",_]]);export{d as C}; +import{_ as c,o as e,c as o,a as s}from"./index-sWoFWHUv.js";const t={},n={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"bi bi-check-lg",viewBox:"0 0 16 16"},a=s("path",{d:"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z"},null,-1),r=[a];function _(l,i){return e(),o("svg",n,r)}const d=c(t,[["render",_]]);export{d as C}; diff --git a/assets/CuponCircle-uEjuryuY.js b/assets/CuponCircle-nhWP3onZ.js similarity index 85% rename from assets/CuponCircle-uEjuryuY.js rename to assets/CuponCircle-nhWP3onZ.js index f12192f..e53fd09 100644 --- a/assets/CuponCircle-uEjuryuY.js +++ b/assets/CuponCircle-nhWP3onZ.js @@ -1 +1 @@ -import{_ as e,o as s,j as c,w as n,a as t,d as i}from"./index-ZKny8dII.js";const r="/DreamBoost/images/home/circle_color.svg",a={},l=t("img",{src:r,class:"img-fluid cuponcircle position-absolute top-10 start-0",alt:"加入會員宣傳效果"},null,-1),p=t("div",{class:"bg-primary rounded-circle d-flex flex-column justify-content-center align-items-center position-absolute top-30 start-18",style:{width:"76px",height:"76px","margin-left":"2px","margin-top":"-2px"}},[t("p",{class:"fs-6 text-secondary-light lh-0 mb-0"},"立即領"),t("h3",{class:"fs-bold fs-28 text-secondary-light mb-0"},"100")],-1);function m(d,_){const o=i("RouterLink");return s(),c(o,{to:"/member",class:"cupon-hover position-absolute bottom-10 start-80 d-none d-md-block",style:{width:"120px",height:"120px",display:"block"}},{default:n(()=>[l,p]),_:1})}const u=e(a,[["render",m]]);export{u as C}; +import{_ as e,o as s,j as c,w as n,a as t,d as i}from"./index-sWoFWHUv.js";const r="/DreamBoost/images/home/circle_color.svg",a={},l=t("img",{src:r,class:"img-fluid cuponcircle position-absolute top-10 start-0",alt:"加入會員宣傳效果"},null,-1),p=t("div",{class:"bg-primary rounded-circle d-flex flex-column justify-content-center align-items-center position-absolute top-30 start-18",style:{width:"76px",height:"76px","margin-left":"2px","margin-top":"-2px"}},[t("p",{class:"fs-6 text-secondary-light lh-0 mb-0"},"立即領"),t("h3",{class:"fs-bold fs-28 text-secondary-light mb-0"},"100")],-1);function m(d,_){const o=i("RouterLink");return s(),c(o,{to:"/member",class:"cupon-hover position-absolute bottom-10 start-80 d-none d-md-block",style:{width:"120px",height:"120px",display:"block"}},{default:n(()=>[l,p]),_:1})}const u=e(a,[["render",m]]);export{u as C}; diff --git a/assets/DashboardFooter--gNTGxaO.js b/assets/DashboardFooter-jm-kNJ3_.js similarity index 99% rename from assets/DashboardFooter--gNTGxaO.js rename to assets/DashboardFooter-jm-kNJ3_.js index 536d8e4..65803a8 100644 --- a/assets/DashboardFooter--gNTGxaO.js +++ b/assets/DashboardFooter-jm-kNJ3_.js @@ -1 +1 @@ -import{_ as t,o as e,c as s,l as a,a as C,b as c,e as r,d as h}from"./index-ZKny8dII.js";const l={},d={width:"253",height:"96",viewBox:"0 0 253 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H=a('',11),n=[H];function p(i,o){return e(),s("svg",d,n)}const P=t(l,[["render",p]]),m={},k={width:"126",height:"32",viewBox:"0 0 126 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V=a('',2),_=[V];function M(i,o){return e(),s("svg",k,_)}const L=t(m,[["render",M]]),Z={data(){return{}},methods:{},components:{AdminLogoSM:L}},w={class:"bg-gray-800"},b={class:"container"},g={class:"row justify-content-center"},x={class:"col-10 col-sm-12"},v={class:"py-2 py-md-10"},$={class:"border-bottom text-center border-gray-500"},u=C("div",{class:"pt-2 pt-md-7"},[C("p",{class:"fs-14 fs-md-5 text-center text-gray-400 mb-1"},[r("Copyright ©2024 DreamBoost. "),C("br",{class:"d-md-none"}),r(" All rights reserve")]),C("p",{class:"text-center text-gray-400 mb-0 fs-10"},"本專題僅為學習用途,不做任何商業使用 , 圖片來源請見 Readme")],-1);function y(i,o,B,A,N,S){const f=h("AdminLogoSM");return e(),s("footer",w,[C("div",b,[C("div",g,[C("div",x,[C("div",v,[C("div",$,[c(f,{class:"mb-md-8"})]),u])])])])])}const j=t(Z,[["render",y]]);export{j as D,P as L}; +import{_ as t,o as e,c as s,l as a,a as C,b as c,e as r,d as h}from"./index-sWoFWHUv.js";const l={},d={width:"253",height:"96",viewBox:"0 0 253 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H=a('',11),n=[H];function p(i,o){return e(),s("svg",d,n)}const P=t(l,[["render",p]]),m={},k={width:"126",height:"32",viewBox:"0 0 126 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V=a('',2),_=[V];function M(i,o){return e(),s("svg",k,_)}const L=t(m,[["render",M]]),Z={data(){return{}},methods:{},components:{AdminLogoSM:L}},w={class:"bg-gray-800"},b={class:"container"},g={class:"row justify-content-center"},x={class:"col-10 col-sm-12"},v={class:"py-2 py-md-10"},$={class:"border-bottom text-center border-gray-500"},u=C("div",{class:"pt-2 pt-md-7"},[C("p",{class:"fs-14 fs-md-5 text-center text-gray-400 mb-1"},[r("Copyright ©2024 DreamBoost. "),C("br",{class:"d-md-none"}),r(" All rights reserve")]),C("p",{class:"text-center text-gray-400 mb-0 fs-10"},"本專題僅為學習用途,不做任何商業使用 , 圖片來源請見 Readme")],-1);function y(i,o,B,A,N,S){const f=h("AdminLogoSM");return e(),s("footer",w,[C("div",b,[C("div",g,[C("div",x,[C("div",v,[C("div",$,[c(f,{class:"mb-md-8"})]),u])])])])])}const j=t(Z,[["render",y]]);export{j as D,P as L}; diff --git a/assets/DashboardView-RPvYAXYH.js b/assets/DashboardView-zuLsGQrn.js similarity index 76% rename from assets/DashboardView-RPvYAXYH.js rename to assets/DashboardView-zuLsGQrn.js index 84f4db6..31c076a 100644 --- a/assets/DashboardView-RPvYAXYH.js +++ b/assets/DashboardView-zuLsGQrn.js @@ -1 +1 @@ -import{_ as o,c as t,b as s,o as n,d as c}from"./index-ZKny8dII.js";const r={components:{}},a={class:"bg-gray-800 min-vh-100 d-flex flex-column"};function _(p,d,i,l,m,f){const e=c("RouterView");return n(),t("div",a,[s(e)])}const x=o(r,[["render",_]]);export{x as default}; +import{_ as o,c as t,b as s,o as n,d as c}from"./index-sWoFWHUv.js";const r={components:{}},a={class:"bg-gray-800 min-vh-100 d-flex flex-column"};function _(p,d,i,l,m,f){const e=c("RouterView");return n(),t("div",a,[s(e)])}const x=o(r,[["render",_]]);export{x as default}; diff --git a/assets/DpCardPay-WYp2AIVa.js b/assets/DpCardPay-mfdWyjZ5.js similarity index 96% rename from assets/DpCardPay-WYp2AIVa.js rename to assets/DpCardPay-mfdWyjZ5.js index a63cb24..4215ae8 100644 --- a/assets/DpCardPay-WYp2AIVa.js +++ b/assets/DpCardPay-mfdWyjZ5.js @@ -1 +1 @@ -import{m as y}from"./mixinVeeValidate-LQg3d4dX.js";import{s as f}from"./sweetAlert2Store-vFUo6cdB.js";import{m as N}from"./mixinFullScreenLoading-9dNja2ki.js";import{_ as k,m as C,c as l,a as e,t as _,z as V,b as a,w as p,d as b,o as i,u as w,B as M,q as u,F as g,r as x,e as h}from"./index-ZKny8dII.js";const F="/DreamBoost/images/explore/light-credit-card.png",Y={mixins:[y,f,N],data(){return{creditCardNumber:"",formattedCreditCardNumber:"",expiryYear:"",years:[],totalMonth:"MM",months:[],checkNumber:"",yearsValue:"",monthValue:""}},methods:{...C(f,["successAlert"]),submit(){this.successAlert("購買成功"),this.$router.push("/")},formatCreditCardNumber(){this.creditCardNumber=this.creditCardNumber.replace(/\D/g,"").substring(0,16),this.formattedCreditCardNumber=this.creditCardNumber.replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},getMonth(){for(let r=1;r<=12;r+=1){const t=r<10?`0${r}`:`${r}`;this.months.push(t)}},getYear(){const r=new Date().getFullYear();for(let t=r-3;t<=r+3;t+=1)this.years.push(t)},checkNum(r){this.checkNumber=this.checkNumber.replace(/\D/g,""),this.checkNumber.length>=3&&(this.checkNumber=this.checkNumber.substring(0,3),r.target.blur())}},components:{},mounted(){this.showFullScreenLoading(),this.getYear(),this.getMonth(),this.checkNum(),setTimeout(()=>{this.hideFullScreenLoading()},1e3)}},D={class:"container pt-22"},S={class:"d-flex flex-column justify-content-center align-items-center pb-30 position-relative"},q=e("h1",{class:"fs-3 text-center"},"輸入信用卡資料",-1),B=e("div",{class:"form-check mb-8"},[e("input",{class:"form-check-input",type:"checkbox",value:"",id:"agreement",checked:""}),e("label",{class:"form-check-label text-gray-600 fs-6",for:"remember"}," 記住本次持卡人交易資料 ")],-1),A=e("img",{src:F,class:"img-fluid position-absolute translate-middle top-90",alt:"信用卡示意圖"},null,-1),L={key:0,class:"credit-card fs-3 text-gray-600 bg-white position-absolute top-108 start-22 start-sm-28 start-md-33 start-lg-37 start-xl-39 start-xxl-41"},E={class:"container"},I={class:"row d-flex justify-content-center mb-28"},T={class:"col-11 col-sm-8 col-lg-6 px-sm-15 px-xl-27 pt-29 pb-21 border border-2 border-primary rounded-4"},U={class:"row"},j={class:"col-12 mb-7"},z=e("label",{for:"cardnum",class:"form-label position-relative"},[h(" 信用卡號 "),e("span",{class:"text-danger"},"*")],-1),P={class:"col-12 mb-7"},G={class:"row"},H={class:"col-12 col-md-4"},J=e("label",{for:"deadlinemon",class:"form-label"},[h(" 有效期限 "),e("span",{class:"text-danger"}," * ")],-1),K=e("option",{value:"",selected:"",disabled:""},"MM",-1),O=["value"],Q={class:"col-12 col-md-4"},R=e("label",{for:"expiry-year",class:"form-label"},null,-1),W=e("option",{value:"",selected:"",disabled:""},"YY",-1),X=["value"],Z={class:"col-12 col-md-4 mt-6 mt-md-0"},$=e("label",{for:"checknum",class:"form-label"},[h(" 確認碼 "),e("span",{class:"text-danger"}," * ")],-1),ee={class:"col-12 mb-13"},se={class:"col-12 mb-4 mt-6 mt-md-0"},te=e("label",{for:"cardname",class:"form-label"},[h(" 持卡人姓名 "),e("span",{class:"text-danger"}," * ")],-1),re=e("p",{class:"text-gray-600 fs-6 fs-md-12 mb-0"}," 注意事項:為維護交易安全,本公司已配合國際組織全面採用信用卡3DS 2.0交易授權機制,如遇交易失敗,請洽詢發卡銀行或更換銀行卡片後重新交易。 ",-1),oe=e("div",{class:"col-12"},[e("button",{type:"submit",class:"btn btn-primary w-100"}," 確認送出 ")],-1);function ae(r,t,le,ie,o,c){const n=b("VField"),d=b("ErrorMessage"),v=b("VForm");return i(),l("main",null,[e("section",D,[e("div",S,[q,B,e("div",null,[A,o.formattedCreditCardNumber?(i(),l("div",L,_(o.formattedCreditCardNumber),1)):V("",!0)])])]),e("section",E,[a(v,{onSubmit:c.submit},{default:p(({errors:m})=>[e("div",I,[e("div",T,[e("div",U,[e("div",j,[z,w(e("input",{id:"cardnum",name:"信用卡號",class:"form-control fs-6","onUpdate:modelValue":t[0]||(t[0]=s=>o.creditCardNumber=s),onInput:t[1]||(t[1]=(...s)=>c.formatCreditCardNumber&&c.formatCreditCardNumber(...s)),inputmode:"numeric"},null,544),[[M,o.creditCardNumber]])]),e("div",P,[e("div",G,[e("div",H,[J,a(n,{id:"deadlinemon",name:"年份",class:u(["form-select fs-6 text-gray-500",{"is-invalid":m.年份}]),modelValue:o.yearsValue,"onUpdate:modelValue":t[2]||(t[2]=s=>o.yearsValue=s),rules:"required",as:"select"},{default:p(()=>[K,(i(!0),l(g,null,x(o.months,s=>(i(),l("option",{key:s,value:s},_(s),9,O))),128))]),_:2},1032,["class","modelValue"]),a(d,{class:"invalid-feedback",name:"年份"})]),e("div",Q,[R,a(n,{id:"expiry-year",name:"月份",class:u(["form-select fs-6 text-gray-500 mt-2",{"is-invalid":m.月份}]),modelValue:o.expiryYear,"onUpdate:modelValue":t[3]||(t[3]=s=>o.expiryYear=s),rules:"required",as:"select"},{default:p(()=>[W,(i(!0),l(g,null,x(o.years,s=>(i(),l("option",{key:s,value:s},_(s),9,X))),128))]),_:2},1032,["class","modelValue"]),a(d,{class:"invalid-feedback",name:"月份"})]),e("div",Z,[$,a(n,{type:"text",id:"checknum",name:"確認碼",class:u(["form-control fs-6",{"is-invalid":m.確認碼}]),rules:"required",onInput:c.checkNum},null,8,["class","onInput"]),a(d,{class:"invalid-feedback",name:"確認碼"})])])]),e("div",ee,[e("div",se,[te,a(n,{type:"text",id:"cardname",name:"姓名",class:u(["form-control fs-6",{"is-invalid":m.姓名}]),rules:"required",placeholder:"請輸入卡片上的姓名"},null,8,["class"]),a(d,{class:"invalid-feedback",name:"姓名"})]),re]),oe])])])]),_:1},8,["onSubmit"])])])}const ue=k(Y,[["render",ae]]);export{ue as default}; +import{m as y}from"./mixinVeeValidate-8HhwwYT8.js";import{s as f}from"./sweetAlert2Store-M-KFz2Pq.js";import{m as N}from"./mixinFullScreenLoading-9dNja2ki.js";import{_ as k,m as C,c as l,a as e,t as _,z as V,b as a,w as p,d as b,o as i,u as w,B as M,q as u,F as g,r as x,e as h}from"./index-sWoFWHUv.js";const F="/DreamBoost/images/explore/light-credit-card.png",Y={mixins:[y,f,N],data(){return{creditCardNumber:"",formattedCreditCardNumber:"",expiryYear:"",years:[],totalMonth:"MM",months:[],checkNumber:"",yearsValue:"",monthValue:""}},methods:{...C(f,["successAlert"]),submit(){this.successAlert("購買成功"),this.$router.push("/")},formatCreditCardNumber(){this.creditCardNumber=this.creditCardNumber.replace(/\D/g,"").substring(0,16),this.formattedCreditCardNumber=this.creditCardNumber.replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},getMonth(){for(let r=1;r<=12;r+=1){const t=r<10?`0${r}`:`${r}`;this.months.push(t)}},getYear(){const r=new Date().getFullYear();for(let t=r-3;t<=r+3;t+=1)this.years.push(t)},checkNum(r){this.checkNumber=this.checkNumber.replace(/\D/g,""),this.checkNumber.length>=3&&(this.checkNumber=this.checkNumber.substring(0,3),r.target.blur())}},components:{},mounted(){this.showFullScreenLoading(),this.getYear(),this.getMonth(),this.checkNum(),setTimeout(()=>{this.hideFullScreenLoading()},1e3)}},D={class:"container pt-22"},S={class:"d-flex flex-column justify-content-center align-items-center pb-30 position-relative"},q=e("h1",{class:"fs-3 text-center"},"輸入信用卡資料",-1),B=e("div",{class:"form-check mb-8"},[e("input",{class:"form-check-input",type:"checkbox",value:"",id:"agreement",checked:""}),e("label",{class:"form-check-label text-gray-600 fs-6",for:"remember"}," 記住本次持卡人交易資料 ")],-1),A=e("img",{src:F,class:"img-fluid position-absolute translate-middle top-90",alt:"信用卡示意圖"},null,-1),L={key:0,class:"credit-card fs-3 text-gray-600 bg-white position-absolute top-108 start-22 start-sm-28 start-md-33 start-lg-37 start-xl-39 start-xxl-41"},E={class:"container"},I={class:"row d-flex justify-content-center mb-28"},T={class:"col-11 col-sm-8 col-lg-6 px-sm-15 px-xl-27 pt-29 pb-21 border border-2 border-primary rounded-4"},U={class:"row"},j={class:"col-12 mb-7"},z=e("label",{for:"cardnum",class:"form-label position-relative"},[h(" 信用卡號 "),e("span",{class:"text-danger"},"*")],-1),P={class:"col-12 mb-7"},G={class:"row"},H={class:"col-12 col-md-4"},J=e("label",{for:"deadlinemon",class:"form-label"},[h(" 有效期限 "),e("span",{class:"text-danger"}," * ")],-1),K=e("option",{value:"",selected:"",disabled:""},"MM",-1),O=["value"],Q={class:"col-12 col-md-4"},R=e("label",{for:"expiry-year",class:"form-label"},null,-1),W=e("option",{value:"",selected:"",disabled:""},"YY",-1),X=["value"],Z={class:"col-12 col-md-4 mt-6 mt-md-0"},$=e("label",{for:"checknum",class:"form-label"},[h(" 確認碼 "),e("span",{class:"text-danger"}," * ")],-1),ee={class:"col-12 mb-13"},se={class:"col-12 mb-4 mt-6 mt-md-0"},te=e("label",{for:"cardname",class:"form-label"},[h(" 持卡人姓名 "),e("span",{class:"text-danger"}," * ")],-1),re=e("p",{class:"text-gray-600 fs-6 fs-md-12 mb-0"}," 注意事項:為維護交易安全,本公司已配合國際組織全面採用信用卡3DS 2.0交易授權機制,如遇交易失敗,請洽詢發卡銀行或更換銀行卡片後重新交易。 ",-1),oe=e("div",{class:"col-12"},[e("button",{type:"submit",class:"btn btn-primary w-100"}," 確認送出 ")],-1);function ae(r,t,le,ie,o,c){const n=b("VField"),d=b("ErrorMessage"),v=b("VForm");return i(),l("main",null,[e("section",D,[e("div",S,[q,B,e("div",null,[A,o.formattedCreditCardNumber?(i(),l("div",L,_(o.formattedCreditCardNumber),1)):V("",!0)])])]),e("section",E,[a(v,{onSubmit:c.submit},{default:p(({errors:m})=>[e("div",I,[e("div",T,[e("div",U,[e("div",j,[z,w(e("input",{id:"cardnum",name:"信用卡號",class:"form-control fs-6","onUpdate:modelValue":t[0]||(t[0]=s=>o.creditCardNumber=s),onInput:t[1]||(t[1]=(...s)=>c.formatCreditCardNumber&&c.formatCreditCardNumber(...s)),inputmode:"numeric"},null,544),[[M,o.creditCardNumber]])]),e("div",P,[e("div",G,[e("div",H,[J,a(n,{id:"deadlinemon",name:"年份",class:u(["form-select fs-6 text-gray-500",{"is-invalid":m.年份}]),modelValue:o.yearsValue,"onUpdate:modelValue":t[2]||(t[2]=s=>o.yearsValue=s),rules:"required",as:"select"},{default:p(()=>[K,(i(!0),l(g,null,x(o.months,s=>(i(),l("option",{key:s,value:s},_(s),9,O))),128))]),_:2},1032,["class","modelValue"]),a(d,{class:"invalid-feedback",name:"年份"})]),e("div",Q,[R,a(n,{id:"expiry-year",name:"月份",class:u(["form-select fs-6 text-gray-500 mt-2",{"is-invalid":m.月份}]),modelValue:o.expiryYear,"onUpdate:modelValue":t[3]||(t[3]=s=>o.expiryYear=s),rules:"required",as:"select"},{default:p(()=>[W,(i(!0),l(g,null,x(o.years,s=>(i(),l("option",{key:s,value:s},_(s),9,X))),128))]),_:2},1032,["class","modelValue"]),a(d,{class:"invalid-feedback",name:"月份"})]),e("div",Z,[$,a(n,{type:"text",id:"checknum",name:"確認碼",class:u(["form-control fs-6",{"is-invalid":m.確認碼}]),rules:"required",onInput:c.checkNum},null,8,["class","onInput"]),a(d,{class:"invalid-feedback",name:"確認碼"})])])]),e("div",ee,[e("div",se,[te,a(n,{type:"text",id:"cardname",name:"姓名",class:u(["form-control fs-6",{"is-invalid":m.姓名}]),rules:"required",placeholder:"請輸入卡片上的姓名"},null,8,["class"]),a(d,{class:"invalid-feedback",name:"姓名"})]),re]),oe])])])]),_:1},8,["onSubmit"])])])}const ue=k(Y,[["render",ae]]);export{ue as default}; diff --git a/assets/DpPayInfo-ULWM-w_K.js b/assets/DpPayInfo-ULWM-w_K.js deleted file mode 100644 index 36d09a6..0000000 --- a/assets/DpPayInfo-ULWM-w_K.js +++ /dev/null @@ -1 +0,0 @@ -import{A as C,_ as x,m as y,g as U,s as F,c as d,a as s,b as o,t as u,w as g,l as M,e as n,d as f,o as m,q as r,z as N,u as p,B as b,D as $,F as E,r as L,G as k}from"./index-ZKny8dII.js";import{e as A}from"./exploreStore-0RzM94wX.js";import{s as V}from"./sweetAlert2Store-vFUo6cdB.js";import{m as B}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as O}from"./mixinVeeValidate-LQg3d4dX.js";import{P as q}from"./PlanCard-bRKIUWYY.js";import"./CheckIcon-p907IZ-C.js";import"./RightArrow-WNYavUu6.js";import"./StarHollow-RvDE_JVe.js";import"./StarFull-hqQk7cwm.js";var R={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{successAlert:j}=V(),{VITE_URL:J}=R,D=C("transactionsStore",{state:()=>({transactionsData:{transactionProposalID:"",transactionFeedbackID:"",transactionTime:new Date().getTime(),transactionShipMethod:"黑喵宅急便",transactionStatus:"尚未出貨",transactionSponsorName:"",transactionSponsorTelephone:"",transactionrInvoice:"personalticket",transactionCouponCode:"",customizeProperty:{transactionLocation:"main-island"}}}),actions:{async postTransaction(){try{const t=await this.$http.post(`${J}/dreamboost/transaction/normal/transaction`,this.transactionsData);j(`${t.data.message},前往付款畫面`)}catch(t){throw new Error(t)}},setDataId(){this.transactionsData.transactionProposalID=this.$route.params.id,this.transactionsData.transactionFeedbackID=this.$route.params.item}}}),P="/DreamBoost/images/explore/info.svg",W={components:{PlanCard:q},data(){return{feedbacks:Object,tooltipName:"",tooltipPhone:"",test:{proposalFeedbacks:{}},selectedCity:null,cities:["台北市","新北市","桃園市","台中市","台南市","高雄市","基隆市","新竹市","嘉義市","新竹縣","苗栗縣","彰化縣","南投縣","雲林縣","嘉義縣","屏東縣","宜蘭縣","花蓮縣","台東縣","澎湖縣","金門縣","連江縣"]}},mixins:[O,B],methods:{...y(D,["setDataId","postTransaction"]),...y(V,["confirmAlert"]),nextStep(){this.confirmAlert("資料是否正確").then(async t=>{t.isConfirmed&&(this.showFullScreenLoading(),await this.postTransaction(),this.hideFullScreenLoading(),this.$router.push(`/product/${this.$route.params.id}/choose/${this.$route.params.item}/payinfo/cardpay`))})}},mounted(){this.showFullScreenLoading(),setTimeout(()=>{this.hideFullScreenLoading()},800),this.setDataId(),this.tooltipName=new this.$bs.Tooltip(this.$refs.name),this.tooltipPhone=new this.$bs.Tooltip(this.$refs.phone)},computed:{...U(A,["singleFeedback"]),...F(D,["transactionsData"])}},Y={class:"container pt-14"},G={class:"row d-flex justify-content-center"},Q={class:"col-12 col-lg-4"},X={class:"mt-8 px-3"},Z={class:"d-flex justify-content-between align-items-center mb-4"},H=s("p",{class:"fs-18 mb-0"},"選項金額",-1),K={class:"fs-18 mb-0"},ss=M('

折扣碼優惠

-(未知)

運費:N/A

+(未知)

',2),ts=s("hr",{class:"border-2 border-gray-700 mb-5"},null,-1),es={class:"px-3 d-flex justify-content-between align-items-center mb-8"},as=s("h3",{class:"mb-0"},"總金額",-1),os={class:"fs-28 fw-bold text-primary mb-0"},ns={class:"col-12 col-lg-6 ps-lg-10 mt-10 mt-lg-1 mb-15 mb-lg-28"},is=s("h4",{class:"mb-4"},"付款方式",-1),ls=s("h5",{class:"mb-3 fw-medium"},[n(" 信用卡付款 "),s("span",{class:"text-danger"},"*")],-1),rs=s("p",{class:"mb-3"}," 指定信用卡可享 3 期 / 零利率、可用銀聯卡、可用國外卡 ",-1),cs={class:"mb-8"},ds={class:"mb-3"},ms={class:"form-check form-check-inline me-11"},ps=s("label",{class:"form-check-label fs-6 text-gray-500",for:"payoff"}," 一次付清 ",-1),us={class:"form-check form-check-inline"},fs=s("label",{class:"form-check-label fs-6 text-gray-500",for:"installment"}," 分 3 期 ",-1),bs={key:0,class:"d-block invalid-feedback"},hs=s("div",{class:"bg-bgc-paper rounded-3 col-12 mb-6"},[s("p",{class:"fs-6 text-primary-dark px-8 py-4"}," 您了解您的贊助是支持創意專案的一種方式,也了解創意實踐過程中充滿變數,專案不一定能確保回饋。 ")],-1),_s={class:"row d-flex mb-6"},vs={class:"col d-flex flex-column"},ys=s("label",{for:"sponsors",class:"form-label fw-medium"},[n("加碼贊助"),s("span",{class:"text-gray-500"},"(選填)")],-1),gs=s("datalist",{id:"datalistOptions"},[s("option",{value:"100"}),s("option",{value:"200"}),s("option",{value:"500"})],-1),ks={class:"col"},Ds=s("label",{for:"discount",class:"form-label fw-medium"},"請輸入折扣碼",-1),Vs={class:"row mb-6"},Ps={class:"col-6"},ws=s("label",{for:"discount",class:"form-label fw-medium"},"收件地點 ",-1),Ss=s("option",{selected:"",value:"main-island"},"台灣(本島)",-1),Is=s("option",{value:"outer-lslands"}," 台灣(外島)需付額外運費 ",-1),Ts=[Ss,Is],zs={class:"row flex-column"},Cs={class:"col-6 d-flex"},xs={class:"col me-2"},Us=s("label",{for:"postal-code",class:"mb-2 fw-medium"},"收件地址",-1),Fs={class:"col mt-2"},Ms=s("label",{for:"choose-area"},null,-1),Ns=s("option",{selected:"",disabled:"",value:""},"選擇縣市",-1),$s=["value"],Es={class:"col me-2"},Ls=s("label",{for:"address",class:"mb-2"},null,-1),As={class:"col mb-6"},Bs={for:"addressee",class:"form-label fw-medium position-relative"},Os={class:"text-danger"},qs={type:"button",class:"btn px-1 py-0 border-0",ref:"name","data-bs-toggle":"tooltip-name","data-bs-placement":"right","data-bs-custom-class":"customTooltip","data-bs-title":"寄送贊助回饋使用,若不正確可能造成投遞失敗。"},Rs=s("span",{class:"",style:{width:"20px"}},[s("img",{src:P,class:"img-fluid",style:{"margin-top":"-6px"},alt:""})],-1),js=[Rs],Js={class:"col mb-6"},Ws={for:"phone",type:"text",class:"form-label fw-medium"},Ys={class:"text-danger"},Gs={type:"button",class:"btn px-1 py-0 border-0",ref:"phone","data-bs-toggle":"tooltip-phone","data-bs-placement":"right","data-bs-custom-class":"customTooltip","data-bs-title":"寄送人聯絡及付款確認使用。請填寫全碼,如 0912123456"},Qs=s("span",{class:"",style:{width:"20px"}},[s("img",{src:P,class:"img-fluid",style:{"margin-top":"-6px"},alt:""})],-1),Xs=[Qs],Zs={class:"col bg-bgc-paper rounded-3 p-6 mb-6"},Hs=s("h5",{class:"mb-3 fw-medium"},[n(" 發票資訊 "),s("span",{class:"text-danger"},"*")],-1),Ks={class:"mb-3"},st={class:"form-check form-check-inline me-11"},tt=s("label",{class:"form-check-label fs-6 text-gray-500",for:"personalticket"}," 個人發票 ",-1),et={class:"form-check form-check-inline"},at=s("label",{class:"form-check-label fs-6 text-gray-500",for:"bsticket"}," 公司發票 ",-1),ot={key:0,class:"col-6"},nt=s("label",{for:"phoneticket",class:"form-label fs-6"},[n(" 手機載具 "),s("span",{class:"text-danger"}," * ")],-1),it={key:1,class:"row"},lt={class:"col-6"},rt=s("label",{for:"compiled",class:"form-label fs-6"},[n(" 統一編號 "),s("span",{class:"text-danger"}," * ")],-1),ct={class:"col-6"},dt=s("label",{for:"bsname",class:"form-label fs-6"},[n(" 發票抬頭 "),s("span",{class:"text-danger"}," * ")],-1),mt={class:"col mb-6"},pt=s("h5",null,[n("備註"),s("span",{class:"text-gray-500"},"(選填)")],-1),ut={class:"form-floating"},ft=s("label",{for:"floatingTextarea"},"請留言",-1),bt=s("div",{class:"form-check mb-8"},[s("input",{class:"form-check-input",type:"checkbox",value:"",id:"agreement",checked:""}),s("label",{class:"form-check-label text-primary fs-6",for:"agreement"}," 我已閱讀並同意 DreamBoost 服務條款與隱私權政策 ")],-1),ht={type:"submit",class:"btn btn-primary mb-9 col-12 col-lg-7"},_t=s("p",{class:"fs-6 text-gray-500"},[n(" 提案人有權決定是否接受贊助。"),s("br"),n(" 如提案人因故決定不接受贊助,將會取消贊助並主動退還贊助款項。 ")],-1);function vt(t,a,yt,gt,w,S){var h,_;const I=f("PlanCard"),l=f("VField"),c=f("ErrorMessage"),T=f("VForm");return m(),d("main",null,[s("section",Y,[s("div",G,[s("div",Q,[o(I,{feedbacks:t.singleFeedback,"feedback-payment":!0},null,8,["feedbacks"]),s("div",X,[s("div",Z,[H,s("p",K," NT$ "+u((h=t.singleFeedback)==null?void 0:h.feedbackSettingMoney),1)]),ss]),ts,s("div",es,[as,s("p",os," NT$ "+u((_=t.singleFeedback)==null?void 0:_.feedbackSettingMoney),1)])]),s("div",ns,[is,ls,rs,o(T,{onSubmit:S.nextStep,ref:"form"},{default:g(({errors:i})=>{var v;return[s("div",cs,[s("div",ds,[s("div",ms,[o(l,{type:"radio",id:"payoff",name:"payment",class:r(["form-check-input",{"is-invalid":i.payment}]),modelValue:t.transactionsData.customizeProperty.transactionPayment,"onUpdate:modelValue":a[0]||(a[0]=e=>t.transactionsData.customizeProperty.transactionPayment=e),rules:"required",value:"一次付清"},null,8,["class","modelValue"]),ps]),s("div",us,[o(l,{type:"radio",id:"installment",name:"payment",class:r(["form-check-input",{"is-invalid":i.payment}]),modelValue:t.transactionsData.customizeProperty.transactionPayment,"onUpdate:modelValue":a[1]||(a[1]=e=>t.transactionsData.customizeProperty.transactionPayment=e),rules:"required",value:"分3期"},null,8,["class","modelValue"]),fs]),i.payment?(m(),d("span",bs,"付款方式 為必填")):N("",!0)]),hs,s("div",_s,[s("div",vs,[ys,p(s("input",{id:"sponsors",class:"form-control fs-6 border-primary-light",placeholder:"小小金額是大大的肯定",list:"datalistOptions","onUpdate:modelValue":a[2]||(a[2]=e=>t.transactionsData.customizeProperty.transactionBonus=e)},null,512),[[b,t.transactionsData.customizeProperty.transactionBonus]]),gs]),s("div",ks,[Ds,p(s("input",{id:"sponsors",class:"form-control fs-6 border-primary-light","onUpdate:modelValue":a[3]||(a[3]=e=>t.transactionsData.transactionCouponCode=e)},null,512),[[b,t.transactionsData.transactionCouponCode]])])]),s("div",Vs,[s("div",Ps,[ws,p(s("select",{class:"form-select border-primary-light fs-6 text-gray-500","aria-label":"inTwOrOut","onUpdate:modelValue":a[4]||(a[4]=e=>t.transactionsData.customizeProperty.transactionLocation=e)},Ts,512),[[$,t.transactionsData.customizeProperty.transactionLocation]])])]),s("div",zs,[s("div",Cs,[s("div",xs,[Us,o(l,{type:"number",id:"area-num",name:"郵遞區號",class:r(["form-control fs-6",{"is-invalid":i.郵遞區號}]),modelValue:t.transactionsData.customizeProperty.receiverAreaCode,"onUpdate:modelValue":a[5]||(a[5]=e=>t.transactionsData.customizeProperty.receiverAreaCode=e),rules:"required",placeholder:"郵遞區號"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"郵遞區號"})]),s("div",Fs,[Ms,o(l,{id:"area",name:"選擇縣市",class:r(["form-select fs-6 text-gray-500",{"is-invalid":i.選擇縣市}]),modelValue:t.transactionsData.customizeProperty.receiverCity,"onUpdate:modelValue":a[6]||(a[6]=e=>t.transactionsData.customizeProperty.receiverCity=e),rules:"required",as:"select"},{default:g(()=>[Ns,(m(!0),d(E,null,L(w.cities,(e,z)=>(m(),d("option",{key:z,value:e},u(e),9,$s))),128))]),_:2},1032,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"選擇縣市"})])]),s("div",Es,[Ls,o(l,{type:"text",id:"address",name:"地址",class:r(["form-control fs-6",{"is-invalid":i.地址}]),modelValue:t.transactionsData.customizeProperty.receiverAddress,"onUpdate:modelValue":a[7]||(a[7]=e=>t.transactionsData.customizeProperty.receiverAddress=e),rules:"required",placeholder:"請輸入正確地址以免造成您的權益受損"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"地址"})])]),s("div",As,[s("label",Bs,[n(" 收件人姓名 "),s("span",Os,[n("* "),s("button",qs,js,512)])]),o(l,{type:"text",id:"name",name:"姓名",class:r(["form-control fs-6",{"is-invalid":i.姓名}]),modelValue:t.transactionsData.transactionSponsorName,"onUpdate:modelValue":a[8]||(a[8]=e=>t.transactionsData.transactionSponsorName=e),rules:"required",placeholder:"請輸入真實姓名"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"姓名"})]),s("div",Js,[s("label",Ws,[n(" 行動電話 "),s("span",Ys,[n("* "),s("button",Gs,Xs,512)])]),o(l,{type:"tel",id:"phone",name:"行動電話",class:r(["form-control fs-6",{"is-invalid":i.行動電話}]),modelValue:t.transactionsData.transactionSponsorTelephone,"onUpdate:modelValue":a[9]||(a[9]=e=>t.transactionsData.transactionSponsorTelephone=e),rules:"required",placeholder:"請輸入聯絡電話"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"行動電話"})]),s("div",Zs,[Hs,s("div",Ks,[s("div",st,[p(s("input",{type:"radio",id:"personalticket",name:"invoice",class:"form-check-input","onUpdate:modelValue":a[10]||(a[10]=e=>t.transactionsData.transactionrInvoice=e),value:"personalticket"},null,512),[[k,t.transactionsData.transactionrInvoice]]),tt]),s("div",et,[p(s("input",{type:"radio",id:"bsticket",name:"invoice",class:"form-check-input","onUpdate:modelValue":a[11]||(a[11]=e=>t.transactionsData.transactionrInvoice=e),value:"bsticket"},null,512),[[k,t.transactionsData.transactionrInvoice]]),at])]),t.transactionsData.transactionrInvoice==="personalticket"?(m(),d("div",ot,[nt,o(l,{id:"phoneticket",name:"手機載具",class:r(["form-control fs-6",{"is-invalid":i.手機載具}]),modelValue:t.transactionsData.customizeProperty.cloudInvoice,"onUpdate:modelValue":a[12]||(a[12]=e=>t.transactionsData.customizeProperty.cloudInvoice=e),rules:"required",placeholder:"例:/AB1CD23"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"手機載具"})])):(m(),d("div",it,[s("div",lt,[rt,o(l,{id:"compiled",name:"統一編號",class:r(["form-control fs-6",{"is-invalid":i.統一編號}]),modelValue:t.transactionsData.customizeProperty.VATNumber,"onUpdate:modelValue":a[13]||(a[13]=e=>t.transactionsData.customizeProperty.VATNumber=e),rules:"required",placeholder:"例:12345678"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"統一編號"})]),s("div",ct,[dt,o(l,{id:"bsname",name:"發票抬頭",class:r(["form-control fs-6",{"is-invalid":i.發票抬頭}]),modelValue:t.transactionsData.customizeProperty.invoiceTitle,"onUpdate:modelValue":a[14]||(a[14]=e=>t.transactionsData.customizeProperty.invoiceTitle=e),rules:"required",placeholder:"組織名稱"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"發票抬頭"})])]))]),s("div",mt,[pt,s("div",ut,[p(s("textarea",{id:"floatingTextarea",class:"form-control","onUpdate:modelValue":a[15]||(a[15]=e=>t.transactionsData.customizeProperty.transactionNote=e),placeholder:"Leave a comment here"},null,512),[[b,t.transactionsData.customizeProperty.transactionNote]]),ft])])]),bt,s("button",ht,[n(" 立即贊助"),s("span",null,"NT$"+u((v=t.singleFeedback)==null?void 0:v.feedbackSettingMoney),1)]),_t]}),_:1},8,["onSubmit"])])])])])}const xt=x(W,[["render",vt]]);export{xt as default}; diff --git a/assets/DpPayInfo-m5Je3aDE.js b/assets/DpPayInfo-m5Je3aDE.js new file mode 100644 index 0000000..c2a9efb --- /dev/null +++ b/assets/DpPayInfo-m5Je3aDE.js @@ -0,0 +1 @@ +import{A as C,_ as F,m as y,g as U,s as $,c as d,a as s,b as o,t as u,w as g,l as I,e as n,d as f,o as m,q as r,z as N,u as p,B as h,D as A,F as L,r as q,G as k}from"./index-sWoFWHUv.js";import{e as B}from"./exploreStore-XbTlwxKO.js";import{s as V}from"./sweetAlert2Store-M-KFz2Pq.js";import{m as M}from"./mixinFullScreenLoading-9dNja2ki.js";import{m as E}from"./mixinVeeValidate-8HhwwYT8.js";import{P as O}from"./PlanCard-dFGp4k9F.js";import"./CheckIcon-mXt6_GXv.js";import"./RightArrow-8a6ZPEaq.js";import"./StarHollow-e-RtIRcs.js";import"./StarFull-qHe9up2f.js";var j={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{successAlert:R}=V(),{VITE_URL:G}=j,D=C("transactionsStore",{state:()=>({transactionsData:{transactionProposalID:"",transactionFeedbackID:"",transactionTime:new Date().getTime(),transactionShipMethod:"黑喵宅急便",transactionStatus:"尚未出貨",transactionSponsorName:"",transactionSponsorTelephone:"",transactionrInvoice:"personalticket",transactionCouponCode:"",customizeProperty:{transactionLocation:"main-island"}}}),actions:{async postTransaction(){try{const t=await this.$http.post(`${G}/dreamboost/transaction/normal/transaction`,this.transactionsData);R(`${t.data.message},前往付款畫面`)}catch(t){throw new Error(t)}},setDataId(){this.transactionsData.transactionProposalID=this.$route.params.id,this.transactionsData.transactionFeedbackID=this.$route.params.item}}}),P="/DreamBoost/images/explore/info.svg",W={components:{PlanCard:O},data(){return{feedbacks:Object,tooltipName:"",tooltipPhone:"",test:{proposalFeedbacks:{}},selectedCity:null,cities:["台北市","新北市","桃園市","台中市","台南市","高雄市","基隆市","新竹市","嘉義市","新竹縣","苗栗縣","彰化縣","南投縣","雲林縣","嘉義縣","屏東縣","宜蘭縣","花蓮縣","台東縣","澎湖縣","金門縣","連江縣"]}},mixins:[E,M],methods:{...y(D,["setDataId","postTransaction"]),...y(V,["confirmAlert"]),nextStep(){this.confirmAlert("資料是否正確").then(async t=>{t.isConfirmed&&(this.showFullScreenLoading(),await this.postTransaction(),this.hideFullScreenLoading(),this.$router.push(`/product/${this.$route.params.id}/choose/${this.$route.params.item}/payinfo/cardpay`))})}},mounted(){this.showFullScreenLoading(),setTimeout(()=>{this.hideFullScreenLoading()},800),this.setDataId(),this.tooltipName=new this.$bs.Tooltip(this.$refs.name),this.tooltipPhone=new this.$bs.Tooltip(this.$refs.phone)},computed:{...U(B,["singleFeedback"]),...$(D,["transactionsData"])}},H={class:"container pt-14"},J={class:"row d-flex justify-content-center"},K={class:"col-12 col-lg-4"},Q={class:"mt-8 px-3"},X={class:"d-flex justify-content-between align-items-center mb-4"},Y=s("p",{class:"fs-18 mb-0"},"選項金額",-1),Z={class:"fs-18 mb-0"},ss=I('

折扣碼優惠

-(未知)

運費:N/A

+(未知)

',2),ts=s("hr",{class:"border-2 border-gray-700 mb-5"},null,-1),es={class:"px-3 d-flex justify-content-between align-items-center mb-8"},as=s("h3",{class:"mb-0"},"總金額",-1),os={class:"fs-28 fw-bold text-primary mb-0"},ns={class:"col-12 col-lg-6 ps-lg-10 mt-10 mt-lg-1 mb-15 mb-lg-28"},is=s("h4",{class:"mb-4"},"付款方式",-1),ls=s("h5",{class:"mb-3 fw-medium"},[n(" 信用卡付款 "),s("span",{class:"text-danger"},"*")],-1),rs=s("p",{class:"mb-3"}," 指定信用卡可享 3 期 / 零利率、可用銀聯卡、可用國外卡 ",-1),cs={class:"mb-8"},ds={class:"mb-3"},ms={class:"form-check form-check-inline me-11"},ps=s("label",{class:"form-check-label fs-6 text-gray-500",for:"payoff"}," 一次付清 ",-1),us={class:"form-check form-check-inline"},fs=s("label",{class:"form-check-label fs-6 text-gray-500",for:"installment"}," 分 3 期 ",-1),hs={key:0,class:"d-block invalid-feedback"},bs=s("div",{class:"bg-bgc-paper rounded-3 col-12 mb-6"},[s("p",{class:"fs-6 text-primary-dark px-8 py-4"}," 您了解您的贊助是支持創意專案的一種方式,也了解創意實踐過程中充滿變數,專案不一定能確保回饋。 ")],-1),_s={class:"row d-flex mb-6"},vs={class:"col d-flex flex-column"},ys=s("label",{for:"sponsors",class:"form-label fw-medium"},[n("加碼贊助"),s("span",{class:"text-gray-500"},"(選填)")],-1),gs=s("datalist",{id:"datalistOptions"},[s("option",{value:"100"}),s("option",{value:"200"}),s("option",{value:"500"})],-1),ks={class:"col"},Ds=s("label",{for:"discount",class:"form-label fw-medium"},"請輸入折扣碼",-1),Vs={class:"row mb-6"},Ps={class:"col-6"},ws=s("label",{for:"discount",class:"form-label fw-medium"},"收件地點 ",-1),Ss=s("option",{selected:"",value:"main-island"},"台灣(本島)",-1),Ts=s("option",{value:"outer-lslands"}," 台灣(外島)需付額外運費 ",-1),zs=[Ss,Ts],xs={class:"row flex-column"},Cs={class:"col-6 d-flex"},Fs={class:"col me-2"},Us=s("label",{for:"postal-code",class:"mb-2 fw-medium"},"收件地址",-1),$s={class:"col mt-2"},Is=s("label",{for:"choose-area"},null,-1),Ns=s("option",{selected:"",disabled:"",value:""},"選擇縣市",-1),As=["value"],Ls={class:"col me-2"},qs=s("label",{for:"address",class:"mb-2"},null,-1),Bs={class:"col mb-6"},Ms={for:"addressee",class:"form-label fw-medium position-relative"},Es={class:"text-danger"},Os={type:"button",class:"btn px-1 py-0 border-0",ref:"name","data-bs-toggle":"tooltip-name","data-bs-placement":"right","data-bs-custom-class":"customTooltip","data-bs-title":"寄送贊助回饋使用,若不正確可能造成投遞失敗。"},js=s("span",{class:"",style:{width:"20px"}},[s("img",{src:P,class:"img-fluid",style:{"margin-top":"-6px"},alt:""})],-1),Rs=[js],Gs={class:"col mb-6"},Ws={for:"phone",type:"text",class:"form-label fw-medium"},Hs={class:"text-danger"},Js={type:"button",class:"btn px-1 py-0 border-0",ref:"phone","data-bs-toggle":"tooltip-phone","data-bs-placement":"right","data-bs-custom-class":"customTooltip","data-bs-title":"寄送人聯絡及付款確認使用。請填寫全碼,如 0912123456"},Ks=s("span",{class:"",style:{width:"20px"}},[s("img",{src:P,class:"img-fluid",style:{"margin-top":"-6px"},alt:""})],-1),Qs=[Ks],Xs={class:"col bg-bgc-paper rounded-3 p-6 mb-6"},Ys=s("h5",{class:"mb-3 fw-medium"},[n(" 發票資訊 "),s("span",{class:"text-danger"},"*")],-1),Zs={class:"mb-3"},st={class:"form-check form-check-inline me-11"},tt=s("label",{class:"form-check-label fs-6 text-gray-500",for:"personalticket"}," 個人發票 ",-1),et={class:"form-check form-check-inline"},at=s("label",{class:"form-check-label fs-6 text-gray-500",for:"bsticket"}," 公司發票 ",-1),ot={key:0,class:"col-6"},nt=s("label",{for:"phoneticket",class:"form-label fs-6"},[n(" 手機載具 "),s("span",{class:"text-danger"}," * ")],-1),it={key:1,class:"row"},lt={class:"col-6"},rt=s("label",{for:"compiled",class:"form-label fs-6"},[n(" 統一編號 "),s("span",{class:"text-danger"}," * ")],-1),ct={class:"col-6"},dt=s("label",{for:"bsname",class:"form-label fs-6"},[n(" 發票抬頭 "),s("span",{class:"text-danger"}," * ")],-1),mt={class:"col mb-6"},pt=s("h5",null,[n("備註"),s("span",{class:"text-gray-500"},"(選填)")],-1),ut={class:"form-floating"},ft=s("label",{for:"floatingTextarea"},"請留言",-1),ht=s("div",{class:"form-check mb-8"},[s("input",{class:"form-check-input",type:"checkbox",value:"",id:"agreement",checked:""}),s("label",{class:"form-check-label text-primary fs-6",for:"agreement"}," 我已閱讀並同意 DreamBoost 服務條款與隱私權政策 ")],-1),bt={type:"submit",class:"btn btn-primary mb-9 col-12 col-lg-7"},_t=s("p",{class:"fs-6 text-gray-500"},[n(" 提案人有權決定是否接受贊助。"),s("br"),n(" 如提案人因故決定不接受贊助,將會取消贊助並主動退還贊助款項。 ")],-1);function vt(t,a,yt,gt,w,S){var b,_;const T=f("PlanCard"),l=f("VField"),c=f("ErrorMessage"),z=f("VForm");return m(),d("main",null,[s("section",H,[s("div",J,[s("div",K,[o(T,{feedbacks:t.singleFeedback,"feedback-payment":!0},null,8,["feedbacks"]),s("div",Q,[s("div",X,[Y,s("p",Z," NT$ "+u((b=t.singleFeedback)==null?void 0:b.feedbackSettingMoney),1)]),ss]),ts,s("div",es,[as,s("p",os," NT$ "+u((_=t.singleFeedback)==null?void 0:_.feedbackSettingMoney),1)])]),s("div",ns,[is,ls,rs,o(z,{onSubmit:S.nextStep,ref:"form"},{default:g(({errors:i})=>{var v;return[s("div",cs,[s("div",ds,[s("div",ms,[o(l,{type:"radio",id:"payoff",name:"payment",class:r(["form-check-input",{"is-invalid":i.payment}]),modelValue:t.transactionsData.customizeProperty.transactionPayment,"onUpdate:modelValue":a[0]||(a[0]=e=>t.transactionsData.customizeProperty.transactionPayment=e),rules:"required",value:"一次付清"},null,8,["class","modelValue"]),ps]),s("div",us,[o(l,{type:"radio",id:"installment",name:"payment",class:r(["form-check-input",{"is-invalid":i.payment}]),modelValue:t.transactionsData.customizeProperty.transactionPayment,"onUpdate:modelValue":a[1]||(a[1]=e=>t.transactionsData.customizeProperty.transactionPayment=e),rules:"required",value:"分3期"},null,8,["class","modelValue"]),fs]),i.payment?(m(),d("span",hs,"付款方式 為必填")):N("",!0)]),bs,s("div",_s,[s("div",vs,[ys,p(s("input",{id:"sponsors",class:"form-control fs-6 border-primary-light",placeholder:"小小金額是大大的肯定",list:"datalistOptions","onUpdate:modelValue":a[2]||(a[2]=e=>t.transactionsData.customizeProperty.transactionBonus=e)},null,512),[[h,t.transactionsData.customizeProperty.transactionBonus]]),gs]),s("div",ks,[Ds,p(s("input",{id:"sponsors",class:"form-control fs-6 border-primary-light","onUpdate:modelValue":a[3]||(a[3]=e=>t.transactionsData.transactionCouponCode=e)},null,512),[[h,t.transactionsData.transactionCouponCode]])])]),s("div",Vs,[s("div",Ps,[ws,p(s("select",{class:"form-select border-primary-light fs-6 text-gray-500","aria-label":"inTwOrOut","onUpdate:modelValue":a[4]||(a[4]=e=>t.transactionsData.customizeProperty.transactionLocation=e)},zs,512),[[A,t.transactionsData.customizeProperty.transactionLocation]])])]),s("div",xs,[s("div",Cs,[s("div",Fs,[Us,o(l,{type:"number",id:"area-num",name:"郵遞區號",class:r(["form-control fs-6",{"is-invalid":i.郵遞區號}]),modelValue:t.transactionsData.customizeProperty.receiverAreaCode,"onUpdate:modelValue":a[5]||(a[5]=e=>t.transactionsData.customizeProperty.receiverAreaCode=e),rules:"required",placeholder:"郵遞區號"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"郵遞區號"})]),s("div",$s,[Is,o(l,{id:"area",name:"選擇縣市",class:r(["form-select fs-6 text-gray-500",{"is-invalid":i.選擇縣市}]),modelValue:t.transactionsData.customizeProperty.receiverCity,"onUpdate:modelValue":a[6]||(a[6]=e=>t.transactionsData.customizeProperty.receiverCity=e),rules:"required",as:"select"},{default:g(()=>[Ns,(m(!0),d(L,null,q(w.cities,(e,x)=>(m(),d("option",{key:x,value:e},u(e),9,As))),128))]),_:2},1032,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"選擇縣市"})])]),s("div",Ls,[qs,o(l,{type:"text",id:"address",name:"地址",class:r(["form-control fs-6",{"is-invalid":i.地址}]),modelValue:t.transactionsData.customizeProperty.receiverAddress,"onUpdate:modelValue":a[7]||(a[7]=e=>t.transactionsData.customizeProperty.receiverAddress=e),rules:"required",placeholder:"請輸入正確地址以免造成您的權益受損"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"地址"})])]),s("div",Bs,[s("label",Ms,[n(" 收件人姓名 "),s("span",Es,[n("* "),s("button",Os,Rs,512)])]),o(l,{type:"text",id:"name",name:"姓名",class:r(["form-control fs-6",{"is-invalid":i.姓名}]),modelValue:t.transactionsData.transactionSponsorName,"onUpdate:modelValue":a[8]||(a[8]=e=>t.transactionsData.transactionSponsorName=e),rules:"required",placeholder:"請輸入真實姓名"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"姓名"})]),s("div",Gs,[s("label",Ws,[n(" 行動電話 "),s("span",Hs,[n("* "),s("button",Js,Qs,512)])]),o(l,{type:"tel",id:"phone",name:"行動電話",class:r(["form-control fs-6",{"is-invalid":i.行動電話}]),modelValue:t.transactionsData.transactionSponsorTelephone,"onUpdate:modelValue":a[9]||(a[9]=e=>t.transactionsData.transactionSponsorTelephone=e),rules:"required",placeholder:"請輸入聯絡電話"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"行動電話"})]),s("div",Xs,[Ys,s("div",Zs,[s("div",st,[p(s("input",{type:"radio",id:"personalticket",name:"invoice",class:"form-check-input","onUpdate:modelValue":a[10]||(a[10]=e=>t.transactionsData.transactionrInvoice=e),value:"personalticket"},null,512),[[k,t.transactionsData.transactionrInvoice]]),tt]),s("div",et,[p(s("input",{type:"radio",id:"bsticket",name:"invoice",class:"form-check-input","onUpdate:modelValue":a[11]||(a[11]=e=>t.transactionsData.transactionrInvoice=e),value:"bsticket"},null,512),[[k,t.transactionsData.transactionrInvoice]]),at])]),t.transactionsData.transactionrInvoice==="personalticket"?(m(),d("div",ot,[nt,o(l,{id:"phoneticket",name:"手機載具",class:r(["form-control fs-6",{"is-invalid":i.手機載具}]),modelValue:t.transactionsData.customizeProperty.cloudInvoice,"onUpdate:modelValue":a[12]||(a[12]=e=>t.transactionsData.customizeProperty.cloudInvoice=e),rules:"required",placeholder:"例:/AB1CD23"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"手機載具"})])):(m(),d("div",it,[s("div",lt,[rt,o(l,{id:"compiled",name:"統一編號",class:r(["form-control fs-6",{"is-invalid":i.統一編號}]),modelValue:t.transactionsData.customizeProperty.VATNumber,"onUpdate:modelValue":a[13]||(a[13]=e=>t.transactionsData.customizeProperty.VATNumber=e),rules:"required",placeholder:"例:12345678"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"統一編號"})]),s("div",ct,[dt,o(l,{id:"bsname",name:"發票抬頭",class:r(["form-control fs-6",{"is-invalid":i.發票抬頭}]),modelValue:t.transactionsData.customizeProperty.invoiceTitle,"onUpdate:modelValue":a[14]||(a[14]=e=>t.transactionsData.customizeProperty.invoiceTitle=e),rules:"required",placeholder:"組織名稱"},null,8,["class","modelValue"]),o(c,{class:"invalid-feedback",name:"發票抬頭"})])]))]),s("div",mt,[pt,s("div",ut,[p(s("textarea",{id:"floatingTextarea",class:"form-control","onUpdate:modelValue":a[15]||(a[15]=e=>t.transactionsData.customizeProperty.transactionNote=e),placeholder:"Leave a comment here"},null,512),[[h,t.transactionsData.customizeProperty.transactionNote]]),ft])])]),ht,s("button",bt,[n(" 立即贊助"),s("span",null,"NT$"+u((v=t.singleFeedback)==null?void 0:v.feedbackSettingMoney),1)]),_t]}),_:1},8,["onSubmit"])])])])])}const Ft=F(W,[["render",vt]]);export{Ft as default}; diff --git a/assets/DpProjectChoose-Jv6rXjjo.js b/assets/DpProjectChoose-Jv6rXjjo.js deleted file mode 100644 index a195e0d..0000000 --- a/assets/DpProjectChoose-Jv6rXjjo.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as b,N as w,P as _,x as f,h as g,i as k,g as I,y as x,m as y,c as r,a as i,j as c,w as n,z as P,l as S,d as a,o as s,F as M,r as V,b as C}from"./index-ZKny8dII.js";import{e as l}from"./exploreStore-0RzM94wX.js";import{P as E}from"./PlanCard-bRKIUWYY.js";/* empty css */import{m as v}from"./mixinFullScreenLoading-9dNja2ki.js";import"./CheckIcon-p907IZ-C.js";import"./RightArrow-WNYavUu6.js";import"./StarHollow-RvDE_JVe.js";import"./StarFull-hqQk7cwm.js";var F={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:B}=F,D={props:{feedbacks:Object},data(){return{modules:[w,_,f],test:{proposalFeedbacks:{}}}},components:{PlanCard:E,Swiper:g,SwiperSlide:k},computed:{...I(l,["singleProposal"]),...x("exploreStore",["getProposalID"])},mixins:[v],async created(){await this.showFullScreenLoading(),await this.getProposals(),setTimeout(()=>{this.hideFullScreenLoading()},800)},mounted(){},methods:{...y(l,["getProposals"]),async getProposals(){const o=this.$route.params.id;await this.$http.get(`${B}/dreamboost/proposal/guest/inActiveProposals`).then(e=>{e.data.success&&(this.test=e.data.data.result[o])}).catch(e=>{throw new Error(e)})}}},O=S('

請選擇您想要贊助的金額與回饋

',1),L={class:"container pb-20 overflow-hidden"};function N(o,e,U,R,t,T){const p=a("PlanCard"),d=a("swiper-slide"),m=a("swiper");return s(),r("main",null,[O,i("section",null,[i("div",L,[t.test&&t.test.proposalFeedbacks?(s(),c(m,{key:0,ref:"swiper",modules:t.modules,"space-between":24,"centered-slides":!0,pagination:{type:"progressbar"},slidesPerView:1,breakpoints:{768:{slidesPerView:1},992:{slidesPerView:3}},autoplay:{delay:6e3,disableOnInteraction:!1},class:"mySwiper row container"},{default:n(()=>[(s(!0),r(M,null,V(t.test.proposalFeedbacks,(u,h)=>(s(),c(d,{class:"pt-10 mb-6 d-flex",key:h},{default:n(()=>[C(p,{feedbacks:u,class:"col"},null,8,["feedbacks"])]),_:2},1024))),128))]),_:1},8,["modules"])):P("",!0)])])])}const Z=b(D,[["render",N]]);export{Z as default}; diff --git a/assets/DpProjectChoose-SDmeo5DA.js b/assets/DpProjectChoose-SDmeo5DA.js new file mode 100644 index 0000000..67c89b9 --- /dev/null +++ b/assets/DpProjectChoose-SDmeo5DA.js @@ -0,0 +1 @@ +import{_,N as w,P as f,x as g,h as b,i as P,g as x,y as S,m as v,c as r,a as i,j as n,w as c,z as y,l as k,d as a,o as s,F as V,r as C,b as F}from"./index-sWoFWHUv.js";import{e as l}from"./exploreStore-XbTlwxKO.js";import{P as B}from"./PlanCard-dFGp4k9F.js";/* empty css */import{m as E}from"./mixinFullScreenLoading-9dNja2ki.js";import"./CheckIcon-mXt6_GXv.js";import"./RightArrow-8a6ZPEaq.js";import"./StarHollow-e-RtIRcs.js";import"./StarFull-qHe9up2f.js";var L={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:D}=L,N={props:{feedbacks:Object},data(){return{modules:[w,f,g],test:{proposalFeedbacks:{}}}},components:{PlanCard:B,Swiper:b,SwiperSlide:P},computed:{...x(l,["singleProposal"]),...S("exploreStore",["getProposalID"])},mixins:[E],async created(){await this.showFullScreenLoading(),await this.getProposals(),setTimeout(()=>{this.hideFullScreenLoading()},800)},mounted(){},methods:{...v(l,["getProposals"]),async getProposals(){const o=this.$route.params.id;await this.$http.get(`${D}/dreamboost/proposal/guest/inActiveProposals`).then(e=>{e.data.success&&(this.test=e.data.data.result[o])}).catch(e=>{throw new Error(e)})}}},A=k('

請選擇您想要贊助的金額與回饋

',1),I={class:"container pb-20 overflow-hidden"};function R(o,e,j,O,t,M){const p=a("PlanCard"),d=a("swiper-slide"),m=a("swiper");return s(),r("main",null,[A,i("section",null,[i("div",I,[t.test&&t.test.proposalFeedbacks?(s(),n(m,{key:0,ref:"swiper",modules:t.modules,"space-between":24,"centered-slides":!0,pagination:{type:"progressbar"},slidesPerView:1,breakpoints:{768:{slidesPerView:1},992:{slidesPerView:3}},autoplay:{delay:6e3,disableOnInteraction:!1},class:"mySwiper row container"},{default:c(()=>[(s(!0),r(V,null,C(t.test.proposalFeedbacks,(u,h)=>(s(),n(d,{class:"pt-10 mb-6 d-flex",key:h},{default:c(()=>[F(p,{feedbacks:u,class:"col"},null,8,["feedbacks"])]),_:2},1024))),128))]),_:1},8,["modules"])):y("",!0)])])])}const Q=_(N,[["render",R]]);export{Q as default}; diff --git a/assets/DpView-q51R5hcu.js b/assets/DpView-Q5Kh7xSE.js similarity index 93% rename from assets/DpView-q51R5hcu.js rename to assets/DpView-Q5Kh7xSE.js index 15a16b8..54d9a20 100644 --- a/assets/DpView-q51R5hcu.js +++ b/assets/DpView-Q5Kh7xSE.js @@ -1 +1 @@ -import{_ as h,g as u,m as f,c as b,a as s,t as e,b as y,F as P,o as x,d as v}from"./index-ZKny8dII.js";import{e as g}from"./exploreStore-0RzM94wX.js";const w={computed:{...u(g,["singleProposal"])},mounted(){this.getProposals()},methods:{...f(g,["getProposals"])}},T={class:"container pt-19 mb-15 mb-md-21"},$={class:"row gx-0 gx-lg-8 d-flex align-items-center align-items-lg-stretch justify-content-center"},N={class:"col-12 col-lg-4 mb-8 mb-lg-0"},V=["src"],S={class:"col-12 col-lg-6 d-flex flex-column justify-content-lg-between mt-2 ps-2 ps-md-0 ms-lg-6"},k={class:"mb-4 mb-lg-0"},B={class:"badge bg-primary rounded-pill mb-2"},j={class:"fs-5 fw-normal mb-0 py-1 px-1"},z={class:"fs-3 text-primary-dark"},C={class:"d-flex align-items-center mt-3"},D=["src"],E={class:"fs-lg-6 mb-0"},F={class:"text-gray-600 mb-2"},I={class:"d-flex align-items-end"},M=s("p",{class:"fs-3 fw-bold lh-1 text-danger mb-0 me-3"}," NT $ 2,250,005 ",-1),R={class:"text-gray-600 mb-0"},A=s("div",{class:"border-bottom border-3 border-primary-light"},null,-1);function q(o,G,H,J,K,L){var t,l,a,i,r,n,c,p,d,m;const _=v("RouterView");return x(),b(P,null,[s("section",T,[s("div",$,[s("div",N,[s("img",{src:(t=o.singleProposal)==null?void 0:t.proposalMainImage,class:"img-fluid w-100 rounded-3",alt:"",style:{"min-height":"236px"}},null,8,V)]),s("div",S,[s("div",k,[s("span",B,[s("p",j,e((l=o.singleProposal)==null?void 0:l.proposalCategory),1)]),s("h1",z,e((a=o.singleProposal)==null?void 0:a.proposalTitle),1),s("div",C,[s("img",{src:(r=(i=o.singleProposal)==null?void 0:i.customizeProperty)==null?void 0:r.userImage,class:"img-fluid rounded-circle me-3",alt:"",style:{height:"36px"}},null,8,D),s("p",E," 發起人:"+e((c=(n=o.singleProposal)==null?void 0:n.customizeProperty)==null?void 0:c.displayName),1)])]),s("div",null,[s("p",F," 專案時間:"+e((p=o.singleProposal)==null?void 0:p.proposalStartTime)+" ~ "+e((d=o.singleProposal)==null?void 0:d.proposalEndTime),1),s("div",I,[M,s("p",R," /目標 NT$ "+e((m=o.singleProposal)==null?void 0:m.proposalTargetMoney),1)])])])])]),A,y(_)],64)}const U=h(w,[["render",q]]);export{U as default}; +import{_ as h,g as u,m as f,c as b,a as s,t as e,b as y,F as P,o as x,d as v}from"./index-sWoFWHUv.js";import{e as g}from"./exploreStore-XbTlwxKO.js";const w={computed:{...u(g,["singleProposal"])},mounted(){this.getProposals()},methods:{...f(g,["getProposals"])}},T={class:"container pt-19 mb-15 mb-md-21"},$={class:"row gx-0 gx-lg-8 d-flex align-items-center align-items-lg-stretch justify-content-center"},N={class:"col-12 col-lg-4 mb-8 mb-lg-0"},V=["src"],S={class:"col-12 col-lg-6 d-flex flex-column justify-content-lg-between mt-2 ps-2 ps-md-0 ms-lg-6"},k={class:"mb-4 mb-lg-0"},B={class:"badge bg-primary rounded-pill mb-2"},j={class:"fs-5 fw-normal mb-0 py-1 px-1"},z={class:"fs-3 text-primary-dark"},C={class:"d-flex align-items-center mt-3"},D=["src"],E={class:"fs-lg-6 mb-0"},F={class:"text-gray-600 mb-2"},I={class:"d-flex align-items-end"},M=s("p",{class:"fs-3 fw-bold lh-1 text-danger mb-0 me-3"}," NT $ 2,250,005 ",-1),R={class:"text-gray-600 mb-0"},A=s("div",{class:"border-bottom border-3 border-primary-light"},null,-1);function q(o,G,H,J,K,L){var t,l,a,i,r,n,c,p,d,m;const _=v("RouterView");return x(),b(P,null,[s("section",T,[s("div",$,[s("div",N,[s("img",{src:(t=o.singleProposal)==null?void 0:t.proposalMainImage,class:"img-fluid w-100 rounded-3",alt:"",style:{"min-height":"236px"}},null,8,V)]),s("div",S,[s("div",k,[s("span",B,[s("p",j,e((l=o.singleProposal)==null?void 0:l.proposalCategory),1)]),s("h1",z,e((a=o.singleProposal)==null?void 0:a.proposalTitle),1),s("div",C,[s("img",{src:(r=(i=o.singleProposal)==null?void 0:i.customizeProperty)==null?void 0:r.userImage,class:"img-fluid rounded-circle me-3",alt:"",style:{height:"36px"}},null,8,D),s("p",E," 發起人:"+e((c=(n=o.singleProposal)==null?void 0:n.customizeProperty)==null?void 0:c.displayName),1)])]),s("div",null,[s("p",F," 專案時間:"+e((p=o.singleProposal)==null?void 0:p.proposalStartTime)+" ~ "+e((d=o.singleProposal)==null?void 0:d.proposalEndTime),1),s("div",I,[M,s("p",R," /目標 NT$ "+e((m=o.singleProposal)==null?void 0:m.proposalTargetMoney),1)])])])])]),A,y(_)],64)}const U=h(w,[["render",q]]);export{U as default}; diff --git a/assets/ExploreView-wnTjHK7D.js b/assets/ExploreView-Yqqb-V9F.js similarity index 94% rename from assets/ExploreView-wnTjHK7D.js rename to assets/ExploreView-Yqqb-V9F.js index 450ae48..b5519f8 100644 --- a/assets/ExploreView-wnTjHK7D.js +++ b/assets/ExploreView-Yqqb-V9F.js @@ -1 +1 @@ -import{_ as x,o,c as a,a as e,f,b as r,t as n,e as h,n as D,w as j,d as c,g as y,m as g,F as w,r as C,l as F,q as H}from"./index-ZKny8dII.js";import{e as $}from"./exploreStore-0RzM94wX.js";import{u as k}from"./userStore-UL1hxTbg.js";import{s as I}from"./sweetAlert2Store-vFUo6cdB.js";import{m as M}from"./mixinFullScreenLoading-9dNja2ki.js";import{M as z}from"./MessageIcon-8I9dQ8cP.js";import{S as A}from"./StarFull-hqQk7cwm.js";import{S as B}from"./StarHollow-RvDE_JVe.js";import{C as L}from"./CuponCircle-uEjuryuY.js";const P={},N={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},U=e("path",{d:"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z",fill:"currentColor"},null,-1),O=[U];function T(t,s){return o(),a("svg",N,O)}const E=x(P,[["render",T]]),R="/DreamBoost/images/home/userIcon36.svg",q={props:{proposals:{type:Object,required:!0}},components:{MessageIcon:z,StarFull:A,StarHollow:B,ArrowUpRight:E},data(){return{randomValue:0}},mounted(){this.randomValue=Math.floor(Math.random()*20)},methods:{}},W={class:"card py-8 px-7 mb-16 border-2 border-primary rounded-4 card-shadow"},G={class:"position-relative"},J=["src"],K={class:"",style:{width:"24px","margin-top":"-2px"}},Q={class:"d-none",style:{width:"24px","margin-top":"-2px"}},X={class:"card-body p-0"},Y={class:"fs-6 text-primary"},Z={href:"",class:"title-hover"},ee={class:"card-title title-hover mb-7 fs-5 fw-semibold"},te={class:"d-flex align-items-center gap-3 mb-7 fw-normal text-gray-600 fs-5"},se=e("span",{class:"d-flex justify-content-center align-items-center bg-primary rounded-circle",style:{width:"35px",height:"35px"}},[e("img",{src:R,class:"img-fluid",alt:"DreamBoost Logo"})],-1),oe={class:"progress bg-secondary-light mb-7 rounded-pill",style:{height:"10px",width:"100%"},role:"progressbar","aria-label":"Basic example","aria-valuenow":"80","aria-valuemin":"0","aria-valuemax":"100"},ae={class:"d-flex justify-content-between align-items-center"},re={class:"d-flex me-3"},le=e("p",{class:"mb-0 me-1"},"已募資",-1),ie={class:"fw-bold text-danger mb-0"},ne={class:"d-flex align-items-center gap-3"},ce={href:""},de={class:"d-flex gap-1 message-star-hover"},pe={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},me={href:""},ue={class:"d-flex gap-1 message-star-hover"},_e={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}},he={class:"share-hover"},ge={class:"d-block",style:{width:"20px","margin-top":"-2px"}};function fe(t,s,l,S,d,p){var v;const _=c("StarHollow"),u=c("StarFull"),i=c("MessageIcon"),m=c("ArrowUpRight"),b=c("router-link");return o(),a("div",{onClick:s[1]||(s[1]=f(V=>t.$router.push(`/product/${l.proposals.proposalID}/info`),["stop"]))},[e("div",W,[e("div",G,[e("img",{src:l.proposals.proposalMainImage,class:"card-img-top rounded-3 mb-12 object-fit-cover",alt:"提案主要照片",style:{height:"250px"}},null,8,J),e("button",{type:"button",class:"border-0 btn btn-empty d-flex align-items-center p-3 position-absolute top-0 end-0",style:{"z-index":"10"},onClick:s[0]||(s[0]=f(V=>t.$emit("favorite"),["stop"]))},[e("i",K,[r(_)]),e("i",Q,[r(u)])])]),e("div",X,[e("span",Y,"#"+n(l.proposals.proposalCategory),1),e("a",Z,[e("h3",ee,n(l.proposals.proposalTitle),1)]),e("h4",te,[se,h(" 發起人:"+n((v=l.proposals.customizeProperty)==null?void 0:v.displayName),1)]),e("div",oe,[e("div",{class:"progress-bar text-white bg-primary-dark rounded-pill",style:D({width:d.randomValue+66+"%"})},null,4)]),e("div",ae,[e("div",re,[le,e("p",ie,n(d.randomValue+66)+"%",1)]),e("div",ne,[e("a",ce,[e("span",de,[h(n(d.randomValue)+" ",1),e("i",pe,[r(i)])])]),e("a",me,[e("span",ue,[h(n(d.randomValue+3)+" ",1),e("i",_e,[r(u)])])])]),r(b,{to:`/product/${l.proposals.proposalID}/info`},{default:j(()=>[e("span",he,[e("i",ge,[r(m)])])]),_:1},8,["to"])])])])])}const xe=x(q,[["render",fe]]),be={components:{CouponCircle:L,CardDefault:xe},data(){return{selectedCategory:null,filteredProposals:[{id:1,name:"挺好夢"},{id:2,name:"科技設計"},{id:3,name:"健康生活"},{id:4,name:"時尚"},{id:5,name:"公共在地"},{id:6,name:"美妝"}]}},mixins:[M],computed:{...y($,["proposals"]),...y(k,["userData"]),filteredData(){return this.selectedCategory?Object.values(this.proposals).filter(t=>t.proposalCategory===this.selectedCategory):Object.values(this.proposals)}},async mounted(){await this.showFullScreenLoading(),await this.getProposals(),await this.getUserData(),setTimeout(()=>{this.hideFullScreenLoading()},1500)},methods:{...g($,["getProposals"]),...g(k,["getUserData"]),...g(I,["errorAlert"]),favoriteHandler(){if(Object.values(this.userData).includes("")){const s=localStorage.getItem("userID");this.$router.push(`userboard/${s}/personal`),setTimeout(()=>{this.$route.path.startsWith("/userboard")&&this.errorAlert("需先完成會員資料")},1500)}},filterCategory(t){this.selectedCategory=t}}},ve={class:"container"},ye=F('

探索專案

Explore Projects

',2),we={class:"postion-relative d-none d-xxl-block"},Ce={class:"container position-relative pt-8 pb-5"},$e={class:"container row gy-8 gy-md-10 justify-content-center position-absolute z-1"},ke=["onClick"],Se=e("div",{class:"container-fluid bg-primary-light py-30 py-lg-24 py-xl-23 py-xxl-8 mb-lg-8 mb-xl-14 mt-5"},null,-1),Ve=e("div",{class:"d-block d-lg-none container-fluid bg-primary-light py-28 py-md-29 mb-4"},null,-1),De={class:"container"},je={class:"row gx-4 gx-xl-10 list-unstyled pt-5"},Fe={key:0,class:"col-12 text-center"},He=e("p",{class:"fs-4 text-gray-600"},"此類別尚未有專案唷~歡迎提案",-1),Ie=[He];function Me(t,s,l,S,d,p){const _=c("CouponCircle"),u=c("CardDefault");return o(),a("main",null,[e("section",ve,[ye,e("div",we,[r(_,{class:"top-24 start-n20 position-absolute"})]),e("div",Ce,[e("div",$e,[(o(!0),a(w,null,C(d.filteredProposals,(i,m)=>(o(),a("div",{key:m,class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},[e("a",{class:H("categorylink categorylink"+i.id+" rounded-pill border border-2 border-white fs-4 fw-medium text-white lterSpc-5 text-center pt-7"),href:"",onClick:f(b=>p.filterCategory(i.name),["prevent"])},n(i.name),11,ke)]))),128))])])]),Se,Ve,e("section",De,[e("ul",je,[p.filteredData.length===0?(o(),a("li",Fe,Ie)):(o(!0),a(w,{key:1},C(p.filteredData,(i,m)=>(o(),a("li",{class:"col-12 col-md-6 col-lg-4",key:m},[r(u,{proposals:i,onFavorite:p.favoriteHandler},null,8,["proposals","onFavorite"])]))),128))])])])}const Ee=x(be,[["render",Me]]);export{Ee as default}; +import{_ as x,o,c as a,a as e,f,b as r,t as n,e as h,n as D,w as j,d as c,g as y,m as g,F as w,r as C,l as F,q as H}from"./index-sWoFWHUv.js";import{e as $}from"./exploreStore-XbTlwxKO.js";import{u as k}from"./userStore-MngA0Arw.js";import{s as I}from"./sweetAlert2Store-M-KFz2Pq.js";import{m as M}from"./mixinFullScreenLoading-9dNja2ki.js";import{M as z}from"./MessageIcon-9j3BkLgi.js";import{S as A}from"./StarFull-qHe9up2f.js";import{S as B}from"./StarHollow-e-RtIRcs.js";import{C as L}from"./CuponCircle-nhWP3onZ.js";const P={},N={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},U=e("path",{d:"M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z",fill:"currentColor"},null,-1),O=[U];function T(t,s){return o(),a("svg",N,O)}const E=x(P,[["render",T]]),R="/DreamBoost/images/home/userIcon36.svg",q={props:{proposals:{type:Object,required:!0}},components:{MessageIcon:z,StarFull:A,StarHollow:B,ArrowUpRight:E},data(){return{randomValue:0}},mounted(){this.randomValue=Math.floor(Math.random()*20)},methods:{}},W={class:"card py-8 px-7 mb-16 border-2 border-primary rounded-4 card-shadow"},G={class:"position-relative"},J=["src"],K={class:"",style:{width:"24px","margin-top":"-2px"}},Q={class:"d-none",style:{width:"24px","margin-top":"-2px"}},X={class:"card-body p-0"},Y={class:"fs-6 text-primary"},Z={href:"",class:"title-hover"},ee={class:"card-title title-hover mb-7 fs-5 fw-semibold"},te={class:"d-flex align-items-center gap-3 mb-7 fw-normal text-gray-600 fs-5"},se=e("span",{class:"d-flex justify-content-center align-items-center bg-primary rounded-circle",style:{width:"35px",height:"35px"}},[e("img",{src:R,class:"img-fluid",alt:"DreamBoost Logo"})],-1),oe={class:"progress bg-secondary-light mb-7 rounded-pill",style:{height:"10px",width:"100%"},role:"progressbar","aria-label":"Basic example","aria-valuenow":"80","aria-valuemin":"0","aria-valuemax":"100"},ae={class:"d-flex justify-content-between align-items-center"},re={class:"d-flex me-3"},le=e("p",{class:"mb-0 me-1"},"已募資",-1),ie={class:"fw-bold text-danger mb-0"},ne={class:"d-flex align-items-center gap-3"},ce={href:""},de={class:"d-flex gap-1 message-star-hover"},pe={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},me={href:""},ue={class:"d-flex gap-1 message-star-hover"},_e={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}},he={class:"share-hover"},ge={class:"d-block",style:{width:"20px","margin-top":"-2px"}};function fe(t,s,l,S,d,p){var v;const _=c("StarHollow"),u=c("StarFull"),i=c("MessageIcon"),m=c("ArrowUpRight"),b=c("router-link");return o(),a("div",{onClick:s[1]||(s[1]=f(V=>t.$router.push(`/product/${l.proposals.proposalID}/info`),["stop"]))},[e("div",W,[e("div",G,[e("img",{src:l.proposals.proposalMainImage,class:"card-img-top rounded-3 mb-12 object-fit-cover",alt:"提案主要照片",style:{height:"250px"}},null,8,J),e("button",{type:"button",class:"border-0 btn btn-empty d-flex align-items-center p-3 position-absolute top-0 end-0",style:{"z-index":"10"},onClick:s[0]||(s[0]=f(V=>t.$emit("favorite"),["stop"]))},[e("i",K,[r(_)]),e("i",Q,[r(u)])])]),e("div",X,[e("span",Y,"#"+n(l.proposals.proposalCategory),1),e("a",Z,[e("h3",ee,n(l.proposals.proposalTitle),1)]),e("h4",te,[se,h(" 發起人:"+n((v=l.proposals.customizeProperty)==null?void 0:v.displayName),1)]),e("div",oe,[e("div",{class:"progress-bar text-white bg-primary-dark rounded-pill",style:D({width:d.randomValue+66+"%"})},null,4)]),e("div",ae,[e("div",re,[le,e("p",ie,n(d.randomValue+66)+"%",1)]),e("div",ne,[e("a",ce,[e("span",de,[h(n(d.randomValue)+" ",1),e("i",pe,[r(i)])])]),e("a",me,[e("span",ue,[h(n(d.randomValue+3)+" ",1),e("i",_e,[r(u)])])])]),r(b,{to:`/product/${l.proposals.proposalID}/info`},{default:j(()=>[e("span",he,[e("i",ge,[r(m)])])]),_:1},8,["to"])])])])])}const xe=x(q,[["render",fe]]),be={components:{CouponCircle:L,CardDefault:xe},data(){return{selectedCategory:null,filteredProposals:[{id:1,name:"挺好夢"},{id:2,name:"科技設計"},{id:3,name:"健康生活"},{id:4,name:"時尚"},{id:5,name:"公共在地"},{id:6,name:"美妝"}]}},mixins:[M],computed:{...y($,["proposals"]),...y(k,["userData"]),filteredData(){return this.selectedCategory?Object.values(this.proposals).filter(t=>t.proposalCategory===this.selectedCategory):Object.values(this.proposals)}},async mounted(){await this.showFullScreenLoading(),await this.getProposals(),await this.getUserData(),setTimeout(()=>{this.hideFullScreenLoading()},1500)},methods:{...g($,["getProposals"]),...g(k,["getUserData"]),...g(I,["errorAlert"]),favoriteHandler(){if(Object.values(this.userData).includes("")){const s=localStorage.getItem("userID");this.$router.push(`userboard/${s}/personal`),setTimeout(()=>{this.$route.path.startsWith("/userboard")&&this.errorAlert("需先完成會員資料")},1500)}},filterCategory(t){this.selectedCategory=t}}},ve={class:"container"},ye=F('

探索專案

Explore Projects

',2),we={class:"postion-relative d-none d-xxl-block"},Ce={class:"container position-relative pt-8 pb-5"},$e={class:"container row gy-8 gy-md-10 justify-content-center position-absolute z-1"},ke=["onClick"],Se=e("div",{class:"container-fluid bg-primary-light py-30 py-lg-24 py-xl-23 py-xxl-8 mb-lg-8 mb-xl-14 mt-5"},null,-1),Ve=e("div",{class:"d-block d-lg-none container-fluid bg-primary-light py-28 py-md-29 mb-4"},null,-1),De={class:"container"},je={class:"row gx-4 gx-xl-10 list-unstyled pt-5"},Fe={key:0,class:"col-12 text-center"},He=e("p",{class:"fs-4 text-gray-600"},"此類別尚未有專案唷~歡迎提案",-1),Ie=[He];function Me(t,s,l,S,d,p){const _=c("CouponCircle"),u=c("CardDefault");return o(),a("main",null,[e("section",ve,[ye,e("div",we,[r(_,{class:"top-24 start-n20 position-absolute"})]),e("div",Ce,[e("div",$e,[(o(!0),a(w,null,C(d.filteredProposals,(i,m)=>(o(),a("div",{key:m,class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},[e("a",{class:H("categorylink categorylink"+i.id+" rounded-pill border border-2 border-white fs-4 fw-medium text-white lterSpc-5 text-center pt-7"),href:"",onClick:f(b=>p.filterCategory(i.name),["prevent"])},n(i.name),11,ke)]))),128))])])]),Se,Ve,e("section",De,[e("ul",je,[p.filteredData.length===0?(o(),a("li",Fe,Ie)):(o(!0),a(w,{key:1},C(p.filteredData,(i,m)=>(o(),a("li",{class:"col-12 col-md-6 col-lg-4",key:m},[r(u,{proposals:i,onFavorite:p.favoriteHandler},null,8,["proposals","onFavorite"])]))),128))])])])}const Ee=x(be,[["render",Me]]);export{Ee as default}; diff --git a/assets/ForgetPassord-Un7zR5Hr.js b/assets/ForgetPassord-9Q--oQ-v.js similarity index 95% rename from assets/ForgetPassord-Un7zR5Hr.js rename to assets/ForgetPassord-9Q--oQ-v.js index 6b87df2..1743ed9 100644 --- a/assets/ForgetPassord-Un7zR5Hr.js +++ b/assets/ForgetPassord-9Q--oQ-v.js @@ -1 +1 @@ -import{_ as s,c as o,a as e,b as c,w as n,d as l,o as r,e as a}from"./index-ZKny8dII.js";const i={components:{}},d={class:"main"},_={class:"container"},m={class:"py-20 mb-30"},p=e("h1",{class:"text-center fs-3 text-primary mb-lg-1"},"忘記密碼",-1),h=e("p",{class:"text-center fs-6 text-primary-light mb-9"},"Forget the Password",-1),f={class:"row flex-column align-items-center"},b={class:"col-12 col-md-7 col-lg-4"},g=e("p",{class:"mb-2 fs-4 fs-lg-5 fw-medium"},"重設密碼",-1),x=e("p",{class:"fs-6 text-gray-600 mb-lg-3"},"請輸入您的註冊帳號時輸入的電子信箱地址,我們會透過電子郵件向您寄送重設密碼的連結。",-1),u=e("input",{type:"email",placeholder:"電子郵件",class:"w-100 mb-12 mb-lg-12 p-3 rounded-3 border border-primary-light"},null,-1),y={class:"d-flex flex-column-reverse flex-md-row align-items-center justify-content-end"},w=e("button",{class:"btn btn-primary py-lg-3 px-lg-9 mb-6 mb-md-0 col-12 col-md-8 col-lg-7"},"發送重設連結",-1);function v(k,$,B,N,V,C){const t=l("router-link");return r(),o("main",d,[e("section",_,[e("div",m,[p,h,e("div",f,[e("div",b,[g,x,u,e("div",y,[c(t,{to:"member",class:"me-6 text-gray-600"},{default:n(()=>[a("返回登入頁面")]),_:1}),w])])])])])])}const P=s(i,[["render",v]]);export{P as default}; +import{_ as s,c as o,a as e,b as c,w as n,d as l,o as r,e as a}from"./index-sWoFWHUv.js";const i={components:{}},d={class:"main"},_={class:"container"},m={class:"py-20 mb-30"},p=e("h1",{class:"text-center fs-3 text-primary mb-lg-1"},"忘記密碼",-1),h=e("p",{class:"text-center fs-6 text-primary-light mb-9"},"Forget the Password",-1),f={class:"row flex-column align-items-center"},b={class:"col-12 col-md-7 col-lg-4"},g=e("p",{class:"mb-2 fs-4 fs-lg-5 fw-medium"},"重設密碼",-1),x=e("p",{class:"fs-6 text-gray-600 mb-lg-3"},"請輸入您的註冊帳號時輸入的電子信箱地址,我們會透過電子郵件向您寄送重設密碼的連結。",-1),u=e("input",{type:"email",placeholder:"電子郵件",class:"w-100 mb-12 mb-lg-12 p-3 rounded-3 border border-primary-light"},null,-1),y={class:"d-flex flex-column-reverse flex-md-row align-items-center justify-content-end"},w=e("button",{class:"btn btn-primary py-lg-3 px-lg-9 mb-6 mb-md-0 col-12 col-md-8 col-lg-7"},"發送重設連結",-1);function v(k,$,B,N,V,C){const t=l("router-link");return r(),o("main",d,[e("section",_,[e("div",m,[p,h,e("div",f,[e("div",b,[g,x,u,e("div",y,[c(t,{to:"member",class:"me-6 text-gray-600"},{default:n(()=>[a("返回登入頁面")]),_:1}),w])])])])])])}const P=s(i,[["render",v]]);export{P as default}; diff --git a/assets/FrontView-BtaVLdfV.js b/assets/FrontView-BtaVLdfV.js deleted file mode 100644 index a788ef8..0000000 --- a/assets/FrontView-BtaVLdfV.js +++ /dev/null @@ -1 +0,0 @@ -import{R as M}from"./RightArrow-WNYavUu6.js";import{_ as u,o as a,c,a as e,V as b,b as t,w as r,F as v,r as x,t as y,d as o,e as l,m as C,S as R,f as S}from"./index-ZKny8dII.js";import{u as B}from"./userStore-UL1hxTbg.js";import{m as U}from"./mixinSwalToast-NfEYWmdB.js";import{m as H}from"./mixinFullScreenLoading-9dNja2ki.js";import{F,I as T}from"./InstaGram-vqASoo6M.js";import{T as E}from"./TwitterIcon-bBbhS31L.js";const z={},A={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},O=e("path",{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z",fill:"currentColor"},null,-1),j=[O];function J(i,n){return a(),c("svg",A,j)}const w=u(z,[["render",J]]),Y={data(){return{adArray:[]}},methods:{adData(){this.adArray=["即刻成為會員,立享$100 折價券!金額不限,全額折抵!","˙","與 DreamBoost 攜手,實現你的夢想!","成為我們的一份子,推動夢想不是夢 !","˙"]}},components:{Vue3Marquee:b},mounted(){this.adData()}},W={class:"container-fluid bg-primary-dark d-flex justify-content-center col-12"},N={style:{height:"28px"}};function q(i,n,d,g,_,p){const h=o("Vue3Marquee");return a(),c("div",W,[e("div",N,[t(h,{vertical:!0,scrollamount:500,class:"",style:{"--duration":"5s","--delay":"2s"}},{default:r(()=>[(a(!0),c(v,null,x(_.adArray,(s,m)=>(a(),c("span",{key:m,class:"fs-12 fs-md-6 text-white mb-0 lterSpc-10"},y(s),1))),128))]),_:1})])])}const $=u(Y,[["render",q]]),k="/DreamBoost/images/header/mainLogo.svg",G={data(){return{vistorHeader:{}}},watch:{$route(){this.vistorHeader.hide()}},mounted(){this.vistorHeader=new this.$bs.Collapse(this.$refs.vistorHeader,{toggle:!1})},components:{SearchIcon:w,RightArrow:M,VisitorHeaderAd:$}},X={class:"overflow-hidden"},Q={class:"navbar navbar-expand-md container-fluid border-bottom border-primary-light shadow-sm"},Z={class:"container d-flex justify-content-between align-items-center"},P=e("a",{href:""},[e("img",{class:"img-fluid",src:k,alt:"首頁"})],-1),K=e("button",{class:"navbar-toggler bg-primary",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"},[e("span",{class:"navbar-toggler-icon"})],-1),ee={class:"collapse navbar-collapse",id:"navbarSupportedContent",ref:"vistorHeader"},te={class:"navbar-nav mx-auto mb-2 mb-md-0"},se={class:"nav-item"},oe={class:"nav-item"},ne={class:"nav-item"},re={class:"d-lg-inline-flex justify-content-center align-items-center d-none d-lg-block"},ae={class:"btn btn-secondary-light border border-2 border-primary rounded-3 px-5 py-3 me-5 d-flex align-items-center justify-content-center btn-pr position-relative"},ce={class:"d-flex justify-content-center align-items-center"},ie=e("p",{class:"mb-0 pe-2 fw-semibold text-nowrap"},"一起追夢",-1),le={class:"mt-1 d-none"},de={class:"btn btn-outline-primary border-2 btn-search p-3"};function _e(i,n,d,g,_,p){const h=o("VisitorHeaderAd"),s=o("RouterLink"),m=o("RightArrow"),f=o("SearchIcon");return a(),c("header",X,[t(h),e("nav",Q,[e("div",Z,[t(s,{to:"/"},{default:r(()=>[P]),_:1}),K,e("div",ee,[e("ul",te,[e("li",se,[t(s,{to:"/explore","aria-current":"page",class:"nav-link text-center fs-18 fs-lg-5 me-6 router-link-active RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 探索 ")]),_:1})]),e("li",oe,[t(s,{to:"/launch",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 發起專案 ")]),_:1})]),e("li",ne,[t(s,{to:"/member",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 註冊登入 ")]),_:1})])]),e("div",re,[t(s,{to:"/explore"},{default:r(()=>[e("button",ae,[e("span",ce,[ie,t(m,{class:"fs-3",style:{width:"18px"}})])])]),_:1}),e("span",le,[e("button",de,[t(f,{class:"fs-3",style:{width:"24px"}})])])])],512)])])])}const he=u(G,[["render",_e]]);var me={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:ue}=me,pe={data(){return{userHeader:null,userInfo:{userTelephone:"09123456789",userGender:"",userAvatarImage:"",userBirthday:"",customizeProperty:{contactEmail:""}}}},watch:{$route(){this.userHeader.hide()}},methods:{...C(B,["changeUser"]),getUserData(){const i=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.defaults.headers.common.Authorization=i,this.$http.get(`${ue}/dreamboost/user/normal/userprofile`).then(n=>{if(n.data.success)this.userInfo=n.data.data.result;else throw new Error("更新使用者資料失敗:",n.data.message)}).catch(()=>{})},logout(){R.fire({title:"確定要登出嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(i=>{i.isConfirmed&&(this.showFullScreenLoading({canCancel:!1,opacity:.8}),this.addToast({content:"登出成功",timer:2e3}),document.cookie="db=",localStorage.removeItem("userID"),this.$emit("logout"),this.changeUser(),this.$router.push({name:"home"}),this.hideFullScreenLoading())}).catch(()=>{this.addToast({content:"取消登出",style:"info"})})}},mixins:[H,U],props:["userId"],mounted(){this.getUserData(),this.userHeader=new this.$bs.Collapse(this.$refs.userHeader,{toggle:!1})},beforeUnmount(){this.userHeader&&this.userHeader.dispose()},components:{SearchIcon:w,VisitorHeaderAd:$}},fe={class:"navbar navbar-expand-md container-fluid border-bottom border-primary-light shadow-sm"},ge={class:"container d-flex justify-content-between align-items-center"},be=e("img",{class:"img-fluid",src:k,alt:"首頁"},null,-1),ve=e("button",{class:"navbar-toggler bg-primary",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"},[e("span",{class:"navbar-toggler-icon"})],-1),xe={class:"collapse navbar-collapse d-md-flex justify-content-lg-between",id:"navbarSupportedContent",ref:"userHeader"},ye={class:"navbar-nav ms-0 ms-md-20 mb-2 mb-md-0"},we={class:"nav-item"},$e={class:"nav-item"},ke={class:"nav-item d-block d-lg-none"},Ie={class:"d-lg-inline-flex justify-content-center align-items-center d-none d-lg-block"},Ve={class:"dropdown"},De={class:"btn border-0 dropdown-toggle d-flex align-items-center px-8",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},Le=["src"],Me=e("p",{class:"mb-0"},"夢想家您好",-1),Ce={class:"dropdown-menu ms-8"},Re=e("li",null,[e("hr",{class:"dropdown-divider mx-6"})],-1),Se=e("li",null,[e("hr",{class:"dropdown-divider mx-6 mb-7"})],-1),Be=e("span",{class:"px-9 py-2 position-relative border border-2 border-primary text-primary rounded-3"}," 登出 ",-1),Ue=[Be],He={class:"mt-1 d-none"},Fe={class:"btn btn-outline-primary border-2 btn-search p-3"};function Te(i,n,d,g,_,p){const h=o("VisitorHeaderAd"),s=o("RouterLink"),m=o("SearchIcon");return a(),c("header",null,[t(h),e("nav",fe,[e("div",ge,[t(s,{to:"/"},{default:r(()=>[be]),_:1}),ve,e("div",xe,[e("ul",ye,[e("li",we,[t(s,{to:"/explore","aria-current":"page",class:"nav-link text-center fs-18 fs-lg-5 me-6 router-link-active RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 探索 ")]),_:1})]),e("li",$e,[t(s,{to:"/launch",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 發起專案 ")]),_:1})]),e("li",ke,[t(s,{to:"/userboard/user/personal",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 會員中心 ")]),_:1})])]),e("div",Ie,[e("div",Ve,[e("button",De,[e("img",{src:_.userInfo.userAvatarImage||"/images/home/userIcon36.svg",class:"img-fluid me-3 rounded-5 border",style:{"max-width":"44px",height:"44px"},alt:"會員頭貼"},null,8,Le),Me]),e("ul",Ce,[e("li",null,[t(s,{to:`/userboard/${d.userId}/personal`,class:"dropdown-item text-center"},{default:r(()=>[l(" 個人頁面 ")]),_:1},8,["to"])]),Re,e("li",null,[t(s,{to:`/userboard/${d.userId}/favorite`,class:"dropdown-item text-center"},{default:r(()=>[l(" 專案收藏 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/sponsorrecord`,class:"dropdown-item text-center"},{default:r(()=>[l(" 贊助紀錄 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/proposalrecord`,class:"dropdown-item text-center"},{default:r(()=>[l(" 提案紀錄 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/news`,class:"dropdown-item text-center"},{default:r(()=>[l(" 最新通知 ")]),_:1},8,["to"])]),Se,e("li",null,[e("button",{onClick:n[0]||(n[0]=S((...f)=>p.logout&&p.logout(...f),["prevent"])),class:"dropdown-item text-center mb-1"},Ue)])])]),e("span",He,[e("button",Fe,[t(m,{class:"fs-3",style:{width:"24px"}})])])])],512)])])])}const Ee=u(pe,[["render",Te]]),ze={},Ae={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},Oe=e("path",{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z",fill:"currentColor"},null,-1),je=[Oe];function Je(i,n){return a(),c("svg",Ae,je)}const Ye=u(ze,[["render",Je]]),We={},Ne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},qe=e("path",{d:"M311 196.8v81.3c0 2.1-1.6 3.7-3.7 3.7h-13c-1.3 0-2.4-.7-3-1.5l-37.3-50.3v48.2c0 2.1-1.6 3.7-3.7 3.7h-13c-2.1 0-3.7-1.6-3.7-3.7V196.9c0-2.1 1.6-3.7 3.7-3.7h12.9c1.1 0 2.4 .6 3 1.6l37.3 50.3V196.9c0-2.1 1.6-3.7 3.7-3.7h13c2.1-.1 3.8 1.6 3.8 3.5zm-93.7-3.7h-13c-2.1 0-3.7 1.6-3.7 3.7v81.3c0 2.1 1.6 3.7 3.7 3.7h13c2.1 0 3.7-1.6 3.7-3.7V196.8c0-1.9-1.6-3.7-3.7-3.7zm-31.4 68.1H150.3V196.8c0-2.1-1.6-3.7-3.7-3.7h-13c-2.1 0-3.7 1.6-3.7 3.7v81.3c0 1 .3 1.8 1 2.5c.7 .6 1.5 1 2.5 1h52.2c2.1 0 3.7-1.6 3.7-3.7v-13c0-1.9-1.6-3.7-3.5-3.7zm193.7-68.1H327.3c-1.9 0-3.7 1.6-3.7 3.7v81.3c0 1.9 1.6 3.7 3.7 3.7h52.2c2.1 0 3.7-1.6 3.7-3.7V265c0-2.1-1.6-3.7-3.7-3.7H344V247.7h35.5c2.1 0 3.7-1.6 3.7-3.7V230.9c0-2.1-1.6-3.7-3.7-3.7H344V213.5h35.5c2.1 0 3.7-1.6 3.7-3.7v-13c-.1-1.9-1.7-3.7-3.7-3.7zM512 93.4V419.4c-.1 51.2-42.1 92.7-93.4 92.6H92.6C41.4 511.9-.1 469.8 0 418.6V92.6C.1 41.4 42.2-.1 93.4 0H419.4c51.2 .1 92.7 42.1 92.6 93.4zM441.6 233.5c0-83.4-83.7-151.3-186.4-151.3s-186.4 67.9-186.4 151.3c0 74.7 66.3 137.4 155.9 149.3c21.8 4.7 19.3 12.7 14.4 42.1c-.8 4.7-3.8 18.4 16.1 10.1s107.3-63.2 146.5-108.2c27-29.7 39.9-59.8 39.9-93.1z",fill:"currentColor"},null,-1),Ge=[qe];function Xe(i,n){return a(),c("svg",Ne,Ge)}const Qe=u(We,[["render",Xe]]),Ze="/DreamBoost/images/home/wt-big-logo.svg",Pe={data(){return{adArray:[]}},methods:{adData(){this.adArray=["與 DreamBoost 攜手,實現你的夢想!成為我們的一份子,推動夢想不是夢 !"]}},mounted(){this.adData()},components:{Vue3Marquee:b,FaceBook:F,InstaGram:T,LinkeDin:Ye,TwitterIcon:E,LineIcon:Qe}},Ke={class:"bg-primary-dark d-flex flex-column justify-content-center align-items-center"},et=e("div",{class:"container-fluid border-bottom border-primary-light"},[e("div",{class:"container d-flex justify-content-center"},[e("img",{src:Ze,class:"img-fluid pt-6 pb-2",alt:"dream boost 白色logo"})])],-1),tt={class:"container d-flex flex-column-reverse flex-lg-row justify-content-center align-items-center"},st=e("div",{class:"d-flex flex-column align-items-center pe-0 pe-lg-10 pb-8 pb-lg-6 py-lg-6 border-end-lg border-primary-light"},[e("p",{class:"fs-6 text-gray-200 mb-1 text-nowrap"},"Copyright ©2024 DreamBoost. All rights reserve"),e("p",{class:"fs-10 text-gray-200 mb-0"},"本專題僅為學習用途,不做任何商業使用 , 圖片來源請見 Readme")],-1),ot={class:"d-none d-lg-block p-6"},nt={class:"container-fluid bg-primary-dark d-flex justify-content-center"},rt={style:{height:"28px"}},at={class:"border-start-lg border-primary-light d-flex justify-content-center align-items-center ps-0 ps-lg-4 ps-xl-10 py-6"},ct={href:"https://zh-tw.facebook.com/login/device-based/regular/login/?login_attempt=1",class:"link-hover"},it={href:"https://access.line.me/oauth2/v2.1/login?returnUri=%2Foauth2%2Fv2.1%2Fauthorize%2Fconsent%3Fapp_id%3D1429440178-lwY6XWYD%26client_id%3D1429440178%26scope%3Dchat_message.write%2Bopenid%2Bprofile%2Bgroups%2Bfriends%2Bmessage.write%26state%3D5TEnGtLYBr6i%26response_type%3Dcode%26code_challenge_method%3DS256%26code_challenge%3DWvUyL2aKO4YOm4q0pF-yDv2644sRXsr9r1JxRO-73C0%26liff_sdk_version%3D2.21.4%26type%3DL%26redirect_uri%3Dhttps%253A%252F%252Fgiftshop-tw.line.me&loginChannelId=1429440178&loginState=LKiBzJ9tm1V2ML4BHuxR0l#/",class:"link-hover"},lt={href:"https://www.instagram.com/accounts/login/?next=%2Fchin_goods%2F&source=desktop_nav",class:"link-hover"},dt={href:"https://www.linkedin.com/login/zh-tw",class:"link-hover"},_t={href:"https://twitter.com/i/flow/login",class:"link-hover"};function ht(i,n,d,g,_,p){const h=o("Vue3Marquee"),s=o("FaceBook"),m=o("LineIcon"),f=o("InstaGram"),I=o("LinkeDin"),V=o("TwitterIcon");return a(),c("footer",Ke,[et,e("div",tt,[st,e("div",ot,[e("div",nt,[e("div",rt,[t(h,{scrollamount:4e3,class:"",style:{"--duration":"10s","--delay":"6s"}},{default:r(()=>[(a(!0),c(v,null,x(_.adArray,(D,L)=>(a(),c("span",{key:L,class:"fs-5 text-secondary-light mb-0 lterSpc-10 me-16 mt-1"},y(D),1))),128))]),_:1})])])]),e("div",at,[e("a",ct,[t(s,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",it,[t(m,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",lt,[t(f,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",dt,[t(I,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",_t,[t(V,{class:"fs-3 text-white",style:{width:"32px"}})])])])])}const mt=u(Pe,[["render",ht]]);var ut={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:pt}=ut,ft={data(){return{isLoggedIn:!1,userID:""}},methods:{checkUser(){const i=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.defaults.headers.common.Authorization=i,this.$http.post(`${pt}/dreamboost/checktoken`).then(n=>{n.data.success&&(this.isLoggedIn=!0,this.userID=n.data.data.result.userID,localStorage.setItem("userID",n.data.data.result.userID))}).catch(()=>{this.isLoggedIn=!1})},logout(){this.isLoggedIn=!1}},mounted(){this.checkUser()},watch:{$route(){this.checkUser()}},components:{VisitorHeader:he,UserHeader:Ee,UserFooter:mt}},gt={class:"min-vh-100 d-flex flex-column"},bt={key:0},vt={key:1},xt={class:"flex-grow-1"};function yt(i,n,d,g,_,p){const h=o("UserHeader"),s=o("VisitorHeader"),m=o("RouterView"),f=o("UserFooter");return a(),c("div",gt,[_.isLoggedIn?(a(),c("div",bt,[t(h,{onLogout:p.logout,"user-id":_.userID},null,8,["onLogout","user-id"])])):(a(),c("div",vt,[t(s)])),e("div",xt,[t(m)]),t(f)])}const Mt=u(ft,[["render",yt]]);export{Mt as default}; diff --git a/assets/FrontView-hMnkeVHk.js b/assets/FrontView-hMnkeVHk.js new file mode 100644 index 0000000..267a166 --- /dev/null +++ b/assets/FrontView-hMnkeVHk.js @@ -0,0 +1 @@ +import{R as S}from"./RightArrow-8a6ZPEaq.js";import{_ as m,o as a,c,a as e,V as v,b as t,w as r,F as b,r as x,t as $,d as o,e as l,m as H,S as R,f as B}from"./index-sWoFWHUv.js";import{u as C}from"./userStore-MngA0Arw.js";import{m as A}from"./mixinSwalToast--n5GZdOL.js";import{m as F}from"./mixinFullScreenLoading-9dNja2ki.js";import{F as U,I as z}from"./InstaGram-Gji30qmE.js";import{T}from"./TwitterIcon-el3Nc_KC.js";const M={},E={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},j=e("path",{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z",fill:"currentColor"},null,-1),O=[j];function q(i,n){return a(),c("svg",E,O)}const w=m(M,[["render",q]]),G={data(){return{adArray:[]}},methods:{adData(){this.adArray=["即刻成為會員,立享$100 折價券!金額不限,全額折抵!","˙","與 DreamBoost 攜手,實現你的夢想!","成為我們的一份子,推動夢想不是夢 !","˙"]}},components:{Vue3Marquee:v},mounted(){this.adData()}},Y={class:"container-fluid bg-primary-dark d-flex justify-content-center col-12"},N={style:{height:"28px"}};function P(i,n,d,g,_,p){const u=o("Vue3Marquee");return a(),c("div",Y,[e("div",N,[t(u,{vertical:!0,scrollamount:500,class:"",style:{"--duration":"5s","--delay":"2s"}},{default:r(()=>[(a(!0),c(b,null,x(_.adArray,(s,h)=>(a(),c("span",{key:h,class:"fs-12 fs-md-6 text-white mb-0 lterSpc-10"},$(s),1))),128))]),_:1})])])}const y=m(G,[["render",P]]),k="/DreamBoost/images/header/mainLogo.svg",J={data(){return{vistorHeader:{}}},watch:{$route(){this.vistorHeader.hide()}},mounted(){this.vistorHeader=new this.$bs.Collapse(this.$refs.vistorHeader,{toggle:!1})},components:{SearchIcon:w,RightArrow:S,VisitorHeaderAd:y}},K={class:"overflow-hidden"},W={class:"navbar navbar-expand-md container-fluid border-bottom border-primary-light shadow-sm"},X={class:"container d-flex justify-content-between align-items-center"},Q=e("a",{href:""},[e("img",{class:"img-fluid",src:k,alt:"首頁"})],-1),Z=e("button",{class:"navbar-toggler bg-primary",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"},[e("span",{class:"navbar-toggler-icon"})],-1),ee={class:"collapse navbar-collapse",id:"navbarSupportedContent",ref:"vistorHeader"},te={class:"navbar-nav mx-auto mb-2 mb-md-0"},se={class:"nav-item"},oe={class:"nav-item"},ne={class:"nav-item"},re={class:"d-lg-inline-flex justify-content-center align-items-center d-none d-lg-block"},ae={class:"btn btn-secondary-light border border-2 border-primary rounded-3 px-5 py-3 me-5 d-flex align-items-center justify-content-center btn-pr position-relative"},ce={class:"d-flex justify-content-center align-items-center"},ie=e("p",{class:"mb-0 pe-2 fw-semibold text-nowrap"},"一起追夢",-1),le={class:"mt-1 d-none"},de={class:"btn btn-outline-primary border-2 btn-search p-3"};function _e(i,n,d,g,_,p){const u=o("VisitorHeaderAd"),s=o("RouterLink"),h=o("RightArrow"),f=o("SearchIcon");return a(),c("header",K,[t(u),e("nav",W,[e("div",X,[t(s,{to:"/"},{default:r(()=>[Q]),_:1}),Z,e("div",ee,[e("ul",te,[e("li",se,[t(s,{to:"/explore","aria-current":"page",class:"nav-link text-center fs-18 fs-lg-5 me-6 router-link-active RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 探索 ")]),_:1})]),e("li",oe,[t(s,{to:"/launch",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 發起專案 ")]),_:1})]),e("li",ne,[t(s,{to:"/member",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 註冊登入 ")]),_:1})])]),e("div",re,[t(s,{to:"/explore"},{default:r(()=>[e("button",ae,[e("span",ce,[ie,t(h,{class:"fs-3",style:{width:"18px"}})])])]),_:1}),e("span",le,[e("button",de,[t(f,{class:"fs-3",style:{width:"24px"}})])])])],512)])])])}const ue=m(J,[["render",_e]]);var he={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:me}=he,pe={data(){return{userHeader:null,userInfo:{userTelephone:"09123456789",userGender:"",userAvatarImage:"",userBirthday:"",customizeProperty:{contactEmail:""}}}},watch:{$route(){this.userHeader.hide()}},methods:{...H(C,["changeUser"]),getUserData(){const i=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.defaults.headers.common.Authorization=i,this.$http.get(`${me}/dreamboost/user/normal/userprofile`).then(n=>{if(n.data.success)this.userInfo=n.data.data.result;else throw new Error("更新使用者資料失敗:",n.data.message)}).catch(()=>{})},logout(){R.fire({title:"確定要登出嗎?",icon:"question",allowOutsideClick:!1,showCancelButton:!0,buttonsStyling:!0,confirmButtonText:"確認",cancelButtonText:"取消"}).then(i=>{i.isConfirmed&&(this.showFullScreenLoading({canCancel:!1,opacity:.8}),this.addToast({content:"登出成功",timer:2e3}),document.cookie="db=",localStorage.removeItem("userID"),this.$emit("logout"),this.changeUser(),this.$router.push({name:"home"}),this.hideFullScreenLoading())}).catch(()=>{this.addToast({content:"取消登出",style:"info"})})}},mixins:[F,A],props:["userId"],mounted(){this.getUserData(),this.userHeader=new this.$bs.Collapse(this.$refs.userHeader,{toggle:!1})},beforeUnmount(){this.userHeader&&this.userHeader.dispose()},components:{SearchIcon:w,VisitorHeaderAd:y}},fe={class:"navbar navbar-expand-md container-fluid border-bottom border-primary-light shadow-sm"},ge={class:"container d-flex justify-content-between align-items-center"},ve=e("img",{class:"img-fluid",src:k,alt:"首頁"},null,-1),be=e("button",{class:"navbar-toggler bg-primary",type:"button","data-bs-toggle":"collapse","data-bs-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"},[e("span",{class:"navbar-toggler-icon"})],-1),xe={class:"collapse navbar-collapse d-md-flex justify-content-lg-between",id:"navbarSupportedContent",ref:"userHeader"},$e={class:"navbar-nav ms-0 ms-md-20 mb-2 mb-md-0"},we={class:"nav-item"},ye={class:"nav-item"},ke={class:"nav-item d-block d-lg-none"},Ie={class:"d-lg-inline-flex justify-content-center align-items-center d-none d-lg-block"},Ve={class:"dropdown"},De={class:"btn border-0 dropdown-toggle d-flex align-items-center px-8",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},Le=["src"],Se=e("p",{class:"mb-0"},"夢想家您好",-1),He={class:"dropdown-menu ms-8"},Re=e("li",null,[e("hr",{class:"dropdown-divider mx-6"})],-1),Be=e("li",null,[e("hr",{class:"dropdown-divider mx-6 mb-7"})],-1),Ce=e("span",{class:"px-9 py-2 position-relative border border-2 border-primary text-primary rounded-3"}," 登出 ",-1),Ae=[Ce],Fe={class:"mt-1 d-none"},Ue={class:"btn btn-outline-primary border-2 btn-search p-3"};function ze(i,n,d,g,_,p){const u=o("VisitorHeaderAd"),s=o("RouterLink"),h=o("SearchIcon");return a(),c("header",null,[t(u),e("nav",fe,[e("div",ge,[t(s,{to:"/"},{default:r(()=>[ve]),_:1}),be,e("div",xe,[e("ul",$e,[e("li",we,[t(s,{to:"/explore","aria-current":"page",class:"nav-link text-center fs-18 fs-lg-5 me-6 router-link-active RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 探索 ")]),_:1})]),e("li",ye,[t(s,{to:"/launch",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 發起專案 ")]),_:1})]),e("li",ke,[t(s,{to:"/userboard/user/personal",class:"nav-link me-6 router-link-active text-center fs-18 fs-lg-5 RoterLink py-4 py-md-0 py-lg-4"},{default:r(()=>[l(" 會員中心 ")]),_:1})])]),e("div",Ie,[e("div",Ve,[e("button",De,[e("img",{src:_.userInfo.userAvatarImage||"/images/home/userIcon36.svg",class:"img-fluid me-3 rounded-5 border",style:{"max-width":"44px",height:"44px"},alt:"會員頭貼"},null,8,Le),Se]),e("ul",He,[e("li",null,[t(s,{to:`/userboard/${d.userId}/personal`,class:"dropdown-item text-center"},{default:r(()=>[l(" 個人頁面 ")]),_:1},8,["to"])]),Re,e("li",null,[t(s,{to:`/userboard/${d.userId}/favorite`,class:"dropdown-item text-center"},{default:r(()=>[l(" 專案收藏 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/sponsorrecord`,class:"dropdown-item text-center"},{default:r(()=>[l(" 贊助紀錄 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/proposalrecord`,class:"dropdown-item text-center"},{default:r(()=>[l(" 提案紀錄 ")]),_:1},8,["to"])]),e("li",null,[t(s,{to:`/userboard/${d.userId}/news`,class:"dropdown-item text-center"},{default:r(()=>[l(" 最新通知 ")]),_:1},8,["to"])]),Be,e("li",null,[e("button",{onClick:n[0]||(n[0]=B((...f)=>p.logout&&p.logout(...f),["prevent"])),class:"dropdown-item text-center mb-1"},Ae)])])]),e("span",Fe,[e("button",Ue,[t(h,{class:"fs-3",style:{width:"24px"}})])])])],512)])])])}const Te=m(pe,[["render",ze]]),Me={},Ee={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},je=e("path",{d:"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z",fill:"currentColor"},null,-1),Oe=[je];function qe(i,n){return a(),c("svg",Ee,Oe)}const Ge=m(Me,[["render",qe]]),Ye={},Ne={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Pe=e("path",{d:"M311 196.8v81.3c0 2.1-1.6 3.7-3.7 3.7h-13c-1.3 0-2.4-.7-3-1.5l-37.3-50.3v48.2c0 2.1-1.6 3.7-3.7 3.7h-13c-2.1 0-3.7-1.6-3.7-3.7V196.9c0-2.1 1.6-3.7 3.7-3.7h12.9c1.1 0 2.4 .6 3 1.6l37.3 50.3V196.9c0-2.1 1.6-3.7 3.7-3.7h13c2.1-.1 3.8 1.6 3.8 3.5zm-93.7-3.7h-13c-2.1 0-3.7 1.6-3.7 3.7v81.3c0 2.1 1.6 3.7 3.7 3.7h13c2.1 0 3.7-1.6 3.7-3.7V196.8c0-1.9-1.6-3.7-3.7-3.7zm-31.4 68.1H150.3V196.8c0-2.1-1.6-3.7-3.7-3.7h-13c-2.1 0-3.7 1.6-3.7 3.7v81.3c0 1 .3 1.8 1 2.5c.7 .6 1.5 1 2.5 1h52.2c2.1 0 3.7-1.6 3.7-3.7v-13c0-1.9-1.6-3.7-3.5-3.7zm193.7-68.1H327.3c-1.9 0-3.7 1.6-3.7 3.7v81.3c0 1.9 1.6 3.7 3.7 3.7h52.2c2.1 0 3.7-1.6 3.7-3.7V265c0-2.1-1.6-3.7-3.7-3.7H344V247.7h35.5c2.1 0 3.7-1.6 3.7-3.7V230.9c0-2.1-1.6-3.7-3.7-3.7H344V213.5h35.5c2.1 0 3.7-1.6 3.7-3.7v-13c-.1-1.9-1.7-3.7-3.7-3.7zM512 93.4V419.4c-.1 51.2-42.1 92.7-93.4 92.6H92.6C41.4 511.9-.1 469.8 0 418.6V92.6C.1 41.4 42.2-.1 93.4 0H419.4c51.2 .1 92.7 42.1 92.6 93.4zM441.6 233.5c0-83.4-83.7-151.3-186.4-151.3s-186.4 67.9-186.4 151.3c0 74.7 66.3 137.4 155.9 149.3c21.8 4.7 19.3 12.7 14.4 42.1c-.8 4.7-3.8 18.4 16.1 10.1s107.3-63.2 146.5-108.2c27-29.7 39.9-59.8 39.9-93.1z",fill:"currentColor"},null,-1),Je=[Pe];function Ke(i,n){return a(),c("svg",Ne,Je)}const We=m(Ye,[["render",Ke]]),Xe="/DreamBoost/images/home/wt-big-logo.svg",Qe={data(){return{adArray:[]}},methods:{adData(){this.adArray=["與 DreamBoost 攜手,實現你的夢想!成為我們的一份子,推動夢想不是夢 !"]}},mounted(){this.adData()},components:{Vue3Marquee:v,FaceBook:U,InstaGram:z,LinkeDin:Ge,TwitterIcon:T,LineIcon:We}},Ze={class:"bg-primary-dark d-flex flex-column justify-content-center align-items-center"},et=e("div",{class:"container-fluid border-bottom border-primary-light"},[e("div",{class:"container d-flex justify-content-center"},[e("img",{src:Xe,class:"img-fluid pt-6 pb-2",alt:"dream boost 白色logo"})])],-1),tt={class:"container d-flex flex-column-reverse flex-lg-row justify-content-center align-items-center"},st=e("div",{class:"d-flex flex-column align-items-center pe-0 pe-lg-10 pb-8 pb-lg-6 py-lg-6 border-end-lg border-primary-light"},[e("p",{class:"fs-6 text-gray-200 mb-1 text-nowrap"},"Copyright ©2024 DreamBoost. All rights reserve"),e("p",{class:"fs-10 text-gray-200 mb-0"},"本專題僅為學習用途,不做任何商業使用 , 圖片來源請見 Readme")],-1),ot={class:"d-none d-lg-block p-6"},nt={class:"container-fluid bg-primary-dark d-flex justify-content-center"},rt={style:{height:"28px"}},at={class:"border-start-lg border-primary-light d-flex justify-content-center align-items-center ps-0 ps-lg-4 ps-xl-10 py-6"},ct={href:"https://zh-tw.facebook.com/login/device-based/regular/login/?login_attempt=1",class:"link-hover"},it={href:"https://access.line.me/oauth2/v2.1/login?returnUri=%2Foauth2%2Fv2.1%2Fauthorize%2Fconsent%3Fapp_id%3D1429440178-lwY6XWYD%26client_id%3D1429440178%26scope%3Dchat_message.write%2Bopenid%2Bprofile%2Bgroups%2Bfriends%2Bmessage.write%26state%3D5TEnGtLYBr6i%26response_type%3Dcode%26code_challenge_method%3DS256%26code_challenge%3DWvUyL2aKO4YOm4q0pF-yDv2644sRXsr9r1JxRO-73C0%26liff_sdk_version%3D2.21.4%26type%3DL%26redirect_uri%3Dhttps%253A%252F%252Fgiftshop-tw.line.me&loginChannelId=1429440178&loginState=LKiBzJ9tm1V2ML4BHuxR0l#/",class:"link-hover"},lt={href:"https://www.instagram.com/accounts/login/?next=%2Fchin_goods%2F&source=desktop_nav",class:"link-hover"},dt={href:"https://www.linkedin.com/login/zh-tw",class:"link-hover"},_t={href:"https://twitter.com/i/flow/login",class:"link-hover"};function ut(i,n,d,g,_,p){const u=o("Vue3Marquee"),s=o("FaceBook"),h=o("LineIcon"),f=o("InstaGram"),I=o("LinkeDin"),V=o("TwitterIcon");return a(),c("footer",Ze,[et,e("div",tt,[st,e("div",ot,[e("div",nt,[e("div",rt,[t(u,{scrollamount:4e3,class:"",style:{"--duration":"10s","--delay":"6s"}},{default:r(()=>[(a(!0),c(b,null,x(_.adArray,(D,L)=>(a(),c("span",{key:L,class:"fs-5 text-secondary-light mb-0 lterSpc-10 me-16 mt-1"},$(D),1))),128))]),_:1})])])]),e("div",at,[e("a",ct,[t(s,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",it,[t(h,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",lt,[t(f,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",dt,[t(I,{class:"fs-3 me-4 text-white",style:{width:"32px"}})]),e("a",_t,[t(V,{class:"fs-3 text-white",style:{width:"32px"}})])])])])}const ht=m(Qe,[["render",ut]]);var mt={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:pt}=mt,ft={data(){return{isLoggedIn:!1,userID:""}},methods:{checkUser(){const i=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.$http.defaults.headers.common.Authorization=i,this.$http.post(`${pt}/dreamboost/checktoken`).then(n=>{n.data.success&&(this.isLoggedIn=!0,this.userID=n.data.data.result.userID,localStorage.setItem("userID",n.data.data.result.userID))}).catch(()=>{this.isLoggedIn=!1})},logout(){this.isLoggedIn=!1}},mounted(){this.checkUser()},watch:{$route(){this.checkUser()}},components:{VisitorHeader:ue,UserHeader:Te,UserFooter:ht}},gt={class:"min-vh-100 d-flex flex-column"},vt={key:0},bt={key:1},xt={class:"flex-grow-1"};function $t(i,n,d,g,_,p){const u=o("UserHeader"),s=o("VisitorHeader"),h=o("RouterView"),f=o("UserFooter");return a(),c("div",gt,[_.isLoggedIn?(a(),c("div",vt,[t(u,{onLogout:p.logout,"user-id":_.userID},null,8,["onLogout","user-id"])])):(a(),c("div",bt,[t(s)])),e("div",xt,[t(h)]),t(f)])}const St=m(ft,[["render",$t]]);export{St as default}; diff --git a/assets/HomeView-BG70zqee.js b/assets/HomeView-BG70zqee.js new file mode 100644 index 0000000..c3b3b8f --- /dev/null +++ b/assets/HomeView-BG70zqee.js @@ -0,0 +1 @@ +import{_ as b,V as M,o as c,c as d,b as s,w as i,F as w,r as k,d as o,N as H,P as O,E as U,g as R,h as N,i as W,j as Y,a as e,e as u,t as h,p as V,k as I,f as B,n as q,C as G,m as J,l as A}from"./index-sWoFWHUv.js";import{e as L}from"./exploreStore-XbTlwxKO.js";import{m as K}from"./mixinFullScreenLoading-9dNja2ki.js";import{R as z}from"./RightArrow-8a6ZPEaq.js";import{C as Q}from"./CuponCircle-nhWP3onZ.js";import{u as X}from"./userStore-MngA0Arw.js";/* empty css */import{_ as Z}from"./w-biglogo--vR3noKG.js";import{S as T}from"./StarFull-qHe9up2f.js";import{M as F}from"./MessageIcon-9j3BkLgi.js";const ee={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/9d3cec53634e1297357325aa9565ffbd9e657190/public/images/home/pr-light-logo.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/9d3cec53634e1297357325aa9565ffbd9e657190/public/images/home/pr-light-logo.svg"]}},components:{Vue3Marquee:M},mounted(){this.imgData()}},te={class:"container-fluid"},se=["src"];function oe(t,a,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",te,[s(p,{clone:!0,duration:6,direction:"reverse"},{default:i(()=>[(c(!0),d(w,null,k(l.imgArray,n=>(c(),d("img",{key:n,src:n,class:"img-fluid me-6"},null,8,se))),128))]),_:1})])}const le=b(ee,[["render",oe]]),ie={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/white-logo.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/white-logo.svg"]}},components:{Vue3Marquee:M},mounted(){this.imgData()}},re={class:"container-fluid bg-gray-700 mb-7"},ce=["src"];function ae(t,a,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",re,[s(p,{clone:!0,duration:8,direction:"normal"},{default:i(()=>[(c(!0),d(w,null,k(l.imgArray,n=>(c(),d("img",{key:n,src:n,class:"img-fluid me-20"},null,8,ce))),128))]),_:1})])}const ne=b(ie,[["render",ae]]),de={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/big_DREAMBOOST.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/db_logoAlong.svg"]}},components:{Vue3Marquee:M},mounted(){this.imgData()}},me={class:"container-fluid"},pe=["src"];function he(t,a,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",me,[s(p,{clone:!0,duration:10,direction:"reverse"},{default:i(()=>[(c(!0),d(w,null,k(l.imgArray,n=>(c(),d("img",{key:n,src:n,class:"img-fluid me-10"},null,8,pe))),128))]),_:1})])}const ue=b(de,[["render",he]]);var _e={VITE_URL:"https://api.dreamboost.shop",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:ge}=_e,be={data(){return{modules:[H,O],bnData:[],EffectFade:U}},methods:{onSlideChange(){},getBnUrl(){this.$http.get(`${ge}/dreamboost/banner/guest/banner`).then(t=>{this.bnData=t.data.data.result}).catch(()=>{})},changeTokenState(){this.isToken=!this.isToken}},created(){const t=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.isToken=t},mounted(){this.getBnUrl()},computed:{...R(X,["isUser"])},components:{RightArrow:z,Swiper:N,SwiperSlide:W}},fe=t=>(V("data-v-55bed53d"),t=t(),I(),t),xe={class:"container py-15 bg-white"},ve={class:"rounded-5"},ye={class:"d-flex flex-column justify-content-center align-items-center"},we=["src"],$e={class:"bg-primary-dark col-12 py-7 rounded-bottom-5 position-absolute bottom-0"},ke={class:"text-secondary-light text-center lterSpc-10 mb-0 mx-8 bn-hover"},je=fe(()=>e("div",{class:"d-flex flex-column align-items-center position-absolute top-24 top-sm-24 px-10"},[e("img",{src:Z,class:"img-fluid mb-5 col-12",alt:""}),e("p",{class:"fs-3 fw-light text-white mb-0 lterSpc-10"},"推動夢想不是夢 !")],-1));function Se(t,a,m,f,l,g){const p=o("RightArrow"),n=o("RouterLink"),_=o("swiper-slide"),x=o("swiper");return c(),d("div",xe,[s(x,{ref:"swiper",modules:[l.EffectFade],effect:"fade","slides-per-view":3,"space-between":120,"centered-slides":!0,breakpoints:{390:{slidesPerView:1}},autoplay:{delay:5e3,disableOnInteraction:!1},onSwiperslidechange:g.onSlideChange,class:"rounded-5 col-12 object-fit-cover",style:{height:"650px"}},{default:i(()=>[(c(!0),d(w,null,k(l.bnData,(v,r)=>(c(),Y(_,{key:`${r}-bn`},{default:i(()=>[e("div",ve,[e("div",ye,[s(n,{to:t.isUser?"/explore":"/member",class:"position-relative col-12 rounded-5 shadow"},{default:i(()=>[e("img",{src:v.imgUrl,class:"img-fluid rounded-5 w-100 object-fit-cover",style:{height:"650px"},alt:"推動夢想不是夢概念圖"},null,8,we),e("div",$e,[e("h4",ke,[u(h(t.isUser?"立即探索,發現新項目":"立刻加入會員,一起追夢去")+" ",1),e("span",null,[s(p,{style:{width:"24px",color:"var(--bs-secondary-light)","margin-top":"-2 px"}})])])])]),_:2},1032,["to"]),je])])]),_:2},1024))),128))]),_:1},8,["modules","onSwiperslidechange"])])}const Pe=b(be,[["render",Se],["__scopeId","data-v-55bed53d"]]),De={props:{popularProjects:{type:Object,required:!0}},data(){return{randomValue:0}},components:{StarFull:T,MessageIcon:F},mounted(){this.randomValue=Math.floor(Math.random()*20)}},E=t=>(V("data-v-ac41c3c2"),t=t(),I(),t),Be=E(()=>e("div",{class:"d-flex justify-content-center mb-6 d-block d-xl-none position-relative"},[e("div",{class:"mb-5 mb-lg-3"},[e("h2",{class:"title-center text-center position-relative"},"當前熱門專案"),e("p",{class:"fs-6 text-primary-light text-center mb-0"},"Current Hot Projects")])],-1)),Ce=["src"],Me={class:"fs-6 text-primary mb-3"},Ve={class:"mb-3"},Ie={class:"mb-9"},Ae={class:"progress bg-secondary-light mb-7",style:{height:"10px"}},Le={class:"d-flex align-items-center justify-content-between"},Re={class:"d-flex align-items-center"},qe=["src"],ze={class:"mb-0"},Te={class:"d-flex"},Fe={class:"d-flex me-3"},Ee=E(()=>e("p",{class:"mb-0 me-1"},"已募資",-1)),He={class:"fw-bold text-danger mb-0"},Oe={class:"d-flex align-items-center gap-3"},Ue={href:""},Ne={class:"d-flex gap-1 message-star-hover"},We={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},Ye={href:""},Ge={class:"d-flex gap-1 message-star-hover"},Je={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}};function Ke(t,a,m,f,l,g){var _,x,v,r,j,$,y,S,P;const p=o("MessageIcon"),n=o("StarFull");return c(),d(w,null,[Be,e("div",{onClick:a[1]||(a[1]=B(C=>t.$router.push(`/product/${this.popularProjects.proposalID}/info`),["prevent"])),class:"popularcard-hover"},[e("img",{src:(_=m.popularProjects)==null?void 0:_.proposalMainImage,class:"imgcover img-fluid rounded-3 mb-7 col-12 h-100",style:{},alt:""},null,8,Ce),e("p",Me,"# "+h((x=m.popularProjects)==null?void 0:x.proposalCategory),1),e("a",{class:"title-hover",onClick:a[0]||(a[0]=B(C=>{var D;return t.$router.push(`/product/${(D=this.popularProjects)==null?void 0:D.proposalID}/info`)},["prevent"]))},[e("h4",Ve,h((v=m.popularProjects)==null?void 0:v.proposalTitle),1)]),e("p",Ie,h((j=(r=m.popularProjects)==null?void 0:r.customizeProperty)==null?void 0:j.introduction),1),e("div",Ae,[e("div",{class:"progress-bar bg-primary-dark rounded-pill",role:"progressbar",style:q({width:l.randomValue+70+"%"}),"aria-valuenow":"50","aria-valuemin":"0","aria-valuemax":"100"},null,4)]),e("div",Le,[e("div",Re,[e("img",{src:(y=($=m.popularProjects)==null?void 0:$.customizeProperty)==null?void 0:y.userImage,class:"img-fluid me-6 rounded-5 border",style:{"max-width":"36px"},alt:"會員頭貼"},null,8,qe),e("p",ze,"發起人:"+h((P=(S=m.popularProjects)==null?void 0:S.customizeProperty)==null?void 0:P.displayName),1)]),e("div",Te,[e("div",Fe,[Ee,e("p",He,h(l.randomValue+70)+"%",1)]),e("div",Oe,[e("a",Ue,[e("span",Ne,[u(h(l.randomValue)+" ",1),e("i",We,[s(p)])])]),e("a",Ye,[e("span",Ge,[u(h(l.randomValue+2)+" ",1),e("i",Je,[s(n)])])])])])])])],64)}const Qe=b(De,[["render",Ke],["__scopeId","data-v-ac41c3c2"]]),Xe={props:{proposals:{type:Object,required:!0}},data(){return{randomValue:0}},components:{StarFull:T,MessageIcon:F},mounted(){this.randomValue=Math.floor(Math.random()*20)}},Ze=t=>(V("data-v-2ec9cdc8"),t=t(),I(),t),et={class:"row g-2 align-items-stretch"},tt={class:"col-md-4 pb-4"},st=["src"],ot={class:"col-md-8 pb-4 mt-0"},lt={class:"card-body d-flex flex-column justify-items-between p-3"},it={class:"card-text fs-6 text-primary mb-1"},rt={class:"card-title fs-5 mb-11"},ct={class:"progress bg-secondary-light mb-4",style:{height:"6px"}},at={class:"d-flex justify-content-between align-items-center"},nt={class:"d-flex me-3"},dt=Ze(()=>e("p",{class:"fs-5 mb-0 me-1"},"已募資",-1)),mt={class:"fs-5 fw-bold text-danger mb-0"},pt={class:"d-flex align-items-center gap-3"},ht={href:""},ut={class:"d-flex gap-1 message-star-hover"},_t={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},gt={href:""},bt={class:"d-flex gap-1 message-star-hover"},ft={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}};function xt(t,a,m,f,l,g){const p=o("MessageIcon"),n=o("StarFull");return c(),d("div",{class:"card col-12 mb-3 border border-top-0 border-start-0 border-end-0 rounded-0 suggestcard-shadow",onClick:a[1]||(a[1]=B(_=>t.$router.push(`/product/${this.proposals.proposalID}/info`),["prevent"]))},[e("div",et,[e("div",tt,[e("img",{src:m.proposals.proposalMainImage,class:"img-fluid object-fit-cover col-12 h-100 rounded-2",alt:""},null,8,st)]),e("div",ot,[e("div",lt,[e("div",null,[e("p",it,"# "+h(m.proposals.proposalCategory),1),e("a",{class:"title-hover",onClick:a[0]||(a[0]=B(_=>t.$router.push(`/product/${this.proposals.proposalID}/info`),["prevent"]))},[e("h4",rt,h(m.proposals.proposalTitle),1)])]),e("div",null,[e("div",ct,[e("div",{class:"progress-bar bg-primary-dark rounded-pill",role:"progressbar",style:q({width:l.randomValue+50+"%"}),"aria-valuenow":"50","aria-valuemin":"0","aria-valuemax":"100"},null,4)]),e("div",at,[e("div",nt,[dt,e("p",mt,h(l.randomValue+50)+"%",1)]),e("div",pt,[e("a",ht,[e("span",ut,[u(h(l.randomValue)+" ",1),e("i",_t,[s(p)])])]),e("a",gt,[e("span",bt,[u(h(l.randomValue+2)+" ",1),e("i",ft,[s(n)])])])])])])])])])])}const vt=b(Xe,[["render",xt],["__scopeId","data-v-2ec9cdc8"]]),yt="/DreamBoost/images/home/cs_01.png",wt="/DreamBoost/images/home/cs_02.png",$t="/DreamBoost/images/home/cs_03.png",kt="/DreamBoost/images/home/cs_04.jpg",jt="/DreamBoost/images/home/cs_05.jpg",St="/DreamBoost/images/home/cs_06.png",Pt="/DreamBoost/images/home/cs_07.png",Dt="/DreamBoost/images/home/cs_08.png",Bt="/DreamBoost/images/home/cowork_01.png",Ct="/DreamBoost/images/home/cowork_02.png",Mt="/DreamBoost/images/home/cowork_03.png",Vt={components:{RightArrow:z,MarqueeDark:ne,CouponCircle:Q,HomeBn:Pe,MarqueeBiglogo:ue,MarqueeLight:le,PopularCard:Qe,SuggestCard:vt,CountTo:G},data(){return{limitedProposals:[],popularProjects:null}},mixins:[K],computed:{...R(L,["proposals"])},async mounted(){this.showFullScreenLoading(),await this.getProposals(),await this.updatePopularProjects(),setTimeout(()=>{this.hideFullScreenLoading()},1800)},watch:{proposals:{handler(t){this.updateLimitedProposals(t),this.popularProjects||this.updatePopularProjects()},immediate:!0}},methods:{...J(L,["getProposals"]),updateLimitedProposals(t){this.limitedProposals=Object.values(t).slice(0,3)},async updatePopularProjects(){if(!this.popularProjects){const t=Object.values(this.proposals),a=Math.floor(Math.random()*t.length);this.popularProjects=t[a]}}}},It={class:"container"},At={class:"row pt-18 pb-20 justify-content-center"},Lt={class:"col-12 col-xl-6 mb-18 mb-md-20 mb-xl-0 px-3 px-sm-6 px-lg-10 me-0 me-xl-10"},Rt=e("div",{class:"mb-3 d-none d-xl-block"},[e("h1",{class:"title position-relative"},"當前熱門專案"),e("p",{class:"fs-6 text-primary-light mb-0"},"Current Hot Projects")],-1),qt={class:"col-12 col-xl-5"},zt=A('

為您推薦

Recommended for You

為您推薦

Recommended for You

',2),Tt={class:"list-unstyled px-0 px-lg-8 px-xl-0 mb-8"},Ft={class:"d-flex justify-content-center justify-content-lg-end align-items-center"},Et={type:"button",class:"col-12 btn btn-secondary-light border border-2 border-primary rounded-3 px-lg-5 py-4 py-md-3 mt-5 mt-md-0 me-5 d-flex align-items-center justify-content-center btn-pr position-relative"},Ht={class:"px-3 d-flex justify-content-center align-items-center"},Ot=e("p",{class:"mb-0 pe-2 fw-semibold"},"查看更多",-1),Ut={class:"container pt-8 pb-5"},Nt=e("div",{class:"d-flex justify-content-center pb-5 position-relative"},[e("div",{class:"mb-5 mb-lg-3"},[e("h2",{class:"title-center text-center position-relative"},"專案類別"),e("p",{class:"fs-6 text-primary-light mb-0"},"Which Categories Interest You?")])],-1),Wt={class:"container row gy-8 gy-md-10 justify-content-center position-absolute translate-middle-null z-3"},Yt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Gt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Jt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Kt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Qt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Xt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Zt=e("div",{class:"container-fluid bg-primary-light py-31 py-lg-13 mb-xl-2"},null,-1),es=e("div",{class:"container-fluid bg-primary-light py-29 py-lg-13 d-block d-xl-none"},null,-1),ts=e("div",{class:"container-fluid bg-primary-light pt-1 d-none d-xl-block py-lg-1"},null,-1),ss={class:"container-fluid position-relative overflow-hidden"},os=A('

即將推出

Coming Soon

Coming Soon

',1),ls={class:"container d-flex flex-column justify-content-center"},is={class:"row g-10 mb-7 pb-27"},rs={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},cs={class:"position-relative rounded-3 h-100 csImage"},as=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),ns=e("img",{src:yt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),ds={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},ms={class:"position-relative rounded-3 h-100 csImage"},ps=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),hs=e("img",{src:wt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),us={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},_s={class:"position-relative rounded-3 h-100 csImage"},gs=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),bs=e("img",{src:$t,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),fs={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},xs={class:"position-relative rounded-3 h-100 csImage"},vs=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),ys=e("img",{src:kt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),ws={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},$s={class:"position-relative rounded-3 h-100 csImage"},ks=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),js=e("img",{src:jt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Ss={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},Ps={class:"position-relative rounded-3 h-100 csImage"},Ds=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),Bs=e("img",{src:St,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Cs={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},Ms={class:"position-relative rounded-3 h-100 csImage"},Vs=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),Is=e("img",{src:Pt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),As={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},Ls={class:"position-relative rounded-3 h-100 csImage"},Rs=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),qs=e("img",{src:Dt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),zs={class:"container-fluid bg-primary-dark"},Ts={class:"container p-12"},Fs=e("div",{class:"mb-7"},[e("h3",{class:"text-center text-white"},"將創意專案轉換為現實"),e("p",{class:"fs-6 text-center text-primary-light mb-3"},"Turn Creative Projects Into Reality"),e("p",{class:"fs-6 text-center text-gray-300 mb-8"},"在 DreamBoost 上,讓我們成為你夢想的翅膀")],-1),Es={class:"row justify-content-center"},Hs={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 me-lg-10 mb-5 p-6"},Os={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Us=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"個專案已募資",-1),Ns={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 me-lg-10 mb-5 p-6"},Ws={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Ys=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"人已經參與募資計畫",-1),Gs={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 py-6 h-100"},Js={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Ks=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"贊助計畫",-1),Qs={class:"container position-relative"},Xs=A('

合作聯繫

Cooperation Contact

合作聯繫

Cooperation Contact

',3),Zs={class:"postion-relative d-none"};function eo(t,a,m,f,l,g){const p=o("HomeBn"),n=o("PopularCard"),_=o("SuggestCard"),x=o("RightArrow"),v=o("RouterLink"),r=o("router-link"),j=o("MarqueeLight"),$=o("MarqueeDark"),y=o("countTo"),S=o("MarqueeBiglogo"),P=o("CouponCircle");return c(),d("main",null,[s(p),e("div",It,[e("div",At,[e("div",Lt,[Rt,e("div",null,[s(n,{popularProjects:l.popularProjects},null,8,["popularProjects"])])]),e("div",qt,[zt,e("ul",Tt,[(c(!0),d(w,null,k(l.limitedProposals,(C,D)=>(c(),d("li",{key:D},[s(_,{proposals:C},null,8,["proposals"])]))),128))]),e("div",Ft,[s(v,{to:"/explore"},{default:i(()=>[e("button",Et,[e("span",Ht,[Ot,s(x,{class:"fs-3",style:{width:"18px"}})])])]),_:1})])])])]),e("div",Ut,[Nt,e("div",Wt,[e("div",Yt,[s(r,{to:{name:"explore"},class:"categorylink categorylink1 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 挺好夢 ")]),_:1})]),e("div",Gt,[s(r,{to:{name:"explore"},class:"categorylink categorylink2 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 科技設計 ")]),_:1})]),e("div",Jt,[s(r,{to:{name:"explore"},class:"categorylink categorylink3 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 健康生活 ")]),_:1})]),e("div",Kt,[s(r,{to:{name:"explore"},class:"categorylink categorylink4 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 時尚 ")]),_:1})]),e("div",Qt,[s(r,{to:{name:"explore"},class:"categorylink categorylink5 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 公共在地 ")]),_:1})]),e("div",Xt,[s(r,{to:{name:"explore"},class:"categorylink categorylink6 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 美妝 ")]),_:1})])])]),s(j),Zt,es,ts,e("div",ss,[os,e("div",ls,[e("div",is,[e("div",rs,[e("div",cs,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[as,ns]),_:1})])]),e("div",ds,[e("div",ms,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[ps,hs]),_:1})])]),e("div",us,[e("div",_s,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[gs,bs]),_:1})])]),e("div",fs,[e("div",xs,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[vs,ys]),_:1})])]),e("div",ws,[e("div",$s,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[ks,js]),_:1})])]),e("div",Ss,[e("div",Ps,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Ds,Bs]),_:1})])]),e("div",Cs,[e("div",Ms,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Vs,Is]),_:1})])]),e("div",As,[e("div",Ls,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Rs,qs]),_:1})])])])])]),e("section",null,[s($),e("div",zs,[e("div",Ts,[Fs,e("div",Es,[e("div",Hs,[e("p",Os,[s(y,{startVal:0,endVal:20243,dicimals:2,duration:15e3,ref:t.refset},null,512)]),Us]),e("div",Ns,[e("p",Ws,[s(y,{startVal:-100,endVal:1766,duration:15e3})]),Ys]),e("div",Gs,[e("p",Js,[s(y,{startVal:0,endVal:23786,dicimals:2,duration:15e3,ref:t.refset},null,512)]),Ks])])])]),s(S),s($)]),e("section",Qs,[Xs,e("div",Zs,[s(P,{class:""})])])])}const po=b(Vt,[["render",eo]]);export{po as default}; diff --git a/assets/HomeView-OADhIMaJ.js b/assets/HomeView-OADhIMaJ.js deleted file mode 100644 index 443c20c..0000000 --- a/assets/HomeView-OADhIMaJ.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as b,V as C,o as c,c as d,b as s,w as i,F as w,r as $,d as o,N as O,P as U,E as W,g as L,h as N,i as H,j as Y,a as e,e as u,t as h,p as B,k as V,f as P,n as z,C as J,m as Q,l as R}from"./index-ZKny8dII.js";import{e as A}from"./exploreStore-0RzM94wX.js";import{m as X}from"./mixinFullScreenLoading-9dNja2ki.js";import{R as T}from"./RightArrow-WNYavUu6.js";import{C as Z}from"./CuponCircle-uEjuryuY.js";import{u as G}from"./userStore-UL1hxTbg.js";/* empty css */import{_ as K}from"./w-biglogo--vR3noKG.js";import{S as q}from"./StarFull-hqQk7cwm.js";import{M as E}from"./MessageIcon-8I9dQ8cP.js";const ee={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/9d3cec53634e1297357325aa9565ffbd9e657190/public/images/home/pr-light-logo.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/9d3cec53634e1297357325aa9565ffbd9e657190/public/images/home/pr-light-logo.svg"]}},components:{Vue3Marquee:C},mounted(){this.imgData()}},te={class:"container-fluid"},se=["src"];function oe(t,n,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",te,[s(p,{clone:!0,duration:6,direction:"reverse"},{default:i(()=>[(c(!0),d(w,null,$(l.imgArray,a=>(c(),d("img",{key:a,src:a,class:"img-fluid me-6"},null,8,se))),128))]),_:1})])}const le=b(ee,[["render",oe]]),ie={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/white-logo.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/white-logo.svg"]}},components:{Vue3Marquee:C},mounted(){this.imgData()}},re={class:"container-fluid bg-gray-700 mb-7"},ce=["src"];function ne(t,n,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",re,[s(p,{clone:!0,duration:8,direction:"normal"},{default:i(()=>[(c(!0),d(w,null,$(l.imgArray,a=>(c(),d("img",{key:a,src:a,class:"img-fluid me-20"},null,8,ce))),128))]),_:1})])}const ae=b(ie,[["render",ne]]),de={data(){return{imgArray:[]}},methods:{imgData(){this.imgArray=["https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/big_DREAMBOOST.svg","https://raw.githubusercontent.com/PinyiW0/DreamBoost/880674654e4e31b44e5ab98a0beb1e0f948fc539/public/images/home/db_logoAlong.svg"]}},components:{Vue3Marquee:C},mounted(){this.imgData()}},me={class:"container-fluid"},pe=["src"];function he(t,n,m,f,l,g){const p=o("Vue3Marquee");return c(),d("div",me,[s(p,{clone:!0,duration:10,direction:"reverse"},{default:i(()=>[(c(!0),d(w,null,$(l.imgArray,a=>(c(),d("img",{key:a,src:a,class:"img-fluid me-10"},null,8,pe))),128))]),_:1})])}const ue=b(de,[["render",he]]);var _e={VITE_URL:"https://api.dreamboost.shop",VITE_WEIKEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RlbWFpbEBnbWFpbC5jb20iLCJ1c2VySUQiOiIzYTU4MjBhZi1iN2JlLTRkODMtOWM2My1kNmY1MWI2YmExMDEiLCJpYXQiOjE3MDg5Mzk5MDcsImV4cCI6MTcxMTUzMTkwN30.BbIXGVkQOU2HqsiCg6UcwFZx-kBd7kdOP24kUD21c1M",BASE_URL:"/DreamBoost/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{VITE_URL:ge}=_e,be={data(){return{modules:[O,U],bnData:[],EffectFade:W}},methods:{onSlideChange(){},getBnUrl(){this.$http.get(`${ge}/dreamboost/banner/guest/banner`).then(t=>{this.bnData=t.data.data.result}).catch(()=>{})},changeTokenState(){this.isToken=!this.isToken}},created(){const t=document.cookie.replace(/(?:(?:^|.*;\s*)db\s*=\s*([^;]*).*$)|^.*$/,"$1");this.isToken=t},mounted(){this.getBnUrl()},computed:{...L(G,["isUser"])},components:{RightArrow:T,Swiper:N,SwiperSlide:H}},fe=t=>(B("data-v-55bed53d"),t=t(),V(),t),xe={class:"container py-15 bg-white"},ve={class:"rounded-5"},ye={class:"d-flex flex-column justify-content-center align-items-center"},we=["src"],ke={class:"bg-primary-dark col-12 py-7 rounded-bottom-5 position-absolute bottom-0"},$e={class:"text-secondary-light text-center lterSpc-10 mb-0 mx-8 bn-hover"},je=fe(()=>e("div",{class:"d-flex flex-column align-items-center position-absolute top-24 top-sm-24 px-10"},[e("img",{src:K,class:"img-fluid mb-5 col-12",alt:""}),e("p",{class:"fs-3 fw-light text-white mb-0 lterSpc-10"},"推動夢想不是夢 !")],-1));function Se(t,n,m,f,l,g){const p=o("RightArrow"),a=o("RouterLink"),_=o("swiper-slide"),x=o("swiper");return c(),d("div",xe,[s(x,{ref:"swiper",modules:[l.EffectFade],effect:"fade","slides-per-view":3,"space-between":120,"centered-slides":!0,breakpoints:{390:{slidesPerView:1}},autoplay:{delay:5e3,disableOnInteraction:!1},onSwiperslidechange:g.onSlideChange,class:"rounded-5 col-12 object-fit-cover",style:{height:"650px"}},{default:i(()=>[(c(!0),d(w,null,$(l.bnData,(v,r)=>(c(),Y(_,{key:`${r}-bn`},{default:i(()=>[e("div",ve,[e("div",ye,[s(a,{to:t.isUser?"/explore":"/member",class:"position-relative col-12 rounded-5 shadow"},{default:i(()=>[e("img",{src:v.imgUrl,class:"img-fluid rounded-5 w-100 object-fit-cover",style:{height:"650px"},alt:"推動夢想不是夢概念圖"},null,8,we),e("div",ke,[e("h4",$e,[u(h(t.isUser?"立即探索,發現新項目":"立刻加入會員,一起追夢去")+" ",1),e("span",null,[s(p,{style:{width:"24px",color:"var(--bs-secondary-light)","margin-top":"-2 px"}})])])])]),_:2},1032,["to"]),je])])]),_:2},1024))),128))]),_:1},8,["modules","onSwiperslidechange"])])}const Ie=b(be,[["render",Se],["__scopeId","data-v-55bed53d"]]),Me={props:{popularProjects:{type:Object,required:!0}},data(){return{randomValue:0}},components:{StarFull:q,MessageIcon:E},mounted(){this.randomValue=Math.floor(Math.random()*20)}},F=t=>(B("data-v-ac41c3c2"),t=t(),V(),t),Pe=F(()=>e("div",{class:"d-flex justify-content-center mb-6 d-block d-xl-none position-relative"},[e("div",{class:"mb-5 mb-lg-3"},[e("h2",{class:"title-center text-center position-relative"},"當前熱門專案"),e("p",{class:"fs-6 text-primary-light text-center mb-0"},"Current Hot Projects")])],-1)),De=["src"],Ce={class:"fs-6 text-primary mb-3"},Be={class:"mb-3"},Ve={class:"mb-9"},Re={class:"progress bg-secondary-light mb-7",style:{height:"10px"}},Ae={class:"d-flex align-items-center justify-content-between"},Le={class:"d-flex align-items-center"},ze=["src"],Te={class:"mb-0"},qe={class:"d-flex"},Ee={class:"d-flex me-3"},Fe=F(()=>e("p",{class:"mb-0 me-1"},"已募資",-1)),Oe={class:"fw-bold text-danger mb-0"},Ue={class:"d-flex align-items-center gap-3"},We={href:""},Ne={class:"d-flex gap-1 message-star-hover"},He={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},Ye={href:""},Je={class:"d-flex gap-1 message-star-hover"},Qe={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}};function Xe(t,n,m,f,l,g){var _,x,v,r,j,k,y,S,I;const p=o("MessageIcon"),a=o("StarFull");return c(),d(w,null,[Pe,e("div",{onClick:n[1]||(n[1]=P(D=>t.$router.push(`/product/${this.popularProjects.proposalID}/info`),["prevent"])),class:"popularcard-hover"},[e("img",{src:(_=m.popularProjects)==null?void 0:_.proposalMainImage,class:"imgcover img-fluid rounded-3 mb-7 col-12 h-100",style:{},alt:""},null,8,De),e("p",Ce,"# "+h((x=m.popularProjects)==null?void 0:x.proposalCategory),1),e("a",{class:"title-hover",onClick:n[0]||(n[0]=P(D=>{var M;return t.$router.push(`/product/${(M=this.popularProjects)==null?void 0:M.proposalID}/info`)},["prevent"]))},[e("h4",Be,h((v=m.popularProjects)==null?void 0:v.proposalTitle),1)]),e("p",Ve,h((j=(r=m.popularProjects)==null?void 0:r.customizeProperty)==null?void 0:j.introduction),1),e("div",Re,[e("div",{class:"progress-bar bg-primary-dark rounded-pill",role:"progressbar",style:z({width:l.randomValue+70+"%"}),"aria-valuenow":"50","aria-valuemin":"0","aria-valuemax":"100"},null,4)]),e("div",Ae,[e("div",Le,[e("img",{src:(y=(k=m.popularProjects)==null?void 0:k.customizeProperty)==null?void 0:y.userImage,class:"img-fluid me-6 rounded-5 border",style:{"max-width":"36px"},alt:"會員頭貼"},null,8,ze),e("p",Te,"發起人:"+h((I=(S=m.popularProjects)==null?void 0:S.customizeProperty)==null?void 0:I.displayName),1)]),e("div",qe,[e("div",Ee,[Fe,e("p",Oe,h(l.randomValue+70)+"%",1)]),e("div",Ue,[e("a",We,[e("span",Ne,[u(h(l.randomValue)+" ",1),e("i",He,[s(p)])])]),e("a",Ye,[e("span",Je,[u(h(l.randomValue+2)+" ",1),e("i",Qe,[s(a)])])])])])])])],64)}const Ze=b(Me,[["render",Xe],["__scopeId","data-v-ac41c3c2"]]),Ge={props:{proposals:{type:Object,required:!0}},data(){return{randomValue:0}},components:{StarFull:q,MessageIcon:E},mounted(){this.randomValue=Math.floor(Math.random()*20)}},Ke=t=>(B("data-v-2ec9cdc8"),t=t(),V(),t),et={class:"row g-2 align-items-stretch"},tt={class:"col-md-4 pb-4"},st=["src"],ot={class:"col-md-8 pb-4 mt-0"},lt={class:"card-body d-flex flex-column justify-items-between p-3"},it={class:"card-text fs-6 text-primary mb-1"},rt={class:"card-title fs-5 mb-11"},ct={class:"progress bg-secondary-light mb-4",style:{height:"6px"}},nt={class:"d-flex justify-content-between align-items-center"},at={class:"d-flex me-3"},dt=Ke(()=>e("p",{class:"fs-5 mb-0 me-1"},"已募資",-1)),mt={class:"fs-5 fw-bold text-danger mb-0"},pt={class:"d-flex align-items-center gap-3"},ht={href:""},ut={class:"d-flex gap-1 message-star-hover"},_t={class:"d-block text-primary-dark",style:{width:"14px","margin-top":"-1px"}},gt={href:""},bt={class:"d-flex gap-1 message-star-hover"},ft={class:"d-block text-secondary-dark",style:{width:"16px","margin-top":"-2px"}};function xt(t,n,m,f,l,g){const p=o("MessageIcon"),a=o("StarFull");return c(),d("div",{class:"card col-12 mb-3 border border-top-0 border-start-0 border-end-0 rounded-0 suggestcard-shadow",onClick:n[1]||(n[1]=P(_=>t.$router.push(`/product/${this.proposals.proposalID}/info`),["prevent"]))},[e("div",et,[e("div",tt,[e("img",{src:m.proposals.proposalMainImage,class:"img-fluid object-fit-cover col-12 h-100 rounded-2",alt:""},null,8,st)]),e("div",ot,[e("div",lt,[e("div",null,[e("p",it,"# "+h(m.proposals.proposalCategory),1),e("a",{class:"title-hover",onClick:n[0]||(n[0]=P(_=>t.$router.push(`/product/${this.proposals.proposalID}/info`),["prevent"]))},[e("h4",rt,h(m.proposals.proposalTitle),1)])]),e("div",null,[e("div",ct,[e("div",{class:"progress-bar bg-primary-dark rounded-pill",role:"progressbar",style:z({width:l.randomValue+50+"%"}),"aria-valuenow":"50","aria-valuemin":"0","aria-valuemax":"100"},null,4)]),e("div",nt,[e("div",at,[dt,e("p",mt,h(l.randomValue+50)+"%",1)]),e("div",pt,[e("a",ht,[e("span",ut,[u(h(l.randomValue)+" ",1),e("i",_t,[s(p)])])]),e("a",gt,[e("span",bt,[u(h(l.randomValue+2)+" ",1),e("i",ft,[s(a)])])])])])])])])])])}const vt=b(Ge,[["render",xt],["__scopeId","data-v-2ec9cdc8"]]),yt="/DreamBoost/images/home/cs_01.png",wt="/DreamBoost/images/home/cs_02.png",kt="/DreamBoost/images/home/cs_03.png",$t="/DreamBoost/images/home/cs_04.jpg",jt="/DreamBoost/images/home/cs_05.jpg",St="/DreamBoost/images/home/cs_06.png",It="/DreamBoost/images/home/cs_07.png",Mt="/DreamBoost/images/home/cs_08.png",Pt="/DreamBoost/images/home/cowork_01.png",Dt="/DreamBoost/images/home/cowork_02.png",Ct="/DreamBoost/images/home/cowork_03.png",Bt={components:{RightArrow:T,MarqueeDark:ae,CouponCircle:Z,HomeBn:Ie,MarqueeBiglogo:ue,MarqueeLight:le,PopularCard:Ze,SuggestCard:vt,CountTo:J},data(){return{limitedProposals:[],popularProjects:null}},mixins:[X],computed:{...L(A,["proposals"])},async mounted(){this.showFullScreenLoading(),await this.getProposals(),await this.updatePopularProjects(),setTimeout(()=>{this.hideFullScreenLoading()},1800)},watch:{proposals:{handler(t){this.updateLimitedProposals(t),this.popularProjects||this.updatePopularProjects()},immediate:!0}},methods:{...Q(A,["getProposals"]),updateLimitedProposals(t){this.limitedProposals=Object.values(t).slice(0,3)},async updatePopularProjects(){if(!this.popularProjects){const t=Object.values(this.proposals),n=Math.floor(Math.random()*t.length);this.popularProjects=t[n]}}}},Vt={class:"container"},Rt={class:"row pt-18 pb-20 justify-content-center"},At={class:"col-12 col-xl-6 mb-18 mb-md-20 mb-xl-0 px-3 px-sm-6 px-lg-10 me-0 me-xl-10"},Lt=e("div",{class:"mb-3 d-none d-xl-block"},[e("h1",{class:"title position-relative"},"當前熱門專案"),e("p",{class:"fs-6 text-primary-light mb-0"},"Current Hot Projects")],-1),zt={class:"col-12 col-xl-5"},Tt=R('

為您推薦

Recommended for You

為您推薦

Recommended for You

',2),qt={class:"list-unstyled px-0 px-lg-8 px-xl-0 mb-8"},Et={class:"d-flex justify-content-center justify-content-lg-end align-items-center"},Ft={type:"button",class:"col-12 btn btn-secondary-light border border-2 border-primary rounded-3 px-lg-5 py-4 py-md-3 mt-5 mt-md-0 me-5 d-flex align-items-center justify-content-center btn-pr position-relative"},Ot={class:"px-3 d-flex justify-content-center align-items-center"},Ut=e("p",{class:"mb-0 pe-2 fw-semibold"},"查看更多",-1),Wt={class:"container pt-8 pb-5"},Nt=e("div",{class:"d-flex justify-content-center pb-5 position-relative"},[e("div",{class:"mb-5 mb-lg-3"},[e("h2",{class:"title-center text-center position-relative"},"專案類別"),e("p",{class:"fs-6 text-primary-light mb-0"},"Which Categories Interest You?")])],-1),Ht={class:"container row gy-8 gy-md-10 justify-content-center position-absolute translate-middle-null z-3"},Yt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Jt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Qt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Xt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Zt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Gt={class:"col-10 col-lg-3 col-xxl me-0 me-lg-10 me-xl-6 me-xxl-3"},Kt=e("div",{class:"container-fluid bg-primary-light py-31 py-lg-13 mb-xl-2"},null,-1),es=e("div",{class:"container-fluid bg-primary-light py-29 py-lg-13 d-block d-xl-none"},null,-1),ts=e("div",{class:"container-fluid bg-primary-light pt-1 d-none d-xl-block py-lg-1"},null,-1),ss={class:"container-fluid position-relative overflow-hidden"},os=R('

即將推出

Coming Soon

Coming Soon

',1),ls={class:"container d-flex flex-column justify-content-center"},is={class:"row g-10 mb-7 pb-27"},rs={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},cs={class:"position-relative rounded-3 h-100 csImage"},ns=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),as=e("img",{src:yt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),ds={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},ms={class:"position-relative rounded-3 h-100 csImage"},ps=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),hs=e("img",{src:wt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),us={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},_s={class:"position-relative rounded-3 h-100 csImage"},gs=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),bs=e("img",{src:kt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),fs={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},xs={class:"position-relative rounded-3 h-100 csImage"},vs=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),ys=e("img",{src:$t,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),ws={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},ks={class:"position-relative rounded-3 h-100 csImage"},$s=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),js=e("img",{src:jt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Ss={class:"col-12 col-sm-6 col-lg-4 g-4 g-sm-3 g-md-2"},Is={class:"position-relative rounded-3 h-100 csImage"},Ms=e("h4",{class:"project-name2 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),Ps=e("img",{src:St,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Ds={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},Cs={class:"position-relative rounded-3 h-100 csImage"},Bs=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),Vs=e("img",{src:It,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Rs={class:"col-12 col-sm-6 col-lg-2 g-4 g-sm-3 g-md-2"},As={class:"position-relative rounded-3 h-100 csImage"},Ls=e("h4",{class:"project-name1 text-center text-white mx-auto z-2 lterSpc-5"},"查看更多",-1),zs=e("img",{src:Mt,alt:"",class:"img-fluid object-fit-cover h-100 col-12 rounded-3"},null,-1),Ts={class:"container-fluid bg-primary-dark"},qs={class:"container p-12"},Es=e("div",{class:"mb-7"},[e("h3",{class:"text-center text-white"},"將創意專案轉換為現實"),e("p",{class:"fs-6 text-center text-primary-light mb-3"},"Turn Creative Projects Into Reality"),e("p",{class:"fs-6 text-center text-gray-300 mb-8"},"在 DreamBoost 上,讓我們成為你夢想的翅膀")],-1),Fs={class:"row justify-content-center"},Os={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 me-lg-10 mb-5 p-6"},Us={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Ws=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"個專案已募資",-1),Ns={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 me-lg-10 mb-5 p-6"},Hs={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Ys=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"人已經參與募資計畫",-1),Js={class:"col-11 col-md-5 col-lg-3 border border-white rounded-4 me-0 me-md-5 py-6 h-100"},Qs={class:"fs-1 fs-md-2 fs-lg-36 text-secondary-light text-center fw-bold mb-0"},Xs=e("p",{class:"fs-5 fs-lg-12 text-white text-center mb-0"},"贊助計畫",-1),Zs={class:"container position-relative"},Gs=R('

合作聯繫

Cooperation Contact

合作聯繫

Cooperation Contact

',3),Ks={class:"postion-relative d-none"};function eo(t,n,m,f,l,g){const p=o("HomeBn"),a=o("PopularCard"),_=o("SuggestCard"),x=o("RightArrow"),v=o("RouterLink"),r=o("router-link"),j=o("MarqueeLight"),k=o("MarqueeDark"),y=o("countTo"),S=o("MarqueeBiglogo"),I=o("CouponCircle");return c(),d("main",null,[s(p),e("div",Vt,[e("div",Rt,[e("div",At,[Lt,e("div",null,[s(a,{popularProjects:l.popularProjects},null,8,["popularProjects"])])]),e("div",zt,[Tt,e("ul",qt,[(c(!0),d(w,null,$(l.limitedProposals,(D,M)=>(c(),d("li",{key:M},[s(_,{proposals:D},null,8,["proposals"])]))),128))]),e("div",Et,[s(v,{to:"/explore"},{default:i(()=>[e("button",Ft,[e("span",Ot,[Ut,s(x,{class:"fs-3",style:{width:"18px"}})])])]),_:1})])])])]),e("div",Wt,[Nt,e("div",Ht,[e("div",Yt,[s(r,{to:{name:"explore"},class:"categorylink categorylink1 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 挺好夢 ")]),_:1})]),e("div",Jt,[s(r,{to:{name:"explore"},class:"categorylink categorylink2 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 科技設計 ")]),_:1})]),e("div",Qt,[s(r,{to:{name:"explore"},class:"categorylink categorylink3 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 健康生活 ")]),_:1})]),e("div",Xt,[s(r,{to:{name:"explore"},class:"categorylink categorylink4 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 時尚 ")]),_:1})]),e("div",Zt,[s(r,{to:{name:"explore"},class:"categorylink categorylink5 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 公共在地 ")]),_:1})]),e("div",Gt,[s(r,{to:{name:"explore"},class:"categorylink categorylink6 rounded-pill border border-2 border-white fs-4 fs-lg-4 fs-xxl-3 fw-medium text-white lterSpc-5 text-center pt-7 pt-xxl-5"},{default:i(()=>[u(" 美妝 ")]),_:1})])])]),s(j),Kt,es,ts,e("div",ss,[os,e("div",ls,[e("div",is,[e("div",rs,[e("div",cs,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[ns,as]),_:1})])]),e("div",ds,[e("div",ms,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[ps,hs]),_:1})])]),e("div",us,[e("div",_s,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[gs,bs]),_:1})])]),e("div",fs,[e("div",xs,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[vs,ys]),_:1})])]),e("div",ws,[e("div",ks,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[$s,js]),_:1})])]),e("div",Ss,[e("div",Is,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Ms,Ps]),_:1})])]),e("div",Ds,[e("div",Cs,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Bs,Vs]),_:1})])]),e("div",Rs,[e("div",As,[s(r,{to:{name:"explore"},class:"position-relative"},{default:i(()=>[Ls,zs]),_:1})])])])])]),e("section",null,[s(k),e("div",Ts,[e("div",qs,[Es,e("div",Fs,[e("div",Os,[e("p",Us,[s(y,{startVal:0,endVal:20243,dicimals:2,duration:15e3,ref:t.refset},null,512)]),Ws]),e("div",Ns,[e("p",Hs,[s(y,{startVal:-100,endVal:1766,duration:15e3})]),Ys]),e("div",Js,[e("p",Qs,[s(y,{startVal:0,endVal:23786,dicimals:2,duration:15e3,ref:t.refset},null,512)]),Xs])])])]),s(S),s(k)]),e("section",Zs,[Gs,e("div",Ks,[s(I,{class:""})])])])}const po=b(Bt,[["render",eo]]);export{po as default}; diff --git a/assets/InstaGram-vqASoo6M.js b/assets/InstaGram-Gji30qmE.js similarity index 96% rename from assets/InstaGram-vqASoo6M.js rename to assets/InstaGram-Gji30qmE.js index 102db36..080e70c 100644 --- a/assets/InstaGram-vqASoo6M.js +++ b/assets/InstaGram-Gji30qmE.js @@ -1 +1 @@ -import{_ as c,o as s,c as o,a as t}from"./index-ZKny8dII.js";const r={},_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},a=t("path",{d:"M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z",fill:"currentColor"},null,-1),l=[a];function h(e,n){return s(),o("svg",_,l)}const u=c(r,[["render",h]]),i={},d={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},m=t("path",{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z",fill:"currentColor"},null,-1),f=[m];function w(e,n){return s(),o("svg",d,f)}const x=c(i,[["render",w]]);export{u as F,x as I}; +import{_ as c,o as s,c as o,a as t}from"./index-sWoFWHUv.js";const r={},_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},a=t("path",{d:"M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z",fill:"currentColor"},null,-1),l=[a];function h(e,n){return s(),o("svg",_,l)}const u=c(r,[["render",h]]),i={},d={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},m=t("path",{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z",fill:"currentColor"},null,-1),f=[m];function w(e,n){return s(),o("svg",d,f)}const x=c(i,[["render",w]]);export{u as F,x as I}; diff --git a/assets/LaunchContent-iWLpKpFO.js b/assets/LaunchContent-FNtDlhgk.js similarity index 99% rename from assets/LaunchContent-iWLpKpFO.js rename to assets/LaunchContent-FNtDlhgk.js index 9d2fed8..17f73ea 100644 --- a/assets/LaunchContent-iWLpKpFO.js +++ b/assets/LaunchContent-FNtDlhgk.js @@ -1,4 +1,4 @@ -import{I as hE,J as Xf,K as un,_ as tk,o as mr,c as fr,a as At,m as uE,s as gE,b as jn,w as pE,F as Yf,d as Fn,q as mE,e as ek,r as fE,u as Qf,B as Zf}from"./index-ZKny8dII.js";import{l as Jf}from"./launchStore-ikl0B8cv.js";import{m as kE}from"./mixinVeeValidate-LQg3d4dX.js";import{L as bE}from"./LaunchNav-LBRqZkVR.js";import{P as wE}from"./PlusIcon-J8zDHS6B.js";import{s as AE}from"./sweetAlert2Store-vFUo6cdB.js";var nk={exports:{}};/*! +import{I as hE,J as Xf,K as un,_ as tk,o as mr,c as fr,a as At,m as uE,s as gE,b as jn,w as pE,F as Yf,d as Fn,q as mE,e as ek,r as fE,u as Qf,B as Zf}from"./index-sWoFWHUv.js";import{l as Jf}from"./launchStore-vk7OD2Xz.js";import{m as kE}from"./mixinVeeValidate-8HhwwYT8.js";import{L as bE}from"./LaunchNav-OsVYHMTP.js";import{P as wE}from"./PlusIcon--Glvv3Uc.js";import{s as AE}from"./sweetAlert2Store-M-KFz2Pq.js";var nk={exports:{}};/*! * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */(function(gt,X){(function(It,Et){gt.exports=Et(hE)})(self,It=>(()=>{var Et={976:D=>{D.exports=It}},L={};function Vt(D){var m=L[D];if(m!==void 0)return m.exports;var v=L[D]={exports:{}};return Et[D](v,v.exports,Vt),v.exports}Vt.d=(D,m)=>{for(var v in m)Vt.o(m,v)&&!Vt.o(D,v)&&Object.defineProperty(D,v,{enumerable:!0,get:m[v]})},Vt.o=(D,m)=>Object.prototype.hasOwnProperty.call(D,m);var E={};return(()=>{Vt.d(E,{default:()=>po});var D=Vt(976);const m=function(V){var it=typeof V;return V!=null&&(it=="object"||it=="function")},v=typeof un=="object"&&un&&un.Object===Object&&un;var I=typeof self=="object"&&self&&self.Object===Object&&self;const C=v||I||Function("return this")(),f=function(){return C.Date.now()};var w=/\s/;const y=function(V){for(var it=V.length;it--&&w.test(V.charAt(it)););return it};var T=/^\s+/;const S=function(V){return V&&V.slice(0,y(V)+1).replace(T,"")},N=C.Symbol;var R=Object.prototype,F=R.hasOwnProperty,G=R.toString,Q=N?N.toStringTag:void 0;const pt=function(V){var it=F.call(V,Q),Pt=V[Q];try{V[Q]=void 0;var Zt=!0}catch{}var ve=G.call(V);return Zt&&(it?V[Q]=Pt:delete V[Q]),ve};var K=Object.prototype.toString;const tt=function(V){return K.call(V)};var _=N?N.toStringTag:void 0;const W=function(V){return V==null?V===void 0?"[object Undefined]":"[object Null]":_&&_ in Object(V)?pt(V):tt(V)},Ct=function(V){return V!=null&&typeof V=="object"},Dt=function(V){return typeof V=="symbol"||Ct(V)&&W(V)=="[object Symbol]"};var vt=/^[-+]0x[0-9a-f]+$/i,Le=/^0b[01]+$/i,Ce=/^0o[0-7]+$/i,de=parseInt;const qe=function(V){if(typeof V=="number")return V;if(Dt(V))return NaN;if(m(V)){var it=typeof V.valueOf=="function"?V.valueOf():V;V=m(it)?it+"":it}if(typeof V!="string")return V===0?V:+V;V=S(V);var Pt=Le.test(V);return Pt||Ce.test(V)?de(V.slice(2),Pt?2:8):vt.test(V)?NaN:+V};var _e=Math.max,ii=Math.min;const dt=function(V,it,Pt){var Zt,ve,ht,Oe,Wt,he,ue=0,mo=!1,gn=!1,ct=!0;if(typeof V!="function")throw new TypeError("Expected a function");function pn(zt){var yt=Zt,Ut=ve;return Zt=ve=void 0,ue=zt,Oe=V.apply(Ut,yt)}function br(zt){return ue=zt,Wt=setTimeout(mn,it),mo?pn(zt):Oe}function ri(zt){var yt=zt-he;return he===void 0||yt>=it||yt<0||gn&&zt-ue>=ht}function mn(){var zt=f();if(ri(zt))return fo(zt);Wt=setTimeout(mn,function(yt){var Ut=it-(yt-he);return gn?ii(Ut,ht-(yt-ue)):Ut}(zt))}function fo(zt){return Wt=void 0,ct&&Zt?pn(zt):(Zt=ve=void 0,Oe)}function ko(){var zt=f(),yt=ri(zt);if(Zt=arguments,ve=this,he=zt,yt){if(Wt===void 0)return br(he);if(gn)return clearTimeout(Wt),Wt=setTimeout(mn,it),pn(he)}return Wt===void 0&&(Wt=setTimeout(mn,it)),Oe}return it=qe(it)||0,m(Pt)&&(mo=!!Pt.leading,ht=(gn="maxWait"in Pt)?_e(qe(Pt.maxWait)||0,it):ht,ct="trailing"in Pt?!!Pt.trailing:ct),ko.cancel=function(){Wt!==void 0&&clearTimeout(Wt),ue=0,Zt=he=ve=Wt=void 0},ko.flush=function(){return Wt===void 0?Oe:fo(f())},ko},go=(0,D.defineComponent)({name:"Ckeditor",model:{prop:"modelValue",event:"update:modelValue"},props:{editor:{type:Function,required:!0},config:{type:Object,default:()=>({})},modelValue:{type:String,default:""},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1},disableTwoWayDataBinding:{type:Boolean,default:!1}},emits:["ready","destroy","blur","focus","input","update:modelValue"],data:()=>({instance:null,lastEditorData:null}),watch:{modelValue(V){this.instance&&V!==this.lastEditorData&&this.instance.data.set(V)},disabled(V){V?this.instance.enableReadOnlyMode("Integration Sample"):this.instance.disableReadOnlyMode("Integration Sample")}},created(){const{CKEDITOR_VERSION:V}=window;if(V){const[it]=V.split(".").map(Number);it<37&&console.warn("The component requires using CKEditor 5 in version 37 or higher.")}else console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.')},mounted(){const V=Object.assign({},this.config);this.modelValue&&(V.initialData=this.modelValue),this.editor.create(this.$el,V).then(it=>{this.instance=(0,D.markRaw)(it),this.setUpEditorEvents(),this.modelValue!==V.initialData&&it.data.set(this.modelValue),this.disabled&&it.enableReadOnlyMode("Integration Sample"),this.$emit("ready",it)}).catch(it=>{console.error(it)})},beforeUnmount(){this.instance&&(this.instance.destroy(),this.instance=null),this.$emit("destroy",this.instance)},methods:{setUpEditorEvents(){const V=this.instance,it=dt(Pt=>{if(this.disableTwoWayDataBinding)return;const Zt=this.lastEditorData=V.data.get();this.$emit("update:modelValue",Zt,Pt,V),this.$emit("input",Zt,Pt,V)},300,{leading:!0});V.model.document.on("change:data",it),V.editing.view.document.on("focus",Pt=>{this.$emit("focus",Pt,V)}),V.editing.view.document.on("blur",Pt=>{this.$emit("blur",Pt,V)})}},render(){return(0,D.h)(this.tagName)}});if(!D.version||!D.version.startsWith("3."))throw new Error("The CKEditor plugin works only with Vue 3+. For more information, please refer to https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html");const po={install(V){V.component("Ckeditor",go)},component:go}})(),E=E.default})())})(nk);var CE=nk.exports;const _E=Xf(CE);var kr={exports:{}};kr.exports;(function(gt,X){(function(It){const Et=It.en=It.en||{};Et.dictionary=Object.assign(Et.dictionary||{},{"%0 of %1":"%0 of %1",Accept:"Accept","Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",Aquamarine:"Aquamarine",Background:"Background",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold",Border:"Border","Break text":"Break text","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Cannot access default workspace.":"Cannot access default workspace.","Cannot determine a category for the uploaded file.":"Cannot determine a category for the uploaded file.","Cannot upload file:":"Cannot upload file:","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Cell properties":"Cell properties","Center table":"Center table","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Circle:"Circle",Clear:"Clear","Click to edit block":"Click to edit block",Close:"Close",Code:"Code",Color:"Color","Color picker":"Color picker",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.",Dashed:"Dashed",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Dimensions:"Dimensions",Disc:"Disc",Dotted:"Dotted",Double:"Double",Downloadable:"Downloadable","Drag to move":"Drag to move","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit image":"Edit image","Edit link":"Edit link","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor dialog":"Editor dialog","Editor editing area: %0":"Editor editing area: %0","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Enter table caption":"Enter table caption","Failed to determine category of edited image.":"Failed to determine category of edited image.","Full size image":"Full size image",Green:"Green",Grey:"Grey",Groove:"Groove","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Height:"Height",HEX:"HEX","Horizontal text alignment toolbar":"Horizontal text alignment toolbar","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent",Insert:"Insert","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert image via URL":"Insert image via URL","Insert image with file manager":"Insert image with file manager","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Insert with file manager":"Insert with file manager","Inserting image failed":"Inserting image failed",Inset:"Inset",Italic:"Italic","Justify cell text":"Justify cell text","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","List properties":"List properties","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","No results found":"No results found","No searchable items":"No searchable items",None:"None","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Open file manager":"Open file manager","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","Open media in new tab":"Open media in new tab",Orange:"Orange",Original:"Original",Outset:"Outset",Padding:"Padding",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous","Processing the edited image.":"Processing the edited image.",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Replace from computer":"Replace from computer","Replace image":"Replace image","Replace image from computer":"Replace image from computer","Replace image with file manager":"Replace image with file manager","Replace with file manager":"Replace with file manager","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Restore default":"Restore default","Reversed order":"Reversed order","Rich Text Editor":"Rich Text Editor",Ridge:"Ridge","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Server failed to process the image.":"Server failed to process the image.","Show more items":"Show more items","Side image":"Side image",Solid:"Solid","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Square:"Square","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.",Strikethrough:"Strikethrough",Style:"Style",Subscript:"Subscript",Superscript:"Superscript","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table properties":"Table properties","Table toolbar":"Table toolbar","Text alternative":"Text alternative",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',"The URL must not be empty.":"The URL must not be empty.",'The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style",Turquoise:"Turquoise","Type or paste your content here.":"Type or paste your content here.","Type your title":"Type your title",Underline:"Underline",Undo:"Undo",Unlink:"Unlink",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Upload from computer":"Upload from computer","Upload image from computer":"Upload image from computer","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","Vertical text alignment toolbar":"Vertical text alignment toolbar",White:"White","Widget toolbar":"Widget toolbar",Width:"Width","Wrap text":"Wrap text",Yellow:"Yellow"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(It,Et){gt.exports=Et()}(self,()=>(()=>{var It={6944:(E,D,m)=>{const v=m(6644),I={};for(const f of Object.keys(v))I[v[f]]=f;const C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};E.exports=C;for(const f of Object.keys(C)){if(!("channels"in C[f]))throw new Error("missing channels property: "+f);if(!("labels"in C[f]))throw new Error("missing channel labels property: "+f);if(C[f].labels.length!==C[f].channels)throw new Error("channel and label counts mismatch: "+f);const{channels:w,labels:y}=C[f];delete C[f].channels,delete C[f].labels,Object.defineProperty(C[f],"channels",{value:w}),Object.defineProperty(C[f],"labels",{value:y})}C.rgb.hsl=function(f){const w=f[0]/255,y=f[1]/255,T=f[2]/255,S=Math.min(w,y,T),N=Math.max(w,y,T),R=N-S;let F,G;N===S?F=0:w===N?F=(y-T)/R:y===N?F=2+(T-w)/R:T===N&&(F=4+(w-y)/R),F=Math.min(60*F,360),F<0&&(F+=360);const Q=(S+N)/2;return G=N===S?0:Q<=.5?R/(N+S):R/(2-N-S),[F,100*G,100*Q]},C.rgb.hsv=function(f){let w,y,T,S,N;const R=f[0]/255,F=f[1]/255,G=f[2]/255,Q=Math.max(R,F,G),pt=Q-Math.min(R,F,G),K=function(tt){return(Q-tt)/6/pt+.5};return pt===0?(S=0,N=0):(N=pt/Q,w=K(R),y=K(F),T=K(G),R===Q?S=T-y:F===Q?S=.3333333333333333+w-T:G===Q&&(S=.6666666666666666+y-w),S<0?S+=1:S>1&&(S-=1)),[360*S,100*N,100*Q]},C.rgb.hwb=function(f){const w=f[0],y=f[1];let T=f[2];const S=C.rgb.hsl(f)[0],N=1/255*Math.min(w,Math.min(y,T));return T=1-.00392156862745098*Math.max(w,Math.max(y,T)),[S,100*N,100*T]},C.rgb.cmyk=function(f){const w=f[0]/255,y=f[1]/255,T=f[2]/255,S=Math.min(1-w,1-y,1-T);return[100*((1-w-S)/(1-S)||0),100*((1-y-S)/(1-S)||0),100*((1-T-S)/(1-S)||0),100*S]},C.rgb.keyword=function(f){const w=I[f];if(w)return w;let y,T=1/0;for(const R of Object.keys(v)){const F=v[R],G=(N=F,((S=f)[0]-N[0])**2+(S[1]-N[1])**2+(S[2]-N[2])**2);G.04045?((w+.055)/1.055)**2.4:w/12.92,y=y>.04045?((y+.055)/1.055)**2.4:y/12.92,T=T>.04045?((T+.055)/1.055)**2.4:T/12.92,[100*(.4124*w+.3576*y+.1805*T),100*(.2126*w+.7152*y+.0722*T),100*(.0193*w+.1192*y+.9505*T)]},C.rgb.lab=function(f){const w=C.rgb.xyz(f);let y=w[0],T=w[1],S=w[2];return y/=95.047,T/=100,S/=108.883,y=y>.008856?y**.3333333333333333:7.787*y+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,S=S>.008856?S**.3333333333333333:7.787*S+.13793103448275862,[116*T-16,500*(y-T),200*(T-S)]},C.hsl.rgb=function(f){const w=f[0]/360,y=f[1]/100,T=f[2]/100;let S,N,R;if(y===0)return R=255*T,[R,R,R];S=T<.5?T*(1+y):T+y-T*y;const F=2*T-S,G=[0,0,0];for(let Q=0;Q<3;Q++)N=w+.3333333333333333*-(Q-1),N<0&&N++,N>1&&N--,R=6*N<1?F+6*(S-F)*N:2*N<1?S:3*N<2?F+(S-F)*(.6666666666666666-N)*6:F,G[Q]=255*R;return G},C.hsl.hsv=function(f){const w=f[0];let y=f[1]/100,T=f[2]/100,S=y;const N=Math.max(T,.01);return T*=2,y*=T<=1?T:2-T,S*=N<=1?N:2-N,[w,100*(T===0?2*S/(N+S):2*y/(T+y)),100*((T+y)/2)]},C.hsv.rgb=function(f){const w=f[0]/60,y=f[1]/100;let T=f[2]/100;const S=Math.floor(w)%6,N=w-Math.floor(w),R=255*T*(1-y),F=255*T*(1-y*N),G=255*T*(1-y*(1-N));switch(T*=255,S){case 0:return[T,G,R];case 1:return[F,T,R];case 2:return[R,T,G];case 3:return[R,F,T];case 4:return[G,R,T];case 5:return[T,R,F]}},C.hsv.hsl=function(f){const w=f[0],y=f[1]/100,T=f[2]/100,S=Math.max(T,.01);let N,R;R=(2-y)*T;const F=(2-y)*S;return N=y*S,N/=F<=1?F:2-F,N=N||0,R/=2,[w,100*N,100*R]},C.hwb.rgb=function(f){const w=f[0]/360;let y=f[1]/100,T=f[2]/100;const S=y+T;let N;S>1&&(y/=S,T/=S);const R=Math.floor(6*w),F=1-T;N=6*w-R,1&R&&(N=1-N);const G=y+N*(F-y);let Q,pt,K;switch(R){default:case 6:case 0:Q=F,pt=G,K=y;break;case 1:Q=G,pt=F,K=y;break;case 2:Q=y,pt=F,K=G;break;case 3:Q=y,pt=G,K=F;break;case 4:Q=G,pt=y,K=F;break;case 5:Q=F,pt=y,K=G}return[255*Q,255*pt,255*K]},C.cmyk.rgb=function(f){const w=f[0]/100,y=f[1]/100,T=f[2]/100,S=f[3]/100;return[255*(1-Math.min(1,w*(1-S)+S)),255*(1-Math.min(1,y*(1-S)+S)),255*(1-Math.min(1,T*(1-S)+S))]},C.xyz.rgb=function(f){const w=f[0]/100,y=f[1]/100,T=f[2]/100;let S,N,R;return S=3.2406*w+-1.5372*y+-.4986*T,N=-.9689*w+1.8758*y+.0415*T,R=.0557*w+-.204*y+1.057*T,S=S>.0031308?1.055*S**.4166666666666667-.055:12.92*S,N=N>.0031308?1.055*N**.4166666666666667-.055:12.92*N,R=R>.0031308?1.055*R**.4166666666666667-.055:12.92*R,S=Math.min(Math.max(0,S),1),N=Math.min(Math.max(0,N),1),R=Math.min(Math.max(0,R),1),[255*S,255*N,255*R]},C.xyz.lab=function(f){let w=f[0],y=f[1],T=f[2];return w/=95.047,y/=100,T/=108.883,w=w>.008856?w**.3333333333333333:7.787*w+.13793103448275862,y=y>.008856?y**.3333333333333333:7.787*y+.13793103448275862,T=T>.008856?T**.3333333333333333:7.787*T+.13793103448275862,[116*y-16,500*(w-y),200*(y-T)]},C.lab.xyz=function(f){let w,y,T;y=(f[0]+16)/116,w=f[1]/500+y,T=y-f[2]/200;const S=y**3,N=w**3,R=T**3;return y=S>.008856?S:(y-.13793103448275862)/7.787,w=N>.008856?N:(w-.13793103448275862)/7.787,T=R>.008856?R:(T-.13793103448275862)/7.787,w*=95.047,y*=100,T*=108.883,[w,y,T]},C.lab.lch=function(f){const w=f[0],y=f[1],T=f[2];let S;return S=360*Math.atan2(T,y)/2/Math.PI,S<0&&(S+=360),[w,Math.sqrt(y*y+T*T),S]},C.lch.lab=function(f){const w=f[0],y=f[1],T=f[2]/360*2*Math.PI;return[w,y*Math.cos(T),y*Math.sin(T)]},C.rgb.ansi16=function(f,w=null){const[y,T,S]=f;let N=w===null?C.rgb.hsv(f)[2]:w;if(N=Math.round(N/50),N===0)return 30;let R=30+(Math.round(S/255)<<2|Math.round(T/255)<<1|Math.round(y/255));return N===2&&(R+=60),R},C.hsv.ansi16=function(f){return C.rgb.ansi16(C.hsv.rgb(f),f[2])},C.rgb.ansi256=function(f){const w=f[0],y=f[1],T=f[2];return w===y&&y===T?w<8?16:w>248?231:Math.round((w-8)/247*24)+232:16+36*Math.round(w/255*5)+6*Math.round(y/255*5)+Math.round(T/255*5)},C.ansi16.rgb=function(f){let w=f%10;if(w===0||w===7)return f>50&&(w+=3.5),w=w/10.5*255,[w,w,w];const y=.5*(1+~~(f>50));return[(1&w)*y*255,(w>>1&1)*y*255,(w>>2&1)*y*255]},C.ansi256.rgb=function(f){if(f>=232){const y=10*(f-232)+8;return[y,y,y]}let w;return f-=16,[Math.floor(f/36)/5*255,Math.floor((w=f%36)/6)/5*255,w%6/5*255]},C.rgb.hex=function(f){const w=(((255&Math.round(f[0]))<<16)+((255&Math.round(f[1]))<<8)+(255&Math.round(f[2]))).toString(16).toUpperCase();return"000000".substring(w.length)+w},C.hex.rgb=function(f){const w=f.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!w)return[0,0,0];let y=w[0];w[0].length===3&&(y=y.split("").map(S=>S+S).join(""));const T=parseInt(y,16);return[T>>16&255,T>>8&255,255&T]},C.rgb.hcg=function(f){const w=f[0]/255,y=f[1]/255,T=f[2]/255,S=Math.max(Math.max(w,y),T),N=Math.min(Math.min(w,y),T),R=S-N;let F,G;return F=R<1?N/(1-R):0,G=R<=0?0:S===w?(y-T)/R%6:S===y?2+(T-w)/R:4+(w-y)/R,G/=6,G%=1,[360*G,100*R,100*F]},C.hsl.hcg=function(f){const w=f[1]/100,y=f[2]/100,T=y<.5?2*w*y:2*w*(1-y);let S=0;return T<1&&(S=(y-.5*T)/(1-T)),[f[0],100*T,100*S]},C.hsv.hcg=function(f){const w=f[1]/100,y=f[2]/100,T=w*y;let S=0;return T<1&&(S=(y-T)/(1-T)),[f[0],100*T,100*S]},C.hcg.rgb=function(f){const w=f[0]/360,y=f[1]/100,T=f[2]/100;if(y===0)return[255*T,255*T,255*T];const S=[0,0,0],N=w%1*6,R=N%1,F=1-R;let G=0;switch(Math.floor(N)){case 0:S[0]=1,S[1]=R,S[2]=0;break;case 1:S[0]=F,S[1]=1,S[2]=0;break;case 2:S[0]=0,S[1]=1,S[2]=R;break;case 3:S[0]=0,S[1]=F,S[2]=1;break;case 4:S[0]=R,S[1]=0,S[2]=1;break;default:S[0]=1,S[1]=0,S[2]=F}return G=(1-y)*T,[255*(y*S[0]+G),255*(y*S[1]+G),255*(y*S[2]+G)]},C.hcg.hsv=function(f){const w=f[1]/100,y=w+f[2]/100*(1-w);let T=0;return y>0&&(T=w/y),[f[0],100*T,100*y]},C.hcg.hsl=function(f){const w=f[1]/100,y=f[2]/100*(1-w)+.5*w;let T=0;return y>0&&y<.5?T=w/(2*y):y>=.5&&y<1&&(T=w/(2*(1-y))),[f[0],100*T,100*y]},C.hcg.hwb=function(f){const w=f[1]/100,y=w+f[2]/100*(1-w);return[f[0],100*(y-w),100*(1-y)]},C.hwb.hcg=function(f){const w=f[1]/100,y=1-f[2]/100,T=y-w;let S=0;return T<1&&(S=(y-T)/(1-T)),[f[0],100*T,100*S]},C.apple.rgb=function(f){return[f[0]/65535*255,f[1]/65535*255,f[2]/65535*255]},C.rgb.apple=function(f){return[f[0]/255*65535,f[1]/255*65535,f[2]/255*65535]},C.gray.rgb=function(f){return[f[0]/100*255,f[0]/100*255,f[0]/100*255]},C.gray.hsl=function(f){return[0,0,f[0]]},C.gray.hsv=C.gray.hsl,C.gray.hwb=function(f){return[0,100,f[0]]},C.gray.cmyk=function(f){return[0,0,0,f[0]]},C.gray.lab=function(f){return[f[0],0,0]},C.gray.hex=function(f){const w=255&Math.round(f[0]/100*255),y=((w<<16)+(w<<8)+w).toString(16).toUpperCase();return"000000".substring(y.length)+y},C.rgb.gray=function(f){return[(f[0]+f[1]+f[2])/3/255*100]}},4416:(E,D,m)=>{const v=m(6944),I=m(2152),C={};Object.keys(v).forEach(f=>{C[f]={},Object.defineProperty(C[f],"channels",{value:v[f].channels}),Object.defineProperty(C[f],"labels",{value:v[f].labels});const w=I(f);Object.keys(w).forEach(y=>{const T=w[y];C[f][y]=function(S){const N=function(...R){const F=R[0];if(F==null)return F;F.length>1&&(R=F);const G=S(R);if(typeof G=="object")for(let Q=G.length,pt=0;pt1&&(R=F),S(R))};return"conversion"in S&&(N.conversion=S.conversion),N}(T)})}),E.exports=C},2152:(E,D,m)=>{const v=m(6944);function I(w){const y=function(){const S={},N=Object.keys(v);for(let R=N.length,F=0;F{E.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},8984:(E,D,m)=>{m.d(D,{c:()=>w});var v=m(9096),I=m.n(v),C=m(1849),f=m.n(C)()(I());f.push([E.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./../ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:[`/* @@ -7392,4 +7392,4 @@ Read more: ${tt}#error-${o}`}function vt(o,t){const e=Dt(o);return t?[o,t,e]:[o, `:o.is("containerElement")||t.is("containerElement")?Nu.includes(o.name)||Nu.includes(t.name)?` `:` -`:"":""}class Be extends z{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Ko),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document;this.listenTo(i,"clipboardInput",(r,s)=>{s.method!="paste"||t.model.canEditAt(t.model.document.selection)||r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,s)=>{const a=s.dataTransfer;let c;if(s.content)c=s.content;else{let h="";a.getData("text/html")?h=function(u){return u.replace(/(\s+)<\/span>/g,(g,p)=>p.length==1?" ":p).replace(//g,"")}(a.getData("text/html")):a.getData("text/plain")&&(((l=(l=a.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||l.includes("
"))&&(l=`

${l}

`),h=l),c=this.editor.data.htmlProcessor.toView(h)}var l;const d=new F(this,"inputTransformation");this.fire(d,{content:c,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),d.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const a=this.editor.data.toModel(s.content,"$clipboardHolder");a.childCount!=0&&(r.stop(),e.change(()=>{this.fire("contentInsertion",{content:a,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=e.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,e.selection,r.name)};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{t.model.canEditAt(t.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=t.data.toView(s.content);n.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:a,method:s.method})},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",Lu(s.content))),s.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Ou{constructor(t,e=20){this._batch=null,this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){this.isLocked&&!t||(this._batch=null,this._size=0)}}class rv extends nt{constructor(t,e){super(t),this._buffer=new Ou(t.model,e),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",r=i.length;let s=n.selection;if(t.selection?s=t.selection:t.range&&(s=e.createSelection(t.range)),!e.canEditAt(s))return;const a=t.resultRange;e.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());e.deleteContent(s),i&&e.insertContent(c.createText(i,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const zu=["insertText","insertReplacementText"];class sv extends Fe{constructor(t){super(t),this.focusObserver=t.getObserver(Pi),f.isAndroid&&zu.push("insertCompositionText");const e=t.document;e.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=i;if(!zu.includes(a))return;this.focusObserver.flush();const l=new F(e,"insertText");e.fire(l,new Xn(t,c,{text:r,selection:t.createSelection(s)})),l.stop.called&&n.stop()}),e.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!f.isAndroid&&i&&e.fire("insertText",new Xn(t,r,{text:i,selection:e.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class Ru extends z{static get pluginName(){return"Input"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=e.document.selection;n.addObserver(sv);const r=new rv(t,t.config.get("typing.undoStep")||20);t.commands.add("insertText",r),t.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,h=Array.from(l.getRanges()).map(p=>t.editing.mapper.toModelRange(p));let u=c;if(f.isAndroid){const p=Array.from(h[0].getItems()).reduce((k,b)=>k+(b.is("$textProxy")?b.data:""),"");p&&(p.length<=u.length?u.startsWith(p)&&(u=u.substring(p.length),h[0].start=h[0].start.getShiftedBy(p.length)):p.startsWith(u)&&(h[0].start=h[0].start.getShiftedBy(u.length),u=""))}const g={text:u,selection:e.createSelection(h)};d&&(g.resultRange=t.editing.mapper.toModelRange(d)),t.execute("insertText",g),n.scrollToTheSelection()}),f.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&ju(e,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||ju(e,r)})}}function ju(o,t){if(!t.isEnabled)return;const e=t.buffer;e.lock(),o.enqueueChange(e.batch,()=>{o.deleteContent(o.document.selection)}),e.unlock()}class Fu extends nt{constructor(t,e){super(t),this.direction=e,this._buffer=new Ou(t.model,t.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(t.selection||n.selection);if(!e.canEditAt(r))return;const s=t.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let c=0;r.getFirstRange().getMinimalFlatRanges().forEach(l=>{c+=zt(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!e.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),r=t.createElement("paragraph");t.remove(t.createRangeIn(i)),t.insert(r,i),t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!="backward"||!t.isCollapsed)return!1;const i=t.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!t.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const Vu="word",cn="selection",io="backward",$o="forward",Uu={deleteContent:{unit:cn,direction:io},deleteContentBackward:{unit:"codePoint",direction:io},deleteWordBackward:{unit:Vu,direction:io},deleteHardLineBackward:{unit:cn,direction:io},deleteSoftLineBackward:{unit:cn,direction:io},deleteContentForward:{unit:"character",direction:$o},deleteWordForward:{unit:Vu,direction:$o},deleteHardLineForward:{unit:cn,direction:$o},deleteSoftLineForward:{unit:cn,direction:$o}};class av extends Fe{constructor(t){super(t);const e=t.document;let n=0;e.on("keydown",()=>{n++}),e.on("keyup",()=>{n=0}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=Uu[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==cn&&(d.selectionToRemove=t.createSelection(s[0])),c==="deleteContentBackward"&&(f.isAndroid&&(d.sequence=1),function(u){if(u.length!=1||u[0].isCollapsed)return!1;const g=u[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let p=0;for(const{nextPosition:k}of g){if(k.parent.is("$text")){const b=k.parent.data,A=k.offset;if(Gr(b,A)||Wr(b,A)||Wc(b,A))continue;p++}else p++;if(p>1)return!0}return!1}(s)&&(d.unit=cn,d.selectionToRemove=t.createSelection(s)));const h=new Zn(e,"delete",s[0]);e.fire(h,new Xn(t,a,d)),h.stop.called&&i.stop()}),f.isBlink&&function(i){const r=i.view,s=r.document;let a=null,c=!1;function l(h){return h==rt.backspace||h==rt.delete}function d(h){return h==rt.backspace?io:$o}s.on("keydown",(h,{keyCode:u})=>{a=u,c=!1}),s.on("keyup",(h,{keyCode:u,domEvent:g})=>{const p=s.selection,k=i.isEnabled&&u==a&&l(u)&&!p.isCollapsed&&!c;if(a=null,k){const b=p.getFirstRange(),A=new Zn(s,"delete",b),x={unit:cn,direction:d(u),selectionToRemove:p};s.fire(A,new Xn(r,g,x))}}),s.on("beforeinput",(h,{inputType:u})=>{const g=Uu[u];l(a)&&g&&g.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(h,{inputType:u,data:g})=>{a==rt.delete&&u=="insertText"&&g==""&&h.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class Qe extends z{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.model.document;e.addObserver(av),this._undoOnBackspace=!1;const r=new Fu(t,"forward");t.commands.add("deleteForward",r),t.commands.add("forwardDelete",r),t.commands.add("delete",new Fu(t,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:h}=a,u=c==="forward"?"deleteForward":"delete",g={sequence:l};if(h=="selection"){const p=Array.from(d.getRanges()).map(k=>t.editing.mapper.toModelRange(k));g.selection=t.model.createSelection(p)}else g.unit=h;t.execute(u,g),e.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,t.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class cv extends z{static get requires(){return[Ru,Qe]}static get pluginName(){return"Typing"}}function Hu(o,t){let e=o.start;return{text:Array.from(o.getWalker({ignoreElementEnd:!1})).reduce((n,{item:i})=>i.is("$text")||i.is("$textProxy")?n+i.data:(e=t.createPositionAfter(i),""),""),range:t.createRange(e,o.end)}}class qu extends ct(){constructor(t,e){super(),this.model=t,this.testCallback=e,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(t,"change:data",(e,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(t,e={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=Hu(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(e,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${t}`,l)}}}class Gu extends z{constructor(t){super(t),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=t.locale,r=e.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==rt.arrowright,l=a.keyCode==rt.arrowleft;if(!c&&!l)return;const d=i.contentLanguageDirection;let h=!1;h=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),h===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&be(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!Ze(i,e))&&!!be(r,e)&&(Qo(t),Ze(i,e)&&be(r,e,!0)?Yo(n,e):this._overrideGravity(),!0)}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(Qo(t),this._restoreGravity(),be(r,e,!0)?Yo(n,e):Zi(n,e,r),!0):r.isAtStart?!!Ze(i,e)&&(Qo(t),Zi(n,e,r),!0):!Ze(i,e)&&be(r,e,!0)?(Qo(t),Zi(n,e,r),!0):!!Wu(r,e)&&(r.isAtEnd&&!Ze(i,e)&&be(r,e)?(Qo(t),Zi(n,e,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view.document;t.editing.view.addObserver(Ps);let r=!1;this.listenTo(i,"mousedown",()=>{r=!0}),this.listenTo(i,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!Ze(n,s))return;const a=n.getFirstPosition();be(a,s)&&(a.isAtStart||be(a,s,!0)?Yo(e,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection,n=this.attributes;this.listenTo(t,"insertContent",()=>{const i=e.getFirstPosition();Ze(e,n)&&be(i,n)&&Yo(t,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=Ze(n,this.attributes)&&!Wu(a,this.attributes)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,s||t.model.enqueueChange(()=>{const a=n.getFirstPosition();Ze(n,this.attributes)&&be(a,this.attributes)&&(a.isAtStart||be(a,this.attributes,!0)?Yo(e,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Ze(o,t){for(const e of t)if(o.hasAttribute(e))return!0;return!1}function Zi(o,t,e){const n=e.nodeBefore;o.change(i=>{if(n){const r=[],s=o.schema.isObject(n)&&o.schema.isInline(n);for(const[a,c]of n.getAttributes())!o.schema.checkAttribute("$text",a)||s&&o.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);i.setSelectionAttribute(r)}else i.removeSelectionAttribute(t)})}function Yo(o,t){o.change(e=>{e.removeSelectionAttribute(t)})}function Qo(o){o.preventDefault()}function Wu(o,t){return be(o.getShiftedBy(-1),t)}function be(o,t,e=!1){const{nodeBefore:n,nodeAfter:i}=o;for(const r of t){const s=n?n.getAttribute(r):void 0,a=i?i.getAttribute(r):void 0;if((!e||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const Ku={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:ro('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:ro("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:ro("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:ro('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:ro('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:ro("'"),to:[null,"‚",null,"’"]}},$u={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},lv=["symbols","mathematical","typography","quotes"];function dv(o){return typeof o=="string"?new RegExp(`(${fu(o)})$`):o}function hv(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function uv(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function ro(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function Ji(o,t,e,n){return n.createRange(Yu(o,t,e,!0,n),Yu(o,t,e,!1,n))}function Yu(o,t,e,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(t)==e;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*Qu(o,t){for(const e of t)e&&o.getAttributeProperties(e[0]).copyOnEnter&&(yield e)}class gv extends nt{execute(){this.editor.model.change(t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})})}enterBlock(t){const e=this.editor.model,n=e.document.selection,i=e.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(i.isLimit(a)||i.isLimit(c))return r||a!=c||e.deleteContent(n),!1;if(r){const l=Qu(t.model.schema,n.getAttributes());return Zu(t,s.start),t.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(e.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Zu(t,n.focus),!0;t.setSelection(c,0)}}return!1}}function Zu(o,t){o.split(t),o.setSelection(t.parent.nextSibling,0)}const pv={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ju extends Fe{constructor(t){super(t);const e=this.document;let n=!1;e.on("keydown",(i,r)=>{n=r.shiftKey}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;f.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=pv[s];if(!c)return;const l=new Zn(e,"enter",r.targetRanges[0]);e.fire(l,new Xn(t,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class Xi extends z{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Ju),t.commands.add("enter",new gv(t)),this.listenTo(n,"enter",(i,r)=>{n.isComposing||r.preventDefault(),r.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class mv extends nt{execute(){const t=this.editor.model,e=t.document;t.change(n=>{(function(i,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,h=l==d;if(a){const u=Qu(i.schema,s.getAttributes());Xu(i,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(u)}else{const u=!(c.start.isAtStart&&c.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:u}),h?Xu(i,r,s.focus):u&&r.setSelection(d,0)}})(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,c=s.end.parent;return!(($s(a,n)||$s(c,n))&&a!==c)}(t.schema,e.selection)}}function Xu(o,t,e){const n=t.createElement("softBreak");o.insertContent(n,e),t.setSelection(n,"after")}function $s(o,t){return!o.is("rootElement")&&(t.isLimit(o)||$s(o.parent,t))}class fv extends z{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=i.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(s,{writer:a})=>a.createEmptyElement("br")}),i.addObserver(Ju),t.commands.add("shiftEnter",new mv(t)),this.listenTo(r,"enter",(s,a)=>{r.isComposing||a.preventDefault(),a.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class kv extends dt(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i===r||Ys(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i===r||Ys(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(Ys(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&bv(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function Ys(o,t){return o&&t&&o.priority==t.priority&&tr(o.classes)==tr(t.classes)}function bv(o,t){return o.priority>t.priority||!(o.prioritytr(t.classes)}function tr(o){return Array.isArray(o)?o.sort().join(","):o}const wv='',Av="ck-widget",tg="ck-widget_selected";function Ft(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function Qs(o,t,e={}){if(!o.is("containerElement"))throw new _("widget-to-widget-wrong-element-type",null,{element:o});return t.setAttribute("contenteditable","false",o),t.addClass(Av,o),t.setCustomProperty("widget",!0,o),o.getFillerOffset=vv,t.setCustomProperty("widgetLabel",[],o),e.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,e.label),e.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new on;return c.set("content",wv),c.render(),a.appendChild(c.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,t),eg(o,t),o}function Cv(o,t,e){if(t.classes&&e.addClass(Tt(t.classes),o),t.attributes)for(const n in t.attributes)e.setAttribute(n,t.attributes[n],o)}function _v(o,t,e){if(t.classes&&e.removeClass(Tt(t.classes),o),t.attributes)for(const n in t.attributes)e.removeAttribute(n,o)}function eg(o,t,e=Cv,n=_v){const i=new kv;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&e(o,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),t.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function ng(o,t,e={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),t.setAttribute("role","textbox",o),e.label&&t.setAttribute("aria-label",e.label,o),t.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{t.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?t.addClass("ck-editor__nested-editable_focused",o):t.removeClass("ck-editor__nested-editable_focused",o)}),eg(o,t),o}function og(o,t){const e=o.getSelectedElement();if(e){const n=ln(o);if(n)return t.createRange(t.createPositionAt(e,n))}return t.schema.findOptimalInsertionRange(o)}function vv(){return null}const Je="widget-type-around";function Bn(o,t,e){return!!o&&Ft(o)&&!e.isInline(t)}function ln(o){return o.getAttribute(Je)}var ig=L(3940),yv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(ig.c,yv),ig.c.locals;const rg=["before","after"],xv=new DOMParser().parseFromString('',"image/svg+xml").firstChild,sg="ck-widget__type-around_disabled";class Ev extends z{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Xi,Qe]}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(n,i,r)=>{e.change(s=>{for(const a of e.document.roots)r?s.removeClass(sg,a):s.addClass(sg,a)}),r||t.model.change(s=>{s.removeSelectionAttribute(Je)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=ln(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&Bn(c,s.item,e)&&(function(l,d,h){const u=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(g){const p=this.toDomElement(g);return function(k,b){for(const A of rg){const x=new Ee({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${A}`],title:b[A],"aria-hidden":"true"},children:[k.ownerDocument.importNode(xv,!0)]});k.appendChild(x.render())}}(p,d),function(k){const b=new Ee({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});k.appendChild(b.render())}(p),p});l.insert(l.createPositionAt(h,"end"),u)}(a.writer,i,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,n=e.document.selection,i=e.schema,r=t.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,c)=>{this._handleArrowKeyPress(a,c)},{context:[Ft,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&t.model.change(l=>{l.removeSelectionAttribute(Je)})}),this._listenToIfEnabled(e.document,"change:data",()=>{const a=n.getSelectedElement();a&&Bn(t.editing.mapper.toViewElement(a),a,i)||t.model.change(c=>{c.removeSelectionAttribute(Je)})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const p=l.mapper.toViewElement(this._currentFakeCaretModelElement);p&&(d.removeClass(rg.map(s),p),this._currentFakeCaretModelElement=null)}const h=c.selection.getSelectedElement();if(!h)return;const u=l.mapper.toViewElement(h);if(!Bn(u,h,i))return;const g=ln(c.selection);g&&(d.addClass(s(g),u),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||t.model.change(d=>{d.removeSelectionAttribute(Je)})})}_handleArrowKeyPress(t,e){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,c=function(h,u){const g=Hr(h,u);return g==="down"||g==="right"}(e.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;Bn(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):e.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=ln(e.document.selection);return e.change(i=>n?n!==(t?"after":"before")?(i.removeSelectionAttribute(Je),!0):!1:(i.setSelectionAttribute(Je,t?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,r=e.plugins.get("Widget"),s=r._getObjectElementNextToSelection(t);return!!Bn(e.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Je,t?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,r=e.editing.mapper,s=n.document.selection,a=t?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!Bn(r.toViewElement(a),a,i)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(Je,t?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(l){return l.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(l,d){const h=l.closest(".ck-widget");return d.mapDomToView(h)}(r,e.domConverter),c=t.editing.mapper.toModelElement(a);this._insertParagraph(c,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=e.getSelectedElement(),a=t.editing.mapper.toViewElement(s),c=t.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Bn(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),i.stop())},{context:Ft})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(e,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=t.selection)},{priority:"high"}),f.isAndroid?this._listenToIfEnabled(t,"keydown",(e,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=ln(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)t.execute("delete",{selection:n.createSelection(l,"on")});else{const h=i.getNearestSelectionRange(n.createPositionAt(l,a),c);if(h)if(h.isCollapsed){const u=n.createSelection(h.start);if(n.modifySelection(u,{direction:c}),u.focus.isEqual(h.start)){const g=function(p,k){let b=k;for(const A of k.getAncestors({parentFirst:!0})){if(A.childCount>1||p.isLimit(A))break;b=A}return b}(i,h.start.parent);n.deleteContent(n.createSelection(g,"on"),{doNotAutoparagraph:!0})}else n.change(g=>{g.setSelection(h),t.execute(d?"deleteForward":"delete")})}else n.change(u=>{u.setSelection(h),t.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Ft})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=ln(n);return a?(i.stop(),e.change(c=>{const l=n.getSelectedElement(),d=e.createPositionAt(l,a),h=c.createSelection(d),u=e.insertContent(r,h);return c.setSelection(h),u})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=ln(e);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||ln(e)&&n.stop()},{priority:"high"})}}function Dv(o){const t=o.model;return(e,n)=>{const i=n.keyCode==rt.arrowup,r=n.keyCode==rt.arrowdown,s=n.shiftKey,a=t.document.selection;if(!i&&!r)return;const c=r;if(s&&function(d,h){return!d.isCollapsed&&d.isBackward==h}(a,c))return;const l=function(d,h,u){const g=d.model;if(u){const p=h.isCollapsed?h.focus:h.getLastPosition(),k=ag(g,p,"forward");if(!k)return null;const b=g.createRange(p,k),A=cg(g.schema,b,"backward");return A?g.createRange(p,A):null}{const p=h.isCollapsed?h.focus:h.getFirstPosition(),k=ag(g,p,"backward");if(!k)return null;const b=g.createRange(k,p),A=cg(g.schema,b,"forward");return A?g.createRange(A,p):null}}(o,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,h,u){const g=d.model,p=d.view.domConverter;if(u){const M=g.createSelection(h.start);g.modifySelection(M),M.focus.isAtEnd||h.start.isEqual(M.focus)||(h=g.createRange(M.focus,h.end))}const k=d.mapper.toViewRange(h),b=p.viewRangeToDom(k),A=ot.getDomRangeRects(b);let x;for(const M of A)if(x!==void 0){if(Math.round(M.top)>=x)return!1;x=Math.max(x,Math.round(M.bottom))}else x=Math.round(M.bottom);return!0}(o,l,c))&&(t.change(d=>{const h=c?l.end:l.start;if(s){const u=t.createSelection(a.anchor);u.setFocus(h),d.setSelection(u)}else d.setSelection(h)}),e.stop(),n.preventDefault(),n.stopPropagation())}}}function ag(o,t,e){const n=o.schema,i=o.createRangeIn(t.root),r=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of i.getWalker({startPosition:t,direction:e})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function cg(o,t,e){const n=e=="backward"?t.end:t.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of t.getWalker({direction:e}))if(o.checkChild(i,"$text"))return i;return null}var lg=L(4680),Iv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(lg.c,Iv),lg.c.locals;class Zo extends z{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[Ev,Qe]}init(){const t=this.editor,e=t.editing.view,n=e.document;this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{const a=s.writer,c=r.selection;if(c.isCollapsed)return;const l=c.getSelectedElement();if(!l)return;const d=t.editing.mapper.toViewElement(l);var h;Ft(d)&&s.consumable.consume(c,"selection")&&a.setSelection(a.createRangeOn(d),{fake:!0,label:(h=d,h.getCustomProperty("widgetLabel").reduce((u,g)=>typeof g=="function"?u?u+". "+g():g():u?u+". "+g:g,""))})}),this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{this._clearPreviouslySelectedWidgets(s.writer);const a=s.writer,c=a.document.selection;let l=null;for(const d of c.getRanges())for(const h of d){const u=h.item;Ft(u)&&!Tv(u,l)&&(a.addClass(tg,u),this._previouslySelected.add(u),l=u)}},{priority:"low"}),e.addObserver(Ps),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[Ft,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",Dv(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(t,e){const n=this.editor,i=n.editing.view,r=i.document;let s=e.target;if(e.domEvent.detail>=3)return void(this._selectBlockContent(s)&&e.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(Ft(l))return!1;l=l.parent}return!1}(s)||!Ft(s)&&(s=s.findAncestor(Ft),!s))return;f.isAndroid&&e.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(t){const e=this.editor,n=e.model,i=e.editing.mapper,r=n.schema,s=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(t,0)),a=function(c,l){for(const d of c.getAncestors({includeSelf:!0,parentFirst:!0})){if(l.checkChild(d,"$text"))return d;if(l.isLimit(d)&&!l.isObject(d))break}return null}(i.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(u,g){const p=new Ge({startPosition:u});for(const{item:k}of p){if(g.isLimit(k)||!k.is("element"))return null;if(g.checkChild(k,"$text"))return k}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),h=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,h))}),!0)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),c=Hr(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const u=l?s.getLastPosition():s.getFirstPosition(),g=r.getNearestSelectionRange(u,l?"forward":"backward");return void(g&&(i.change(p=>{p.setSelection(g)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed&&!e.shiftKey){const u=s.getFirstPosition(),g=s.getLastPosition(),p=u.nodeAfter,k=g.nodeBefore;return void((p&&r.isObject(p)||k&&r.isObject(k))&&(i.change(b=>{b.setSelection(l?g:u)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&r.isObject(h)){if(r.isInline(h)&&d)return;this._setSelectionOverElement(h),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(e.preventDefault(),t.stop())}_handleDelete(t){const e=this.editor.model.document.selection;if(!this.editor.model.canEditAt(e)||!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(i=>{let r=e.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,r=e.createSelection(i);if(e.modifySelection(r,{direction:t?"forward":"backward"}),r.isEqual(i))return null;const s=t?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(tg,e);this._previouslySelected.clear()}}function Tv(o,t){return!!t&&Array.from(o.getAncestors()).includes(t)}class er extends z{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Ki]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Ft(r))})(t.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void W("widget-toolbar-no-items",{toolbarId:t});const s=this.editor,a=s.t,c=new Os(s.locale);if(c.ariaLabel=e||a("Widget toolbar"),this._toolbarDefinitions.has(t))throw new _("widget-toolbar-duplicated",this,{toolbarId:t});const l={view:c,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(t,l)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>t&&(t=s,e=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?dg(this.editor,e):this._isToolbarInBalloon(t)||(t.initialized||(t.initialized=!0,t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:t.view,position:hg(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);dg(this.editor,i)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function dg(o,t){const e=o.plugins.get("ContextualBalloon"),n=hg(o,t);e.updatePosition(n)}function hg(o,t){const e=o.editing.view,n=ee.defaultPositions;return{target:e.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var ug=L(9444),Sv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(ug.c,Sv),ug.c.locals;const Zs=$n("px");class Mv extends ${constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",e=>!e)],style:{left:t.to("left",e=>Zs(e)),top:t.to("top",e=>Zs(e)),width:t.to("width",e=>Zs(e))}}})}}class nr extends z{constructor(){super(...arguments),this.removeDropMarkerDelayed=qr(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=Gi(t=>this._updateDropMarker(t),40),this._reconvertMarkerThrottled=Gi(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new Mv,this._domEmitter=new(pe()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:t}of this._scrollables.values())t.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(t,e,n,i,r,s){this.removeDropMarkerDelayed.cancel();const a=gg(this.editor,t,e,n,i,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(t,e,n,i,r,s){const a=gg(this.editor,t,e,n,i,r,s);return this.removeDropMarker(),a}removeDropMarker(){const t=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,t.markers.has("drop-target")&&t.change(e=>{e.removeMarker("drop-target")})}_setupDropMarker(){const t=this.editor;t.ui.view.body.add(this._dropTargetLineView),t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);e.markerRange.isCollapsed?this._updateDropTargetLine(e.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||i.updateMarker("drop-target",{range:t}):i.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(t){return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const n=this.toDomElement(e);return n.append("⁠",e.createElement("span"),"⁠"),n})}_updateDropTargetLine(t){const e=this.editor.editing,n=t.start.nodeBefore,i=t.start.nodeAfter,r=t.start.parent,s=n?e.mapper.toViewElement(n):null,a=s?e.view.domConverter.mapViewToDom(s):null,c=i?e.mapper.toViewElement(i):null,l=c?e.view.domConverter.mapViewToDom(c):null,d=e.mapper.toViewElement(r);if(!d)return;const h=e.view.domConverter.mapViewToDom(d),u=this._getScrollableRect(d),{scrollX:g,scrollY:p}=q.window,k=a?new ot(a):null,b=l?new ot(l):null,A=new ot(h).excludeScrollbarsAndBorders(),x=k?k.bottom:A.top,M=b?b.top:A.bottom,O=q.window.getComputedStyle(h),H=x<=M?(x+M)/2:M;if(u.topa.schema.checkChild(h,u))){if(a.schema.checkChild(h,"$text"))return a.createRange(h);if(d)return or(o,mg(o,d.parent),n,i)}}}else if(a.schema.isInline(l))return or(o,l,n,i)}if(a.schema.isBlock(l))return or(o,l,n,i);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(g=>g.is("element")&&!Bv(o,g));let h=0,u=d.length;if(u==0)return a.createRange(a.createPositionAt(l,"end"));for(;ht in o?Nv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Rv extends z{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(pe())}static get pluginName(){return"DragDropBlockToolbar"}init(){const t=this.editor;if(this.listenTo(t,"change:isReadOnly",(e,n,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),f.isAndroid&&this.forceDisabled("noAndroidSupport"),t.plugins.has("BlockToolbar")){const e=t.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(e,"dragstart",(n,i)=>this._handleBlockDragStart(i)),this._domEmitter.listenTo(q.document,"dragover",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo(q.document,"drop",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo(q.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&e.setAttribute("draggable","true"),this.on("change:isEnabled",(n,i,r)=>{e.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(t){if(!this.isEnabled)return;const e=this.editor.model,n=e.document.selection,i=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));e.change(a=>a.setSelection(s)),this._isBlockDragging=!0,i.focus(),i.getObserver(Ko).onDomEvent(t)}_handleBlockDragging(t){if(!this.isEnabled||!this._isBlockDragging)return;const e=t.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=t.clientY,i=document.elementFromPoint(e,n),r=this.editor.editing.view;var s,a;i&&i.closest(".ck-editor__editable")&&r.getObserver(Ko).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))Ov.call(l,d)&&kg(c,d,l[d]);if(fg)for(var d of fg(l))zv.call(l,d)&&kg(c,d,l[d]);return c})({},t),a={type:t.type,dataTransfer:t.dataTransfer,target:i,clientX:e,clientY:n,preventDefault:()=>t.preventDefault(),stopPropagation:()=>t.stopPropagation()},Pv(s,Lv(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var bg=L(9256),jv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bg.c,jv),bg.c.locals;class Fv extends z{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=qr(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(pe())}static get pluginName(){return"DragDrop"}static get requires(){return[Be,Zo,nr,Rv]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,e.addObserver(Ko),e.addObserver(Ps),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),f.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=t.plugins.get(nr);this.listenTo(i,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=Q(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:h}=a,{clientX:u}=h;this._updatePreview({dataTransfer:l,domTarget:d,clientX:u}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(i,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(q.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(i,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(i,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(i,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");const{clientX:c,clientY:l}=a.domEvent;r.updateDropMarker(a.target,a.targetRanges,c,l,this._blockMode,this._draggedRange),this._draggedRange||(a.dataTransfer.dropEffect="copy"),f.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get(nr);this.listenTo(e,"clipboardInput",(i,r)=>{if(r.method!="drop")return;const{clientX:s,clientY:a}=r.domEvent,c=n.getFinalDropRange(r.target,r.targetRanges,s,a,this._blockMode,this._draggedRange);if(!c)return this._finalizeDragging(!1),void i.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),wg(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void i.stop();r.targetRanges=[t.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(Be);t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=wg(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,n=e.document;this.listenTo(n,"mousedown",(i,r)=>{if(f.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Ag(r.target);if(f.isBlink&&!t.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&Ft(a)||(s=n.selection.editableElement)}s&&(e.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=t.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{f.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(t){const e=this.editor,n=e.model;e.plugins.get(nr).removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(t&&this.isEnabled&&n.change(i=>{const r=n.createSelection(this._draggedRange);n.deleteContent(r,{doNotAutoparagraph:!0});const s=r.getFirstPosition().parent;s.isEmpty&&!n.schema.checkChild(s,"$text")&&n.schema.checkChild(s,"paragraph")&&i.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(t){const e=this.editor,n=e.model,i=n.document.selection,r=t?Ag(t):null;if(r){const l=e.editing.mapper.toModelElement(r);this._draggedRange=ce.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(i.isCollapsed&&!i.getFirstPosition().parent.isEmpty)return;const s=Array.from(i.getSelectedBlocks()),a=i.getFirstRange();if(s.length==0)return void(this._draggedRange=ce.fromRange(a));const c=Cg(n,s);if(s.length>1)this._draggedRange=ce.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=ce.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:t,domTarget:e,clientX:n}){const i=this.editor.editing.view,r=i.document.selection.editableElement,s=i.domConverter.mapViewToDom(r),a=q.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=si(q.document,"div",{style:"position: fixed; left: -999999px;"}),q.document.body.appendChild(this._previewContainer));const c=new ot(s);if(s.contains(e))return;const l=parseFloat(a.paddingLeft),d=si(q.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,f.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=t.getData("text/html"),t.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function wg(o){return f.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Ag(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Ft);if(Ft(o))return o;const t=o.findAncestor(e=>Ft(e)||e.is("editableElement"));return Ft(t)?t:null}function Cg(o,t){const e=t[0],n=t[t.length-1],i=e.getCommonAncestor(n),r=o.createPositionBefore(e),s=o.createPositionAfter(n);if(i&&i.is("element")&&!o.schema.isLimit(i)){const a=o.createRangeOn(i),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return Cg(o,[i])}return o.createRange(r,s)}class Vv extends z{static get pluginName(){return"PastePlainText"}static get requires(){return[Be]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=e.document.selection;let s=!1;n.addObserver(Ko),this.listenTo(i,"keydown",(a,c)=>{s=c.shiftKey}),t.plugins.get(Be).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const h=l.getChild(0);return d.isObject(h)?!1:Array.from(h.getAttributeKeys()).length==0}(c.content,e.schema))&&e.change(l=>{const d=Array.from(r.getAttributes()).filter(([u])=>e.schema.getAttributeProperties(u).isFormatting);r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const h=l.createRangeIn(c.content);for(const u of h.getItems())u.is("$textProxy")&&l.setAttributes(d,u)})})}}class _g extends z{static get pluginName(){return"Clipboard"}static get requires(){return[Be,Fv,Vv]}}class Uv extends nt{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!vg(t.schema,n))do if(n=n.parent,!n)return;while(!vg(t.schema,n));t.change(i=>{i.setSelection(n,"in")})}}function vg(o,t){return o.isLimit(t)&&(o.checkChild(t,"$text")||o.checkChild(t,"paragraph"))}const Hv=Io("Ctrl+A");class qv extends z{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new Uv(t)),this.listenTo(e,"keydown",(n,i)=>{Yn(i)===Hv&&(t.execute("selectAll"),i.preventDefault())})}}class Gv extends z{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const n=t.commands.get("selectAll"),i=new ut(e),r=e.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),i})}}class Wv extends z{static get requires(){return[qv,Gv]}static get pluginName(){return"SelectAll"}}var Kv=Object.defineProperty,yg=Object.getOwnPropertySymbols,$v=Object.prototype.hasOwnProperty,Yv=Object.prototype.propertyIsEnumerable,xg=(o,t,e)=>t in o?Kv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Eg extends nt{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))$v.call(s,a)&&xg(r,a,s[a]);if(yg)for(var a of yg(s))Yv.call(s,a)&&xg(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,r=i.document,s=[],a=t.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(h=>h.root!=r.graveyard).filter(h=>!Zv(h,c));d.length&&(Qv(d),s.push(d[0]))}s.length&&i.change(l=>{l.setSelection(s,{backward:e})})}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(i.history.getOperations(a)),l=WA([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const h=d.affectedSelectable;h&&!n.canEditAt(h)&&(d=new jt(d.baseVersion)),e.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function Qv(o){o.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;te!==o&&e.containsRange(o,!0))}class Jv extends Eg{execute(t=null){const e=t?this._stack.findIndex(r=>r.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r)}),this.fire("revert",n.batch,i),this.refresh()}}class Xv extends Eg{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class t1 extends z{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const t=this.editor;this._undoCommand=new Jv(t),this._redoCommand=new Xv(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(e,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const r=i.batch,s=this._redoCommand.createdBatches.has(r),a=this._undoCommand.createdBatches.has(r);this._batchRegistry.has(r)||(this._batchRegistry.add(r),r.isUndoable&&(s?this._undoCommand.addBatch(r):a||(this._undoCommand.addBatch(r),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,n,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}class e1 extends z{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?J.undo:J.redo,r=e.uiLanguageDirection=="ltr"?J.redo:J.undo;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(t,e,n,i){const r=this.editor;r.ui.componentFactory.add(t,s=>{const a=r.commands.get(t),c=new ut(s);return c.set({label:e,icon:i,keystroke:n,tooltip:!0}),c.bind("isEnabled").to(a,"isEnabled"),this.listenTo(c,"execute",()=>{r.execute(t),r.editing.view.focus()}),c})}}class Dg extends z{static get requires(){return[t1,e1]}static get pluginName(){return"Undo"}}class n1 extends ct(){constructor(){super();const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,i)=>{e.onload=()=>{const r=e.result;this._data=r,n(r)},e.onerror=()=>{i("error")},e.onabort=()=>{i("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}class Ne extends z{constructor(){super(...arguments),this.loaders=new xe,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Eh]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return W("filerepository-no-upload-adapter"),null;const e=new Ig(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(n=>{this._loadersMap.set(n,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),e.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),e}destroyLoader(t){const e=t instanceof Ig?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((n,i)=>{n===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Eh);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=i=>`${e("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}class Ig extends ct(){constructor(t,e){super(),this.id=Q(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new n1,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new _("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if(this.status!=="reading")throw this.status;return this.status="idle",t}).catch(t=>{throw t==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:t)})}upload(){if(this.status!="idle")throw new _("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{throw this.status==="aborted"?"aborted":(this.status="error",t)})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?t=="reading"?this._reader.abort():t=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((n,i)=>{e.rejecter=i,e.isFulfilled=!1,t.then(r=>{e.isFulfilled=!0,n(r)}).catch(r=>{e.isFulfilled=!0,i(r)})}),e}}class o1 extends ut{constructor(t){super(t),this.buttonView=this,this._fileInputView=new i1(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}class i1 extends ${constructor(t){super(t),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const Tg="ckCsrfToken",Sg="abcdefghijklmnopqrstuvwxyz0123456789";function r1(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(Tg);var t,e;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),t=Tg,e=o,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"),o}class s1{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>e(s)),i.addEventListener("abort",()=>e()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return e(a&&a.error&&a.error.message?a.error.message:s);t({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",r1()),this.xhr.send(e)}}function dn(o,t,e,n){let i,r=null;typeof n=="function"?i=n:(r=o.commands.get(n),i=()=>{o.execute(n)}),o.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const c=Ht(o.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(o.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const h=d.position.parent;if(h.is("element","codeBlock")||h.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const u=h.getChild(0),g=o.model.createRangeOn(u);if(!g.containsRange(c)&&!c.end.isEqual(g.end))return;const p=e.exec(u.data.substr(0,c.end.offset));p&&o.model.enqueueChange(k=>{const b=k.createPositionAt(h,0),A=k.createPositionAt(h,p[0].length),x=new ce(b,A);if(i({match:p})!==!1){k.remove(x);const M=o.model.document.selection.getFirstRange(),O=k.createRangeIn(h);!h.isEmpty||O.isEqual(M)||O.containsRange(M,!0)||k.remove(h)}x.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function so(o,t,e,n){let i,r;e instanceof RegExp?i=e:r=e,r=r||(s=>{let a;const c=[],l=[];for(;(a=i.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:h,2:u,3:g}=a;const p=h+u+g;d+=a[0].length-p.length;const k=[d,d+h.length],b=[d+h.length+u.length,d+h.length+u.length+g.length];c.push(k),c.push(b),l.push([d+h.length,d+h.length+u.length])}return{remove:c,format:l}}),o.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;const c=o.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),h=d[0];if(d.length!=1||h.type!=="insert"||h.name!="$text"||h.length!=1)return;const u=l.focus,g=u.parent,{text:p,range:k}=function(M,O){let H=M.start;return{text:Array.from(M.getItems()).reduce((et,Bt)=>!Bt.is("$text")&&!Bt.is("$textProxy")||Bt.getAttribute("code")?(H=O.createPositionAfter(Bt),""):et+Bt.data,""),range:O.createRange(H,M.end)}}(c.createRange(c.createPositionAt(g,0),u),c),b=r(p),A=Mg(k.start,b.format,c),x=Mg(k.start,b.remove,c);A.length&&x.length&&c.enqueueChange(M=>{if(n(M,A)!==!1){for(const O of x.reverse())M.remove(O);c.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function Mg(o,t,e){return t.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>e.createRange(o.getShiftedBy(n[0]),o.getShiftedBy(n[1])))}function ir(o,t){return(e,n)=>{if(!o.commands.get(t).isEnabled)return!1;const i=o.model.schema.getValidRanges(n,t);for(const r of i)e.setAttribute(t,!0,r);e.removeSelectionAttribute(t)}}class Bg extends nt{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.forceValue===void 0?!this.value:t.forceValue;e.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(e.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const ao="bold";class a1 extends z{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:ao}),t.model.schema.setAttributeProperties(ao,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:ao,view:"strong",upcastAlso:["b",e=>{const n=e.getStyle("font-weight");return n&&(n=="bold"||Number(n)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(ao,new Bg(t,ao)),t.keystrokes.set("CTRL+B",ao)}}const Js="bold";class c1 extends z{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Js,n=>{const i=t.commands.get(Js),r=new ut(n);return r.set({label:e("Bold"),icon:J.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(Js),t.editing.view.focus()}),r})}}var Ng=L(8984),l1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Ng.c,l1),Ng.c.locals;const co="italic";class d1 extends z{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:co}),t.model.schema.setAttributeProperties(co,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:co,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(co,new Bg(t,co)),t.keystrokes.set("CTRL+I",co)}}const Xs="italic";class h1 extends z{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Xs,n=>{const i=t.commands.get(Xs),r=new ut(n);return r.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(Xs),t.editing.view.focus()}),r})}}class u1 extends nt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks()),s=t.forceValue===void 0?!this.value:t.forceValue;e.change(a=>{if(s){const c=r.filter(l=>rr(l)||Lg(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(rr))})}_getValue(){const t=Ht(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!rr(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Ht(t.getSelectedBlocks());return!!n&&Lg(e,n)}_removeQuote(t,e){Pg(t,e).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void t.unwrap(n.start.parent);if(n.start.isAtStart){const r=t.createPositionBefore(n.start.parent);return void t.move(n,r)}n.end.isAtEnd||t.split(n.end);const i=t.createPositionAfter(n.end.parent);t.move(n,i)})}_applyQuote(t,e){const n=[];Pg(t,e).reverse().forEach(i=>{let r=rr(i.start);r||(r=t.createElement("blockQuote"),t.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(t.merge(t.createPositionAfter(i)),i):r)}}function rr(o){return o.parent.name=="blockQuote"?o.parent:null}function Pg(o,t){let e,n=0;const i=[];for(;n{const a=t.model.document.differ.getChanges();for(const c of a)if(c.type=="insert"){const l=c.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!e.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const h of d.getItems())if(h.is("element","blockQuote")&&!e.checkChild(s.createPositionBefore(h),h))return s.unwrap(h),!0}}else if(c.type=="remove"){const l=c.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});const n=this.editor.editing.view.document,i=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const c=i.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var Og=L(8888),p1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Og.c,p1),Og.c.locals;class m1 extends z{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const i=t.commands.get("blockQuote"),r=new ut(n);return r.set({label:e("Block quote"),icon:J.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r})}}class f1 extends z{static get pluginName(){return"CKBoxUI"}afterInit(){const t=this.editor,e=t.commands.get("ckbox");if(!e)return;const n=t.t;if(t.ui.componentFactory.add("ckbox",i=>{const r=new ut(i);return r.set({label:n("Open file manager"),icon:J.browseFiles,tooltip:!0}),r.bind("isOn","isEnabled").to(e,"value","isEnabled"),r.on("execute",()=>{t.execute("ckbox")}),r}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"assetManager",observable:e,buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=J.imageAssetManager,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=J.imageAssetManager,r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}var k1=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Jo=o=>{let t=0;for(let e=0;e{let t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ea=o=>{let t=Math.max(0,Math.min(1,o));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},na=(o,t)=>(e=>e<0?-1:1)(o)*Math.pow(Math.abs(o),t),zg=class extends Error{constructor(o){super(o),this.name="ValidationError",this.message=o}},b1=o=>{if(!o||o.length<6)throw new zg("The blurhash string must be at least 6 characters");let t=Jo(o[0]),e=Math.floor(t/9)+1,n=t%9+1;if(o.length!==4+2*n*e)throw new zg(`blurhash length mismatch: length is ${o.length} but it should be ${4+2*n*e}`)},w1=o=>{let t=o>>8&255,e=255&o;return[ta(o>>16),ta(t),ta(e)]},A1=(o,t)=>{let e=Math.floor(o/361),n=Math.floor(o/19)%19,i=o%19;return[na((e-9)/9,2)*t,na((n-9)/9,2)*t,na((i-9)/9,2)*t]},C1=(o,t,e,n)=>{b1(o),n|=1;let i=Jo(o[0]),r=Math.floor(i/9)+1,s=i%9+1,a=(Jo(o[1])+1)/166,c=new Array(s*r);for(let h=0;ht in o?_1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;function Fg(o){const t=[];let e=0;for(const i in o){const r=parseInt(i,10);isNaN(r)||(r>e&&(e=r),t.push(`${o[i]} ${i}w`))}const n=[{srcset:t.join(","),sizes:`(max-width: ${e}px) 100vw, ${e}px`,type:"image/webp"}];return{imageFallbackUrl:o.default,imageSources:n}}const Xo=32;function Vg({url:o,method:t="GET",data:e,onUploadProgress:n,signal:i,authorization:r}){const s=new XMLHttpRequest;s.open(t,o.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{i.throwIfAborted(),i.addEventListener("abort",a),s.addEventListener("loadstart",()=>{i.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{i.removeEventListener("abort",a)}),s.addEventListener("error",()=>{l()}),s.addEventListener("abort",()=>{l()}),s.addEventListener("load",()=>{const d=s.response;if(!d||d.statusCode>=400)return l(d&&d.message);c(d)}),n&&s.upload.addEventListener("progress",d=>{n(d)}),s.send(e)})}const x1={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function E1(o,t){return e=this,n=null,i=function*(){try{const r=yield fetch(o,((s,a)=>{for(var c in a||(a={}))v1.call(a,c)&&jg(s,c,a[c]);if(Rg)for(var c of Rg(a))y1.call(a,c)&&jg(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},t));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(i.next(d))}catch(h){s(h)}},c=d=>{try{l(i.throw(d))}catch(h){s(h)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((i=i.apply(e,n)).next())});var e,n,i}var D1=Object.defineProperty,Ug=Object.getOwnPropertySymbols,I1=Object.prototype.hasOwnProperty,T1=Object.prototype.propertyIsEnumerable,Hg=(o,t,e)=>t in o?D1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,qg=(o,t)=>{for(var e in t||(t={}))I1.call(t,e)&&Hg(o,e,t[e]);if(Ug)for(var e of Ug(t))T1.call(t,e)&&Hg(o,e,t[e]);return o};class S1 extends nt{constructor(t){super(t),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return this._wrapper!==null}_checkEnabled(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");return!(!t.isEnabled&&!e.isEnabled)}_prepareOptions(){const t=this.editor.config.get("ckbox");return{theme:t.theme,language:t.language,tokenUrl:t.tokenUrl,serviceOrigin:t.serviceOrigin,forceDemoLabel:t.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const t=this.editor,e=t.model,n=!t.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=si(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))}),this.on("ckbox:close",()=>{this.value&&(this._wrapper.remove(),this._wrapper=null,t.editing.view.focus())}),this.on("ckbox:choose",(i,r)=>{if(!this.isEnabled)return;const s=t.commands.get("insertImage"),a=t.commands.get("link"),c=function({assets:d,isImageAllowed:h,isLinkAllowed:u}){return d.map(g=>function(p){const k=p.data.metadata;return k?k.width&&k.height:!1}(g)?{id:g.data.id,type:"image",attributes:M1(g)}:{id:g.data.id,type:"link",attributes:B1(g)}).filter(g=>g.type==="image"?h:u)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(e.change(d=>{for(const h of c){const u=h===c[l-1],g=l===1;this._insertAsset(h,u,d,g),n&&(setTimeout(()=>this._chosenAssets.delete(h),1e3),this._chosenAssets.add(h))}}),t.editing.view.focus())}),this.listenTo(t,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(t,e,n,i){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),t.type==="image"?this._insertImage(t):this._insertLink(t,n,i),e||n.setSelection(r.getLastPosition())}_insertImage(t){const e=this.editor,{imageFallbackUrl:n,imageSources:i,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=t.attributes;e.execute("insertImage",{source:qg({src:n,sources:i,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(t,e,n){const i=this.editor,r=i.model,s=r.document.selection,{linkName:a,linkHref:c}=t.attributes;if(s.isCollapsed){const l=Re(s.getAttributes()),d=e.createText(a,l);if(!n){const u=s.getLastPosition(),g=u.parent;g.name==="paragraph"&&g.isEmpty||i.execute("insertParagraph",{position:u});const p=r.insertContent(d);return e.setSelection(p),void i.execute("link",c)}const h=r.insertContent(d);e.setSelection(h)}i.execute("link",c)}}function M1(o){const{imageFallbackUrl:t,imageSources:e}=Fg(o.data.imageUrls),{description:n,width:i,height:r,blurHash:s}=o.data.metadata,a=function(c){if(c)try{const l=`${Xo}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const h=d.getContext("2d");if(!h)return;const u=h.createImageData(Xo,Xo),g=C1(c,Xo,Xo);return u.data.set(g),h.putImageData(u,0,0),d.toDataURL()}catch{return}}(s);return qg({imageFallbackUrl:t,imageSources:e,imageTextAlternative:n||"",imageWidth:i,imageHeight:r},a?{imagePlaceholder:a}:null)}function B1(o){return{linkName:o.data.name,linkHref:N1(o)}}function N1(o){const t=new URL(o.data.url);return t.searchParams.set("download","true"),t.toString()}var oa=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class Gg extends z{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return oa(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;t.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:t.locale.uiLanguage,theme:"lark",tokenUrl:t.config.get("cloudServices.tokenUrl")});const i=t.plugins.get("CloudServices"),r=t.config.get("cloudServices.tokenUrl"),s=t.config.get("ckbox.tokenUrl");if(!s)throw new _("ckbox-plugin-missing-token-url",this);this._token=s==r?i.token:yield i.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const t=(0,this.editor.t)("Cannot access default workspace."),e=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(i,r){const[,s]=i.value.split("."),a=JSON.parse(atob(s)),c=a.auth&&a.auth.ckbox&&a.auth.ckbox.workspaces||[a.aud];return r?(a.auth&&a.auth.ckbox&&a.auth.ckbox.role)=="superadmin"||c.includes(r)?r:null:c[0]}(this._token,e);if(n==null)throw Ct("ckbox-access-default-workspace-error"),t;return n}getCategoryIdForFile(t,e){return oa(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),i=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(e),s=typeof t=="string"?(a=yield E1(t,e),x1[a]):function(d){const h=d.name,u=new RegExp("\\.(?[^.]+)$");return h.match(u).groups.ext.toLowerCase()}(t);var a;const c=yield r;if(!c)throw n;if(i){const d=Object.keys(i).find(h=>i[h].find(u=>u.toLowerCase()==s));if(d){const h=c.find(u=>u.id===d||u.name===d);if(!h)throw n;return h.id}}const l=c.find(d=>d.extensions.find(h=>h.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(t){return oa(this,null,function*(){const e=this.editor,n=this._token,{signal:i}=t,r=e.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const h=yield a(d);c.push(...h.items),l=h.totalCount-(d+50),d+=50}while(l>0);return c}catch{return i.throwIfAborted(),void Ct("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit","50"),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),Vg({url:l,signal:i,authorization:n.value})}})}}var ia=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class P1 extends z{static get requires(){return["ImageUploadEditing","ImageUploadProgress",Ne,Wg]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return ia(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;const i=t.plugins.get(Ne),r=t.plugins.get(Gg);i.createUploadAdapter=c=>new L1(c,t,r);const s=!t.config.get("ckbox.ignoreDataId"),a=t.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{t.model.change(h=>{h.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class L1{constructor(t,e,n){this.loader=t,this.token=n.getToken(),this.ckboxUtils=n,this.editor=e,this.controller=new AbortController,this.serviceOrigin=e.config.get("ckbox.serviceOrigin")}upload(){return ia(this,null,function*(){const t=this.ckboxUtils,e=this.editor.t,n=yield this.loader.file,i=yield t.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",t.getWorkspaceId()),s.append("categoryId",i),s.append("file",n),Vg({method:"POST",url:r,data:s,onUploadProgress:a=>{a.lengthComputable&&(this.loader.uploadTotal=a.total,this.loader.uploaded=a.loaded)},signal:this.controller.signal,authorization:this.token.value}).then(a=>ia(this,null,function*(){const c=Fg(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=e("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class Wg extends z{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",P1,Gg]}init(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;(e||n)&&(this._checkImagePlugins(),t.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()),n&&t.commands.add("ckbox",new S1(t)))}_checkImagePlugins(){const t=this.editor;t.plugins.has("ImageBlockEditing")||t.plugins.has("ImageInlineEditing")||Ct("ckbox-plugin-image-feature-missing",t)}_initSchema(){const t=this.editor.model.schema;t.extend("$text",{allowAttributes:"ckboxLinkId"}),t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.addAttributeCheck((e,n)=>{if(!e.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const t=this.editor;t.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,i.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(h=>h.name==="a");d&&(r.item.hasAttribute("ckboxLinkId")?a.setAttribute("data-ckbox-resource-id",r.item.getAttribute("ckboxLinkId"),d):a.removeAttribute("data-ckbox-resource-id",d))},{priority:"low"}),n.on("attribute:ckboxLinkId",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,i.name)){if(r.attributeOldValue){const d=Kg(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=Kg(a,r.attributeNewValue);if(r.item.is("selection")){const h=a.document.selection;a.wrap(h.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),t.conversion.for("upcast").add(n=>{n.on("element:a",(i,r,s)=>{const{writer:a,consumable:c}=s;if(!r.viewItem.getAttribute("href")||!c.consume(r.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const l=r.viewItem.getAttribute("data-ckbox-resource-id");if(l)if(r.modelRange)for(let d of r.modelRange.getItems())d.is("$textProxy")&&(d=d.textNode),z1(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),t.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),t.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const e=t.commands.get("replaceImageSource");e&&this.listenTo(e,"cleanupImage",(n,[i,r])=>{i.removeAttribute("ckboxImageId",r)})}_initFixers(){const t=this.editor,e=t.model,n=e.document.selection;e.document.registerPostFixer(function(i){return r=>{let s=!1;const a=i.model,c=i.commands.get("ckbox");if(!c)return s;for(const l of a.document.differ.getChanges()){if(l.type!=="insert"&&l.type!=="attribute")continue;const d=l.type==="insert"?new B(l.position,l.position.getShiftedBy(l.length)):l.range,h=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const u of d.getItems()){if(h&&u.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",u),s=!0;continue}const g=O1(u,c._chosenAssets);for(const p of g){const k=p.type==="image"?"ckboxImageId":"ckboxLinkId";p.id!==u.getAttribute(k)&&(r.setAttribute(k,p.id,u),s=!0)}}}return s}}(t)),e.document.registerPostFixer(function(i){return r=>!(i.hasAttribute("linkHref")||!i.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function O1(o,t){const e=o.is("element","imageInline")||o.is("element","imageBlock"),n=o.hasAttribute("linkHref");return[...t].filter(i=>i.type==="image"&&e?i.attributes.imageFallbackUrl===o.getAttribute("src"):i.type==="link"&&n?i.attributes.linkHref===o.getAttribute("linkHref"):void 0)}function Kg(o,t){const e=o.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return o.setCustomProperty("link",!0,e),e}function z1(o){return!!o.is("$text")||!(!o.is("element","imageInline")&&!o.is("element","imageBlock"))}var $g=L(9268),R1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()($g.c,R1),$g.c.locals;class j1 extends z{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t;if(e.add("ckfinder",i=>{const r=t.commands.get("ckfinder"),s=new ut(i);return s.set({label:n("Insert image or file"),icon:J.browseFiles,tooltip:!0}),s.bind("isEnabled").to(r),s.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),s}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI"),r=t.commands.get("ckfinder");i.registerIntegration({name:"assetManager",observable:r,buttonViewCreator:()=>{const s=this.editor.ui.componentFactory.create("ckfinder");return s.icon=J.imageAssetManager,s.bind("label").to(i,"isImageSelected",a=>n(a?"Replace image with file manager":"Insert image with file manager")),s},formViewCreator:()=>{const s=this.editor.ui.componentFactory.create("ckfinder");return s.icon=J.imageAssetManager,s.withText=!0,s.bind("label").to(i,"isImageSelected",a=>n(a?"Replace with file manager":"Insert with file manager")),s.on("execute",()=>{i.dropdownView.isOpen=!1}),s}})}}}class F1 extends nt{constructor(t){super(t),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if(e!="popup"&&e!="modal")throw new _("ckfinder-unknown-openermethod",t);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=t.locale.uiLanguage),n.onInit=r=>{i&&i(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(h=>!h.isImage()),l=a.filter(h=>h.isImage());for(const h of c)t.execute("link",h.getUrl());const d=[];for(const h of l){const u=h.getUrl();d.push(u||r.request("file:getProxyUrl",{file:h}))}d.length&&Yg(t,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)Yg(t,[a]);else{const c=t.plugins.get("Notification"),l=t.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](n)}}function Yg(o,t){if(o.commands.get("insertImage").isEnabled)o.execute("insertImage",{source:t});else{const e=o.plugins.get("Notification"),n=o.locale.t;e.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class V1 extends z{static get pluginName(){return"CKFinderEditing"}static get requires(){return[qs,"LinkEditing"]}init(){const t=this.editor;if(!t.plugins.has("ImageBlockEditing")&&!t.plugins.has("ImageInlineEditing"))throw new _("ckfinder-missing-image-plugin",t);t.commands.add("ckfinder",new F1(t))}}class U1 extends z{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Ne]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),n=e.token,i=e.uploadUrl;if(!n)return;const r=t.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),t.plugins.get(Ne).createUploadAdapter=s=>new H1(this._uploadGateway,s)}}class H1{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then(t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",(e,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class q1 extends nt{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}refresh(){const t=this.editor.model,e=Ht(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Qg(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document,i=t.selection||n.selection;e.canEditAt(i)&&e.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Qg(a,e.schema)&&r.rename(a,"paragraph")})}}function Qg(o,t){return t.checkChild(o.parent,"paragraph")&&!t.isObject(o)}class G1 extends nt{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.canEditAt(i)&&e.change(r=>{if(i=this._findPositionToInsertParagraph(i,r),!i)return;const s=r.createElement("paragraph");n&&e.schema.setAllowedAttributes(s,n,r),e.insertContent(s,i),r.setSelection(s,"in")})}_findPositionToInsertParagraph(t,e){const n=this.editor.model;if(n.schema.checkChild(t,"paragraph"))return t;const i=n.schema.findAllowedParent(t,"paragraph");if(!i)return null;const r=t.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&t.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&t.isAtStart?n.createPositionBefore(r):e.split(t,i).position}}const Zg=class extends z{static get pluginName(){return"Paragraph"}init(){const o=this.editor,t=o.model;o.commands.add("paragraph",new q1(o)),o.commands.add("insertParagraph",new G1(o)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(e,{writer:n})=>Zg.paragraphLikeElements.has(e.name)?e.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let ra=Zg;ra.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class W1 extends nt{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Ht(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Jg(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Jg(a,i,e.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Jg(o,t,e){return e.checkChild(o.parent,t)&&!e.isObject(o)}const Xg="paragraph";class K1 extends z{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ra]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)i.model!=="paragraph"&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new W1(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(i,r)=>{const s=t.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Xg)&&s.childCount===0&&r.writer.rename(s,Xg)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:pt.low+1})}}var tp=L(2500),$1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(tp.c,$1),tp.c.locals;class Y1 extends z{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(s){const a=s.t,c={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(l=>{const d=c[l.title];return d&&d!=l.title&&(l.title=d),l})}(t),i=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",s=>{const a={},c=new xe,l=t.commands.get("heading"),d=t.commands.get("paragraph"),h=[l];for(const g of n){const p={type:"button",model:new hu({label:g.title,class:g.class,role:"menuitemradio",withText:!0})};g.model==="paragraph"?(p.model.bind("isOn").to(d,"value"),p.model.set("commandName","paragraph"),h.push(d)):(p.model.bind("isOn").to(l,"value",k=>k===g.model),p.model.set({commandName:"heading",commandValue:g.model})),c.add(p),a[g.model]=g.title}const u=Ye(s);return Oh(u,c,{ariaLabel:r,role:"menu"}),u.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(h,"isEnabled",(...g)=>g.some(p=>p)),u.buttonView.bind("label").to(l,"value",d,"value",(g,p)=>{const k=g||p&&"paragraph";return typeof k=="boolean"?i:a[k]?a[k]:i}),this.listenTo(u,"execute",g=>{const{commandName:p,commandValue:k}=g.source;t.execute(p,k?{value:k}:void 0),t.editing.view.focus()}),u})}}function ep(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function np(o,t){const e=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>e.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==t?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function sa(o,t){const e=Ht(t.getSelectedBlocks());return!e||o.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function sr(o){return o&&o.endsWith("px")?parseInt(o):null}function op(o){const t=sr(o.getStyle("width")),e=sr(o.getStyle("height"));return!(!t||!e)}var Q1=Object.defineProperty,ip=Object.getOwnPropertySymbols,Z1=Object.prototype.hasOwnProperty,J1=Object.prototype.propertyIsEnumerable,rp=(o,t,e)=>t in o?Q1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,sp=(o,t)=>{for(var e in t||(t={}))Z1.call(t,e)&&rp(o,e,t[e]);if(ip)for(var e of ip(t))J1.call(t,e)&&rp(o,e,t[e]);return o};const X1=/^(image|image-inline)$/;class oe extends z{constructor(){super(...arguments),this._domEmitter=new(pe())}static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null,i={}){const r=this.editor,s=r.model,a=s.document.selection,c=ap(r,e||a,n);t=sp(sp({},Object.fromEntries(a.getAttributes())),t);for(const l in t)s.schema.checkAttribute(c,l)||delete t[l];return s.change(l=>{const{setImageSizes:d=!0}=i,h=l.createElement(c,t);return s.insertObject(h,e,null,{setSelection:"on",findOptimalPosition:e||c=="imageInline"?void 0:"auto"}),h.parent?(d&&this.setImageNaturalSizeAttributes(h),h):null})}setImageNaturalSizeAttributes(t){const e=t.getAttribute("src");e&&(t.getAttribute("width")||t.getAttribute("height")||this.editor.model.change(n=>{const i=new q.window.Image;this._domEmitter.listenTo(i,"load",()=>{t.getAttribute("width")||t.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",i.naturalWidth,t),r.setAttribute("height",i.naturalHeight,t)}),this._domEmitter.stopListening(i,"load")}),i.src=e}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e)return null;const n=t.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=e.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(t){return t.findAncestor({classes:X1})}isImageAllowed(){const t=this.editor.model.document.selection;return function(e,n){if(ap(e,n,null)=="imageBlock"){const r=function(s,a){const c=og(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,e.model);if(e.model.schema.checkChild(r,"imageBlock"))return!0}else if(e.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(e){return[...e.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(t)}toImageWidget(t,e,n){return e.setCustomProperty("image",!0,t),Qs(t,e,{label:()=>{const i=this.findViewImgElement(t).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Ft(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function ap(o,t,e){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?e||(i==="inline"?"imageInline":i!=="auto"?"imageBlock":t.is("selection")?sa(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class ty extends nt{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",t.newValue,r)})}}class ey extends z{static get requires(){return[oe]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new ty(this.editor))}}var cp=L(5688),ny={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(cp.c,ny),cp.c.locals;var lp=L(2636),oy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(lp.c,oy),lp.c.locals;class iy extends ${constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Kt,this.keystrokes=new Jt,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._focusables=new me,this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),m({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new _i(this.locale,Hi);return e.label=t("Text alternative"),e}}function dp(o){const t=o.editing.view,e=ee.defaultPositions,n=o.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class ry extends z{static get requires(){return[Ki]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const i=t.commands.get("imageTextAlternative"),r=new ut(n);return r.set({label:e("Change image text alternative"),icon:J.textAlternative,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(D(iy))(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(t.ui,"update",()=>{n.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=dp(i);r.updatePosition(s)}}(t):this._hideForm(!0)}),E({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:dp(t)}),n.fieldView.value=n.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class hp extends z{static get requires(){return[ey,ry]}static get pluginName(){return"ImageTextAlternative"}}function up(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),c=o.findViewImgElement(a);i.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):i.attributeNewValue&&(s.setAttribute("srcset",i.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${t}`,e)}}function ar(o,t,e){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=o.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return i=>{i.on(`attribute:${e}:${t}`,n)}}class gp extends Fe{observe(t){this.listenTo(t,"load",(e,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(t){this.stopListening(t)}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}var sy=Object.defineProperty,pp=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,mp=(o,t,e)=>t in o?sy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,cr=(o,t)=>{for(var e in t||(t={}))ay.call(t,e)&&mp(o,e,t[e]);if(pp)for(var e of pp(t))cy.call(t,e)&&mp(o,e,t[e]);return o};class ly extends nt{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||e==="block"&&W("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||e==="inline"&&W("image-inline-plugin-required")}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=Tt(t.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);i.insertImage(cr(cr({},s),r),l)}else i.insertImage(cr(cr({},s),r))})}}class dy extends nt{constructor(t){super(t),this.decorate("cleanupImage")}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=t.isImage(e),this.value=this.isEnabled?e.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(i=>{i.setAttribute("src",t.source,e),this.cleanupImage(i,e),n.setImageNaturalSizeAttributes(e)})}cleanupImage(t,e){t.removeAttribute("srcset",e),t.removeAttribute("sizes",e),t.removeAttribute("sources",e),t.removeAttribute("width",e),t.removeAttribute("height",e),t.removeAttribute("alt",e)}}class aa extends z{static get requires(){return[oe]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(gp),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new ly(t),i=new dy(t);t.commands.add("insertImage",n),t.commands.add("replaceImageSource",i),t.commands.add("imageInsert",n)}}class fp extends z{static get requires(){return[oe]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=t==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${t}`,(d,h,u)=>{if(!u.consumable.consume(h.item,d.name))return;const g=u.writer,p=u.mapper.toViewElement(h.item),k=n.findViewImgElement(p);if(h.attributeNewValue!==null?g.setAttribute(c,h.attributeNewValue,k):g.removeAttribute(c,k),h.item.hasAttribute("sources"))return;const b=h.item.hasAttribute("resizedWidth");if(t==="imageInline"&&!b&&!l)return;const A=h.item.getAttribute("width"),x=h.item.getAttribute("height");A&&x&&g.setStyle("aspect-ratio",`${A}/${x}`,k)})}e.conversion.for("upcast").attributeToAttribute({view:{name:i,styles:{width:/.+/}},model:{key:"width",value:s=>op(s)?sr(s.getStyle("width")):null}}).attributeToAttribute({view:{name:i,key:"width"},model:"width"}).attributeToAttribute({view:{name:i,styles:{height:/.+/}},model:{key:"height",value:s=>op(s)?sr(s.getStyle("height")):null}}).attributeToAttribute({view:{name:i,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),e.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class kp extends nt{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(t={}){const e=this.editor,n=this.editor.model,i=e.plugins.get("ImageUtils"),r=i.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=t,l=Array.from(n.markers).filter(u=>u.getRange().containsItem(r)),d=i.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const h=a.createRangeOn(d);for(const u of l){const g=u.getRange(),p=g.root.rootName!="$graveyard"?g.getJoined(h,!0):h;a.updateMarker(u,{range:p})}return{oldElement:r,newElement:d}}):null}}var bp=L(9684),hy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bp.c,hy),bp.c.locals;class wp extends z{static get requires(){return[oe]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["placeholder"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const t=this.editor,e=t.conversion,n=t.plugins.get("ImageUtils");e.for("editingDowncast").add(i=>{i.on("attribute:placeholder",(r,s,a)=>{if(!a.consumable.test(s.item,r.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;a.consumable.consume(s.item,r.name);const c=a.writer,l=a.mapper.toViewElement(s.item),d=n.findViewImgElement(l);s.attributeNewValue?(c.addClass("image_placeholder",d),c.setStyle("background-image",`url(${s.attributeNewValue})`,d),c.setCustomProperty("editingPipeline:doNotReuseOnce",!0,d)):(c.removeClass("image_placeholder",d),c.removeStyle("background-image",d))})})}_setupLoadListener(){const t=this.editor,e=t.model,n=t.editing,i=n.view,r=t.plugins.get("ImageUtils");i.addObserver(gp),this.listenTo(i.document,"imageLoaded",(s,a)=>{const c=i.domConverter.mapDomToView(a.target);if(!c)return;const l=r.getImageWidgetFromImageView(c);if(!l)return;const d=n.mapper.toModelElement(l);d&&d.hasAttribute("placeholder")&&e.enqueueChange({isUndoable:!1},h=>{h.removeAttribute("placeholder",d)})})}}class Ap extends z{static get requires(){return[aa,fp,oe,wp,Be]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new kp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>ep(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(ep(s),s,e("image widget"))}),n.for("downcast").add(ar(i,"imageBlock","src")).add(ar(i,"imageBlock","alt")).add(up(i,"imageBlock")),n.for("upcast").elementToElement({view:np(t,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,c,l)=>{if(!l.consumable.test(c.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(c.viewItem);if(!d||!l.consumable.test(d,{name:!0}))return;l.consumable.consume(c.viewItem,{name:!0,classes:"image"});const h=Ht(l.convertItem(d,c.modelCursor).modelRange.getItems());h?(l.convertChildren(c.viewItem,h),l.updateConversionResult(h,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isInlineImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(sa(e.schema,d)==="imageBlock"){const h=new $e(n.document),u=c.map(g=>h.createElement("figure",{class:"image"},g));a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&i.setImageNaturalSizeAttributes(d)})})}}var Cp=L(3756),uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Cp.c,uy),Cp.c.locals;class gy extends ${constructor(t,e=[]){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me,this.children=this.createCollection(),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of e)this.children.add(n),this._focusables.add(n),n instanceof ow&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)py(n)&&(n.focusCycler.on("forwardCycle",i=>{this._focusCycler.focusNext(),i.stop()}),n.focusCycler.on("backwardCycle",i=>{this._focusCycler.focusPrevious(),i.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),m({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function py(o){return"focusCycler"in o}class _p extends z{constructor(t){super(t),this._integrations=new Map,t.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[oe]}init(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(t.model.document,"change",()=>{this.isImageSelected=n.isImage(e.getSelectedElement())});const i=r=>this._createToolbarComponent(r);t.ui.componentFactory.add("insertImage",i),t.ui.componentFactory.add("imageInsert",i)}registerIntegration({name:t,observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:r}){this._integrations.has(t)&&W("image-insert-integration-exists",{name:t}),this._integrations.set(t,{observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:!!r})}_createToolbarComponent(t){const e=this.editor,n=t.t,i=this._prepareIntegrations();if(!i.length)return null;let r;const s=i[0];if(i.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new Ui(t,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=Ye(t,r),c=i.map(({observable:l})=>l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=i.map(({formViewCreator:h})=>h(i.length==1)),d=new gy(e.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),e=[];if(!t.length)return W("image-insert-integrations-not-specified"),e;for(const n of t)this._integrations.has(n)?e.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||W("image-insert-unknown-integration",{item:n});return e.length||W("image-insert-integrations-not-registered"),e}}var vp=L(1220),my={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(vp.c,my),vp.c.locals;class fy extends z{static get requires(){return[Ap,Zo,hp,_p]}static get pluginName(){return"ImageBlock"}}class ky extends z{static get requires(){return[aa,fp,oe,wp,Be]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),e.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new kp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,e("image widget"))}),n.for("downcast").add(ar(i,"imageInline","src")).add(ar(i,"imageInline","alt")).add(up(i,"imageInline")),n.for("upcast").elementToElement({view:np(t,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isBlockImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(sa(e.schema,d)==="imageInline"){const h=new $e(n.document),u=c.map(g=>g.childCount===1?(Array.from(g.getAttributes()).forEach(p=>h.setAttribute(...p,i.findViewImgElement(g))),g.getChild(0)):g);a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&i.setImageNaturalSizeAttributes(d)})})}}class by extends z{static get requires(){return[ky,Zo,hp,_p]}static get pluginName(){return"ImageInline"}}class yp extends z{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[oe]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),n=t.getFirstPosition().findAncestor("caption");return n&&e.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return t.name=="figcaption"&&e.isBlockImageView(t.parent)?{name:!0}:null}}class wy extends nt{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils"),n=t.plugins.get("ImageUtils");if(!t.plugins.has(Ap))return this.isEnabled=!1,void(this.value=!1);const i=t.model.document.selection,r=i.getSelectedElement();if(!r){const s=e.getCaptionFromModelSelection(i);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(r):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,e)})}_showImageCaption(t,e){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=i._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||t.createElement("caption");t.append(c,s),e&&t.setSelection(c,"in")}_hideImageCaption(t){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageCaptionEditing"),r=e.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),i._saveCaption(a,s),t.setSelection(a,"on"),t.remove(s)}}class Ay extends z{constructor(t){super(t),this._savedCaptionsMap=new WeakMap}static get requires(){return[oe,yp]}static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.model.schema;e.isRegistered("caption")?e.extend("caption",{allowIn:"imageBlock"}):e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),t.commands.add("toggleImageCaption",new wy(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils"),r=t.t;t.conversion.for("upcast").elementToElement({view:s=>i.matchImageCaptionViewElement(s),model:"caption"}),t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>{if(!n.isBlockImage(s.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),c.placeholder=r("Enter image caption"),Il({view:e,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return ng(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.plugins.get("ImageCaptionUtils"),i=t.commands.get("imageTypeInline"),r=t.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(e.isBlockImage(c)){const h=n.getCaptionFromImageModelElement(c);if(h)return void this._saveCaption(l,h)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};i&&this.listenTo(i,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?mt.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor,e=t.model,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",()=>{const r=e.document.differ.getChanges();for(const s of r){if(s.attributeKey!=="alt")continue;const a=s.range.start.nodeAfter;if(n.isBlockImage(a)){const c=i.getCaptionFromImageModelElement(a);if(!c)return;t.editing.reconvertItem(c)}}})}}class Cy extends z{static get requires(){return[yp]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),i=t.t;t.ui.componentFactory.add("toggleImageCaption",r=>{const s=t.commands.get("toggleImageCaption"),a=new ut(r);return a.set({icon:J.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>i(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(t.model.document.selection);if(c){const l=t.editing.mapper.toViewElement(c);e.scrollToTheSelection(),e.change(d=>{d.addClass("image__caption_highlighted",l)})}t.editing.view.focus()}),a})}}var xp=L(6816),_y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(xp.c,_y),xp.c.locals;function Ep(o){const t=o.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function vy(o){return new Promise((t,e)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=Dp(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});t(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=q.document.createElement("img");l.addEventListener("load",()=>{const d=q.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(h=>h?a(h):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=Dp(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(t).catch(e):e(i))})}function Dp(o,t){return o.type?o.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class yy extends z{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,n=i=>{const r=new o1(i),s=t.commands.get("uploadImage"),a=t.config.get("image.upload.types"),c=Ep(a);return r.set({acceptedType:a.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:e("Upload image from computer"),icon:J.imageUpload,tooltip:!0}),r.bind("isEnabled").to(s),r.on("done",(l,d)=>{const h=Array.from(d).filter(u=>c.test(u.type));h.length&&(t.execute("uploadImage",{file:h}),t.editing.view.focus())}),r};if(t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI"),r=t.commands.get("uploadImage");i.registerIntegration({name:"upload",observable:r,buttonViewCreator:()=>{const s=t.ui.componentFactory.create("uploadImage");return s.bind("label").to(i,"isImageSelected",a=>e(a?"Replace image from computer":"Upload image from computer")),s},formViewCreator:()=>{const s=t.ui.componentFactory.create("uploadImage");return s.withText=!0,s.bind("label").to(i,"isImageSelected",a=>e(a?"Replace from computer":"Upload from computer")),s.on("execute",()=>{i.dropdownView.isOpen=!1}),s}})}}}var Ip=L(2628),xy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Ip.c,xy),Ip.c.locals;var Tp=L(1652),Ey={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Tp.c,Ey),Tp.c.locals;var Sp=L(4164),Dy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Sp.c,Dy),Sp.c.locals;class Iy extends z{constructor(t){super(t),this.uploadStatusChange=(e,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,e.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(Ne),d=a?n.attributeNewValue:null,h=this.placeholder,u=r.editing.mapper.toViewElement(s),g=i.writer;if(d=="reading")return Mp(u,g),void Bp(c,h,u,g);if(d=="uploading"){const p=l.loaders.get(a);return Mp(u,g),void(p?(Np(u,g),function(k,b,A,x){const M=function(O){const H=O.createUIElement("div",{class:"ck-progress-bar"});return O.setCustomProperty("progressBar",!0,H),H}(b);b.insert(b.createPositionAt(k,"end"),M),A.on("change:uploadedPercent",(O,H,Y)=>{x.change(et=>{et.setStyle("width",Y+"%",M)})})}(u,g,p,r.editing.view),function(k,b,A,x){if(x.data){const M=k.findViewImgElement(b);A.setAttribute("src",x.data,M)}}(c,u,g,p)):Bp(c,h,u,g))}d=="complete"&&l.loaders.get(a)&&function(p,k,b){const A=k.createUIElement("div",{class:"ck-image-upload-complete-icon"});k.insert(k.createPositionAt(p,"end"),A),setTimeout(()=>{b.change(x=>x.remove(x.createRangeOn(A)))},3e3)}(u,g,r.editing.view),function(p,k){Lp(p,k,"progressBar")}(u,g),Np(u,g),function(p,k){k.removeClass("ck-appear",p)}(u,g)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),t.plugins.has("ImageInlineEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function Mp(o,t){o.hasClass("ck-appear")||t.addClass("ck-appear",o)}function Bp(o,t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const i=o.findViewImgElement(e);i.getAttribute("src")!==t&&n.setAttribute("src",t,i),Pp(e,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function Np(o,t){o.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",o),Lp(o,t,"placeholder")}function Pp(o,t){for(const e of o.getChildren())if(e.getCustomProperty(t))return e}function Lp(o,t,e){const n=Pp(o,e);n&&t.remove(t.createRangeOn(n))}var Ty=Object.defineProperty,Sy=Object.defineProperties,My=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,By=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,zp=(o,t,e)=>t in o?Ty(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Py extends nt{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=Tt(t.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(t,e,n){const i=this.editor,r=i.plugins.get(Ne).createLoader(t),s=i.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var h in d||(d={}))By.call(d,h)&&zp(l,h,d[h]);if(Op)for(var h of Op(d))Ny.call(d,h)&&zp(l,h,d[h]);return l})({},e),c={uploadId:r.id},Sy(a,My(c))),n)}}class Ly extends z{constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Ne,qs,Be,oe]}static get pluginName(){return"ImageUploadEditing"}init(){const t=this.editor,e=t.model.document,n=t.conversion,i=t.plugins.get(Ne),r=t.plugins.get("ImageUtils"),s=t.plugins.get("ClipboardPipeline"),a=Ep(t.config.get("image.upload.types")),c=new Py(t);t.commands.add("uploadImage",c),t.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(l,d)=>{if(h=d.dataTransfer,Array.from(h.types).includes("text/html")&&h.getData("text/html")!=="")return;var h;const u=Array.from(d.dataTransfer.files).filter(g=>!!g&&a.test(g.type));u.length&&(l.stop(),t.model.change(g=>{d.targetRanges&&g.setSelection(d.targetRanges.map(p=>t.editing.mapper.toModelRange(p))),t.execute("uploadImage",{file:u})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const h=Array.from(t.editing.view.createRangeIn(d.content)).map(g=>g.item).filter(g=>function(p,k){return!(!p.isInlineImageView(k)||!k.getAttribute("src")||!k.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!k.getAttribute("src").match(/^blob:/g))}(r,g)&&!g.getAttribute("uploadProcessed")).map(g=>({promise:vy(g),imageElement:g}));if(!h.length)return;const u=new $e(t.editing.view.document);for(const g of h){u.setAttribute("uploadProcessed",!0,g.imageElement);const p=i.createLoader(g.promise);p&&(u.setAttribute("src","",g.imageElement),u.setAttribute("uploadId",p.id,g.imageElement))}}),t.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),e.on("change",()=>{const l=e.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const h of l)if(h.type=="insert"&&h.name!="$text"){const u=h.position.nodeAfter,g=h.position.root.rootName=="$graveyard";for(const p of Oy(t,u)){const k=p.getAttribute("uploadId");if(!k)continue;const b=i.loaders.get(k);b&&(g?d.has(k)||b.abort():(d.add(k),this._uploadImageElements.set(k,p),b.status=="idle"&&this._readAndUpload(b)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:h})=>{const u=h.urls?h.urls:h;this.editor.model.change(g=>{g.setAttribute("src",u.default,d),this._parseAndSetSrcsetAttributeOnImage(u,d,g),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(t){const e=this.editor,n=e.model,i=e.locale.t,r=e.plugins.get(Ne),s=e.plugins.get(qs),a=e.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(t.id))}),t.read().then(()=>{const d=t.upload(),h=c.get(t.id);if(f.isSafari){const u=e.editing.mapper.toViewElement(h),g=a.findViewImgElement(u);e.editing.view.once("render",()=>{if(!g.parent)return;const p=e.editing.view.domConverter.mapViewToDom(g.parent);if(!p)return;const k=p.style.display;p.style.display="none",p._ckHack=p.offsetHeight,p.style.display=k})}return n.enqueueChange({isUndoable:!1},u=>{u.setAttribute("uploadStatus","uploading",h)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},h=>{const u=c.get(t.id);h.setAttribute("uploadStatus","complete",u),this.fire("uploadComplete",{data:d,imageElement:u})}),l()}).catch(d=>{if(t.status!=="error"&&t.status!=="aborted")throw d;t.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},h=>{h.remove(c.get(t.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const h=c.get(t.id);d.removeAttribute("uploadId",h),d.removeAttribute("uploadStatus",h),c.delete(t.id)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const r=Object.keys(t).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${t[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};e.hasAttribute("width")||e.hasAttribute("height")||(s.width=i),n.setAttributes(s,e)}}}function Oy(o,t){const e=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(t)).filter(n=>e.isImage(n.item)).map(n=>n.item)}var Rp=L(2876),zy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Rp.c,zy),Rp.c.locals;class Ry extends nt{constructor(t,e){super(t),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(e.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled?t.hasAttribute("imageStyle")?this.value=t.getAttribute("imageStyle"):this.value=this._defaultStyles[t.name]:this.value=!1}execute(t={}){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils");n.change(r=>{const s=t.value,{setImageSizes:a=!0}=t;let c=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(i.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&i.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(t,e){return!this._styles.get(t).modelElements.includes(e.name)}}var jy=Object.defineProperty,jp=Object.getOwnPropertySymbols,Fy=Object.prototype.hasOwnProperty,Vy=Object.prototype.propertyIsEnumerable,Fp=(o,t,e)=>t in o?jy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Vp=(o,t)=>{for(var e in t||(t={}))Fy.call(t,e)&&Fp(o,e,t[e]);if(jp)for(var e of jp(t))Vy.call(t,e)&&Fp(o,e,t[e]);return o};const{objectFullWidth:Uy,objectInline:Up,objectLeft:Hp,objectRight:ca,objectCenter:la,objectBlockLeft:qp,objectBlockRight:Gp}=J,lr={get inline(){return{name:"inline",title:"In line",icon:Up,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Hp,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:qp,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:la,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:ca,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Gp,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:la,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:ca,modelElements:["imageBlock"],className:"image-style-side"}}},Wp={full:Uy,left:qp,right:Gp,center:la,inlineLeft:Hp,inlineRight:ca,inline:Up},Kp=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function $p(o){W("image-style-configuration-definition-invalid",o)}const da={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(t=>function(e){return e=typeof e=="string"?lr[e]?Vp({},lr[e]):{name:e}:function(n,i){const r=Vp({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(lr[e.name],e),typeof e.icon=="string"&&(e.icon=Wp[e.icon]||e.icon),e}(t)).filter(t=>function(e,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=e;if(!(r&&r.length&&s))return $p({style:e}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(c=>a.includes(c)))return W("image-style-missing-dependency",{style:e,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(t,o))},getDefaultStylesConfiguration:function(o,t){return o&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...Kp]:[]},warnInvalidStyle:$p,DEFAULT_OPTIONS:lr,DEFAULT_ICONS:Wp,DEFAULT_DROPDOWN_DEFINITIONS:Kp};function Yp(o,t){for(const e of t)if(e.name===o)return e}class Qp extends z{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[oe]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=da,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,r)),this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new Ry(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const h=Yp(l.attributeNewValue,s),u=Yp(l.attributeOldValue,s),g=d.mapper.toViewElement(l.item),p=d.writer;u&&p.removeClass(u.className,g),h&&p.addClass(h.className,g)});var s;const a=function(c){const l={imageInline:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,h,u)=>{if(!h.modelRange)return;const g=h.viewItem,p=Ht(h.modelRange.getItems());if(p&&u.schema.checkAttribute(p,"imageStyle"))for(const k of l[p.name])u.consumable.consume(g,{classes:k.className})&&u.writer.setAttribute("imageStyle",k.name,p)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),t&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),e&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const t=this.editor,e=t.model.document,n=t.plugins.get(oe),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));e.registerPostFixer(r=>{let s=!1;for(const a of e.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let c=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!n.isImage(c))continue;const l=c.getAttribute("imageStyle");if(!l)continue;const d=i.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Zp=L(9216),Hy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Zp.c,Hy),Zp.c.locals;class qy extends z{static get requires(){return[Qp]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],n=Jp(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Jp([...e.filter(ht),...da.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,i=>{let r;const{defaultItem:s,items:a,title:c}=t,l=a.filter(g=>e.find(({name:p})=>Xp(p)===g)).map(g=>{const p=n.create(g);return g===s&&(r=p),p});a.length!==l.length&&da.warnInvalidStyle({dropdown:t});const d=Ye(i,Ui),h=d.buttonView,u=h.arrowView;return zs(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:tm(c,r.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:c}),h.bind("icon").toMany(l,"isOn",(...g)=>{const p=g.findIndex(yn);return p<0?r.icon:l[p].icon}),h.bind("label").toMany(l,"isOn",(...g)=>{const p=g.findIndex(yn);return tm(c,p<0?r.label:l[p].label)}),h.bind("isOn").toMany(l,"isOn",(...g)=>g.some(yn)),h.bind("class").toMany(l,"isOn",(...g)=>g.some(yn)?"ck-splitbutton_flatten":void 0),h.on("execute",()=>{l.some(({isOn:g})=>g)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...g)=>g.some(yn)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(Xp(e),n=>{const i=this.editor.commands.get("imageStyle"),r=new ut(n);return r.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===e),r.on("execute",this._executeCommand.bind(this,e)),r})}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function Jp(o,t){for(const e of o)t[e.title]&&(e.title=t[e.title]);return o}function Xp(o){return`imageStyle:${o}`}function tm(o,t){return(o?o+": ":"")+t}class Gy extends z{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new vl(t)),t.commands.add("outdent",new vl(t))}}class Wy extends z{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?J.indent:J.outdent,r=e.uiLanguageDirection=="ltr"?J.outdent:J.indent;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,r=>{const s=i.commands.get(t),a=new ut(r);return a.set({label:e,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(t),i.editing.view.focus()}),a})}}class Ky{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(e=>this._definitions.add(e)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(e,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const c=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,c);for(const l in a.styles)r.setStyle(l,a.styles[l],c);r.setCustomProperty("link",!0,c),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),c):r.wrap(i.mapper.toViewRange(n.range),c):r.unwrap(i.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",(e,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(c=>c.is("element","a"));for(const c of this._definitions){const l=Re(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,h]of l)d==="class"?i.addClass(h,a):i.setAttribute(d,h,a);c.classes&&i.addClass(c.classes,a);for(const d in c.styles)i.setStyle(d,c.styles[d],a)}else{for(const[d,h]of l)d==="class"?i.removeClass(h,a):i.removeAttribute(d,a);c.classes&&i.removeClass(c.classes,a);for(const d in c.styles)i.removeStyle(d,a)}}})}}}const $y=function(o,t,e){var n=o.length;return e=e===void 0?n:e,!t&&e>=n?o:Ll(o,t,e)};var Yy=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const em=function(o){return Yy.test(o)},Qy=function(o){return o.split("")};var nm="\\ud800-\\udfff",Zy="["+nm+"]",ha="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ua="\\ud83c[\\udffb-\\udfff]",om="[^"+nm+"]",im="(?:\\ud83c[\\udde6-\\uddff]){2}",rm="[\\ud800-\\udbff][\\udc00-\\udfff]",sm="(?:"+ha+"|"+ua+")?",am="[\\ufe0e\\ufe0f]?",Jy=am+sm+("(?:\\u200d(?:"+[om,im,rm].join("|")+")"+am+sm+")*"),Xy="(?:"+[om+ha+"?",ha,im,rm,Zy].join("|")+")",t2=RegExp(ua+"(?="+ua+")|"+Xy+Jy,"g");const e2=function(o){return o.match(t2)||[]},n2=function(o){return em(o)?e2(o):Qy(o)},o2=function(o){return function(t){t=is(t);var e=em(t)?n2(t):void 0,n=e?e[0]:t.charAt(0),i=e?$y(e,1).join(""):t.slice(1);return n[o]()+i}}("toUpperCase"),i2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,r2=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,s2=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,a2=/^((\w+:(\/{2,})?)|(\W))/i,ga="Ctrl+K";function cm(o,{writer:t}){const e=t.createAttributeElement("a",{href:o},{priority:5});return t.setCustomProperty("link",!0,e),e}function lm(o){const t=String(o);return function(e){return!!e.replace(i2,"").match(r2)}(t)?t:"#"}function pa(o,t){return!!o&&t.checkAttribute(o.name,"linkHref")}function ma(o,t){const e=(n=o,s2.test(n)?"mailto:":t);var n;const i=!!e&&!dm(o);return o&&i?e+o:o}function dm(o){return a2.test(o)}function hm(o){window.open(o,"_blank","noopener")}class c2 extends nt{constructor(){super(...arguments),this.manualDecorators=new xe,this.automaticDecorators=new Ky}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||Ht(e.getSelectedBlocks());pa(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in e)e[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const c=i.getFirstPosition();if(i.hasAttribute("linkHref")){const l=um(i);let d=Ji(c,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,t)),a.setAttribute("linkHref",t,d),r.forEach(h=>{a.setAttribute(h,!0,d)}),s.forEach(h=>{a.removeAttribute(h,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(t!==""){const l=Re(i.getAttributes());l.set("linkHref",t),r.forEach(h=>{l.set(h,!0)});const{end:d}=n.insertContent(a.createText(t,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(i.getRanges(),"linkHref"),l=[];for(const h of i.getSelectedBlocks())n.schema.checkAttribute(h,"linkHref")&&l.push(a.createRangeOn(h));const d=l.slice();for(const h of c)this._isRangeToUpdate(h,l)&&d.push(h);for(const h of d){let u=h;if(d.length===1){const g=um(i);i.getAttribute("linkHref")===g&&(u=this._updateLinkContent(n,a,h,t),a.setSelection(a.createSelection(u)))}a.setAttribute("linkHref",t,u),r.forEach(g=>{a.setAttribute(g,!0,u)}),s.forEach(g=>{a.removeAttribute(g,u)})}}})}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return pa(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}_updateLinkContent(t,e,n,i){const r=e.createText(i,{linkHref:i});return t.insertContent(r,n)}}function um(o){if(o.isCollapsed){const t=o.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(o.getFirstRange().getItems());if(t.length>1)return null;const e=t[0];return e.is("$text")||e.is("$textProxy")?e.data:null}}class l2 extends nt{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();pa(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change(r=>{const s=n.isCollapsed?[Ji(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const c of i.manualDecorators)r.removeAttribute(c.id,a)})}}class d2 extends ct(){constructor({id:t,label:e,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=t,this.set("value",void 0),this.defaultValue=s,this.label=e,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var gm=L(8836),h2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(gm.c,h2),gm.c.locals;var u2=Object.defineProperty,pm=Object.getOwnPropertySymbols,g2=Object.prototype.hasOwnProperty,p2=Object.prototype.propertyIsEnumerable,mm=(o,t,e)=>t in o?u2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,m2=(o,t)=>{for(var e in t||(t={}))g2.call(t,e)&&mm(o,e,t[e]);if(pm)for(var e of pm(t))p2.call(t,e)&&mm(o,e,t[e]);return o};const fm="automatic",f2=/^(https?:)?\/\//;class km extends z{static get pluginName(){return"LinkEditing"}static get requires(){return[Gu,Ru,Be]}constructor(t){super(t),t.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:cm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>cm(lm(n),i)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),t.commands.add("link",new c2(t)),t.commands.add("unlink",new l2(t));const e=function(n,i){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(s=>("label"in s&&r[s.label]&&(s.label=r[s.label]),s)),i}(t.t,function(n){const i=[];if(n)for(const[r,s]of Object.entries(n)){const a=Object.assign({},s,{id:`link${o2(r)}`});i.push(a)}return i}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(n=>n.mode===fm)),this._enableManualDecorators(e.filter(n=>n.mode==="manual")),t.plugins.get(Gu).registerAttribute("linkHref"),function(n,i,r,s){const a=n.editing.view,c=new Set;a.document.registerPostFixer(l=>{const d=n.model.document.selection;let h=!1;if(d.hasAttribute(i)){const u=Ji(d.getFirstPosition(),i,d.getAttribute(i),n.model),g=n.editing.mapper.toViewRange(u);for(const p of g.getItems())p.is("element",r)&&!p.hasClass(s)&&(l.addClass(s,p),c.add(p),h=!0)}return h}),n.conversion.for("editingDowncast").add(l=>{function d(){a.change(h=>{for(const u of c.values())h.removeClass(s,u),c.delete(u)})}l.on("insert",d,{priority:"highest"}),l.on("remove",d,{priority:"highest"}),l.on("attribute",d,{priority:"highest"}),l.on("selection",d,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:fm,callback:i=>!!i&&f2.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(i=>{e.model.schema.extend("$text",{allowAttributes:i.id});const r=new d2(i);n.add(r),e.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:c},{item:l})=>{if((l.is("selection")||c.isInline(l))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const h in r.styles)a.setStyle(h,r.styles[h],d);return a.setCustomProperty("link",!0,d),d}}}),e.conversion.for("upcast").elementToAttribute({view:m2({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(n,i)=>{if(!(f.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),hm(s))},{context:"$capture"}),this.listenTo(e,"keydown",(n,i)=>{const r=t.commands.get("link").value;r&&i.keyCode===rt.enter&&i.altKey&&(n.stop(),hm(r))})}_enableSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(e,"change:attribute",(n,{attributeKeys:i})=>{i.includes("linkHref")&&!e.hasAttribute("linkHref")&&t.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=t.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const t=this.editor,e=t.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{e.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=ma(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var bm=L(8408),k2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bm.c,k2),bm.c.locals;class b2 extends ${constructor(t,e){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me;const n=t.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),m({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new _i(this.locale,Hi);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new Ai(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const n=new $;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(n)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var wm=L(9796),w2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(wm.c,w2),wm.c.locals;class A2 extends ${constructor(t){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me;const e=t.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),J.pencil,"edit"),this.set("href",void 0),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new ut(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new ut(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",i=>i&&lm(i)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",i=>i||n("This link has no URL")),t.bind("isEnabled").to(this,"href",i=>!!i),t.template.tag="a",t.template.eventListeners={},t}}const Ue="link-ui";class C2 extends z{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Ki]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(TC),this._balloon=t.plugins.get(Ki),this._createToolbarLinkButton(),this._enableBalloonActivators(),t.conversion.for("editingDowncast").markerToHighlight({model:Ue,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Ue,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new A2(t.locale),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),e.keystrokes.set(ga,(r,s)=>{this._addFormView(),s()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=t.config.get("link.allowCreatingEmptyLinks"),r=new(D(b2))(t.locale,e);return r.urlInputView.fieldView.bind("value").to(e,"value"),r.urlInputView.bind("isEnabled").to(e,"isEnabled"),r.saveButtonView.bind("isEnabled").to(e,"isEnabled",r.urlInputView,"isEmpty",(s,a)=>s&&(i||!a)),this.listenTo(r,"submit",()=>{const{value:s}=r.urlInputView.fieldView.element,a=ma(s,n);t.execute("link",a,r.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(r,"cancel",()=>{this._closeFormView()}),r.keystrokes.set("Esc",(s,a)=>{this._closeFormView(),a()}),r}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.ui.componentFactory.add("link",i=>{const r=new ut(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=ga,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(e,"isEnabled"),r.bind("isOn").to(e,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),t.keystrokes.set(ga,(n,i)=>{i(),t.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),E({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=t.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),t.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=c};function s(){return e.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(t.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return!!this.formView&&t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i;if(e.markers.has(Ue)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Ue)),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));i=t.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?t.domConverter.mapViewToDom(r):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&Ft(n))return fa(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),r=fa(i.start),s=fa(i.end);return r&&r==s&&t.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(Ue))e.updateMarker(Ue,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!t.schema.isContent(r),{boundaries:n});e.addMarker(Ue,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(Ue,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Ue)&&t.change(e=>{e.removeMarker(Ue)})}}function fa(o){return o.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})||null}const Am=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class _2 extends z{static get requires(){return[Qe,km]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(t,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?Ji(e,"linkHref",e.textNode.getAttribute("linkHref"),t):null}_selectEntireLinks(t,e){const n=this.editor.model,i=n.document.selection,r=i.getFirstPosition(),s=i.getLastPosition();let a=e.getJoined(this._expandLinkRange(n,r)||e);a&&(a=a.getJoined(this._expandLinkRange(n,s)||e)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&t.setSelection(a)}_enablePasteLinking(){const t=this.editor,e=t.model,n=e.document.selection,i=t.plugins.get("ClipboardPipeline"),r=t.commands.get("link");i.on("inputTransformation",(s,a)=>{if(!this.isEnabled||!r.isEnabled||n.isCollapsed||a.method!=="paste"||n.rangeCount>1)return;const c=n.getFirstRange(),l=a.dataTransfer.getData("text/plain");if(!l)return;const d=l.match(Am);d&&d[2]===l&&(e.change(h=>{this._selectEntireLinks(h,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const t=this.editor,e=new qu(t.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Cm(n.substr(0,n.length-1));return i?{url:i}:void 0});e.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=t.model.createRange(l,c);this._applyAutoLink(a,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=e.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition(),r=e.createRange(e.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=Hu(t,e),r=Cm(n);if(r){const s=e.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(t,e){const n=this.editor.model,i=ma(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(e,n)&&dm(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",t,e),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Cm(o){const t=Am.exec(o);return t?t[2]:null}var _m=L(5064),v2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(_m.c,v2),_m.c.locals;class we{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=Tt(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){return Ht(new this(t,e)[Symbol.iterator]())}*[Symbol.iterator](){const t=[];for(const{node:e}of ti(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(i=>e.getAttribute(i)!==this._startElement.getAttribute(i)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*ti(o,t="forward"){const e=t=="forward",n=[];let i=null;for(;Gt(o);){let r=null;if(i){const s=o.getAttribute("listIndent"),a=i.getAttribute("listIndent");s>a?n[a]=i:st in o?x2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,ka=(o,t)=>{for(var e in t||(t={}))I2.call(t,e)&&ym(o,e,t[e]);if(vm)for(var e of vm(t))T2.call(t,e)&&ym(o,e,t[e]);return o},ba=(o,t)=>E2(o,D2(t));class lo{static next(){return Q()}}function Gt(o){return!!o&&o.is("element")&&o.hasAttribute("listItemId")}function wa(o,t={}){return[...hn(o,ba(ka({},t),{direction:"backward"})),...hn(o,ba(ka({},t),{direction:"forward"}))]}function hn(o,t={}){const e=t.direction=="forward",n=Array.from(new we(o,ba(ka({},t),{includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"})));return e?n:n.reverse()}function xm(o){const t=new we(o,{sameIndent:!0,sameAttributes:"listType"}),e=new we(o,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(t).reverse(),...e]}function Nn(o){return!we.first(o,{sameIndent:!0,sameAttributes:"listItemId"})}function Em(o){return!we.first(o,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function ei(o,t={}){o=Tt(o);const e=t.withNested!==!1,n=new Set;for(const i of o)for(const r of wa(i,{higherIndent:e}))n.add(r);return Pn(n)}function S2(o){o=Tt(o);const t=new Set;for(const e of o)for(const n of xm(e))t.add(n);return Pn(t)}function Aa(o,t){const e=hn(o,{direction:"forward"}),n=lo.next();for(const i of e)t.setAttribute("listItemId",n,i);return e}function Ca(o,t,e){const n={};for(const[r,s]of t.getAttributes())r.startsWith("list")&&(n[r]=s);const i=hn(o,{direction:"forward"});for(const r of i)e.setAttributes(n,r);return i}function _a(o,t,{expand:e,indentBy:n=1}={}){o=Tt(o);const i=e?ei(o):o;for(const r of i){const s=r.getAttribute("listIndent")+n;s<0?dr(r,t):t.setAttribute("listIndent",s,r)}return i}function dr(o,t){o=Tt(o);for(const e of o)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of o)for(const n of e.getAttributeKeys())n.startsWith("list")&&t.removeAttribute(n,e);return o}function ni(o){if(!o.length)return!1;const t=o[0].getAttribute("listItemId");return!!t&&!o.some(e=>e.getAttribute("listItemId")!=t)}function Pn(o){return Array.from(o).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function oi(o){const t=o.document.selection.getSelectedElement();return t&&o.schema.isObject(t)&&o.schema.isBlock(t)?t:null}function va(o,t){return t.checkChild(o.parent,"listItem")&&t.checkChild(o,"$text")&&!t.isObject(o)}function M2(o,t,e){return hn(t,{direction:"forward"}).pop().index>o.index?Ca(o,t,e):[]}class Dm extends nt{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=Im(t.document.selection);t.change(n=>{const i=[];ni(e)&&!Nn(e[0])?(this._direction=="forward"&&i.push(..._a(e,n)),i.push(...Aa(e[0],n))):this._direction=="forward"?i.push(..._a(e,n,{expand:!0})):i.push(...function(r,s){const a=ei(r=Tt(r)),c=new Set,l=Math.min(...a.map(h=>h.getAttribute("listIndent"))),d=new Map;for(const h of a)d.set(h,we.first(h,{lowerIndent:!0}));for(const h of a){if(c.has(h))continue;c.add(h);const u=h.getAttribute("listIndent")-1;if(u<0)dr(h,s);else{if(h.getAttribute("listIndent")==l){const g=M2(h,d.get(h),s);for(const p of g)c.add(p);if(g.length)continue}s.setAttribute("listIndent",u,h)}}return Pn(c)}(e,n));for(const r of i){if(!r.hasAttribute("listType"))continue;const s=we.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",Pn(new Set(t)))}_checkEnabled(){let t=Im(this.editor.model.document.selection),e=t[0];if(!e)return!1;if(this._direction=="backward"||ni(t)&&!Nn(t[0]))return!0;t=ei(t),e=t[0];const n=we.first(e,{sameIndent:!0});return!!n&&n.getAttribute("listType")==e.getAttribute("listType")}}function Im(o){const t=Array.from(o.getSelectedBlocks()),e=t.findIndex(n=>!Gt(n));return e!=-1&&(t.length=e),t}class Tm extends nt{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=oi(e),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>e.schema.checkAttribute(a,"listType")||va(a,e.schema)),s=t.forceValue!==void 0?!t.forceValue:this.value;e.change(a=>{if(s){const c=r[r.length-1],l=hn(c,{direction:"forward"}),d=[];l.length>1&&d.push(...Aa(l[1],a)),d.push(...dr(r,a)),d.push(...function(h,u){const g=[];let p=Number.POSITIVE_INFINITY;for(const{node:k}of ti(h.nextSibling,"forward")){const b=k.getAttribute("listIndent");if(b==0)break;b{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,t),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const u=(h=a,Array.from(new we(h,{direction:"forward",higherIndent:!0})));i.push(..._a([a,...u],r,{indentBy:c-l,expand:c{const e=Aa(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",Pn(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&Gt(e)&&!Nn(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?t:t.nextSibling}}class B2 extends z{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(t){return S2(t)}isFirstBlockOfListItem(t){return Nn(t)}isListItemBlock(t){return Gt(t)}expandListBlocksToCompleteItems(t,e={}){return ei(t,e)}}function Bm(o){return o.is("element","ol")||o.is("element","ul")}function hr(o){return o.is("element","li")}function N2(o,t,e,n=Pm(e,t)){return o.createAttributeElement(Nm(e),null,{priority:2*t/100-100,id:n})}function P2(o,t,e){return o.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function Nm(o){return o=="numbered"?"ol":"ul"}function Pm(o,t){return`list-${o}-${t}`}function Pe(o,t){const e=o.nodeBefore;if(Gt(e)){let n=e;for(const{node:i}of ti(n,"backward"))if(n=i,t.has(n))return;t.set(e,n)}else{const n=o.nodeAfter;Gt(n)&&t.set(n,n)}}function L2(){return(o,t,e)=>{const{writer:n,schema:i}=e;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(h=>i.checkAttribute(h,"listItemId"));if(!r.length)return;const s=lo.next(),a=function(h){let u=0,g=h.parent;for(;g;){if(hr(g))u++;else{const p=g.previousSibling;p&&hr(p)&&u++}g=g.parent}return u}(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");l&&(c=l);const d={listItemId:s,listIndent:a,listType:c};for(const h of r)h.hasAttribute("listItemId")||n.setAttributes(d,h);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&e.keepEmptyElement(r[0])}}function Lm(){return(o,t,e)=>{if(!e.consumable.test(t.viewItem,{name:!0}))return;const n=new $e(t.viewItem.document);for(const i of Array.from(t.viewItem.getChildren()))hr(i)||Bm(i)||n.remove(i)}}function Om(o,t,e,{dataPipeline:n}={}){const i=function(r){return(s,a)=>{const c=[];for(const l of r)s.hasAttribute(l)&&c.push(`attribute:${l}`);return!!c.every(l=>a.test(s,l)!==!1)&&(c.forEach(l=>a.consume(s,l)),!0)}}(o);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,h=s.item;if(!o.includes(s.attributeKey)||!i(h,d))return;const u=function(p,k,b){const A=b.createRangeOn(p);return k.toViewRange(A).getTrimmed().end.nodeBefore}(h,l,e);(function(p,k,b){for(;p.parent.is("attributeElement")&&p.parent.getCustomProperty("listItemWrapper");)k.unwrap(k.createRangeIn(p.parent),p.parent);const A=k.createPositionBefore(p).getWalker({direction:"backward"}),x=[];for(const{item:M}of A){if(M.is("element")&&b.toModelElement(M))break;M.is("element")&&M.getCustomProperty("listItemMarker")&&x.push(M)}for(const M of x)k.remove(M)})(u,c,l),function(p,k){let b=p.parent;for(;b.is("attributeElement")&&["ul","ol","li"].includes(b.name);){const A=b.parent;k.unwrap(k.createRangeOn(p),b),b=A}}(u,c);const g=function(p,k,b,A,{dataPipeline:x}){let M=A.createRangeOn(k);if(!Nn(p))return M;for(const O of b){if(O.scope!="itemMarker")continue;const H=O.createElement(A,p,{dataPipeline:x});if(!H||(A.setCustomProperty("listItemMarker",!0,H),A.insert(M.start,H),M=A.createRange(A.createPositionBefore(H),A.createPositionAfter(k)),!O.createWrapperElement||!O.canWrapElement))continue;const Y=O.createWrapperElement(A,p,{dataPipeline:x});A.setCustomProperty("listItemWrapper",!0,Y),O.canWrapElement(p)?M=A.wrap(M,Y):(M=A.wrap(A.createRangeOn(H),Y),M=A.createRange(M.start,A.createPositionAfter(k)))}return M}(h,u,t,c,{dataPipeline:n});(function(p,k,b,A){if(!p.hasAttribute("listIndent"))return;const x=p.getAttribute("listIndent");let M=p;for(let O=x;O>=0;O--){const H=P2(A,O,M.getAttribute("listItemId")),Y=N2(A,O,M.getAttribute("listType"));for(const et of b)et.scope!="list"&&et.scope!="item"||!M.hasAttribute(et.attributeName)||et.setAttributeOnDowncast(A,M.getAttribute(et.attributeName),et.scope=="list"?Y:H);if(k=A.wrap(k,H),k=A.wrap(k,Y),O==0||(M=we.first(M,{lowerIndent:!0}),!M))break}})(h,g,t,c)}}function zm(o,{dataPipeline:t}={}){return(e,{writer:n})=>{if(!Rm(e,o))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const i=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,i),i}}function Rm(o,t,e=wa(o)){if(!Gt(o))return!1;for(const n of o.getAttributeKeys())if(!n.startsWith("selection:")&&!t.includes(n))return!1;return e.length<2}var jm=L(2483),O2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(jm.c,O2),jm.c.locals;var Fm=L(2984),z2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Fm.c,z2),Fm.c.locals;const ur=["listType","listIndent","listItemId"];class R2 extends z{constructor(t){super(t),this._downcastStrategies=[],t.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[Xi,Qe,B2,Be]}init(){const t=this.editor,e=t.model,n=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new _("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:ur}),n?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const i of ur)e.schema.setAttributeProperties(i,{copyOnReplace:!0});t.commands.add("numberedList",new Tm(t,"numbered")),t.commands.add("bulletedList",new Tm(t,"bulleted")),t.commands.add("indentList",new Dm(t,"forward")),t.commands.add("outdentList",new Dm(t,"backward")),t.commands.add("splitListItemBefore",new Mm(t,"before")),t.commands.add("splitListItemAfter",new Mm(t,"after")),n&&(t.commands.add("mergeListItemBackward",new Sm(t,"backward")),t.commands.add("mergeListItemForward",new Sm(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...ur,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),n=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(i,r)=>{const s=t.model.document.selection;oi(t.model)||t.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!Gt(c))return;if(we.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:Vm(t.model,"backward")})}else Em(c)||t.execute("splitListItemAfter"),t.execute("outdentList");r.preventDefault(),i.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:Vm(t.model,"forward")}),r.preventDefault(),i.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,n=t.commands,i=n.get("enter");this.listenTo(t.editing.view.document,"enter",(r,s)=>{const a=e.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&Gt(c)&&c.isEmpty&&!s.isSoft){const l=Nn(c),d=Em(c);l&&d?(t.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(t.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(t.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(i,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&wa(t.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,n=this.getListAttributeNames(),i=t.config.get("list.multiBlock"),r=i?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(s,{writer:a})=>a.createElement(r,{listType:""})}).elementToElement({view:"p",model:(s,{writer:a})=>s.parent&&s.parent.is("element","li")?a.createElement(r,{listType:""}):null,converterPriority:"high"}).add(s=>{s.on("element:li",L2()),s.on("element:ul",Lm(),{priority:"high"}),s.on("element:ol",Lm(),{priority:"high"})}),i||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:r,view:zm(n),converterPriority:"high"}).add(s=>{s.on("attribute",Om(n,this._downcastStrategies,e))}),t.conversion.for("dataDowncast").elementToElement({model:r,view:zm(n,{dataPipeline:!0}),converterPriority:"high"}).add(s=>{s.on("attribute",Om(n,this._downcastStrategies,e,{dataPipeline:!0}))}),this.listenTo(e.document,"change:data",function(s,a,c,l){return()=>{const g=s.document.differ.getChanges(),p=[],k=new Map,b=new Set;for(const A of g)if(A.type=="insert"&&A.name!="$text")Pe(A.position,k),A.attributes.has("listItemId")?b.add(A.position.nodeAfter):Pe(A.position.getShiftedBy(A.length),k);else if(A.type=="remove"&&A.attributes.has("listItemId"))Pe(A.position,k);else if(A.type=="attribute"){const x=A.range.start.nodeAfter;c.includes(A.attributeKey)?(Pe(A.range.start,k),A.attributeNewValue===null?(Pe(A.range.start.getShiftedBy(1),k),h(x)&&p.push(x)):b.add(x)):Gt(x)&&h(x)&&p.push(x)}for(const A of k.values())p.push(...d(A,b));for(const A of new Set(p))a.reconvertItem(A)};function d(g,p){const k=[],b=new Set,A=[];for(const{node:x,previous:M}of ti(g,"forward")){if(b.has(x))continue;const O=x.getAttribute("listIndent");M&&Oc.includes(Y)));const H=hn(x,{direction:"forward"});for(const Y of H)b.add(Y),(h(Y,H)||u(Y,A,p))&&k.push(Y)}return k}function h(g,p){const k=a.mapper.toViewElement(g);if(!k)return!1;if(l.fire("checkElement",{modelElement:g,viewElement:k}))return!0;if(!g.is("element","paragraph")&&!g.is("element","listItem"))return!1;const b=Rm(g,c,p);return!(!b||!k.is("element","p"))||!(b||!k.is("element","span"))}function u(g,p,k){if(k.has(g))return!1;const b=a.mapper.toViewElement(g);let A=p.length-1;for(let x=b.parent;!x.is("editableElement");x=x.parent){const M=hr(x),O=Bm(x);if(!O&&!M)continue;const H="checkAttributes:"+(M?"item":"list");if(l.fire(H,{viewElement:x,modelAttributes:p[A]}))break;if(O&&(A--,A<0))return!1}return!0}}(e,t.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(s,{viewElement:a,modelAttributes:c})=>{a.id!=c.listItemId&&(s.return=!0,s.stop())}),this.on("checkAttributes:list",(s,{viewElement:a,modelAttributes:c})=>{a.name==Nm(c.listType)&&a.id==Pm(c.listType,c.listIndent)||(s.return=!0,s.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(n=>function(i,r,s,a){const c=i.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let h=!1;for(const g of c){if(g.type=="insert"&&g.name!="$text"){const p=g.position.nodeAfter;if(!i.schema.checkAttribute(p,"listItemId"))for(const k of Array.from(p.getAttributeKeys()))s.includes(k)&&(r.removeAttribute(k,p),h=!0);Pe(g.position,l),g.attributes.has("listItemId")||Pe(g.position.getShiftedBy(g.length),l);for(const{item:k,previousPosition:b}of i.createRangeIn(p))Gt(k)&&Pe(b,l)}else g.type=="remove"?Pe(g.position,l):g.type=="attribute"&&s.includes(g.attributeKey)&&(Pe(g.range.start,l),g.attributeNewValue===null&&Pe(g.range.start.getShiftedBy(1),l));if(!d&&g.type=="attribute"&&ur.includes(g.attributeKey)){const p=g.range.start.nodeAfter;g.attributeNewValue===null&&p&&p.is("element","listItem")?(r.rename(p,"paragraph"),h=!0):g.attributeOldValue===null&&p&&p.is("element")&&p.name!="listItem"&&(r.rename(p,"listItem"),h=!0)}}const u=new Set;for(const g of l.values())h=a.fire("postFixer",{listNodes:new y2(g),listHead:g,writer:r,seenIds:u})||h;return h}(t,n,e,this)),this.on("postFixer",(n,{listNodes:i,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,h=!1;for(const{node:u}of s){const g=u.getAttribute("listIndent");if(g>c){let p;d===null?(d=g-c,p=c):(d>g&&(d=g),p=g-d),p>l+1&&(p=l+1),a.setAttribute("listIndent",p,u),h=!0,l=p}else d=null,c=g+1,l=g}return h}(i,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:i,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let h=!1;for(const{node:u}of a){if(d.has(u))continue;let g=u.getAttribute("listType"),p=u.getAttribute("listItemId");if(c.has(p)&&(p=lo.next()),c.add(p),u.is("element","listItem"))u.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,u),h=!0);else for(const k of hn(u,{direction:"forward"}))d.add(k),k.getAttribute("listType")!=g&&(p=lo.next(),g=k.getAttribute("listType")),k.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,k),h=!0)}return h}(i,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(n){return(i,[r,s])=>{const a=r.is("documentFragment")?Array.from(r.getChildren()):[r];if(!a.length)return;const c=(s?n.createSelection(s):n.document.selection).getFirstPosition();let l;if(Gt(c.parent))l=c.parent;else{if(!Gt(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const h=l.getAttribute("listType"),u=l.getAttribute("listIndent"),g=a[0].getAttribute("listIndent")||0,p=Math.max(u-g,0);for(const k of a){const b=Gt(k);l.is("element","listItem")&&k.is("element","paragraph")&&d.rename(k,"listItem"),d.setAttributes({listIndent:(b?k.getAttribute("listIndent"):0)+p,listItemId:b?k.getAttribute("listItemId"):lo.next(),listType:h},k)}})}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(n,i)=>{t.change(r=>{const s=Array.from(i.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every(Gt)&&r.remove(a),i.method=="copy"||i.method=="cut"){const c=Array.from(i.content.getChildren());ni(c)&&dr(c,r)}})})}}function Vm(o,t){const e=o.document.selection;if(!e.isCollapsed)return!oi(o);if(t==="forward")return!0;const n=e.getFirstPosition().parent,i=n.previousSibling;return!o.schema.isObject(i)&&(!!i.isEmpty||ni([n,i]))}function Um(o,t,e,n){o.ui.componentFactory.add(t,i=>{const r=o.commands.get(t),s=new ut(i);return s.set({label:e,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(t),o.editing.view.focus()}),s})}class j2 extends z{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;Um(this.editor,"numberedList",t("Numbered List"),J.numberedList),Um(this.editor,"bulletedList",t("Bulleted List"),J.bulletedList)}}class F2 extends z{static get requires(){return[R2,j2]}static get pluginName(){return"List"}}const V2=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:t,listType:e}of V2);var Hm=L(4672),U2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Hm.c,U2),Hm.c.locals;var qm=L(6832),H2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(qm.c,H2),qm.c.locals,Io("Ctrl+Enter");var Gm=L(9472),q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Gm.c,q2),Gm.c.locals,Io("Ctrl+Enter");function Wm(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=i.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(i.item),l=[...c.getChildren()].find(h=>h.getCustomProperty("media-content"));a.remove(l);const d=o.getMediaViewElement(a,s,t);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",e)}}function Km(o,t,e,n){return o.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(o,e,n),o.createSlot()])}function $m(o){const t=o.getSelectedElement();return t&&t.is("element","media")?t:null}function Ym(o,t,e,n){o.change(i=>{const r=i.createElement("media",{url:t});o.insertObject(r,e,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class G2 extends nt{refresh(){const t=this.editor.model,e=t.document.selection,n=$m(e);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(i){const r=i.getSelectedElement();return!!r&&r.name==="media"}(e)||function(i,r){let a=og(i,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=$m(n);i?e.change(r=>{r.setAttribute("url",t,i)}):Ym(e,t,n,!0)}}class W2{constructor(t,e){const n=e.providers,i=e.extraProviders||[],r=new Set(e.removeProviders),s=n.concat(i).filter(a=>{const c=a.name;return c?!r.has(c):(W("media-embed-no-provider-name",{provider:a}),!1)});this.locale=t,this.providerDefinitions=s}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new Qm(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=Tt(e.url);for(const r of i){const s=this._getUrlMatches(t,r);if(s)return new Qm(this.locale,t,s,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class Qm{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(e);i=t.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new on,e=this._locale.t;return t.content='',t.viewBox="0 0 64 42",new Ee({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var Zm=L(2792),K2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Zm.c,K2),Zm.c.locals;class gr extends z{constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const n=e[1],i=e[2];return`
`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new W2(t.locale,t.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,r=t.config.get("mediaEmbed.previewsInData"),s=t.config.get("mediaEmbed.elementName"),a=this.registry;t.commands.add("mediaEmbed",new G2(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return Km(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),i.for("dataDowncast").add(Wm(a,{elementName:s,renderMediaPreview:r})),i.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(h,u,g){return u.setCustomProperty("media",!0,h),Qs(h,u,{label:g})}(Km(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),i.for("editingDowncast").add(Wm(a,{elementName:s,renderForEditingView:!0})),i.for("upcast").elementToElement({view:c=>["oembed",s].includes(c.name)&&c.getAttribute("url")?{name:!0}:null,model:(c,{writer:l})=>{const d=c.getAttribute("url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(c,{writer:l})=>{const d=c.getAttribute("data-oembed-url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).add(c=>{c.on("element:figure",(l,d,h)=>{if(!h.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:u,modelCursor:g}=h.convertChildren(d.viewItem,d.modelCursor);d.modelRange=u,d.modelCursor=g,Ht(u.getItems())||h.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const $2=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Y2 extends z{constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[_g,Qe,Dg]}static get pluginName(){return"AutoMediaEmbed"}init(){const t=this.editor,e=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const i=e.selection.getFirstRange(),r=$t.fromPosition(i.start);r.stickiness="toPrevious";const s=$t.fromPosition(i.end);s.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(q.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(gr).registry,r=new ce(t,e),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const c of s)c.item.is("$textProxy")&&(a+=c.item.data);if(a=a.trim(),!a.match($2)||!i.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=$t.fromPosition(t),this._timeoutId=q.window.setTimeout(()=>{n.model.change(c=>{this._timeoutId=null,c.remove(r),r.detach();let l=null;this._positionToInsert.root.rootName!=="$graveyard"&&(l=this._positionToInsert),Ym(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(Qe).requestUndoOnBackspace()},100)):r.detach()}}var Jm=L(8776),Q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Jm.c,Q2),Jm.c.locals;class Z2 extends ${constructor(t,e){super(e);const n=e.t;this.focusTracker=new Kt,this.keystrokes=new Jt,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._focusables=new me,this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),m({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new _i(this.locale,Hi),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),e}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class J2 extends z{static get requires(){return[gr]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",n=>{const i=Ye(n);return this._setUpDropdown(i,e),i})}_setUpDropdown(t,e){const n=this.editor,i=n.t,r=t.buttonView,s=n.plugins.get(gr).registry;t.once("change:isOpen",()=>{const a=new(D(Z2))(function(c,l){return[d=>{if(!d.url.length)return c("The URL must not be empty.")},d=>{if(!l.hasMedia(d.url))return c("This media URL is not supported.")}]}(n.t,s),n.locale);t.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=e.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),t.on("change:isOpen",()=>a.resetFormStatus()),t.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(t),a.urlInputView.fieldView.bind("value").to(e,"value"),a.urlInputView.bind("isEnabled").to(e,"isEnabled")}),t.bind("isEnabled").to(e),r.set({label:i("Insert media"),icon:'',tooltip:!0})}}var Xm=L(9460),X2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Xm.c,X2),Xm.c.locals;function tx(o,t){if(!o.childCount)return;const e=new $e(o.document),n=function(s,a){const c=a.createRangeIn(s),l=new De({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),d=[];for(const h of c)if(h.type==="elementStart"&&l.match(h.item)){const u=nx(h.item);d.push({element:h.item,id:u.id,order:u.order,indent:u.indent})}return d}(o,e);if(!n.length)return;let i=null,r=1;n.forEach((s,a)=>{const c=function(p,k){if(!p)return!0;if(p.id!==k.id)return k.indent-p.indent!=1;const b=k.element.previousSibling;if(!b)return!0;return A=b,!(A.is("element","ol")||A.is("element","ul"));var A}(n[a-1],s),l=c?null:n[a-1],d=(u=s,(h=l)?u.indent-h.indent:u.indent-1);var h,u;if(c&&(i=null,r=1),!i||d!==0){const p=function(k,b){const A=new RegExp(`@list l${k.id}:level${k.indent}\\s*({[^}]*)`,"gi"),x=/mso-level-number-format:([^;]{0,100});/gi,M=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,O=A.exec(b);let H="decimal",Y="ol",et=null;if(O&&O[1]){const Bt=x.exec(O[1]);if(Bt&&Bt[1]&&(H=Bt[1].trim(),Y=H!=="bullet"&&H!=="image"?"ol":"ul"),H==="bullet"){const Nt=function(uo){const He=function(Xe){if(Xe.getChild(0).is("$text"))return null;for(const tn of Xe.getChildren()){if(!tn.is("element","span"))continue;const Rn=tn.getChild(0);if(Rn)return Rn.is("$text")?Rn:Rn.getChild(0)}return null}(uo);if(!He)return null;const Ae=He._data;return Ae==="o"?"circle":Ae==="·"?"disc":Ae==="§"?"square":null}(k.element);Nt&&(H=Nt)}else{const Nt=M.exec(O[1]);Nt&&Nt[1]&&(et=parseInt(Nt[1]))}}return{type:Y,startIndex:et,style:ex(H)}}(s,t);if(i){if(s.indent>r){const k=i.getChild(i.childCount-1),b=k.getChild(k.childCount-1);i=tf(p,b,e),r+=1}else if(s.indent1&&e.setAttribute("start",o.startIndex,i),i}function nx(o){const t={},e=o.getStyle("mso-list");if(e){const n=e.match(/(^|\s{1,100})l(\d+)/i),i=e.match(/\s{0,100}lfo(\d+)/i),r=e.match(/\s{0,100}level(\d+)/i);n&&i&&r&&(t.id=n[2],t.order=i[1],t.indent=parseInt(r[1]))}return t}function ox(o,t){if(!o.childCount)return;const e=new $e(o.document),n=function(r,s){const a=s.createRangeIn(r),c=new De({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const h=d.item,u=h.previousSibling,g=u&&u.is("element")?u.name:null;c.match(h)&&h.getAttribute("o:gfxdata")&&g!=="v:shapetype"&&l.push(d.item.getAttribute("id"))}return l}(o,e);(function(r,s,a){const c=a.createRangeIn(s),l=new De({name:"img"}),d=[];for(const h of c)if(h.item.is("element")&&l.match(h.item)){const u=h.item,g=u.getAttribute("v:shapes")?u.getAttribute("v:shapes").split(" "):[];g.length&&g.every(p=>r.indexOf(p)>-1)?d.push(u):u.getAttribute("src")||d.push(u)}for(const h of d)a.remove(h)})(n,o,e),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const u of c)if(u.type=="elementStart"&&u.item.is("element","v:shape")){const g=u.item.getAttribute("id");if(r.includes(g))continue;d(u.item.parent.getChildren(),g)||l.push(u.item)}for(const u of l){const g={src:h(u)};u.hasAttribute("alt")&&(g.alt=u.getAttribute("alt"));const p=a.createElement("img",g);a.insertChild(u.index+1,p,u.parent)}function d(u,g){for(const p of u)if(p.is("element")&&(p.name=="img"&&p.getAttribute("v:shapes")==g||d(p.getChildren(),g)))return!0;return!1}function h(u){for(const g of u.getChildren())if(g.is("element")&&g.getAttribute("src"))return g.getAttribute("src")}}(n,o,e),function(r,s){const a=s.createRangeIn(r),c=new De({name:/v:(.+)/}),l=[];for(const d of a)d.type=="elementStart"&&c.match(d.item)&&l.push(d.item);for(const d of l)s.remove(d)}(o,e);const i=function(r,s){const a=s.createRangeIn(r),c=new De({name:"img"}),l=[];for(const d of a)d.item.is("element")&&c.match(d.item)&&d.item.getAttribute("src").startsWith("file://")&&l.push(d.item);return l}(o,e);i.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(t,16))).join(""))}const rx=//i,sx=/xmlns:o="urn:schemas-microsoft-com/i;class ax{constructor(t){this.document=t}isActive(t){return rx.test(t)||sx.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;tx(e,n),ox(e,t.dataTransfer.getData("text/rtf")),function(i){const r=[],s=new $e(i.document);for(const{item:a}of s.createRangeIn(i))if(a.is("element")){for(const c of a.getClassNames())/\bmso/gi.exec(c)&&s.removeClass(c,a);for(const c of a.getStyleNames())/\bmso/gi.exec(c)&&s.removeStyle(c,a);a.is("element","w:sdt")&&r.push(a)}for(const a of r){const c=a.parent,l=c.getChildIndex(a);s.insertChild(l,a.getChildren(),c),s.remove(a)}}(e),t.content=e}}function ef(o,t,e,{blockElements:n,inlineObjectElements:i}){let r=e.createPositionAt(o,t=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!i.includes(s.name),{direction:t}),t=="forward"?r.nodeAfter:r.nodeBefore}function nf(o,t){return!!o&&o.is("element")&&t.includes(o.name)}const cx=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class lx{constructor(t){this.document=t}isActive(t){return cx.test(t)}execute(t){const e=new $e(this.document),{body:n}=t._parsedData;(function(i,r){for(const s of i.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=i.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),i)}})(n,e),function(i,r){for(const s of r.createRangeIn(i)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,e),function(i,r){const s=new Ii(r.document.stylesProcessor),a=new Mi(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const h of r.createRangeIn(i)){const u=h.item;if(u.is("element","br")){const g=ef(u,"forward",r,{blockElements:c,inlineObjectElements:l}),p=ef(u,"backward",r,{blockElements:c,inlineObjectElements:l}),k=nf(g,c);(nf(p,c)||k)&&d.push(u)}}for(const h of d)h.hasClass("Apple-interchange-newline")?r.remove(h):r.replace(h,r.createElement("p"))}(n,e),t.content=n}}const dx=/(\s+)<\/span>/g,(t,e)=>e.length===1?" ":Array(e.length+1).join("  ").substr(0,e.length))}function ux(o,t){const e=new DOMParser,n=function(c){return of(of(c)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(c){const l="",d="",h=c.indexOf(l);if(h<0)return c;const u=c.indexOf(d,h+l.length);return c.substring(0,h+l.length)+(u>=0?c.substring(u):"")}(o=(o=o.replace(//g,"")}(a.getData("text/html")):a.getData("text/plain")&&(((l=(l=a.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||l.includes("
"))&&(l=`

${l}

`),h=l),c=this.editor.data.htmlProcessor.toView(h)}var l;const d=new F(this,"inputTransformation");this.fire(d,{content:c,dataTransfer:a,targetRanges:s.targetRanges,method:s.method}),d.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,s)=>{if(s.content.isEmpty)return;const a=this.editor.data.toModel(s.content,"$clipboardHolder");a.childCount!=0&&(r.stop(),e.change(()=>{this.fire("contentInsertion",{content:a,method:s.method,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,s)=>{s.resultRange=e.insertContent(s.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,n=t.editing.view.document,i=(r,s)=>{const a=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(a,e.selection,r.name)};this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,s)=>{t.model.canEditAt(t.model.document.selection)?i(r,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(r,s)=>{const a=t.data.toView(s.content);n.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:a,method:s.method})},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",Lu(s.content))),s.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Ou{constructor(t,e=20){this._batch=null,this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(n,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){this.isLocked&&!t||(this._batch=null,this._size=0)}}class rv extends nt{constructor(t,e){super(t),this._buffer=new Ou(t.model,e),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",r=i.length;let s=n.selection;if(t.selection?s=t.selection:t.range&&(s=e.createSelection(t.range)),!e.canEditAt(s))return;const a=t.resultRange;e.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const l=Array.from(n.selection.getAttributes());e.deleteContent(s),i&&e.insertContent(c.createText(i,l),s),a?c.setSelection(a):s.is("documentSelection")||c.setSelection(s),this._buffer.unlock(),this._buffer.input(r)})}}const zu=["insertText","insertReplacementText"];class sv extends Fe{constructor(t){super(t),this.focusObserver=t.getObserver(Pi),f.isAndroid&&zu.push("insertCompositionText");const e=t.document;e.on("beforeinput",(n,i)=>{if(!this.isEnabled)return;const{data:r,targetRanges:s,inputType:a,domEvent:c}=i;if(!zu.includes(a))return;this.focusObserver.flush();const l=new F(e,"insertText");e.fire(l,new Xn(t,c,{text:r,selection:t.createSelection(s)})),l.stop.called&&n.stop()}),e.on("compositionend",(n,{data:i,domEvent:r})=>{this.isEnabled&&!f.isAndroid&&i&&e.fire("insertText",new Xn(t,r,{text:i,selection:e.selection}))},{priority:"lowest"})}observe(){}stopObserving(){}}class Ru extends z{static get pluginName(){return"Input"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=e.document.selection;n.addObserver(sv);const r=new rv(t,t.config.get("typing.undoStep")||20);t.commands.add("insertText",r),t.commands.add("input",r),this.listenTo(n.document,"insertText",(s,a)=>{n.document.isComposing||a.preventDefault();const{text:c,selection:l,resultRange:d}=a,h=Array.from(l.getRanges()).map(p=>t.editing.mapper.toModelRange(p));let u=c;if(f.isAndroid){const p=Array.from(h[0].getItems()).reduce((k,b)=>k+(b.is("$textProxy")?b.data:""),"");p&&(p.length<=u.length?u.startsWith(p)&&(u=u.substring(p.length),h[0].start=h[0].start.getShiftedBy(p.length)):p.startsWith(u)&&(h[0].start=h[0].start.getShiftedBy(u.length),u=""))}const g={text:u,selection:e.createSelection(h)};d&&(g.resultRange=t.editing.mapper.toModelRange(d)),t.execute("insertText",g),n.scrollToTheSelection()}),f.isAndroid?this.listenTo(n.document,"keydown",(s,a)=>{!i.isCollapsed&&a.keyCode==229&&n.document.isComposing&&ju(e,r)}):this.listenTo(n.document,"compositionstart",()=>{i.isCollapsed||ju(e,r)})}}function ju(o,t){if(!t.isEnabled)return;const e=t.buffer;e.lock(),o.enqueueChange(e.batch,()=>{o.deleteContent(o.document.selection)}),e.unlock()}class Fu extends nt{constructor(t,e){super(t),this.direction=e,this._buffer=new Ou(t.model,t.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(t.selection||n.selection);if(!e.canEditAt(r))return;const s=t.sequence||1,a=r.isCollapsed;if(r.isCollapsed&&e.modifySelection(r,{direction:this.direction,unit:t.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let c=0;r.getFirstRange().getMinimalFlatRanges().forEach(l=>{c+=zt(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(r,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(c),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!e.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(t){const e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),r=t.createElement("paragraph");t.remove(t.createRangeIn(i)),t.insert(r,i),t.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const n=this.editor.model;if(e>1||this.direction!="backward"||!t.isCollapsed)return!1;const i=t.getFirstPosition(),r=n.schema.getLimitElement(i),s=r.getChild(0);return i.parent==s&&!!t.containsEntireContent(s)&&!!n.schema.checkChild(r,"paragraph")&&s.name!="paragraph"}}const Vu="word",cn="selection",io="backward",$o="forward",Uu={deleteContent:{unit:cn,direction:io},deleteContentBackward:{unit:"codePoint",direction:io},deleteWordBackward:{unit:Vu,direction:io},deleteHardLineBackward:{unit:cn,direction:io},deleteSoftLineBackward:{unit:cn,direction:io},deleteContentForward:{unit:"character",direction:$o},deleteWordForward:{unit:Vu,direction:$o},deleteHardLineForward:{unit:cn,direction:$o},deleteSoftLineForward:{unit:cn,direction:$o}};class av extends Fe{constructor(t){super(t);const e=t.document;let n=0;e.on("keydown",()=>{n++}),e.on("keyup",()=>{n=0}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:c}=r,l=Uu[c];if(!l)return;const d={direction:l.direction,unit:l.unit,sequence:n};d.unit==cn&&(d.selectionToRemove=t.createSelection(s[0])),c==="deleteContentBackward"&&(f.isAndroid&&(d.sequence=1),function(u){if(u.length!=1||u[0].isCollapsed)return!1;const g=u[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let p=0;for(const{nextPosition:k}of g){if(k.parent.is("$text")){const b=k.parent.data,A=k.offset;if(Gr(b,A)||Wr(b,A)||Wc(b,A))continue;p++}else p++;if(p>1)return!0}return!1}(s)&&(d.unit=cn,d.selectionToRemove=t.createSelection(s)));const h=new Zn(e,"delete",s[0]);e.fire(h,new Xn(t,a,d)),h.stop.called&&i.stop()}),f.isBlink&&function(i){const r=i.view,s=r.document;let a=null,c=!1;function l(h){return h==rt.backspace||h==rt.delete}function d(h){return h==rt.backspace?io:$o}s.on("keydown",(h,{keyCode:u})=>{a=u,c=!1}),s.on("keyup",(h,{keyCode:u,domEvent:g})=>{const p=s.selection,k=i.isEnabled&&u==a&&l(u)&&!p.isCollapsed&&!c;if(a=null,k){const b=p.getFirstRange(),A=new Zn(s,"delete",b),x={unit:cn,direction:d(u),selectionToRemove:p};s.fire(A,new Xn(r,g,x))}}),s.on("beforeinput",(h,{inputType:u})=>{const g=Uu[u];l(a)&&g&&g.direction==d(a)&&(c=!0)},{priority:"high"}),s.on("beforeinput",(h,{inputType:u,data:g})=>{a==rt.delete&&u=="insertText"&&g==""&&h.stop()},{priority:"high"})}(this)}observe(){}stopObserving(){}}class Qe extends z{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,n=e.document,i=t.model.document;e.addObserver(av),this._undoOnBackspace=!1;const r=new Fu(t,"forward");t.commands.add("deleteForward",r),t.commands.add("forwardDelete",r),t.commands.add("delete",new Fu(t,"backward")),this.listenTo(n,"delete",(s,a)=>{n.isComposing||a.preventDefault();const{direction:c,sequence:l,selectionToRemove:d,unit:h}=a,u=c==="forward"?"deleteForward":"delete",g={sequence:l};if(h=="selection"){const p=Array.from(d.getRanges()).map(k=>t.editing.mapper.toModelRange(k));g.selection=t.model.createSelection(p)}else g.unit=h;t.execute(u,g),e.scrollToTheSelection()},{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,t.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class cv extends z{static get requires(){return[Ru,Qe]}static get pluginName(){return"Typing"}}function Hu(o,t){let e=o.start;return{text:Array.from(o.getWalker({ignoreElementEnd:!1})).reduce((n,{item:i})=>i.is("$text")||i.is("$textProxy")?n+i.data:(e=t.createPositionAfter(i),""),""),range:t.createRange(e,o.end)}}class qu extends ct(){constructor(t,e){super(),this.model=t,this.testCallback=e,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:n})=>{n&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))}),this.listenTo(t,"change:data",(e,n)=>{!n.isUndo&&n.isLocal&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(t,e={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:s,range:a}=Hu(r,n),c=this.testCallback(s);if(!c&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!c,c){const l=Object.assign(e,{text:s,range:a});typeof c=="object"&&Object.assign(l,c),this.fire(`matched:${t}`,l)}}}class Gu extends z{constructor(t){super(t),this._isNextGravityRestorationSkipped=!1,this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}init(){const t=this.editor,e=t.model,n=t.editing.view,i=t.locale,r=e.document.selection;this.listenTo(n.document,"arrowKey",(s,a)=>{if(!r.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const c=a.keyCode==rt.arrowright,l=a.keyCode==rt.arrowleft;if(!c&&!l)return;const d=i.contentLanguageDirection;let h=!1;h=d==="ltr"&&c||d==="rtl"&&l?this._handleForwardMovement(a):this._handleBackwardMovement(a),h===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(s,a)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!a.directChange&&be(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!Ze(i,e))&&!!be(r,e)&&(Qo(t),Ze(i,e)&&be(r,e,!0)?Yo(n,e):this._overrideGravity(),!0)}_handleBackwardMovement(t){const e=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(Qo(t),this._restoreGravity(),be(r,e,!0)?Yo(n,e):Zi(n,e,r),!0):r.isAtStart?!!Ze(i,e)&&(Qo(t),Zi(n,e,r),!0):!Ze(i,e)&&be(r,e,!0)?(Qo(t),Zi(n,e,r),!0):!!Wu(r,e)&&(r.isAtEnd&&!Ze(i,e)&&be(r,e)?(Qo(t),Zi(n,e,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view.document;t.editing.view.addObserver(Ps);let r=!1;this.listenTo(i,"mousedown",()=>{r=!0}),this.listenTo(i,"selectionChange",()=>{const s=this.attributes;if(!r||(r=!1,!n.isCollapsed)||!Ze(n,s))return;const a=n.getFirstPosition();be(a,s)&&(a.isAtStart||be(a,s,!0)?Yo(e,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection,n=this.attributes;this.listenTo(t,"insertContent",()=>{const i=e.getFirstPosition();Ze(e,n)&&be(i,n)&&Yo(t,n)},{priority:"low"})}_handleDeleteContentAfterNode(){const t=this.editor,e=t.model,n=e.document.selection,i=t.editing.view;let r=!1,s=!1;this.listenTo(i.document,"delete",(a,c)=>{r=c.direction==="backward"},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{if(!r)return;const a=n.getFirstPosition();s=Ze(n,this.attributes)&&!Wu(a,this.attributes)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,s||t.model.enqueueChange(()=>{const a=n.getFirstPosition();Ze(n,this.attributes)&&be(a,this.attributes)&&(a.isAtStart||be(a,this.attributes,!0)?Yo(e,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Ze(o,t){for(const e of t)if(o.hasAttribute(e))return!0;return!1}function Zi(o,t,e){const n=e.nodeBefore;o.change(i=>{if(n){const r=[],s=o.schema.isObject(n)&&o.schema.isInline(n);for(const[a,c]of n.getAttributes())!o.schema.checkAttribute("$text",a)||s&&o.schema.getAttributeProperties(a).copyFromObject===!1||r.push([a,c]);i.setSelectionAttribute(r)}else i.removeSelectionAttribute(t)})}function Yo(o,t){o.change(e=>{e.removeSelectionAttribute(t)})}function Qo(o){o.preventDefault()}function Wu(o,t){return be(o.getShiftedBy(-1),t)}function be(o,t,e=!1){const{nodeBefore:n,nodeAfter:i}=o;for(const r of t){const s=n?n.getAttribute(r):void 0,a=i?i.getAttribute(r):void 0;if((!e||s!==void 0&&a!==void 0)&&a!==s)return!0}return!1}const Ku={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:ro('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:ro("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:ro("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:ro('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:ro('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:ro("'"),to:[null,"‚",null,"’"]}},$u={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},lv=["symbols","mathematical","typography","quotes"];function dv(o){return typeof o=="string"?new RegExp(`(${fu(o)})$`):o}function hv(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function uv(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function ro(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function Ji(o,t,e,n){return n.createRange(Yu(o,t,e,!0,n),Yu(o,t,e,!1,n))}function Yu(o,t,e,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),s=null;for(;r&&r.getAttribute(t)==e;)s=r,r=n?r.previousSibling:r.nextSibling;return s?i.createPositionAt(s,n?"before":"after"):o}function*Qu(o,t){for(const e of t)e&&o.getAttributeProperties(e[0]).copyOnEnter&&(yield e)}class gv extends nt{execute(){this.editor.model.change(t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})})}enterBlock(t){const e=this.editor.model,n=e.document.selection,i=e.schema,r=n.isCollapsed,s=n.getFirstRange(),a=s.start.parent,c=s.end.parent;if(i.isLimit(a)||i.isLimit(c))return r||a!=c||e.deleteContent(n),!1;if(r){const l=Qu(t.model.schema,n.getAttributes());return Zu(t,s.start),t.setSelectionAttribute(l),!0}{const l=!(s.start.isAtStart&&s.end.isAtEnd),d=a==c;if(e.deleteContent(n,{leaveUnmerged:l}),l){if(d)return Zu(t,n.focus),!0;t.setSelection(c,0)}}return!1}}function Zu(o,t){o.split(t),o.setSelection(t.parent.nextSibling,0)}const pv={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ju extends Fe{constructor(t){super(t);const e=this.document;let n=!1;e.on("keydown",(i,r)=>{n=r.shiftKey}),e.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let s=r.inputType;f.isSafari&&n&&s=="insertParagraph"&&(s="insertLineBreak");const a=r.domEvent,c=pv[s];if(!c)return;const l=new Zn(e,"enter",r.targetRanges[0]);e.fire(l,new Xn(t,a,{isSoft:c.isSoft})),l.stop.called&&i.stop()})}observe(){}stopObserving(){}}class Xi extends z{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Ju),t.commands.add("enter",new gv(t)),this.listenTo(n,"enter",(i,r)=>{n.isComposing||r.preventDefault(),r.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class mv extends nt{execute(){const t=this.editor.model,e=t.document;t.change(n=>{(function(i,r,s){const a=s.isCollapsed,c=s.getFirstRange(),l=c.start.parent,d=c.end.parent,h=l==d;if(a){const u=Qu(i.schema,s.getAttributes());Xu(i,r,c.end),r.removeSelectionAttribute(s.getAttributeKeys()),r.setSelectionAttribute(u)}else{const u=!(c.start.isAtStart&&c.end.isAtEnd);i.deleteContent(s,{leaveUnmerged:u}),h?Xu(i,r,s.focus):u&&r.setSelection(d,0)}})(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const s=i.getFirstRange(),a=s.start.parent,c=s.end.parent;return!(($s(a,n)||$s(c,n))&&a!==c)}(t.schema,e.selection)}}function Xu(o,t,e){const n=t.createElement("softBreak");o.insertContent(n,e),t.setSelection(n,"after")}function $s(o,t){return!o.is("rootElement")&&(t.isLimit(o)||$s(o.parent,t))}class fv extends z{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,r=i.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(s,{writer:a})=>a.createEmptyElement("br")}),i.addObserver(Ju),t.commands.add("shiftEnter",new mv(t)),this.listenTo(r,"enter",(s,a)=>{r.isComposing||a.preventDefault(),a.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class kv extends dt(){constructor(){super(...arguments),this._stack=[]}add(t,e){const n=this._stack,i=n[0];this._insertDescriptor(t);const r=n[0];i===r||Ys(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}remove(t,e){const n=this._stack,i=n[0];this._removeDescriptor(t);const r=n[0];i===r||Ys(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:e})}_insertDescriptor(t){const e=this._stack,n=e.findIndex(r=>r.id===t.id);if(Ys(t,e[n]))return;n>-1&&e.splice(n,1);let i=0;for(;e[i]&&bv(e[i],t);)i++;e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack,n=e.findIndex(i=>i.id===t);n>-1&&e.splice(n,1)}}function Ys(o,t){return o&&t&&o.priority==t.priority&&tr(o.classes)==tr(t.classes)}function bv(o,t){return o.priority>t.priority||!(o.prioritytr(t.classes)}function tr(o){return Array.isArray(o)?o.sort().join(","):o}const wv='',Av="ck-widget",tg="ck-widget_selected";function Ft(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function Qs(o,t,e={}){if(!o.is("containerElement"))throw new _("widget-to-widget-wrong-element-type",null,{element:o});return t.setAttribute("contenteditable","false",o),t.addClass(Av,o),t.setCustomProperty("widget",!0,o),o.getFillerOffset=vv,t.setCustomProperty("widgetLabel",[],o),e.label&&function(n,i){n.getCustomProperty("widgetLabel").push(i)}(o,e.label),e.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(s){const a=this.toDomElement(s),c=new on;return c.set("content",wv),c.render(),a.appendChild(c.element),a});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,t),eg(o,t),o}function Cv(o,t,e){if(t.classes&&e.addClass(Tt(t.classes),o),t.attributes)for(const n in t.attributes)e.setAttribute(n,t.attributes[n],o)}function _v(o,t,e){if(t.classes&&e.removeClass(Tt(t.classes),o),t.attributes)for(const n in t.attributes)e.removeAttribute(n,o)}function eg(o,t,e=Cv,n=_v){const i=new kv;i.on("change:top",(r,s)=>{s.oldDescriptor&&n(o,s.oldDescriptor,s.writer),s.newDescriptor&&e(o,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(r,s,a)=>i.add(s,a),o),t.setCustomProperty("removeHighlight",(r,s,a)=>i.remove(s,a),o)}function ng(o,t,e={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),t.setAttribute("role","textbox",o),e.label&&t.setAttribute("aria-label",e.label,o),t.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(n,i,r)=>{t.setAttribute("contenteditable",r?"false":"true",o)}),o.on("change:isFocused",(n,i,r)=>{r?t.addClass("ck-editor__nested-editable_focused",o):t.removeClass("ck-editor__nested-editable_focused",o)}),eg(o,t),o}function og(o,t){const e=o.getSelectedElement();if(e){const n=ln(o);if(n)return t.createRange(t.createPositionAt(e,n))}return t.schema.findOptimalInsertionRange(o)}function vv(){return null}const Je="widget-type-around";function Bn(o,t,e){return!!o&&Ft(o)&&!e.isInline(t)}function ln(o){return o.getAttribute(Je)}var ig=L(3940),yv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(ig.c,yv),ig.c.locals;const rg=["before","after"],xv=new DOMParser().parseFromString('',"image/svg+xml").firstChild,sg="ck-widget__type-around_disabled";class Ev extends z{constructor(){super(...arguments),this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Xi,Qe]}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(n,i,r)=>{e.change(s=>{for(const a of e.document.roots)r?s.removeClass(sg,a):s.addClass(sg,a)}),r||t.model.change(s=>{s.removeSelectionAttribute(Je)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor,i=n.editing.view,r=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:r}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=ln(t);if(!e)return!1;const n=t.getSelectedElement();return this._insertParagraph(n,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,n=t.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(r,s,a)=>{const c=a.mapper.toViewElement(s.item);c&&Bn(c,s.item,e)&&(function(l,d,h){const u=l.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(g){const p=this.toDomElement(g);return function(k,b){for(const A of rg){const x=new Ee({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${A}`],title:b[A],"aria-hidden":"true"},children:[k.ownerDocument.importNode(xv,!0)]});k.appendChild(x.render())}}(p,d),function(k){const b=new Ee({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});k.appendChild(b.render())}(p),p});l.insert(l.createPositionAt(h,"end"),u)}(a.writer,i,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,n=e.document.selection,i=e.schema,r=t.editing.view;function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}this._listenToIfEnabled(r.document,"arrowKey",(a,c)=>{this._handleArrowKeyPress(a,c)},{context:[Ft,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(a,c)=>{c.directChange&&t.model.change(l=>{l.removeSelectionAttribute(Je)})}),this._listenToIfEnabled(e.document,"change:data",()=>{const a=n.getSelectedElement();a&&Bn(t.editing.mapper.toViewElement(a),a,i)||t.model.change(c=>{c.removeSelectionAttribute(Je)})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(a,c,l)=>{const d=l.writer;if(this._currentFakeCaretModelElement){const p=l.mapper.toViewElement(this._currentFakeCaretModelElement);p&&(d.removeClass(rg.map(s),p),this._currentFakeCaretModelElement=null)}const h=c.selection.getSelectedElement();if(!h)return;const u=l.mapper.toViewElement(h);if(!Bn(u,h,i))return;const g=ln(c.selection);g&&(d.addClass(s(g),u),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(a,c,l)=>{l||t.model.change(d=>{d.removeSelectionAttribute(Je)})})}_handleArrowKeyPress(t,e){const n=this.editor,i=n.model,r=i.document.selection,s=i.schema,a=n.editing.view,c=function(h,u){const g=Hr(h,u);return g==="down"||g==="right"}(e.keyCode,n.locale.contentLanguageDirection),l=a.document.selection.getSelectedElement();let d;Bn(l,n.editing.mapper.toModelElement(l),s)?d=this._handleArrowKeyPressOnSelectedWidget(c):r.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(c):e.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(c)),d&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,n=ln(e.document.selection);return e.change(i=>n?n!==(t?"after":"before")?(i.removeSelectionAttribute(Je),!0):!1:(i.setSelectionAttribute(Je,t?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,n=e.model,i=n.schema,r=e.plugins.get("Widget"),s=r._getObjectElementNextToSelection(t);return!!Bn(e.editing.mapper.toViewElement(s),s,i)&&(n.change(a=>{r._setSelectionOverElement(s),a.setSelectionAttribute(Je,t?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor,n=e.model,i=n.schema,r=e.editing.mapper,s=n.document.selection,a=t?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!Bn(r.toViewElement(a),a,i)&&(n.change(c=>{c.setSelection(a,"on"),c.setSelectionAttribute(Je,t?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(l){return l.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),a=function(l,d){const h=l.closest(".ck-widget");return d.mapDomToView(h)}(r,e.domConverter),c=t.editing.mapper.toModelElement(a);this._insertParagraph(c,s),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,n=t.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const s=e.getSelectedElement(),a=t.editing.mapper.toViewElement(s),c=t.model.schema;let l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Bn(a,s,c)&&(this._insertParagraph(s,r.isSoft?"before":"after"),l=!0),l&&(r.preventDefault(),i.stop())},{context:Ft})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view.document;this._listenToIfEnabled(t,"insertText",(e,n)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(n.selection=t.selection)},{priority:"high"}),f.isAndroid?this._listenToIfEnabled(t,"keydown",(e,n)=>{n.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(t,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,n=t.model,i=n.schema;this._listenToIfEnabled(e.document,"delete",(r,s)=>{if(r.eventPhase!="atTarget")return;const a=ln(n.document.selection);if(!a)return;const c=s.direction,l=n.document.selection.getSelectedElement(),d=c=="forward";if(a==="before"===d)t.execute("delete",{selection:n.createSelection(l,"on")});else{const h=i.getNearestSelectionRange(n.createPositionAt(l,a),c);if(h)if(h.isCollapsed){const u=n.createSelection(h.start);if(n.modifySelection(u,{direction:c}),u.focus.isEqual(h.start)){const g=function(p,k){let b=k;for(const A of k.getAncestors({parentFirst:!0})){if(A.childCount>1||p.isLimit(A))break;b=A}return b}(i,h.start.parent);n.deleteContent(n.createSelection(g,"on"),{doNotAutoparagraph:!0})}else n.change(g=>{g.setSelection(h),t.execute(d?"deleteForward":"delete")})}else n.change(u=>{u.setSelection(h),t.execute(d?"deleteForward":"delete")})}s.preventDefault(),r.stop()},{context:Ft})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(i,[r,s])=>{if(s&&!s.is("documentSelection"))return;const a=ln(n);return a?(i.stop(),e.change(c=>{const l=n.getSelectedElement(),d=e.createPositionAt(l,a),h=c.createSelection(d),u=e.insertContent(r,h);return c.setSelection(h),u})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"insertObject",(n,i)=>{const[,r,s={}]=i;if(r&&!r.is("documentSelection"))return;const a=ln(e);a&&(s.findOptimalPosition=a,i[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||ln(e)&&n.stop()},{priority:"high"})}}function Dv(o){const t=o.model;return(e,n)=>{const i=n.keyCode==rt.arrowup,r=n.keyCode==rt.arrowdown,s=n.shiftKey,a=t.document.selection;if(!i&&!r)return;const c=r;if(s&&function(d,h){return!d.isCollapsed&&d.isBackward==h}(a,c))return;const l=function(d,h,u){const g=d.model;if(u){const p=h.isCollapsed?h.focus:h.getLastPosition(),k=ag(g,p,"forward");if(!k)return null;const b=g.createRange(p,k),A=cg(g.schema,b,"backward");return A?g.createRange(p,A):null}{const p=h.isCollapsed?h.focus:h.getFirstPosition(),k=ag(g,p,"backward");if(!k)return null;const b=g.createRange(k,p),A=cg(g.schema,b,"forward");return A?g.createRange(A,p):null}}(o,a,c);if(l){if(l.isCollapsed&&(a.isCollapsed||s))return;(l.isCollapsed||function(d,h,u){const g=d.model,p=d.view.domConverter;if(u){const M=g.createSelection(h.start);g.modifySelection(M),M.focus.isAtEnd||h.start.isEqual(M.focus)||(h=g.createRange(M.focus,h.end))}const k=d.mapper.toViewRange(h),b=p.viewRangeToDom(k),A=ot.getDomRangeRects(b);let x;for(const M of A)if(x!==void 0){if(Math.round(M.top)>=x)return!1;x=Math.max(x,Math.round(M.bottom))}else x=Math.round(M.bottom);return!0}(o,l,c))&&(t.change(d=>{const h=c?l.end:l.start;if(s){const u=t.createSelection(a.anchor);u.setFocus(h),d.setSelection(u)}else d.setSelection(h)}),e.stop(),n.preventDefault(),n.stopPropagation())}}}function ag(o,t,e){const n=o.schema,i=o.createRangeIn(t.root),r=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:c}of i.getWalker({startPosition:t,direction:e})){if(n.isLimit(a)&&!n.isInline(a))return s;if(c==r&&n.isBlock(a))return null}return null}function cg(o,t,e){const n=e=="backward"?t.end:t.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of t.getWalker({direction:e}))if(o.checkChild(i,"$text"))return i;return null}var lg=L(4680),Iv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(lg.c,Iv),lg.c.locals;class Zo extends z{constructor(){super(...arguments),this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[Ev,Qe]}init(){const t=this.editor,e=t.editing.view,n=e.document;this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{const a=s.writer,c=r.selection;if(c.isCollapsed)return;const l=c.getSelectedElement();if(!l)return;const d=t.editing.mapper.toViewElement(l);var h;Ft(d)&&s.consumable.consume(c,"selection")&&a.setSelection(a.createRangeOn(d),{fake:!0,label:(h=d,h.getCustomProperty("widgetLabel").reduce((u,g)=>typeof g=="function"?u?u+". "+g():g():u?u+". "+g:g,""))})}),this.editor.editing.downcastDispatcher.on("selection",(i,r,s)=>{this._clearPreviouslySelectedWidgets(s.writer);const a=s.writer,c=a.document.selection;let l=null;for(const d of c.getRanges())for(const h of d){const u=h.item;Ft(u)&&!Tv(u,l)&&(a.addClass(tg,u),this._previouslySelected.add(u),l=u)}},{priority:"low"}),e.addObserver(Ps),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[Ft,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",Dv(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(t,e){const n=this.editor,i=n.editing.view,r=i.document;let s=e.target;if(e.domEvent.detail>=3)return void(this._selectBlockContent(s)&&e.preventDefault());if(function(c){let l=c;for(;l;){if(l.is("editableElement")&&!l.is("rootElement"))return!0;if(Ft(l))return!1;l=l.parent}return!1}(s)||!Ft(s)&&(s=s.findAncestor(Ft),!s))return;f.isAndroid&&e.preventDefault(),r.isFocused||i.focus();const a=n.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(t){const e=this.editor,n=e.model,i=e.editing.mapper,r=n.schema,s=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(t,0)),a=function(c,l){for(const d of c.getAncestors({includeSelf:!0,parentFirst:!0})){if(l.checkChild(d,"$text"))return d;if(l.isLimit(d)&&!l.isObject(d))break}return null}(i.toModelElement(s),n.schema);return!!a&&(n.change(c=>{const l=r.isLimit(a)?null:function(u,g){const p=new Ge({startPosition:u});for(const{item:k}of p){if(g.isLimit(k)||!k.is("element"))return null;if(g.checkChild(k,"$text"))return k}return null}(c.createPositionAfter(a),r),d=c.createPositionAt(a,0),h=l?c.createPositionAt(l,0):c.createPositionAt(a,"end");c.setSelection(c.createRange(d,h))}),!0)}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode,i=this.editor.model,r=i.schema,s=i.document.selection,a=s.getSelectedElement(),c=Hr(n,this.editor.locale.contentLanguageDirection),l=c=="down"||c=="right",d=c=="up"||c=="down";if(a&&r.isObject(a)){const u=l?s.getLastPosition():s.getFirstPosition(),g=r.getNearestSelectionRange(u,l?"forward":"backward");return void(g&&(i.change(p=>{p.setSelection(g)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed&&!e.shiftKey){const u=s.getFirstPosition(),g=s.getLastPosition(),p=u.nodeAfter,k=g.nodeBefore;return void((p&&r.isObject(p)||k&&r.isObject(k))&&(i.change(b=>{b.setSelection(l?g:u)}),e.preventDefault(),t.stop()))}if(!s.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&r.isObject(h)){if(r.isInline(h)&&d)return;this._setSelectionOverElement(h),e.preventDefault(),t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(e.preventDefault(),t.stop())}_handleDelete(t){const e=this.editor.model.document.selection;if(!this.editor.model.canEditAt(e)||!e.isCollapsed)return;const n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(i=>{let r=e.anchor.parent;for(;r.isEmpty;){const s=r;r=s.parent,i.remove(s)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,n=e.schema,i=e.document.selection,r=e.createSelection(i);if(e.modifySelection(r,{direction:t?"forward":"backward"}),r.isEqual(i))return null;const s=t?r.focus.nodeBefore:r.focus.nodeAfter;return s&&n.isObject(s)?s:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass(tg,e);this._previouslySelected.clear()}}function Tv(o,t){return!!t&&Array.from(o.getAncestors()).includes(t)}class er extends z{constructor(){super(...arguments),this._toolbarDefinitions=new Map}static get requires(){return[Ki]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!Ft(r))})(t.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void W("widget-toolbar-no-items",{toolbarId:t});const s=this.editor,a=s.t,c=new Os(s.locale);if(c.ariaLabel=e||a("Widget toolbar"),this._toolbarDefinitions.has(t))throw new _("widget-toolbar-duplicated",this,{toolbarId:t});const l={view:c,getRelatedElement:i,balloonClassName:r,itemsConfig:n,initialized:!1};s.ui.addToolbar(c,{isContextual:!0,beforeFocus:()=>{const d=i(s.editing.view.document.selection);d&&this._showToolbar(l,d)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(t,l)}_updateToolbarsVisibility(){let t=0,e=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>t&&(t=s,e=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?dg(this.editor,e):this._isToolbarInBalloon(t)||(t.initialized||(t.initialized=!0,t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:t.view,position:hg(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);dg(this.editor,i)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function dg(o,t){const e=o.plugins.get("ContextualBalloon"),n=hg(o,t);e.updatePosition(n)}function hg(o,t){const e=o.editing.view,n=ee.defaultPositions;return{target:e.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}var ug=L(9444),Sv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(ug.c,Sv),ug.c.locals;const Zs=$n("px");class Mv extends ${constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",e=>!e)],style:{left:t.to("left",e=>Zs(e)),top:t.to("top",e=>Zs(e)),width:t.to("width",e=>Zs(e))}}})}}class nr extends z{constructor(){super(...arguments),this.removeDropMarkerDelayed=qr(()=>this.removeDropMarker(),40),this._updateDropMarkerThrottled=Gi(t=>this._updateDropMarker(t),40),this._reconvertMarkerThrottled=Gi(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0),this._dropTargetLineView=new Mv,this._domEmitter=new(pe()),this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:t}of this._scrollables.values())t.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(t,e,n,i,r,s){this.removeDropMarkerDelayed.cancel();const a=gg(this.editor,t,e,n,i,r,s);if(a)return s&&s.containsRange(a)?this.removeDropMarker():void this._updateDropMarkerThrottled(a)}getFinalDropRange(t,e,n,i,r,s){const a=gg(this.editor,t,e,n,i,r,s);return this.removeDropMarker(),a}removeDropMarker(){const t=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,t.markers.has("drop-target")&&t.change(e=>{e.removeMarker("drop-target")})}_setupDropMarker(){const t=this.editor;t.ui.view.body.add(this._dropTargetLineView),t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(n);e.markerRange.isCollapsed?this._updateDropTargetLine(e.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(t){const e=this.editor,n=e.model.markers;e.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(t)||i.updateMarker("drop-target",{range:t}):i.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(t){return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const n=this.toDomElement(e);return n.append("⁠",e.createElement("span"),"⁠"),n})}_updateDropTargetLine(t){const e=this.editor.editing,n=t.start.nodeBefore,i=t.start.nodeAfter,r=t.start.parent,s=n?e.mapper.toViewElement(n):null,a=s?e.view.domConverter.mapViewToDom(s):null,c=i?e.mapper.toViewElement(i):null,l=c?e.view.domConverter.mapViewToDom(c):null,d=e.mapper.toViewElement(r);if(!d)return;const h=e.view.domConverter.mapViewToDom(d),u=this._getScrollableRect(d),{scrollX:g,scrollY:p}=q.window,k=a?new ot(a):null,b=l?new ot(l):null,A=new ot(h).excludeScrollbarsAndBorders(),x=k?k.bottom:A.top,M=b?b.top:A.bottom,O=q.window.getComputedStyle(h),H=x<=M?(x+M)/2:M;if(u.topa.schema.checkChild(h,u))){if(a.schema.checkChild(h,"$text"))return a.createRange(h);if(d)return or(o,mg(o,d.parent),n,i)}}}else if(a.schema.isInline(l))return or(o,l,n,i)}if(a.schema.isBlock(l))return or(o,l,n,i);if(a.schema.checkChild(l,"$block")){const d=Array.from(l.getChildren()).filter(g=>g.is("element")&&!Bv(o,g));let h=0,u=d.length;if(u==0)return a.createRange(a.createPositionAt(l,"end"));for(;ht in o?Nv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Rv extends z{constructor(){super(...arguments),this._isBlockDragging=!1,this._domEmitter=new(pe())}static get pluginName(){return"DragDropBlockToolbar"}init(){const t=this.editor;if(this.listenTo(t,"change:isReadOnly",(e,n,i)=>{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),f.isAndroid&&this.forceDisabled("noAndroidSupport"),t.plugins.has("BlockToolbar")){const e=t.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(e,"dragstart",(n,i)=>this._handleBlockDragStart(i)),this._domEmitter.listenTo(q.document,"dragover",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo(q.document,"drop",(n,i)=>this._handleBlockDragging(i)),this._domEmitter.listenTo(q.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&e.setAttribute("draggable","true"),this.on("change:isEnabled",(n,i,r)=>{e.setAttribute("draggable",r?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(t){if(!this.isEnabled)return;const e=this.editor.model,n=e.document.selection,i=this.editor.editing.view,r=Array.from(n.getSelectedBlocks()),s=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));e.change(a=>a.setSelection(s)),this._isBlockDragging=!0,i.focus(),i.getObserver(Ko).onDomEvent(t)}_handleBlockDragging(t){if(!this.isEnabled||!this._isBlockDragging)return;const e=t.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),n=t.clientY,i=document.elementFromPoint(e,n),r=this.editor.editing.view;var s,a;i&&i.closest(".ck-editor__editable")&&r.getObserver(Ko).onDomEvent((s=((c,l)=>{for(var d in l||(l={}))Ov.call(l,d)&&kg(c,d,l[d]);if(fg)for(var d of fg(l))zv.call(l,d)&&kg(c,d,l[d]);return c})({},t),a={type:t.type,dataTransfer:t.dataTransfer,target:i,clientX:e,clientY:n,preventDefault:()=>t.preventDefault(),stopPropagation:()=>t.stopPropagation()},Pv(s,Lv(a))))}_handleBlockDragEnd(){this._isBlockDragging=!1}}var bg=L(9256),jv={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bg.c,jv),bg.c.locals;class Fv extends z{constructor(){super(...arguments),this._clearDraggableAttributesDelayed=qr(()=>this._clearDraggableAttributes(),40),this._blockMode=!1,this._domEmitter=new(pe())}static get pluginName(){return"DragDrop"}static get requires(){return[Be,Zo,nr,Rv]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,e.addObserver(Ko),e.addObserver(Ps),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),f.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=t.plugins.get(nr);this.listenTo(i,"dragstart",(s,a)=>{if(a.target&&a.target.is("editableElement")||(this._prepareDraggedRange(a.target),!this._draggedRange))return void a.preventDefault();this._draggingUid=Q(),a.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,c,"dragstart");const{dataTransfer:l,domTarget:d,domEvent:h}=a,{clientX:u}=h;this._updatePreview({dataTransfer:l,domTarget:d,clientX:u}),a.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(i,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(q.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(i,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(i,"dragleave",()=>{r.removeDropMarkerDelayed()}),this.listenTo(i,"dragging",(s,a)=>{if(!this.isEnabled)return void(a.dataTransfer.dropEffect="none");const{clientX:c,clientY:l}=a.domEvent;r.updateDropMarker(a.target,a.targetRanges,c,l,this._blockMode,this._draggedRange),this._draggedRange||(a.dataTransfer.dropEffect="copy"),f.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get(nr);this.listenTo(e,"clipboardInput",(i,r)=>{if(r.method!="drop")return;const{clientX:s,clientY:a}=r.domEvent,c=n.getFinalDropRange(r.target,r.targetRanges,s,a,this._blockMode,this._draggedRange);if(!c)return this._finalizeDragging(!1),void i.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),wg(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(c,!0))return this._finalizeDragging(!1),void i.stop();r.targetRanges=[t.editing.mapper.toViewRange(c)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(Be);t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(e,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=wg(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,n=e.document;this.listenTo(n,"mousedown",(i,r)=>{if(f.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Ag(r.target);if(f.isBlink&&!t.isReadOnly&&!s&&!n.selection.isCollapsed){const a=n.selection.getSelectedElement();a&&Ft(a)||(s=n.selection.editableElement)}s&&(e.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=t.editing.mapper.toModelElement(s))}),this.listenTo(n,"mouseup",()=>{f.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(t){const e=this.editor,n=e.model;e.plugins.get(nr).removeDropMarker(),this._clearDraggableAttributes(),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(t&&this.isEnabled&&n.change(i=>{const r=n.createSelection(this._draggedRange);n.deleteContent(r,{doNotAutoparagraph:!0});const s=r.getFirstPosition().parent;s.isEmpty&&!n.schema.checkChild(s,"$text")&&n.schema.checkChild(s,"paragraph")&&i.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(t){const e=this.editor,n=e.model,i=n.document.selection,r=t?Ag(t):null;if(r){const l=e.editing.mapper.toModelElement(r);this._draggedRange=ce.fromRange(n.createRangeOn(l)),this._blockMode=n.schema.isBlock(l),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(i.isCollapsed&&!i.getFirstPosition().parent.isEmpty)return;const s=Array.from(i.getSelectedBlocks()),a=i.getFirstRange();if(s.length==0)return void(this._draggedRange=ce.fromRange(a));const c=Cg(n,s);if(s.length>1)this._draggedRange=ce.fromRange(c),this._blockMode=!0;else if(s.length==1){const l=a.start.isTouching(c.start)&&a.end.isTouching(c.end);this._draggedRange=ce.fromRange(l?c:a),this._blockMode=l}n.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:t,domTarget:e,clientX:n}){const i=this.editor.editing.view,r=i.document.selection.editableElement,s=i.domConverter.mapViewToDom(r),a=q.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=si(q.document,"div",{style:"position: fixed; left: -999999px;"}),q.document.body.appendChild(this._previewContainer));const c=new ot(s);if(s.contains(e))return;const l=parseFloat(a.paddingLeft),d=si(q.document,"div");d.className="ck ck-content",d.style.width=a.width,d.style.paddingLeft=`${c.left-n+l}px`,f.isiOS&&(d.style.backgroundColor="white"),d.innerHTML=t.getData("text/html"),t.setDragImage(d,0,0),this._previewContainer.appendChild(d)}}function wg(o){return f.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function Ag(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(Ft);if(Ft(o))return o;const t=o.findAncestor(e=>Ft(e)||e.is("editableElement"));return Ft(t)?t:null}function Cg(o,t){const e=t[0],n=t[t.length-1],i=e.getCommonAncestor(n),r=o.createPositionBefore(e),s=o.createPositionAfter(n);if(i&&i.is("element")&&!o.schema.isLimit(i)){const a=o.createRangeOn(i),c=r.isTouching(a.start),l=s.isTouching(a.end);if(c&&l)return Cg(o,[i])}return o.createRange(r,s)}class Vv extends z{static get pluginName(){return"PastePlainText"}static get requires(){return[Be]}init(){const t=this.editor,e=t.model,n=t.editing.view,i=n.document,r=e.document.selection;let s=!1;n.addObserver(Ko),this.listenTo(i,"keydown",(a,c)=>{s=c.shiftKey}),t.plugins.get(Be).on("contentInsertion",(a,c)=>{(s||function(l,d){if(l.childCount>1)return!1;const h=l.getChild(0);return d.isObject(h)?!1:Array.from(h.getAttributeKeys()).length==0}(c.content,e.schema))&&e.change(l=>{const d=Array.from(r.getAttributes()).filter(([u])=>e.schema.getAttributeProperties(u).isFormatting);r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0}),d.push(...r.getAttributes());const h=l.createRangeIn(c.content);for(const u of h.getItems())u.is("$textProxy")&&l.setAttributes(d,u)})})}}class _g extends z{static get pluginName(){return"Clipboard"}static get requires(){return[Be,Fv,Vv]}}class Uv extends nt{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!vg(t.schema,n))do if(n=n.parent,!n)return;while(!vg(t.schema,n));t.change(i=>{i.setSelection(n,"in")})}}function vg(o,t){return o.isLimit(t)&&(o.checkChild(t,"$text")||o.checkChild(t,"paragraph"))}const Hv=Io("Ctrl+A");class qv extends z{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new Uv(t)),this.listenTo(e,"keydown",(n,i)=>{Yn(i)===Hv&&(t.execute("selectAll"),i.preventDefault())})}}class Gv extends z{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const n=t.commands.get("selectAll"),i=new ut(e),r=e.t;return i.set({label:r("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isEnabled").to(n,"isEnabled"),this.listenTo(i,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),i})}}class Wv extends z{static get requires(){return[qv,Gv]}static get pluginName(){return"SelectAll"}}var Kv=Object.defineProperty,yg=Object.getOwnPropertySymbols,$v=Object.prototype.hasOwnProperty,Yv=Object.prototype.propertyIsEnumerable,xg=(o,t,e)=>t in o?Kv(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Eg extends nt{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(t.data,"set",(e,n)=>{n[1]=((r,s)=>{for(var a in s||(s={}))$v.call(s,a)&&xg(r,a,s[a]);if(yg)for(var a of yg(s))Yv.call(s,a)&&xg(r,a,s[a]);return r})({},n[1]);const i=n[1];i.batchType||(i.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(t.data,"set",(e,n)=>{n[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model,r=i.document,s=[],a=t.map(l=>l.getTransformedByOperations(n)),c=a.flat();for(const l of a){const d=l.filter(h=>h.root!=r.graveyard).filter(h=>!Zv(h,c));d.length&&(Qv(d),s.push(d[0]))}s.length&&i.change(l=>{l.setSelection(s,{backward:e})})}_undo(t,e){const n=this.editor.model,i=n.document;this._createdBatches.add(e);const r=t.operations.slice().filter(s=>s.isDocumentOperation);r.reverse();for(const s of r){const a=s.baseVersion+1,c=Array.from(i.history.getOperations(a)),l=WA([s.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let d of l){const h=d.affectedSelectable;h&&!n.canEditAt(h)&&(d=new jt(d.baseVersion)),e.addOperation(d),n.applyOperation(d),i.history.setOperationAsUndone(s,d)}}}}function Qv(o){o.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;te!==o&&e.containsRange(o,!0))}class Jv extends Eg{execute(t=null){const e=t?this._stack.findIndex(r=>r.batch==t):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r)}),this.fire("revert",n.batch,i),this.refresh()}}class Xv extends Eg{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(t.selection.ranges,t.selection.isBackward,i),this._undo(t.batch,e)}),this.refresh()}}class t1 extends z{constructor(){super(...arguments),this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const t=this.editor;this._undoCommand=new Jv(t),this._redoCommand=new Xv(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(e,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const r=i.batch,s=this._redoCommand.createdBatches.has(r),a=this._undoCommand.createdBatches.has(r);this._batchRegistry.has(r)||(this._batchRegistry.add(r),r.isUndoable&&(s?this._undoCommand.addBatch(r):a||(this._undoCommand.addBatch(r),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,n,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}class e1 extends z{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?J.undo:J.redo,r=e.uiLanguageDirection=="ltr"?J.redo:J.undo;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(t,e,n,i){const r=this.editor;r.ui.componentFactory.add(t,s=>{const a=r.commands.get(t),c=new ut(s);return c.set({label:e,icon:i,keystroke:n,tooltip:!0}),c.bind("isEnabled").to(a,"isEnabled"),this.listenTo(c,"execute",()=>{r.execute(t),r.editing.view.focus()}),c})}}class Dg extends z{static get requires(){return[t1,e1]}static get pluginName(){return"Undo"}}class n1 extends ct(){constructor(){super();const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((n,i)=>{e.onload=()=>{const r=e.result;this._data=r,n(r)},e.onerror=()=>{i("error")},e.onabort=()=>{i("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}class Ne extends z{constructor(){super(...arguments),this.loaders=new xe,this._loadersMap=new Map,this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[Eh]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return W("filerepository-no-upload-adapter"),null;const e=new Ig(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(n=>{this._loadersMap.set(n,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),e.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),e}destroyLoader(t){const e=t instanceof Ig?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((n,i)=>{n===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Eh);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,n=i=>`${e("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=t.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else t.remove(this._pendingAction),this._pendingAction=null}}class Ig extends ct(){constructor(t,e){super(),this.id=Q(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new n1,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new _("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if(this.status!=="reading")throw this.status;return this.status="idle",t}).catch(t=>{throw t==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:t)})}upload(){if(this.status!="idle")throw new _("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{throw this.status==="aborted"?"aborted":(this.status="error",t)})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?t=="reading"?this._reader.abort():t=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((n,i)=>{e.rejecter=i,e.isFulfilled=!1,t.then(r=>{e.isFulfilled=!0,n(r)}).catch(r=>{e.isFulfilled=!0,i(r)})}),e}}class o1 extends ut{constructor(t){super(t),this.buttonView=this,this._fileInputView=new i1(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}class i1 extends ${constructor(t){super(t),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}const Tg="ckCsrfToken",Sg="abcdefghijklmnopqrstuvwxyz0123456789";function r1(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const s=r.split("=");if(decodeURIComponent(s[0].trim().toLowerCase())===n)return decodeURIComponent(s[1])}return null}(Tg);var t,e;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let s=0;s.5?a.toUpperCase():a}return i}(40),t=Tg,e=o,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+";path=/"),o}class s1{constructor(t,e,n){this.loader=t,this.url=e,this.t=n}upload(){return this.loader.file.then(t=>new Promise((e,n)=>{this._initRequest(),this._initListeners(e,n,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,n){const i=this.xhr,r=this.loader,s=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>e(s)),i.addEventListener("abort",()=>e()),i.addEventListener("load",()=>{const a=i.response;if(!a||!a.uploaded)return e(a&&a.error&&a.error.message?a.error.message:s);t({default:a.url})}),i.upload&&i.upload.addEventListener("progress",a=>{a.lengthComputable&&(r.uploadTotal=a.total,r.uploaded=a.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",r1()),this.xhr.send(e)}}function dn(o,t,e,n){let i,r=null;typeof n=="function"?i=n:(r=o.commands.get(n),i=()=>{o.execute(n)}),o.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!t.isEnabled)return;const c=Ht(o.model.document.selection.getRanges());if(!c.isCollapsed||a.isUndo||!a.isLocal)return;const l=Array.from(o.model.document.differ.getChanges()),d=l[0];if(l.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const h=d.position.parent;if(h.is("element","codeBlock")||h.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const u=h.getChild(0),g=o.model.createRangeOn(u);if(!g.containsRange(c)&&!c.end.isEqual(g.end))return;const p=e.exec(u.data.substr(0,c.end.offset));p&&o.model.enqueueChange(k=>{const b=k.createPositionAt(h,0),A=k.createPositionAt(h,p[0].length),x=new ce(b,A);if(i({match:p})!==!1){k.remove(x);const M=o.model.document.selection.getFirstRange(),O=k.createRangeIn(h);!h.isEmpty||O.isEqual(M)||O.containsRange(M,!0)||k.remove(h)}x.detach(),o.model.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})})})}function so(o,t,e,n){let i,r;e instanceof RegExp?i=e:r=e,r=r||(s=>{let a;const c=[],l=[];for(;(a=i.exec(s))!==null&&!(a&&a.length<4);){let{index:d,1:h,2:u,3:g}=a;const p=h+u+g;d+=a[0].length-p.length;const k=[d,d+h.length],b=[d+h.length+u.length,d+h.length+u.length+g.length];c.push(k),c.push(b),l.push([d+h.length,d+h.length+u.length])}return{remove:c,format:l}}),o.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;const c=o.model,l=c.document.selection;if(!l.isCollapsed)return;const d=Array.from(c.document.differ.getChanges()),h=d[0];if(d.length!=1||h.type!=="insert"||h.name!="$text"||h.length!=1)return;const u=l.focus,g=u.parent,{text:p,range:k}=function(M,O){let H=M.start;return{text:Array.from(M.getItems()).reduce((et,Bt)=>!Bt.is("$text")&&!Bt.is("$textProxy")||Bt.getAttribute("code")?(H=O.createPositionAfter(Bt),""):et+Bt.data,""),range:O.createRange(H,M.end)}}(c.createRange(c.createPositionAt(g,0),u),c),b=r(p),A=Mg(k.start,b.format,c),x=Mg(k.start,b.remove,c);A.length&&x.length&&c.enqueueChange(M=>{if(n(M,A)!==!1){for(const O of x.reverse())M.remove(O);c.enqueueChange(()=>{o.plugins.get("Delete").requestUndoOnBackspace()})}})})}function Mg(o,t,e){return t.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>e.createRange(o.getShiftedBy(n[0]),o.getShiftedBy(n[1])))}function ir(o,t){return(e,n)=>{if(!o.commands.get(t).isEnabled)return!1;const i=o.model.schema.getValidRanges(n,t);for(const r of i)e.setAttribute(t,!0,r);e.removeSelectionAttribute(t)}}class Bg extends nt{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,n=e.document.selection,i=t.forceValue===void 0?!this.value:t.forceValue;e.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const s=e.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const a of s)i?r.setAttribute(this.attributeKey,i,a):r.removeAttribute(this.attributeKey,a)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(e.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}const ao="bold";class a1 extends z{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:ao}),t.model.schema.setAttributeProperties(ao,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:ao,view:"strong",upcastAlso:["b",e=>{const n=e.getStyle("font-weight");return n&&(n=="bold"||Number(n)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(ao,new Bg(t,ao)),t.keystrokes.set("CTRL+B",ao)}}const Js="bold";class c1 extends z{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Js,n=>{const i=t.commands.get(Js),r=new ut(n);return r.set({label:e("Bold"),icon:J.bold,keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(Js),t.editing.view.focus()}),r})}}var Ng=L(8984),l1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Ng.c,l1),Ng.c.locals;const co="italic";class d1 extends z{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:co}),t.model.schema.setAttributeProperties(co,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:co,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(co,new Bg(t,co)),t.keystrokes.set("CTRL+I",co)}}const Xs="italic";class h1 extends z{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add(Xs,n=>{const i=t.commands.get(Xs),r=new ut(n);return r.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute(Xs),t.editing.view.focus()}),r})}}class u1 extends nt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks()),s=t.forceValue===void 0?!this.value:t.forceValue;e.change(a=>{if(s){const c=r.filter(l=>rr(l)||Lg(n,l));this._applyQuote(a,c)}else this._removeQuote(a,r.filter(rr))})}_getValue(){const t=Ht(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!rr(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,n=Ht(t.getSelectedBlocks());return!!n&&Lg(e,n)}_removeQuote(t,e){Pg(t,e).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void t.unwrap(n.start.parent);if(n.start.isAtStart){const r=t.createPositionBefore(n.start.parent);return void t.move(n,r)}n.end.isAtEnd||t.split(n.end);const i=t.createPositionAfter(n.end.parent);t.move(n,i)})}_applyQuote(t,e){const n=[];Pg(t,e).reverse().forEach(i=>{let r=rr(i.start);r||(r=t.createElement("blockQuote"),t.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(t.merge(t.createPositionAfter(i)),i):r)}}function rr(o){return o.parent.name=="blockQuote"?o.parent:null}function Pg(o,t){let e,n=0;const i=[];for(;n{const a=t.model.document.differ.getChanges();for(const c of a)if(c.type=="insert"){const l=c.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!e.checkChild(c.position,l))return s.unwrap(l),!0;if(l.is("element")){const d=s.createRangeIn(l);for(const h of d.getItems())if(h.is("element","blockQuote")&&!e.checkChild(s.createPositionBefore(h),h))return s.unwrap(h),!0}}else if(c.type=="remove"){const l=c.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});const n=this.editor.editing.view.document,i=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(n,"enter",(s,a)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(s,a)=>{if(a.direction!="backward"||!i.isCollapsed||!r.value)return;const c=i.getLastPosition().parent;c.isEmpty&&!c.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}var Og=L(8888),p1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Og.c,p1),Og.c.locals;class m1 extends z{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",n=>{const i=t.commands.get("blockQuote"),r=new ut(n);return r.set({label:e("Block quote"),icon:J.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),r})}}class f1 extends z{static get pluginName(){return"CKBoxUI"}afterInit(){const t=this.editor,e=t.commands.get("ckbox");if(!e)return;const n=t.t;if(t.ui.componentFactory.add("ckbox",i=>{const r=new ut(i);return r.set({label:n("Open file manager"),icon:J.browseFiles,tooltip:!0}),r.bind("isOn","isEnabled").to(e,"value","isEnabled"),r.on("execute",()=>{t.execute("ckbox")}),r}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI");i.registerIntegration({name:"assetManager",observable:e,buttonViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=J.imageAssetManager,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace image with file manager":"Insert image with file manager")),r},formViewCreator:()=>{const r=this.editor.ui.componentFactory.create("ckbox");return r.icon=J.imageAssetManager,r.withText=!0,r.bind("label").to(i,"isImageSelected",s=>n(s?"Replace with file manager":"Insert with file manager")),r.on("execute",()=>{i.dropdownView.isOpen=!1}),r}})}}}var k1=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],Jo=o=>{let t=0;for(let e=0;e{let t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},ea=o=>{let t=Math.max(0,Math.min(1,o));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},na=(o,t)=>(e=>e<0?-1:1)(o)*Math.pow(Math.abs(o),t),zg=class extends Error{constructor(o){super(o),this.name="ValidationError",this.message=o}},b1=o=>{if(!o||o.length<6)throw new zg("The blurhash string must be at least 6 characters");let t=Jo(o[0]),e=Math.floor(t/9)+1,n=t%9+1;if(o.length!==4+2*n*e)throw new zg(`blurhash length mismatch: length is ${o.length} but it should be ${4+2*n*e}`)},w1=o=>{let t=o>>8&255,e=255&o;return[ta(o>>16),ta(t),ta(e)]},A1=(o,t)=>{let e=Math.floor(o/361),n=Math.floor(o/19)%19,i=o%19;return[na((e-9)/9,2)*t,na((n-9)/9,2)*t,na((i-9)/9,2)*t]},C1=(o,t,e,n)=>{b1(o),n|=1;let i=Jo(o[0]),r=Math.floor(i/9)+1,s=i%9+1,a=(Jo(o[1])+1)/166,c=new Array(s*r);for(let h=0;ht in o?_1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;function Fg(o){const t=[];let e=0;for(const i in o){const r=parseInt(i,10);isNaN(r)||(r>e&&(e=r),t.push(`${o[i]} ${i}w`))}const n=[{srcset:t.join(","),sizes:`(max-width: ${e}px) 100vw, ${e}px`,type:"image/webp"}];return{imageFallbackUrl:o.default,imageSources:n}}const Xo=32;function Vg({url:o,method:t="GET",data:e,onUploadProgress:n,signal:i,authorization:r}){const s=new XMLHttpRequest;s.open(t,o.toString()),s.setRequestHeader("Authorization",r),s.setRequestHeader("CKBox-Version","CKEditor 5"),s.responseType="json";const a=()=>{s.abort()};return new Promise((c,l)=>{i.throwIfAborted(),i.addEventListener("abort",a),s.addEventListener("loadstart",()=>{i.addEventListener("abort",a)}),s.addEventListener("loadend",()=>{i.removeEventListener("abort",a)}),s.addEventListener("error",()=>{l()}),s.addEventListener("abort",()=>{l()}),s.addEventListener("load",()=>{const d=s.response;if(!d||d.statusCode>=400)return l(d&&d.message);c(d)}),n&&s.upload.addEventListener("progress",d=>{n(d)}),s.send(e)})}const x1={"image/gif":"gif","image/jpeg":"jpg","image/png":"png","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};function E1(o,t){return e=this,n=null,i=function*(){try{const r=yield fetch(o,((s,a)=>{for(var c in a||(a={}))v1.call(a,c)&&jg(s,c,a[c]);if(Rg)for(var c of Rg(a))y1.call(a,c)&&jg(s,c,a[c]);return s})({method:"HEAD",cache:"force-cache"},t));return r.ok&&r.headers.get("content-type")||""}catch{return""}},new Promise((r,s)=>{var a=d=>{try{l(i.next(d))}catch(h){s(h)}},c=d=>{try{l(i.throw(d))}catch(h){s(h)}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,c);l((i=i.apply(e,n)).next())});var e,n,i}var D1=Object.defineProperty,Ug=Object.getOwnPropertySymbols,I1=Object.prototype.hasOwnProperty,T1=Object.prototype.propertyIsEnumerable,Hg=(o,t,e)=>t in o?D1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,qg=(o,t)=>{for(var e in t||(t={}))I1.call(t,e)&&Hg(o,e,t[e]);if(Ug)for(var e of Ug(t))T1.call(t,e)&&Hg(o,e,t[e]);return o};class S1 extends nt{constructor(t){super(t),this._chosenAssets=new Set,this._wrapper=null,this._initListeners()}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){this.fire("ckbox:open")}_getValue(){return this._wrapper!==null}_checkEnabled(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");return!(!t.isEnabled&&!e.isEnabled)}_prepareOptions(){const t=this.editor.config.get("ckbox");return{theme:t.theme,language:t.language,tokenUrl:t.tokenUrl,serviceOrigin:t.serviceOrigin,forceDemoLabel:t.forceDemoLabel,dialog:{onClose:()=>this.fire("ckbox:close")},assets:{onChoose:e=>this.fire("ckbox:choose",e)}}}_initListeners(){const t=this.editor,e=t.model,n=!t.config.get("ckbox.ignoreDataId");this.on("ckbox",()=>{this.refresh()},{priority:"low"}),this.on("ckbox:open",()=>{this.isEnabled&&!this.value&&(this._wrapper=si(document,"div",{class:"ck ckbox-wrapper"}),document.body.appendChild(this._wrapper),window.CKBox.mount(this._wrapper,this._prepareOptions()))}),this.on("ckbox:close",()=>{this.value&&(this._wrapper.remove(),this._wrapper=null,t.editing.view.focus())}),this.on("ckbox:choose",(i,r)=>{if(!this.isEnabled)return;const s=t.commands.get("insertImage"),a=t.commands.get("link"),c=function({assets:d,isImageAllowed:h,isLinkAllowed:u}){return d.map(g=>function(p){const k=p.data.metadata;return k?k.width&&k.height:!1}(g)?{id:g.data.id,type:"image",attributes:M1(g)}:{id:g.data.id,type:"link",attributes:B1(g)}).filter(g=>g.type==="image"?h:u)}({assets:r,isImageAllowed:s.isEnabled,isLinkAllowed:a.isEnabled}),l=c.length;l!==0&&(e.change(d=>{for(const h of c){const u=h===c[l-1],g=l===1;this._insertAsset(h,u,d,g),n&&(setTimeout(()=>this._chosenAssets.delete(h),1e3),this._chosenAssets.add(h))}}),t.editing.view.focus())}),this.listenTo(t,"destroy",()=>{this.fire("ckbox:close"),this._chosenAssets.clear()})}_insertAsset(t,e,n,i){const r=this.editor.model.document.selection;n.removeSelectionAttribute("linkHref"),t.type==="image"?this._insertImage(t):this._insertLink(t,n,i),e||n.setSelection(r.getLastPosition())}_insertImage(t){const e=this.editor,{imageFallbackUrl:n,imageSources:i,imageTextAlternative:r,imageWidth:s,imageHeight:a,imagePlaceholder:c}=t.attributes;e.execute("insertImage",{source:qg({src:n,sources:i,alt:r,width:s,height:a},c?{placeholder:c}:null)})}_insertLink(t,e,n){const i=this.editor,r=i.model,s=r.document.selection,{linkName:a,linkHref:c}=t.attributes;if(s.isCollapsed){const l=Re(s.getAttributes()),d=e.createText(a,l);if(!n){const u=s.getLastPosition(),g=u.parent;g.name==="paragraph"&&g.isEmpty||i.execute("insertParagraph",{position:u});const p=r.insertContent(d);return e.setSelection(p),void i.execute("link",c)}const h=r.insertContent(d);e.setSelection(h)}i.execute("link",c)}}function M1(o){const{imageFallbackUrl:t,imageSources:e}=Fg(o.data.imageUrls),{description:n,width:i,height:r,blurHash:s}=o.data.metadata,a=function(c){if(c)try{const l=`${Xo}px`,d=document.createElement("canvas");d.setAttribute("width",l),d.setAttribute("height",l);const h=d.getContext("2d");if(!h)return;const u=h.createImageData(Xo,Xo),g=C1(c,Xo,Xo);return u.data.set(g),h.putImageData(u,0,0),d.toDataURL()}catch{return}}(s);return qg({imageFallbackUrl:t,imageSources:e,imageTextAlternative:n||"",imageWidth:i,imageHeight:r},a?{imagePlaceholder:a}:null)}function B1(o){return{linkName:o.data.name,linkHref:N1(o)}}function N1(o){const t=new URL(o.data.url);return t.searchParams.set("download","true"),t.toString()}var oa=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class Gg extends z{static get pluginName(){return"CKBoxUtils"}static get requires(){return["CloudServices"]}init(){return oa(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;t.config.define("ckbox",{serviceOrigin:"https://api.ckbox.io",defaultUploadCategories:null,ignoreDataId:!1,language:t.locale.uiLanguage,theme:"lark",tokenUrl:t.config.get("cloudServices.tokenUrl")});const i=t.plugins.get("CloudServices"),r=t.config.get("cloudServices.tokenUrl"),s=t.config.get("ckbox.tokenUrl");if(!s)throw new _("ckbox-plugin-missing-token-url",this);this._token=s==r?i.token:yield i.registerTokenUrl(s)})}getToken(){return this._token}getWorkspaceId(){const t=(0,this.editor.t)("Cannot access default workspace."),e=this.editor.config.get("ckbox.defaultUploadWorkspaceId"),n=function(i,r){const[,s]=i.value.split("."),a=JSON.parse(atob(s)),c=a.auth&&a.auth.ckbox&&a.auth.ckbox.workspaces||[a.aud];return r?(a.auth&&a.auth.ckbox&&a.auth.ckbox.role)=="superadmin"||c.includes(r)?r:null:c[0]}(this._token,e);if(n==null)throw Ct("ckbox-access-default-workspace-error"),t;return n}getCategoryIdForFile(t,e){return oa(this,null,function*(){const n=(0,this.editor.t)("Cannot determine a category for the uploaded file."),i=this.editor.config.get("ckbox.defaultUploadCategories"),r=this._getAvailableCategories(e),s=typeof t=="string"?(a=yield E1(t,e),x1[a]):function(d){const h=d.name,u=new RegExp("\\.(?[^.]+)$");return h.match(u).groups.ext.toLowerCase()}(t);var a;const c=yield r;if(!c)throw n;if(i){const d=Object.keys(i).find(h=>i[h].find(u=>u.toLowerCase()==s));if(d){const h=c.find(u=>u.id===d||u.name===d);if(!h)throw n;return h.id}}const l=c.find(d=>d.extensions.find(h=>h.toLowerCase()==s));if(!l)throw n;return l.id})}_getAvailableCategories(t){return oa(this,null,function*(){const e=this.editor,n=this._token,{signal:i}=t,r=e.config.get("ckbox.serviceOrigin"),s=this.getWorkspaceId();try{const c=[];let l,d=0;do{const h=yield a(d);c.push(...h.items),l=h.totalCount-(d+50),d+=50}while(l>0);return c}catch{return i.throwIfAborted(),void Ct("ckbox-fetch-category-http-error")}function a(c){const l=new URL("categories",r);return l.searchParams.set("limit","50"),l.searchParams.set("offset",c.toString()),l.searchParams.set("workspaceId",s),Vg({url:l,signal:i,authorization:n.value})}})}}var ia=(o,t,e)=>new Promise((n,i)=>{var r=c=>{try{a(e.next(c))}catch(l){i(l)}},s=c=>{try{a(e.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(r,s);a((e=e.apply(o,t)).next())});class P1 extends z{static get requires(){return["ImageUploadEditing","ImageUploadProgress",Ne,Wg]}static get pluginName(){return"CKBoxUploadAdapter"}afterInit(){return ia(this,null,function*(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;if(!e&&!n)return;const i=t.plugins.get(Ne),r=t.plugins.get(Gg);i.createUploadAdapter=c=>new L1(c,t,r);const s=!t.config.get("ckbox.ignoreDataId"),a=t.plugins.get("ImageUploadEditing");s&&a.on("uploadComplete",(c,{imageElement:l,data:d})=>{t.model.change(h=>{h.setAttribute("ckboxImageId",d.ckboxImageId,l)})})})}}class L1{constructor(t,e,n){this.loader=t,this.token=n.getToken(),this.ckboxUtils=n,this.editor=e,this.controller=new AbortController,this.serviceOrigin=e.config.get("ckbox.serviceOrigin")}upload(){return ia(this,null,function*(){const t=this.ckboxUtils,e=this.editor.t,n=yield this.loader.file,i=yield t.getCategoryIdForFile(n,{signal:this.controller.signal}),r=new URL("assets",this.serviceOrigin),s=new FormData;return r.searchParams.set("workspaceId",t.getWorkspaceId()),s.append("categoryId",i),s.append("file",n),Vg({method:"POST",url:r,data:s,onUploadProgress:a=>{a.lengthComputable&&(this.loader.uploadTotal=a.total,this.loader.uploaded=a.loaded)},signal:this.controller.signal,authorization:this.token.value}).then(a=>ia(this,null,function*(){const c=Fg(a.imageUrls);return{ckboxImageId:a.id,default:c.imageFallbackUrl,sources:c.imageSources}})).catch(()=>{const a=e("Cannot upload file:")+` ${n.name}.`;return Promise.reject(a)})})}abort(){this.controller.abort()}}class Wg extends z{static get pluginName(){return"CKBoxEditing"}static get requires(){return["LinkEditing","PictureEditing",P1,Gg]}init(){const t=this.editor,e=!!t.config.get("ckbox"),n=!!window.CKBox;(e||n)&&(this._checkImagePlugins(),t.config.get("ckbox.ignoreDataId")||(this._initSchema(),this._initConversion(),this._initFixers()),n&&t.commands.add("ckbox",new S1(t)))}_checkImagePlugins(){const t=this.editor;t.plugins.has("ImageBlockEditing")||t.plugins.has("ImageInlineEditing")||Ct("ckbox-plugin-image-feature-missing",t)}_initSchema(){const t=this.editor.model.schema;t.extend("$text",{allowAttributes:"ckboxLinkId"}),t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["ckboxImageId","ckboxLinkId"]}),t.addAttributeCheck((e,n)=>{if(!e.last.getAttribute("linkHref")&&n==="ckboxLinkId")return!1})}_initConversion(){const t=this.editor;t.conversion.for("downcast").add(n=>{n.on("attribute:ckboxLinkId:imageBlock",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(!l.consume(r.item,i.name))return;const d=[...c.toViewElement(r.item).getChildren()].find(h=>h.name==="a");d&&(r.item.hasAttribute("ckboxLinkId")?a.setAttribute("data-ckbox-resource-id",r.item.getAttribute("ckboxLinkId"),d):a.removeAttribute("data-ckbox-resource-id",d))},{priority:"low"}),n.on("attribute:ckboxLinkId",(i,r,s)=>{const{writer:a,mapper:c,consumable:l}=s;if(l.consume(r.item,i.name)){if(r.attributeOldValue){const d=Kg(a,r.attributeOldValue);a.unwrap(c.toViewRange(r.range),d)}if(r.attributeNewValue){const d=Kg(a,r.attributeNewValue);if(r.item.is("selection")){const h=a.document.selection;a.wrap(h.getFirstRange(),d)}else a.wrap(c.toViewRange(r.range),d)}}},{priority:"low"})}),t.conversion.for("upcast").add(n=>{n.on("element:a",(i,r,s)=>{const{writer:a,consumable:c}=s;if(!r.viewItem.getAttribute("href")||!c.consume(r.viewItem,{attributes:["data-ckbox-resource-id"]}))return;const l=r.viewItem.getAttribute("data-ckbox-resource-id");if(l)if(r.modelRange)for(let d of r.modelRange.getItems())d.is("$textProxy")&&(d=d.textNode),z1(d)&&a.setAttribute("ckboxLinkId",l,d);else{const d=r.modelCursor.nodeBefore||r.modelCursor.parent;a.setAttribute("ckboxLinkId",l,d)}},{priority:"low"})}),t.conversion.for("downcast").attributeToAttribute({model:"ckboxImageId",view:"data-ckbox-resource-id"}),t.conversion.for("upcast").elementToAttribute({model:{key:"ckboxImageId",value:n=>n.getAttribute("data-ckbox-resource-id")},view:{attributes:{"data-ckbox-resource-id":/[\s\S]+/}}});const e=t.commands.get("replaceImageSource");e&&this.listenTo(e,"cleanupImage",(n,[i,r])=>{i.removeAttribute("ckboxImageId",r)})}_initFixers(){const t=this.editor,e=t.model,n=e.document.selection;e.document.registerPostFixer(function(i){return r=>{let s=!1;const a=i.model,c=i.commands.get("ckbox");if(!c)return s;for(const l of a.document.differ.getChanges()){if(l.type!=="insert"&&l.type!=="attribute")continue;const d=l.type==="insert"?new B(l.position,l.position.getShiftedBy(l.length)):l.range,h=l.type==="attribute"&&l.attributeKey==="linkHref"&&l.attributeNewValue===null;for(const u of d.getItems()){if(h&&u.hasAttribute("ckboxLinkId")){r.removeAttribute("ckboxLinkId",u),s=!0;continue}const g=O1(u,c._chosenAssets);for(const p of g){const k=p.type==="image"?"ckboxImageId":"ckboxLinkId";p.id!==u.getAttribute(k)&&(r.setAttribute(k,p.id,u),s=!0)}}}return s}}(t)),e.document.registerPostFixer(function(i){return r=>!(i.hasAttribute("linkHref")||!i.hasAttribute("ckboxLinkId"))&&(r.removeSelectionAttribute("ckboxLinkId"),!0)}(n))}}function O1(o,t){const e=o.is("element","imageInline")||o.is("element","imageBlock"),n=o.hasAttribute("linkHref");return[...t].filter(i=>i.type==="image"&&e?i.attributes.imageFallbackUrl===o.getAttribute("src"):i.type==="link"&&n?i.attributes.linkHref===o.getAttribute("linkHref"):void 0)}function Kg(o,t){const e=o.createAttributeElement("a",{"data-ckbox-resource-id":t},{priority:5});return o.setCustomProperty("link",!0,e),e}function z1(o){return!!o.is("$text")||!(!o.is("element","imageInline")&&!o.is("element","imageBlock"))}var $g=L(9268),R1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()($g.c,R1),$g.c.locals;class j1 extends z{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,n=t.t;if(e.add("ckfinder",i=>{const r=t.commands.get("ckfinder"),s=new ut(i);return s.set({label:n("Insert image or file"),icon:J.browseFiles,tooltip:!0}),s.bind("isEnabled").to(r),s.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),s}),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI"),r=t.commands.get("ckfinder");i.registerIntegration({name:"assetManager",observable:r,buttonViewCreator:()=>{const s=this.editor.ui.componentFactory.create("ckfinder");return s.icon=J.imageAssetManager,s.bind("label").to(i,"isImageSelected",a=>n(a?"Replace image with file manager":"Insert image with file manager")),s},formViewCreator:()=>{const s=this.editor.ui.componentFactory.create("ckfinder");return s.icon=J.imageAssetManager,s.withText=!0,s.bind("label").to(i,"isImageSelected",a=>n(a?"Replace with file manager":"Insert with file manager")),s.on("execute",()=>{i.dropdownView.isOpen=!1}),s}})}}}class F1 extends nt{constructor(t){super(t),this.affectsData=!1,this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if(e!="popup"&&e!="modal")throw new _("ckfinder-unknown-openermethod",t);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=t.locale.uiLanguage),n.onInit=r=>{i&&i(r),r.on("files:choose",s=>{const a=s.data.files.toArray(),c=a.filter(h=>!h.isImage()),l=a.filter(h=>h.isImage());for(const h of c)t.execute("link",h.getUrl());const d=[];for(const h of l){const u=h.getUrl();d.push(u||r.request("file:getProxyUrl",{file:h}))}d.length&&Yg(t,d)}),r.on("file:choose:resizedImage",s=>{const a=s.data.resizedUrl;if(a)Yg(t,[a]);else{const c=t.plugins.get("Notification"),l=t.locale.t;c.showWarning(l("Could not obtain resized image URL."),{title:l("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](n)}}function Yg(o,t){if(o.commands.get("insertImage").isEnabled)o.execute("insertImage",{source:t});else{const e=o.plugins.get("Notification"),n=o.locale.t;e.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class V1 extends z{static get pluginName(){return"CKFinderEditing"}static get requires(){return[qs,"LinkEditing"]}init(){const t=this.editor;if(!t.plugins.has("ImageBlockEditing")&&!t.plugins.has("ImageInlineEditing"))throw new _("ckfinder-missing-image-plugin",t);t.commands.add("ckfinder",new F1(t))}}class U1 extends z{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Ne]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),n=e.token,i=e.uploadUrl;if(!n)return;const r=t.plugins.get("CloudServicesCore");this._uploadGateway=r.createUploadGateway(n,i),t.plugins.get(Ne).createUploadAdapter=s=>new H1(this._uploadGateway,s)}}class H1{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then(t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",(e,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class q1 extends nt{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}refresh(){const t=this.editor.model,e=Ht(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Qg(e,t.schema)}execute(t={}){const e=this.editor.model,n=e.document,i=t.selection||n.selection;e.canEditAt(i)&&e.change(r=>{const s=i.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&Qg(a,e.schema)&&r.rename(a,"paragraph")})}}function Qg(o,t){return t.checkChild(o.parent,"paragraph")&&!t.isObject(o)}class G1 extends nt{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}execute(t){const e=this.editor.model,n=t.attributes;let i=t.position;e.canEditAt(i)&&e.change(r=>{if(i=this._findPositionToInsertParagraph(i,r),!i)return;const s=r.createElement("paragraph");n&&e.schema.setAllowedAttributes(s,n,r),e.insertContent(s,i),r.setSelection(s,"in")})}_findPositionToInsertParagraph(t,e){const n=this.editor.model;if(n.schema.checkChild(t,"paragraph"))return t;const i=n.schema.findAllowedParent(t,"paragraph");if(!i)return null;const r=t.parent,s=n.schema.checkChild(r,"$text");return r.isEmpty||s&&t.isAtEnd?n.createPositionAfter(r):!r.isEmpty&&s&&t.isAtStart?n.createPositionBefore(r):e.split(t,i).position}}const Zg=class extends z{static get pluginName(){return"Paragraph"}init(){const o=this.editor,t=o.model;o.commands.add("paragraph",new q1(o)),o.commands.add("insertParagraph",new G1(o)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),o.conversion.elementToElement({model:"paragraph",view:"p"}),o.conversion.for("upcast").elementToElement({model:(e,{writer:n})=>Zg.paragraphLikeElements.has(e.name)?e.isEmpty?null:n.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}};let ra=Zg;ra.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class W1 extends nt{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Ht(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Jg(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,n=e.document,i=t.value;e.change(r=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(a=>Jg(a,i,e.schema));for(const a of s)a.is("element",i)||r.rename(a,i)})}}function Jg(o,t,e){return e.checkChild(o.parent,t)&&!e.isObject(o)}const Xg="paragraph";class K1 extends z{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[ra]}init(){const t=this.editor,e=t.config.get("heading.options"),n=[];for(const i of e)i.model!=="paragraph"&&(t.model.schema.register(i.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new W1(t,n))}afterInit(){const t=this.editor,e=t.commands.get("enter"),n=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(i,r)=>{const s=t.model.document.selection.getFirstPosition().parent;n.some(a=>s.is("element",a.model))&&!s.is("element",Xg)&&s.childCount===0&&r.writer.rename(s,Xg)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:pt.low+1})}}var tp=L(2500),$1={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(tp.c,$1),tp.c.locals;class Y1 extends z{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,n=function(s){const a=s.t,c={Paragraph:a("Paragraph"),"Heading 1":a("Heading 1"),"Heading 2":a("Heading 2"),"Heading 3":a("Heading 3"),"Heading 4":a("Heading 4"),"Heading 5":a("Heading 5"),"Heading 6":a("Heading 6")};return s.config.get("heading.options").map(l=>{const d=c[l.title];return d&&d!=l.title&&(l.title=d),l})}(t),i=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",s=>{const a={},c=new xe,l=t.commands.get("heading"),d=t.commands.get("paragraph"),h=[l];for(const g of n){const p={type:"button",model:new hu({label:g.title,class:g.class,role:"menuitemradio",withText:!0})};g.model==="paragraph"?(p.model.bind("isOn").to(d,"value"),p.model.set("commandName","paragraph"),h.push(d)):(p.model.bind("isOn").to(l,"value",k=>k===g.model),p.model.set({commandName:"heading",commandValue:g.model})),c.add(p),a[g.model]=g.title}const u=Ye(s);return Oh(u,c,{ariaLabel:r,role:"menu"}),u.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),u.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),u.bind("isEnabled").toMany(h,"isEnabled",(...g)=>g.some(p=>p)),u.buttonView.bind("label").to(l,"value",d,"value",(g,p)=>{const k=g||p&&"paragraph";return typeof k=="boolean"?i:a[k]?a[k]:i}),this.listenTo(u,"execute",g=>{const{commandName:p,commandValue:k}=g.source;t.execute(p,k?{value:k}:void 0),t.editing.view.focus()}),u})}}function ep(o){return o.createContainerElement("figure",{class:"image"},[o.createEmptyElement("img"),o.createSlot("children")])}function np(o,t){const e=o.plugins.get("ImageUtils"),n=o.plugins.has("ImageInlineEditing")&&o.plugins.has("ImageBlockEditing");return r=>e.isInlineImageView(r)?n&&(r.getStyle("display")=="block"||r.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==t?null:i(r):null;function i(r){const s={name:!0};return r.hasAttribute("src")&&(s.attributes=["src"]),s}}function sa(o,t){const e=Ht(t.getSelectedBlocks());return!e||o.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function sr(o){return o&&o.endsWith("px")?parseInt(o):null}function op(o){const t=sr(o.getStyle("width")),e=sr(o.getStyle("height"));return!(!t||!e)}var Q1=Object.defineProperty,ip=Object.getOwnPropertySymbols,Z1=Object.prototype.hasOwnProperty,J1=Object.prototype.propertyIsEnumerable,rp=(o,t,e)=>t in o?Q1(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,sp=(o,t)=>{for(var e in t||(t={}))Z1.call(t,e)&&rp(o,e,t[e]);if(ip)for(var e of ip(t))J1.call(t,e)&&rp(o,e,t[e]);return o};const X1=/^(image|image-inline)$/;class oe extends z{constructor(){super(...arguments),this._domEmitter=new(pe())}static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null,i={}){const r=this.editor,s=r.model,a=s.document.selection,c=ap(r,e||a,n);t=sp(sp({},Object.fromEntries(a.getAttributes())),t);for(const l in t)s.schema.checkAttribute(c,l)||delete t[l];return s.change(l=>{const{setImageSizes:d=!0}=i,h=l.createElement(c,t);return s.insertObject(h,e,null,{setSelection:"on",findOptimalPosition:e||c=="imageInline"?void 0:"auto"}),h.parent?(d&&this.setImageNaturalSizeAttributes(h),h):null})}setImageNaturalSizeAttributes(t){const e=t.getAttribute("src");e&&(t.getAttribute("width")||t.getAttribute("height")||this.editor.model.change(n=>{const i=new q.window.Image;this._domEmitter.listenTo(i,"load",()=>{t.getAttribute("width")||t.getAttribute("height")||this.editor.model.enqueueChange(n.batch,r=>{r.setAttribute("width",i.naturalWidth,t),r.setAttribute("height",i.naturalHeight,t)}),this._domEmitter.stopListening(i,"load")}),i.src=e}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e)return null;const n=t.getSelectedElement();if(n&&this.isImageWidget(n))return n;let i=e.parent;for(;i;){if(i.is("element")&&this.isImageWidget(i))return i;i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(t){return t.findAncestor({classes:X1})}isImageAllowed(){const t=this.editor.model.document.selection;return function(e,n){if(ap(e,n,null)=="imageBlock"){const r=function(s,a){const c=og(s,a),l=c.start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,e.model);if(e.model.schema.checkChild(r,"imageBlock"))return!0}else if(e.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,t)&&function(e){return[...e.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(t)}toImageWidget(t,e,n){return e.setCustomProperty("image",!0,t),Qs(t,e,{label:()=>{const i=this.findViewImgElement(t).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(t){return!!t.getCustomProperty("image")&&Ft(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t))return t;const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t))if(this.isInlineImageView(n))return n}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function ap(o,t,e){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?e||(i==="inline"?"imageInline":i!=="auto"?"imageBlock":t.is("selection")?sa(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class ty extends nt{refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(s=>{s.setAttribute("alt",t.newValue,r)})}}class ey extends z{static get requires(){return[oe]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new ty(this.editor))}}var cp=L(5688),ny={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(cp.c,ny),cp.c.locals;var lp=L(2636),oy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(lp.c,oy),lp.c.locals;class iy extends ${constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Kt,this.keystrokes=new Jt,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._focusables=new me,this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),m({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const t=this.locale.t,e=new _i(this.locale,Hi);return e.label=t("Text alternative"),e}}function dp(o){const t=o.editing.view,e=ee.defaultPositions,n=o.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class ry extends z{static get requires(){return[Ki]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",n=>{const i=t.commands.get("imageTextAlternative"),r=new ut(n);return r.set({label:e("Change image text alternative"),icon:J.textAlternative,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>!!s),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_createForm(){const t=this.editor,e=t.editing.view.document,n=t.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(D(iy))(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(t.ui,"update",()=>{n.getClosestSelectedImageWidget(e.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const s=dp(i);r.updatePosition(s)}}(t):this._hideForm(!0)}),E({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const t=this.editor,e=t.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:dp(t)}),n.fieldView.value=n.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class hp extends z{static get requires(){return[ey,ry]}static get pluginName(){return"ImageTextAlternative"}}function up(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=r.writer,a=r.mapper.toViewElement(i.item),c=o.findViewImgElement(a);i.attributeNewValue===null?(s.removeAttribute("srcset",c),s.removeAttribute("sizes",c)):i.attributeNewValue&&(s.setAttribute("srcset",i.attributeNewValue,c),s.setAttribute("sizes","100vw",c))};return n=>{n.on(`attribute:srcset:${t}`,e)}}function ar(o,t,e){const n=(i,r,s)=>{if(!s.consumable.consume(r.item,i.name))return;const a=s.writer,c=s.mapper.toViewElement(r.item),l=o.findViewImgElement(c);a.setAttribute(r.attributeKey,r.attributeNewValue||"",l)};return i=>{i.on(`attribute:${e}:${t}`,n)}}class gp extends Fe{observe(t){this.listenTo(t,"load",(e,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}stopObserving(t){this.stopListening(t)}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}var sy=Object.defineProperty,pp=Object.getOwnPropertySymbols,ay=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,mp=(o,t,e)=>t in o?sy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,cr=(o,t)=>{for(var e in t||(t={}))ay.call(t,e)&&mp(o,e,t[e]);if(pp)for(var e of pp(t))cy.call(t,e)&&mp(o,e,t[e]);return o};class ly extends nt{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||e==="block"&&W("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||e==="inline"&&W("image-inline-plugin-required")}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=Tt(t.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);i.insertImage(cr(cr({},s),r),l)}else i.insertImage(cr(cr({},s),r))})}}class dy extends nt{constructor(t){super(t),this.decorate("cleanupImage")}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=this.editor.model.document.selection.getSelectedElement();this.isEnabled=t.isImage(e),this.value=this.isEnabled?e.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement(),n=this.editor.plugins.get("ImageUtils");this.editor.model.change(i=>{i.setAttribute("src",t.source,e),this.cleanupImage(i,e),n.setImageNaturalSizeAttributes(e)})}cleanupImage(t,e){t.removeAttribute("srcset",e),t.removeAttribute("sizes",e),t.removeAttribute("sources",e),t.removeAttribute("width",e),t.removeAttribute("height",e),t.removeAttribute("alt",e)}}class aa extends z{static get requires(){return[oe]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(gp),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new ly(t),i=new dy(t);t.commands.add("insertImage",n),t.commands.add("replaceImageSource",i),t.commands.add("imageInsert",n)}}class fp extends z{static get requires(){return[oe]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(t){const e=this.editor,n=e.plugins.get("ImageUtils"),i=t==="imageBlock"?"figure":"img";function r(s,a,c,l){s.on(`attribute:${a}:${t}`,(d,h,u)=>{if(!u.consumable.consume(h.item,d.name))return;const g=u.writer,p=u.mapper.toViewElement(h.item),k=n.findViewImgElement(p);if(h.attributeNewValue!==null?g.setAttribute(c,h.attributeNewValue,k):g.removeAttribute(c,k),h.item.hasAttribute("sources"))return;const b=h.item.hasAttribute("resizedWidth");if(t==="imageInline"&&!b&&!l)return;const A=h.item.getAttribute("width"),x=h.item.getAttribute("height");A&&x&&g.setStyle("aspect-ratio",`${A}/${x}`,k)})}e.conversion.for("upcast").attributeToAttribute({view:{name:i,styles:{width:/.+/}},model:{key:"width",value:s=>op(s)?sr(s.getStyle("width")):null}}).attributeToAttribute({view:{name:i,key:"width"},model:"width"}).attributeToAttribute({view:{name:i,styles:{height:/.+/}},model:{key:"height",value:s=>op(s)?sr(s.getStyle("height")):null}}).attributeToAttribute({view:{name:i,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(s=>{r(s,"width","width",!0),r(s,"height","height",!0)}),e.conversion.for("dataDowncast").add(s=>{r(s,"width","width",!1),r(s,"height","height",!1)})}}class kp extends nt{constructor(t,e){super(t),this._modelElementName=e}refresh(){const t=this.editor.plugins.get("ImageUtils"),e=t.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=t.isInlineImage(e):this.isEnabled=t.isBlockImage(e)}execute(t={}){const e=this.editor,n=this.editor.model,i=e.plugins.get("ImageUtils"),r=i.getClosestSelectedImageElement(n.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?n.change(a=>{const{setImageSizes:c=!0}=t,l=Array.from(n.markers).filter(u=>u.getRange().containsItem(r)),d=i.insertImage(s,n.createSelection(r,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const h=a.createRangeOn(d);for(const u of l){const g=u.getRange(),p=g.root.rootName!="$graveyard"?g.getJoined(h,!0):h;a.updateMarker(u,{range:p})}return{oldElement:r,newElement:d}}):null}}var bp=L(9684),hy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bp.c,hy),bp.c.locals;class wp extends z{static get requires(){return[oe]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["placeholder"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const t=this.editor,e=t.conversion,n=t.plugins.get("ImageUtils");e.for("editingDowncast").add(i=>{i.on("attribute:placeholder",(r,s,a)=>{if(!a.consumable.test(s.item,r.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;a.consumable.consume(s.item,r.name);const c=a.writer,l=a.mapper.toViewElement(s.item),d=n.findViewImgElement(l);s.attributeNewValue?(c.addClass("image_placeholder",d),c.setStyle("background-image",`url(${s.attributeNewValue})`,d),c.setCustomProperty("editingPipeline:doNotReuseOnce",!0,d)):(c.removeClass("image_placeholder",d),c.removeStyle("background-image",d))})})}_setupLoadListener(){const t=this.editor,e=t.model,n=t.editing,i=n.view,r=t.plugins.get("ImageUtils");i.addObserver(gp),this.listenTo(i.document,"imageLoaded",(s,a)=>{const c=i.domConverter.mapDomToView(a.target);if(!c)return;const l=r.getImageWidgetFromImageView(c);if(!l)return;const d=n.mapper.toModelElement(l);d&&d.hasAttribute("placeholder")&&e.enqueueChange({isUndoable:!1},h=>{h.removeAttribute("placeholder",d)})})}}class Ap extends z{static get requires(){return[aa,fp,oe,wp,Be]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new kp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>ep(s)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:s})=>i.toImageWidget(ep(s),s,e("image widget"))}),n.for("downcast").add(ar(i,"imageBlock","src")).add(ar(i,"imageBlock","alt")).add(up(i,"imageBlock")),n.for("upcast").elementToElement({view:np(t,"imageBlock"),model:(r,{writer:s})=>s.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(function(r){const s=(a,c,l)=>{if(!l.consumable.test(c.viewItem,{name:!0,classes:"image"}))return;const d=r.findViewImgElement(c.viewItem);if(!d||!l.consumable.test(d,{name:!0}))return;l.consumable.consume(c.viewItem,{name:!0,classes:"image"});const h=Ht(l.convertItem(d,c.modelCursor).modelRange.getItems());h?(l.convertChildren(c.viewItem,h),l.updateConversionResult(h,c)):l.consumable.revert(c.viewItem,{name:!0,classes:"image"})};return a=>{a.on("element:figure",s)}}(i))}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isInlineImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(sa(e.schema,d)==="imageBlock"){const h=new $e(n.document),u=c.map(g=>h.createElement("figure",{class:"image"},g));a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageBlock")&&i.setImageNaturalSizeAttributes(d)})})}}var Cp=L(3756),uy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Cp.c,uy),Cp.c.locals;class gy extends ${constructor(t,e=[]){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me,this.children=this.createCollection(),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const n of e)this.children.add(n),this._focusables.add(n),n instanceof ow&&this._focusables.addMany(n.children);if(this._focusables.length>1)for(const n of this._focusables)py(n)&&(n.focusCycler.on("forwardCycle",i=>{this._focusCycler.focusNext(),i.stop()}),n.focusCycler.on("backwardCycle",i=>{this._focusCycler.focusPrevious(),i.stop()}));this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),m({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function py(o){return"focusCycler"in o}class _p extends z{constructor(t){super(t),this._integrations=new Map,t.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get requires(){return[oe]}init(){const t=this.editor,e=t.model.document.selection,n=t.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(t.model.document,"change",()=>{this.isImageSelected=n.isImage(e.getSelectedElement())});const i=r=>this._createToolbarComponent(r);t.ui.componentFactory.add("insertImage",i),t.ui.componentFactory.add("imageInsert",i)}registerIntegration({name:t,observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:r}){this._integrations.has(t)&&W("image-insert-integration-exists",{name:t}),this._integrations.set(t,{observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:!!r})}_createToolbarComponent(t){const e=this.editor,n=t.t,i=this._prepareIntegrations();if(!i.length)return null;let r;const s=i[0];if(i.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const l=s.buttonViewCreator(!1);r=new Ui(t,l),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",d=>n(d?"Replace image":"Insert image"))}const a=this.dropdownView=Ye(t,r),c=i.map(({observable:l})=>l);return a.bind("isEnabled").toMany(c,"isEnabled",(...l)=>l.some(d=>d)),a.once("change:isOpen",()=>{const l=i.map(({formViewCreator:h})=>h(i.length==1)),d=new gy(e.locale,l);a.panelView.children.add(d)}),a}_prepareIntegrations(){const t=this.editor.config.get("image.insert.integrations"),e=[];if(!t.length)return W("image-insert-integrations-not-specified"),e;for(const n of t)this._integrations.has(n)?e.push(this._integrations.get(n)):["upload","assetManager","url"].includes(n)||W("image-insert-unknown-integration",{item:n});return e.length||W("image-insert-integrations-not-registered"),e}}var vp=L(1220),my={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(vp.c,my),vp.c.locals;class fy extends z{static get requires(){return[Ap,Zo,hp,_p]}static get pluginName(){return"ImageBlock"}}class ky extends z{static get requires(){return[aa,fp,oe,wp,Be]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor,e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),e.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new kp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,n=t.conversion,i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:s})=>s.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:s})=>i.toImageWidget(function(a){return a.createContainerElement("span",{class:"image-inline"},a.createEmptyElement("img"))}(s),s,e("image widget"))}),n.for("downcast").add(ar(i,"imageInline","src")).add(ar(i,"imageInline","alt")).add(up(i,"imageInline")),n.for("upcast").elementToElement({view:np(t,"imageInline"),model:(r,{writer:s})=>s.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,n=t.editing.view,i=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(s,a)=>{const c=Array.from(a.content.getChildren());let l;if(!c.every(i.isBlockImageView))return;l=a.targetRanges?t.editing.mapper.toModelRange(a.targetRanges[0]):e.document.selection.getFirstRange();const d=e.createSelection(l);if(sa(e.schema,d)==="imageInline"){const h=new $e(n.document),u=c.map(g=>g.childCount===1?(Array.from(g.getAttributes()).forEach(p=>h.setAttribute(...p,i.findViewImgElement(g))),g.getChild(0)):g);a.content=h.createDocumentFragment(u)}}),this.listenTo(r,"contentInsertion",(s,a)=>{a.method==="paste"&&e.change(c=>{const l=c.createRangeIn(a.content);for(const d of l.getItems())d.is("element","imageInline")&&i.setImageNaturalSizeAttributes(d)})})}}class by extends z{static get requires(){return[ky,Zo,hp,_p]}static get pluginName(){return"ImageInline"}}class yp extends z{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[oe]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),n=t.getFirstPosition().findAncestor("caption");return n&&e.isBlockImage(n.parent)?n:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return t.name=="figcaption"&&e.isBlockImageView(t.parent)?{name:!0}:null}}class wy extends nt{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils"),n=t.plugins.get("ImageUtils");if(!t.plugins.has(Ap))return this.isEnabled=!1,void(this.value=!1);const i=t.model.document.selection,r=i.getSelectedElement();if(!r){const s=e.getCaptionFromModelSelection(i);return this.isEnabled=!!s,void(this.value=!!s)}this.isEnabled=n.isImage(r),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(r):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,e)})}_showImageCaption(t,e){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=n.getSelectedElement();const a=i._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=n.getSelectedElement());const c=a||t.createElement("caption");t.append(c,s),e&&t.setSelection(c,"in")}_hideImageCaption(t){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageCaptionEditing"),r=e.plugins.get("ImageCaptionUtils");let s,a=n.getSelectedElement();a?s=r.getCaptionFromImageModelElement(a):(s=r.getCaptionFromModelSelection(n),a=s.parent),i._saveCaption(a,s),t.setSelection(a,"on"),t.remove(s)}}class Ay extends z{constructor(t){super(t),this._savedCaptionsMap=new WeakMap}static get requires(){return[oe,yp]}static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.model.schema;e.isRegistered("caption")?e.extend("caption",{allowIn:"imageBlock"}):e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),t.commands.add("toggleImageCaption",new wy(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils"),r=t.t;t.conversion.for("upcast").elementToElement({view:s=>i.matchImageCaptionViewElement(s),model:"caption"}),t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>n.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>{if(!n.isBlockImage(s.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),c.placeholder=r("Enter image caption"),Il({view:e,element:c,keepOnFocus:!0});const l=s.parent.getAttribute("alt");return ng(c,a,{label:l?r("Caption for image: %0",[l]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.plugins.get("ImageCaptionUtils"),i=t.commands.get("imageTypeInline"),r=t.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:c,newElement:l}=a.return;if(!c)return;if(e.isBlockImage(c)){const h=n.getCaptionFromImageModelElement(c);if(h)return void this._saveCaption(l,h)}const d=this._getSavedCaption(c);d&&this._saveCaption(l,d)};i&&this.listenTo(i,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?mt.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor,e=t.model,n=t.plugins.get("ImageUtils"),i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",()=>{const r=e.document.differ.getChanges();for(const s of r){if(s.attributeKey!=="alt")continue;const a=s.range.start.nodeAfter;if(n.isBlockImage(a)){const c=i.getCaptionFromImageModelElement(a);if(!c)return;t.editing.reconvertItem(c)}}})}}class Cy extends z{static get requires(){return[yp]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor,e=t.editing.view,n=t.plugins.get("ImageCaptionUtils"),i=t.t;t.ui.componentFactory.add("toggleImageCaption",r=>{const s=t.commands.get("toggleImageCaption"),a=new ut(r);return a.set({icon:J.caption,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",c=>i(c?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const c=n.getCaptionFromModelSelection(t.model.document.selection);if(c){const l=t.editing.mapper.toViewElement(c);e.scrollToTheSelection(),e.change(d=>{d.addClass("image__caption_highlighted",l)})}t.editing.view.focus()}),a})}}var xp=L(6816),_y={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(xp.c,_y),xp.c.locals;function Ep(o){const t=o.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function vy(o){return new Promise((t,e)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=Dp(i,n),s=r.replace("image/",""),a=new File([i],`image.${s}`,{type:r});t(a)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(s){return new Promise((a,c)=>{const l=q.document.createElement("img");l.addEventListener("load",()=>{const d=q.document.createElement("canvas");d.width=l.width,d.height=l.height,d.getContext("2d").drawImage(l,0,0),d.toBlob(h=>h?a(h):c())}),l.addEventListener("error",()=>c()),l.src=s})}(r).then(s=>{const a=Dp(s,r),c=a.replace("image/","");return new File([s],`image.${c}`,{type:a})})}(n).then(t).catch(e):e(i))})}function Dp(o,t){return o.type?o.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class yy extends z{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,n=i=>{const r=new o1(i),s=t.commands.get("uploadImage"),a=t.config.get("image.upload.types"),c=Ep(a);return r.set({acceptedType:a.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:e("Upload image from computer"),icon:J.imageUpload,tooltip:!0}),r.bind("isEnabled").to(s),r.on("done",(l,d)=>{const h=Array.from(d).filter(u=>c.test(u.type));h.length&&(t.execute("uploadImage",{file:h}),t.editing.view.focus())}),r};if(t.ui.componentFactory.add("uploadImage",n),t.ui.componentFactory.add("imageUpload",n),t.plugins.has("ImageInsertUI")){const i=t.plugins.get("ImageInsertUI"),r=t.commands.get("uploadImage");i.registerIntegration({name:"upload",observable:r,buttonViewCreator:()=>{const s=t.ui.componentFactory.create("uploadImage");return s.bind("label").to(i,"isImageSelected",a=>e(a?"Replace image from computer":"Upload image from computer")),s},formViewCreator:()=>{const s=t.ui.componentFactory.create("uploadImage");return s.withText=!0,s.bind("label").to(i,"isImageSelected",a=>e(a?"Replace from computer":"Upload from computer")),s.on("execute",()=>{i.dropdownView.isOpen=!1}),s}})}}}var Ip=L(2628),xy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Ip.c,xy),Ip.c.locals;var Tp=L(1652),Ey={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Tp.c,Ey),Tp.c.locals;var Sp=L(4164),Dy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Sp.c,Dy),Sp.c.locals;class Iy extends z{constructor(t){super(t),this.uploadStatusChange=(e,n,i)=>{const r=this.editor,s=n.item,a=s.getAttribute("uploadId");if(!i.consumable.consume(n.item,e.name))return;const c=r.plugins.get("ImageUtils"),l=r.plugins.get(Ne),d=a?n.attributeNewValue:null,h=this.placeholder,u=r.editing.mapper.toViewElement(s),g=i.writer;if(d=="reading")return Mp(u,g),void Bp(c,h,u,g);if(d=="uploading"){const p=l.loaders.get(a);return Mp(u,g),void(p?(Np(u,g),function(k,b,A,x){const M=function(O){const H=O.createUIElement("div",{class:"ck-progress-bar"});return O.setCustomProperty("progressBar",!0,H),H}(b);b.insert(b.createPositionAt(k,"end"),M),A.on("change:uploadedPercent",(O,H,Y)=>{x.change(et=>{et.setStyle("width",Y+"%",M)})})}(u,g,p,r.editing.view),function(k,b,A,x){if(x.data){const M=k.findViewImgElement(b);A.setAttribute("src",x.data,M)}}(c,u,g,p)):Bp(c,h,u,g))}d=="complete"&&l.loaders.get(a)&&function(p,k,b){const A=k.createUIElement("div",{class:"ck-image-upload-complete-icon"});k.insert(k.createPositionAt(p,"end"),A),setTimeout(()=>{b.change(x=>x.remove(x.createRangeOn(A)))},3e3)}(u,g,r.editing.view),function(p,k){Lp(p,k,"progressBar")}(u,g),Np(u,g),function(p,k){k.removeClass("ck-appear",p)}(u,g)},this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}init(){const t=this.editor;t.plugins.has("ImageBlockEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),t.plugins.has("ImageInlineEditing")&&t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function Mp(o,t){o.hasClass("ck-appear")||t.addClass("ck-appear",o)}function Bp(o,t,e,n){e.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",e);const i=o.findViewImgElement(e);i.getAttribute("src")!==t&&n.setAttribute("src",t,i),Pp(e,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const s=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,s),s}(n))}function Np(o,t){o.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",o),Lp(o,t,"placeholder")}function Pp(o,t){for(const e of o.getChildren())if(e.getCustomProperty(t))return e}function Lp(o,t,e){const n=Pp(o,e);n&&t.remove(t.createRangeOn(n))}var Ty=Object.defineProperty,Sy=Object.defineProperties,My=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,By=Object.prototype.hasOwnProperty,Ny=Object.prototype.propertyIsEnumerable,zp=(o,t,e)=>t in o?Ty(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;class Py extends nt{refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=Tt(t.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());e.forEach((s,a)=>{const c=n.getSelectedElement();if(a&&c&&i.isImage(c)){const l=this.editor.model.createPositionAfter(c);this._uploadImage(s,r,l)}else this._uploadImage(s,r)})}_uploadImage(t,e,n){const i=this.editor,r=i.plugins.get(Ne).createLoader(t),s=i.plugins.get("ImageUtils");var a,c;r&&s.insertImage((a=((l,d)=>{for(var h in d||(d={}))By.call(d,h)&&zp(l,h,d[h]);if(Op)for(var h of Op(d))Ny.call(d,h)&&zp(l,h,d[h]);return l})({},e),c={uploadId:r.id},Sy(a,My(c))),n)}}class Ly extends z{constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[Ne,qs,Be,oe]}static get pluginName(){return"ImageUploadEditing"}init(){const t=this.editor,e=t.model.document,n=t.conversion,i=t.plugins.get(Ne),r=t.plugins.get("ImageUtils"),s=t.plugins.get("ClipboardPipeline"),a=Ep(t.config.get("image.upload.types")),c=new Py(t);t.commands.add("uploadImage",c),t.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(l,d)=>{if(h=d.dataTransfer,Array.from(h.types).includes("text/html")&&h.getData("text/html")!=="")return;var h;const u=Array.from(d.dataTransfer.files).filter(g=>!!g&&a.test(g.type));u.length&&(l.stop(),t.model.change(g=>{d.targetRanges&&g.setSelection(d.targetRanges.map(p=>t.editing.mapper.toModelRange(p))),t.execute("uploadImage",{file:u})}))}),this.listenTo(s,"inputTransformation",(l,d)=>{const h=Array.from(t.editing.view.createRangeIn(d.content)).map(g=>g.item).filter(g=>function(p,k){return!(!p.isInlineImageView(k)||!k.getAttribute("src")||!k.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!k.getAttribute("src").match(/^blob:/g))}(r,g)&&!g.getAttribute("uploadProcessed")).map(g=>({promise:vy(g),imageElement:g}));if(!h.length)return;const u=new $e(t.editing.view.document);for(const g of h){u.setAttribute("uploadProcessed",!0,g.imageElement);const p=i.createLoader(g.promise);p&&(u.setAttribute("src","",g.imageElement),u.setAttribute("uploadId",p.id,g.imageElement))}}),t.editing.view.document.on("dragover",(l,d)=>{d.preventDefault()}),e.on("change",()=>{const l=e.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const h of l)if(h.type=="insert"&&h.name!="$text"){const u=h.position.nodeAfter,g=h.position.root.rootName=="$graveyard";for(const p of Oy(t,u)){const k=p.getAttribute("uploadId");if(!k)continue;const b=i.loaders.get(k);b&&(g?d.has(k)||b.abort():(d.add(k),this._uploadImageElements.set(k,p),b.status=="idle"&&this._readAndUpload(b)))}}}),this.on("uploadComplete",(l,{imageElement:d,data:h})=>{const u=h.urls?h.urls:h;this.editor.model.change(g=>{g.setAttribute("src",u.default,d),this._parseAndSetSrcsetAttributeOnImage(u,d,g),r.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(t){const e=this.editor,n=e.model,i=e.locale.t,r=e.plugins.get(Ne),s=e.plugins.get(qs),a=e.plugins.get("ImageUtils"),c=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","reading",c.get(t.id))}),t.read().then(()=>{const d=t.upload(),h=c.get(t.id);if(f.isSafari){const u=e.editing.mapper.toViewElement(h),g=a.findViewImgElement(u);e.editing.view.once("render",()=>{if(!g.parent)return;const p=e.editing.view.domConverter.mapViewToDom(g.parent);if(!p)return;const k=p.style.display;p.style.display="none",p._ckHack=p.offsetHeight,p.style.display=k})}return n.enqueueChange({isUndoable:!1},u=>{u.setAttribute("uploadStatus","uploading",h)}),d}).then(d=>{n.enqueueChange({isUndoable:!1},h=>{const u=c.get(t.id);h.setAttribute("uploadStatus","complete",u),this.fire("uploadComplete",{data:d,imageElement:u})}),l()}).catch(d=>{if(t.status!=="error"&&t.status!=="aborted")throw d;t.status=="error"&&d&&s.showWarning(d,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},h=>{h.remove(c.get(t.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},d=>{const h=c.get(t.id);d.removeAttribute("uploadId",h),d.removeAttribute("uploadStatus",h),c.delete(t.id)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const r=Object.keys(t).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return i=Math.max(i,a),!0}).map(s=>`${t[s]} ${s}w`).join(", ");if(r!=""){const s={srcset:r};e.hasAttribute("width")||e.hasAttribute("height")||(s.width=i),n.setAttributes(s,e)}}}function Oy(o,t){const e=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(t)).filter(n=>e.isImage(n.item)).map(n=>n.item)}var Rp=L(2876),zy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Rp.c,zy),Rp.c.locals;class Ry extends nt{constructor(t,e){super(t),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(e.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const t=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!t,this.isEnabled?t.hasAttribute("imageStyle")?this.value=t.getAttribute("imageStyle"):this.value=this._defaultStyles[t.name]:this.value=!1}execute(t={}){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils");n.change(r=>{const s=t.value,{setImageSizes:a=!0}=t;let c=i.getClosestSelectedImageElement(n.document.selection);s&&this.shouldConvertImageType(s,c)&&(this.editor.execute(i.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),c=i.getClosestSelectedImageElement(n.document.selection)),!s||this._styles.get(s).isDefault?r.removeAttribute("imageStyle",c):r.setAttribute("imageStyle",s,c),a&&i.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(t,e){return!this._styles.get(t).modelElements.includes(e.name)}}var jy=Object.defineProperty,jp=Object.getOwnPropertySymbols,Fy=Object.prototype.hasOwnProperty,Vy=Object.prototype.propertyIsEnumerable,Fp=(o,t,e)=>t in o?jy(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Vp=(o,t)=>{for(var e in t||(t={}))Fy.call(t,e)&&Fp(o,e,t[e]);if(jp)for(var e of jp(t))Vy.call(t,e)&&Fp(o,e,t[e]);return o};const{objectFullWidth:Uy,objectInline:Up,objectLeft:Hp,objectRight:ca,objectCenter:la,objectBlockLeft:qp,objectBlockRight:Gp}=J,lr={get inline(){return{name:"inline",title:"In line",icon:Up,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Hp,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:qp,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:la,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:ca,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Gp,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:la,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:ca,modelElements:["imageBlock"],className:"image-style-side"}}},Wp={full:Uy,left:qp,right:Gp,center:la,inlineLeft:Hp,inlineRight:ca,inline:Up},Kp=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function $p(o){W("image-style-configuration-definition-invalid",o)}const da={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(t=>function(e){return e=typeof e=="string"?lr[e]?Vp({},lr[e]):{name:e}:function(n,i){const r=Vp({},i);for(const s in n)Object.prototype.hasOwnProperty.call(i,s)||(r[s]=n[s]);return r}(lr[e.name],e),typeof e.icon=="string"&&(e.icon=Wp[e.icon]||e.icon),e}(t)).filter(t=>function(e,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:s}=e;if(!(r&&r.length&&s))return $p({style:e}),!1;{const a=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(c=>a.includes(c)))return W("image-style-missing-dependency",{style:e,missingPlugins:r.map(c=>c==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(t,o))},getDefaultStylesConfiguration:function(o,t){return o&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...Kp]:[]},warnInvalidStyle:$p,DEFAULT_OPTIONS:lr,DEFAULT_ICONS:Wp,DEFAULT_DROPDOWN_DEFINITIONS:Kp};function Yp(o,t){for(const e of t)if(e.name===o)return e}class Qp extends z{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[oe]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=da,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,r)),this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new Ry(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor,i=n.model.schema,r=(s=this.normalizedStyles,(c,l,d)=>{if(!d.consumable.consume(l.item,c.name))return;const h=Yp(l.attributeNewValue,s),u=Yp(l.attributeOldValue,s),g=d.mapper.toViewElement(l.item),p=d.writer;u&&p.removeClass(u.className,g),h&&p.addClass(h.className,g)});var s;const a=function(c){const l={imageInline:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageInline")),imageBlock:c.filter(d=>!d.isDefault&&d.modelElements.includes("imageBlock"))};return(d,h,u)=>{if(!h.modelRange)return;const g=h.viewItem,p=Ht(h.modelRange.getItems());if(p&&u.schema.checkAttribute(p,"imageStyle"))for(const k of l[p.name])u.consumable.consume(g,{classes:k.className})&&u.writer.setAttribute("imageStyle",k.name,p)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),t&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),e&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const t=this.editor,e=t.model.document,n=t.plugins.get(oe),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));e.registerPostFixer(r=>{let s=!1;for(const a of e.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let c=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!n.isImage(c))continue;const l=c.getAttribute("imageStyle");if(!l)continue;const d=i.get(l);d&&d.modelElements.includes(c.name)||(r.removeAttribute("imageStyle",c),s=!0)}return s})}}var Zp=L(9216),Hy={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Zp.c,Hy),Zp.c.locals;class qy extends z{static get requires(){return[Qp]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],n=Jp(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=Jp([...e.filter(ht),...da.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,i=>{let r;const{defaultItem:s,items:a,title:c}=t,l=a.filter(g=>e.find(({name:p})=>Xp(p)===g)).map(g=>{const p=n.create(g);return g===s&&(r=p),p});a.length!==l.length&&da.warnInvalidStyle({dropdown:t});const d=Ye(i,Ui),h=d.buttonView,u=h.arrowView;return zs(d,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:tm(c,r.label),class:null,tooltip:!0}),u.unbind("label"),u.set({label:c}),h.bind("icon").toMany(l,"isOn",(...g)=>{const p=g.findIndex(yn);return p<0?r.icon:l[p].icon}),h.bind("label").toMany(l,"isOn",(...g)=>{const p=g.findIndex(yn);return tm(c,p<0?r.label:l[p].label)}),h.bind("isOn").toMany(l,"isOn",(...g)=>g.some(yn)),h.bind("class").toMany(l,"isOn",(...g)=>g.some(yn)?"ck-splitbutton_flatten":void 0),h.on("execute",()=>{l.some(({isOn:g})=>g)?d.isOpen=!d.isOpen:r.fire("execute")}),d.bind("isEnabled").toMany(l,"isEnabled",(...g)=>g.some(yn)),this.listenTo(d,"execute",()=>{this.editor.editing.view.focus()}),d})}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(Xp(e),n=>{const i=this.editor.commands.get("imageStyle"),r=new ut(n);return r.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",s=>s===e),r.on("execute",this._executeCommand.bind(this,e)),r})}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function Jp(o,t){for(const e of o)t[e.title]&&(e.title=t[e.title]);return o}function Xp(o){return`imageStyle:${o}`}function tm(o,t){return(o?o+": ":"")+t}class Gy extends z{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new vl(t)),t.commands.add("outdent",new vl(t))}}class Wy extends z{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,n=t.t,i=e.uiLanguageDirection=="ltr"?J.indent:J.outdent,r=e.uiLanguageDirection=="ltr"?J.outdent:J.indent;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,r=>{const s=i.commands.get(t),a=new ut(r);return a.set({label:e,icon:n,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{i.execute(t),i.editing.view.focus()}),a})}}class Ky{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(e=>this._definitions.add(e)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(e,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref")||!n.item.is("selection")&&!i.schema.isInline(n.item))return;const r=i.writer,s=r.document.selection;for(const a of this._definitions){const c=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,c);for(const l in a.styles)r.setStyle(l,a.styles[l],c);r.setCustomProperty("link",!0,c),a.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(s.getFirstRange(),c):r.wrap(i.mapper.toViewRange(n.range),c):r.unwrap(i.mapper.toViewRange(n.range),c)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",(e,n,{writer:i,mapper:r})=>{const s=r.toViewElement(n.item),a=Array.from(s.getChildren()).find(c=>c.is("element","a"));for(const c of this._definitions){const l=Re(c.attributes);if(c.callback(n.attributeNewValue)){for(const[d,h]of l)d==="class"?i.addClass(h,a):i.setAttribute(d,h,a);c.classes&&i.addClass(c.classes,a);for(const d in c.styles)i.setStyle(d,c.styles[d],a)}else{for(const[d,h]of l)d==="class"?i.removeClass(h,a):i.removeAttribute(d,a);c.classes&&i.removeClass(c.classes,a);for(const d in c.styles)i.removeStyle(d,a)}}})}}}const $y=function(o,t,e){var n=o.length;return e=e===void 0?n:e,!t&&e>=n?o:Ll(o,t,e)};var Yy=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const em=function(o){return Yy.test(o)},Qy=function(o){return o.split("")};var nm="\\ud800-\\udfff",Zy="["+nm+"]",ha="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ua="\\ud83c[\\udffb-\\udfff]",om="[^"+nm+"]",im="(?:\\ud83c[\\udde6-\\uddff]){2}",rm="[\\ud800-\\udbff][\\udc00-\\udfff]",sm="(?:"+ha+"|"+ua+")?",am="[\\ufe0e\\ufe0f]?",Jy=am+sm+("(?:\\u200d(?:"+[om,im,rm].join("|")+")"+am+sm+")*"),Xy="(?:"+[om+ha+"?",ha,im,rm,Zy].join("|")+")",t2=RegExp(ua+"(?="+ua+")|"+Xy+Jy,"g");const e2=function(o){return o.match(t2)||[]},n2=function(o){return em(o)?e2(o):Qy(o)},o2=function(o){return function(t){t=is(t);var e=em(t)?n2(t):void 0,n=e?e[0]:t.charAt(0),i=e?$y(e,1).join(""):t.slice(1);return n[o]()+i}}("toUpperCase"),i2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,r2=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,s2=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,a2=/^((\w+:(\/{2,})?)|(\W))/i,ga="Ctrl+K";function cm(o,{writer:t}){const e=t.createAttributeElement("a",{href:o},{priority:5});return t.setCustomProperty("link",!0,e),e}function lm(o){const t=String(o);return function(e){return!!e.replace(i2,"").match(r2)}(t)?t:"#"}function pa(o,t){return!!o&&t.checkAttribute(o.name,"linkHref")}function ma(o,t){const e=(n=o,s2.test(n)?"mailto:":t);var n;const i=!!e&&!dm(o);return o&&i?e+o:o}function dm(o){return a2.test(o)}function hm(o){window.open(o,"_blank","noopener")}class c2 extends nt{constructor(){super(...arguments),this.manualDecorators=new xe,this.automaticDecorators=new Ky}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement()||Ht(e.getSelectedBlocks());pa(n,t.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(n,"linkHref")):(this.value=e.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(t,e={}){const n=this.editor.model,i=n.document.selection,r=[],s=[];for(const a in e)e[a]?r.push(a):s.push(a);n.change(a=>{if(i.isCollapsed){const c=i.getFirstPosition();if(i.hasAttribute("linkHref")){const l=um(i);let d=Ji(c,"linkHref",i.getAttribute("linkHref"),n);i.getAttribute("linkHref")===l&&(d=this._updateLinkContent(n,a,d,t)),a.setAttribute("linkHref",t,d),r.forEach(h=>{a.setAttribute(h,!0,d)}),s.forEach(h=>{a.removeAttribute(h,d)}),a.setSelection(a.createPositionAfter(d.end.nodeBefore))}else if(t!==""){const l=Re(i.getAttributes());l.set("linkHref",t),r.forEach(h=>{l.set(h,!0)});const{end:d}=n.insertContent(a.createText(t,l),c);a.setSelection(d)}["linkHref",...r,...s].forEach(l=>{a.removeSelectionAttribute(l)})}else{const c=n.schema.getValidRanges(i.getRanges(),"linkHref"),l=[];for(const h of i.getSelectedBlocks())n.schema.checkAttribute(h,"linkHref")&&l.push(a.createRangeOn(h));const d=l.slice();for(const h of c)this._isRangeToUpdate(h,l)&&d.push(h);for(const h of d){let u=h;if(d.length===1){const g=um(i);i.getAttribute("linkHref")===g&&(u=this._updateLinkContent(n,a,h,t),a.setSelection(a.createSelection(u)))}a.setAttribute("linkHref",t,u),r.forEach(g=>{a.setAttribute(g,!0,u)}),s.forEach(g=>{a.removeAttribute(g,u)})}}})}_getDecoratorStateFromModel(t){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();return pa(i,e.schema)?i.getAttribute(t):n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e)if(n.containsRange(t))return!1;return!0}_updateLinkContent(t,e,n,i){const r=e.createText(i,{linkHref:i});return t.insertContent(r,n)}}function um(o){if(o.isCollapsed){const t=o.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(o.getFirstRange().getItems());if(t.length>1)return null;const e=t[0];return e.is("$text")||e.is("$textProxy")?e.data:null}}class l2 extends nt{refresh(){const t=this.editor.model,e=t.document.selection,n=e.getSelectedElement();pa(n,t.schema)?this.isEnabled=t.schema.checkAttribute(n,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,n=e.document.selection,i=t.commands.get("link");e.change(r=>{const s=n.isCollapsed?[Ji(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const a of s)if(r.removeAttribute("linkHref",a),i)for(const c of i.manualDecorators)r.removeAttribute(c.id,a)})}}class d2 extends ct(){constructor({id:t,label:e,attributes:n,classes:i,styles:r,defaultValue:s}){super(),this.id=t,this.set("value",void 0),this.defaultValue=s,this.label=e,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var gm=L(8836),h2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(gm.c,h2),gm.c.locals;var u2=Object.defineProperty,pm=Object.getOwnPropertySymbols,g2=Object.prototype.hasOwnProperty,p2=Object.prototype.propertyIsEnumerable,mm=(o,t,e)=>t in o?u2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,m2=(o,t)=>{for(var e in t||(t={}))g2.call(t,e)&&mm(o,e,t[e]);if(pm)for(var e of pm(t))p2.call(t,e)&&mm(o,e,t[e]);return o};const fm="automatic",f2=/^(https?:)?\/\//;class km extends z{static get pluginName(){return"LinkEditing"}static get requires(){return[Gu,Ru,Be]}constructor(t){super(t),t.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:cm}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>cm(lm(n),i)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),t.commands.add("link",new c2(t)),t.commands.add("unlink",new l2(t));const e=function(n,i){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(s=>("label"in s&&r[s.label]&&(s.label=r[s.label]),s)),i}(t.t,function(n){const i=[];if(n)for(const[r,s]of Object.entries(n)){const a=Object.assign({},s,{id:`link${o2(r)}`});i.push(a)}return i}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(n=>n.mode===fm)),this._enableManualDecorators(e.filter(n=>n.mode==="manual")),t.plugins.get(Gu).registerAttribute("linkHref"),function(n,i,r,s){const a=n.editing.view,c=new Set;a.document.registerPostFixer(l=>{const d=n.model.document.selection;let h=!1;if(d.hasAttribute(i)){const u=Ji(d.getFirstPosition(),i,d.getAttribute(i),n.model),g=n.editing.mapper.toViewRange(u);for(const p of g.getItems())p.is("element",r)&&!p.hasClass(s)&&(l.addClass(s,p),c.add(p),h=!0)}return h}),n.conversion.for("editingDowncast").add(l=>{function d(){a.change(h=>{for(const u of c.values())h.removeClass(s,u),c.delete(u)})}l.on("insert",d,{priority:"highest"}),l.on("remove",d,{priority:"highest"}),l.on("attribute",d,{priority:"highest"}),l.on("selection",d,{priority:"highest"})})}(t,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor,n=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:fm,callback:i=>!!i&&f2.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(t),n.length&&e.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,n=e.commands.get("link").manualDecorators;t.forEach(i=>{e.model.schema.extend("$text",{allowAttributes:i.id});const r=new d2(i);n.add(r),e.conversion.for("downcast").attributeToElement({model:r.id,view:(s,{writer:a,schema:c},{item:l})=>{if((l.is("selection")||c.isInline(l))&&s){const d=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,d);for(const h in r.styles)a.setStyle(h,r.styles[h],d);return a.setCustomProperty("link",!0,d),d}}}),e.conversion.for("upcast").elementToAttribute({view:m2({name:"a"},r._createPattern()),model:{key:r.id}})})}_enableLinkOpen(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(n,i)=>{if(!(f.isMac?i.domEvent.metaKey:i.domEvent.ctrlKey))return;let r=i.domTarget;if(r.tagName.toLowerCase()!="a"&&(r=r.closest("a")),!r)return;const s=r.getAttribute("href");s&&(n.stop(),i.preventDefault(),hm(s))},{context:"$capture"}),this.listenTo(e,"keydown",(n,i)=>{const r=t.commands.get("link").value;r&&i.keyCode===rt.enter&&i.altKey&&(n.stop(),hm(r))})}_enableSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(e,"change:attribute",(n,{attributeKeys:i})=>{i.includes("linkHref")&&!e.hasAttribute("linkHref")&&t.change(r=>{var s;(function(a,c){a.removeSelectionAttribute("linkHref");for(const l of c)a.removeSelectionAttribute(l)})(r,(s=t.schema,s.getDefinition("$text").allowAttributes.filter(a=>a.startsWith("link"))))})})}_enableClipboardIntegration(){const t=this.editor,e=t.model,n=this.editor.config.get("link.defaultProtocol");n&&this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",(i,r)=>{e.change(s=>{const a=s.createRangeIn(r.content);for(const c of a.getItems())if(c.hasAttribute("linkHref")){const l=ma(c.getAttribute("linkHref"),n);s.setAttribute("linkHref",l,c)}})})}}var bm=L(8408),k2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(bm.c,k2),bm.c.locals;class b2 extends ${constructor(t,e){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me;const n=t.t;this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),m({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new _i(this.locale,Hi);return e.label=t("Link URL"),e}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new Ai(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,t],"value",(r,s)=>s===void 0&&r===void 0?!!n.defaultValue:!!r),i.on("execute",()=>{n.set("value",!i.isOn)}),e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const n=new $;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(n)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}var wm=L(9796),w2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(wm.c,w2),wm.c.locals;class A2 extends ${constructor(t){super(t),this.focusTracker=new Kt,this.keystrokes=new Jt,this._focusables=new me;const e=t.t;this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),J.pencil,"edit"),this.set("href",void 0),this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new ut(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const t=new ut(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",i=>i&&lm(i)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",i=>i||n("This link has no URL")),t.bind("isEnabled").to(this,"href",i=>!!i),t.template.tag="a",t.template.eventListeners={},t}}const Ue="link-ui";class C2 extends z{constructor(){super(...arguments),this.actionsView=null,this.formView=null}static get requires(){return[Ki]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(TC),this._balloon=t.plugins.get(Ki),this._createToolbarLinkButton(),this._enableBalloonActivators(),t.conversion.for("editingDowncast").markerToHighlight({model:Ue,view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:Ue,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor,e=new A2(t.locale),n=t.commands.get("link"),i=t.commands.get("unlink");return e.bind("href").to(n,"value"),e.editButtonView.bind("isEnabled").to(n),e.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(r,s)=>{this._hideUI(),s()}),e.keystrokes.set(ga,(r,s)=>{this._addFormView(),s()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),n=t.config.get("link.defaultProtocol"),i=t.config.get("link.allowCreatingEmptyLinks"),r=new(D(b2))(t.locale,e);return r.urlInputView.fieldView.bind("value").to(e,"value"),r.urlInputView.bind("isEnabled").to(e,"isEnabled"),r.saveButtonView.bind("isEnabled").to(e,"isEnabled",r.urlInputView,"isEmpty",(s,a)=>s&&(i||!a)),this.listenTo(r,"submit",()=>{const{value:s}=r.urlInputView.fieldView.element,a=ma(s,n);t.execute("link",a,r.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(r,"cancel",()=>{this._closeFormView()}),r.keystrokes.set("Esc",(s,a)=>{this._closeFormView(),a()}),r}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),n=t.t;t.ui.componentFactory.add("link",i=>{const r=new ut(i);return r.isEnabled=!0,r.label=n("Link"),r.icon='',r.keystroke=ga,r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(e,"isEnabled"),r.bind("isOn").to(e,"value",s=>!!s),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_enableBalloonActivators(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),t.keystrokes.set(ga,(n,i)=>{i(),t.commands.get("link").isEnabled&&this._showUI(!0)})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),E({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=t.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),t.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let n=this._getSelectedLinkElement(),i=s();const r=()=>{const a=this._getSelectedLinkElement(),c=s();n&&!a||!n&&c!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=a,i=c};function s(){return e.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(t.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return!!this.formView&&t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,n=t.document;let i;if(e.markers.has(Ue)){const r=Array.from(this.editor.editing.mapper.markerNameToElements(Ue)),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));i=t.domConverter.viewRangeToDom(s)}else i=()=>{const r=this._getSelectedLinkElement();return r?t.domConverter.mapViewToDom(r):t.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection,n=e.getSelectedElement();if(e.isCollapsed||n&&Ft(n))return fa(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),r=fa(i.start),s=fa(i.end);return r&&r==s&&t.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(Ue))e.updateMarker(Ue,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!t.schema.isContent(r),{boundaries:n});e.addMarker(Ue,{usingOperation:!1,affectsData:!1,range:e.createRange(i,n.end)})}else e.addMarker(Ue,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has(Ue)&&t.change(e=>{e.removeMarker(Ue)})}}function fa(o){return o.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})||null}const Am=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class _2 extends z{static get requires(){return[Qe,km]}static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(t,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?Ji(e,"linkHref",e.textNode.getAttribute("linkHref"),t):null}_selectEntireLinks(t,e){const n=this.editor.model,i=n.document.selection,r=i.getFirstPosition(),s=i.getLastPosition();let a=e.getJoined(this._expandLinkRange(n,r)||e);a&&(a=a.getJoined(this._expandLinkRange(n,s)||e)),a&&(a.start.isBefore(r)||a.end.isAfter(s))&&t.setSelection(a)}_enablePasteLinking(){const t=this.editor,e=t.model,n=e.document.selection,i=t.plugins.get("ClipboardPipeline"),r=t.commands.get("link");i.on("inputTransformation",(s,a)=>{if(!this.isEnabled||!r.isEnabled||n.isCollapsed||a.method!=="paste"||n.rangeCount>1)return;const c=n.getFirstRange(),l=a.dataTransfer.getData("text/plain");if(!l)return;const d=l.match(Am);d&&d[2]===l&&(e.change(h=>{this._selectEntireLinks(h,c),r.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const t=this.editor,e=new qu(t.model,n=>{if(!function(r){return r.length>4&&r[r.length-1]===" "&&r[r.length-2]!==" "}(n))return;const i=Cm(n.substr(0,n.length-1));return i?{url:i}:void 0});e.on("matched:data",(n,i)=>{const{batch:r,range:s,url:a}=i;if(!r.isTyping)return;const c=s.end.getShiftedBy(-1),l=c.getShiftedBy(-a.length),d=t.model.createRange(l,c);this._applyAutoLink(a,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("enter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=e.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,n=t.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=e.document.selection.getFirstPosition(),r=e.createRange(e.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:n,range:i}=Hu(t,e),r=Cm(n);if(r){const s=e.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,s)}}_applyAutoLink(t,e){const n=this.editor.model,i=ma(t,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(r,s){return s.schema.checkAttributeInSelection(s.createSelection(r),"linkHref")}(e,n)&&dm(i)&&!function(r){const s=r.start.nodeAfter;return!!s&&s.hasAttribute("linkHref")}(e)&&this._persistAutoLink(i,e)}_persistAutoLink(t,e){const n=this.editor.model,i=this.editor.plugins.get("Delete");n.enqueueChange(r=>{r.setAttribute("linkHref",t,e),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function Cm(o){const t=Am.exec(o);return t?t[2]:null}var _m=L(5064),v2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(_m.c,v2),_m.c.locals;class we{constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=Tt(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){return Ht(new this(t,e)[Symbol.iterator]())}*[Symbol.iterator](){const t=[];for(const{node:e}of ti(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(i=>e.getAttribute(i)!==this._startElement.getAttribute(i)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*ti(o,t="forward"){const e=t=="forward",n=[];let i=null;for(;Gt(o);){let r=null;if(i){const s=o.getAttribute("listIndent"),a=i.getAttribute("listIndent");s>a?n[a]=i:st in o?x2(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,ka=(o,t)=>{for(var e in t||(t={}))I2.call(t,e)&&ym(o,e,t[e]);if(vm)for(var e of vm(t))T2.call(t,e)&&ym(o,e,t[e]);return o},ba=(o,t)=>E2(o,D2(t));class lo{static next(){return Q()}}function Gt(o){return!!o&&o.is("element")&&o.hasAttribute("listItemId")}function wa(o,t={}){return[...hn(o,ba(ka({},t),{direction:"backward"})),...hn(o,ba(ka({},t),{direction:"forward"}))]}function hn(o,t={}){const e=t.direction=="forward",n=Array.from(new we(o,ba(ka({},t),{includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"})));return e?n:n.reverse()}function xm(o){const t=new we(o,{sameIndent:!0,sameAttributes:"listType"}),e=new we(o,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward"});return[...Array.from(t).reverse(),...e]}function Nn(o){return!we.first(o,{sameIndent:!0,sameAttributes:"listItemId"})}function Em(o){return!we.first(o,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function ei(o,t={}){o=Tt(o);const e=t.withNested!==!1,n=new Set;for(const i of o)for(const r of wa(i,{higherIndent:e}))n.add(r);return Pn(n)}function S2(o){o=Tt(o);const t=new Set;for(const e of o)for(const n of xm(e))t.add(n);return Pn(t)}function Aa(o,t){const e=hn(o,{direction:"forward"}),n=lo.next();for(const i of e)t.setAttribute("listItemId",n,i);return e}function Ca(o,t,e){const n={};for(const[r,s]of t.getAttributes())r.startsWith("list")&&(n[r]=s);const i=hn(o,{direction:"forward"});for(const r of i)e.setAttributes(n,r);return i}function _a(o,t,{expand:e,indentBy:n=1}={}){o=Tt(o);const i=e?ei(o):o;for(const r of i){const s=r.getAttribute("listIndent")+n;s<0?dr(r,t):t.setAttribute("listIndent",s,r)}return i}function dr(o,t){o=Tt(o);for(const e of o)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of o)for(const n of e.getAttributeKeys())n.startsWith("list")&&t.removeAttribute(n,e);return o}function ni(o){if(!o.length)return!1;const t=o[0].getAttribute("listItemId");return!!t&&!o.some(e=>e.getAttribute("listItemId")!=t)}function Pn(o){return Array.from(o).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function oi(o){const t=o.document.selection.getSelectedElement();return t&&o.schema.isObject(t)&&o.schema.isBlock(t)?t:null}function va(o,t){return t.checkChild(o.parent,"listItem")&&t.checkChild(o,"$text")&&!t.isObject(o)}function M2(o,t,e){return hn(t,{direction:"forward"}).pop().index>o.index?Ca(o,t,e):[]}class Dm extends nt{constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=Im(t.document.selection);t.change(n=>{const i=[];ni(e)&&!Nn(e[0])?(this._direction=="forward"&&i.push(..._a(e,n)),i.push(...Aa(e[0],n))):this._direction=="forward"?i.push(..._a(e,n,{expand:!0})):i.push(...function(r,s){const a=ei(r=Tt(r)),c=new Set,l=Math.min(...a.map(h=>h.getAttribute("listIndent"))),d=new Map;for(const h of a)d.set(h,we.first(h,{lowerIndent:!0}));for(const h of a){if(c.has(h))continue;c.add(h);const u=h.getAttribute("listIndent")-1;if(u<0)dr(h,s);else{if(h.getAttribute("listIndent")==l){const g=M2(h,d.get(h),s);for(const p of g)c.add(p);if(g.length)continue}s.setAttribute("listIndent",u,h)}}return Pn(c)}(e,n));for(const r of i){if(!r.hasAttribute("listType"))continue;const s=we.first(r,{sameIndent:!0});s&&n.setAttribute("listType",s.getAttribute("listType"),r)}this._fireAfterExecute(i)})}_fireAfterExecute(t){this.fire("afterExecute",Pn(new Set(t)))}_checkEnabled(){let t=Im(this.editor.model.document.selection),e=t[0];if(!e)return!1;if(this._direction=="backward"||ni(t)&&!Nn(t[0]))return!0;t=ei(t),e=t[0];const n=we.first(e,{sameIndent:!0});return!!n&&n.getAttribute("listType")==e.getAttribute("listType")}}function Im(o){const t=Array.from(o.getSelectedBlocks()),e=t.findIndex(n=>!Gt(n));return e!=-1&&(t.length=e),t}class Tm extends nt{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,n=e.document,i=oi(e),r=Array.from(n.selection.getSelectedBlocks()).filter(a=>e.schema.checkAttribute(a,"listType")||va(a,e.schema)),s=t.forceValue!==void 0?!t.forceValue:this.value;e.change(a=>{if(s){const c=r[r.length-1],l=hn(c,{direction:"forward"}),d=[];l.length>1&&d.push(...Aa(l[1],a)),d.push(...dr(r,a)),d.push(...function(h,u){const g=[];let p=Number.POSITIVE_INFINITY;for(const{node:k}of ti(h.nextSibling,"forward")){const b=k.getAttribute("listIndent");if(b==0)break;b{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(n,t),c=s.getAttribute("listIndent")||0,l=a.getAttribute("listIndent"),d=a.getAttribute("listItemId");if(c!=l){const u=(h=a,Array.from(new we(h,{direction:"forward",higherIndent:!0})));i.push(..._a([a,...u],r,{indentBy:c-l,expand:c{const e=Aa(this._getStartBlock(),t);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",Pn(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&Gt(e)&&!Nn(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?t:t.nextSibling}}class B2 extends z{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(t){return S2(t)}isFirstBlockOfListItem(t){return Nn(t)}isListItemBlock(t){return Gt(t)}expandListBlocksToCompleteItems(t,e={}){return ei(t,e)}}function Bm(o){return o.is("element","ol")||o.is("element","ul")}function hr(o){return o.is("element","li")}function N2(o,t,e,n=Pm(e,t)){return o.createAttributeElement(Nm(e),null,{priority:2*t/100-100,id:n})}function P2(o,t,e){return o.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function Nm(o){return o=="numbered"?"ol":"ul"}function Pm(o,t){return`list-${o}-${t}`}function Pe(o,t){const e=o.nodeBefore;if(Gt(e)){let n=e;for(const{node:i}of ti(n,"backward"))if(n=i,t.has(n))return;t.set(e,n)}else{const n=o.nodeAfter;Gt(n)&&t.set(n,n)}}function L2(){return(o,t,e)=>{const{writer:n,schema:i}=e;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(h=>i.checkAttribute(h,"listItemId"));if(!r.length)return;const s=lo.next(),a=function(h){let u=0,g=h.parent;for(;g;){if(hr(g))u++;else{const p=g.previousSibling;p&&hr(p)&&u++}g=g.parent}return u}(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");l&&(c=l);const d={listItemId:s,listIndent:a,listType:c};for(const h of r)h.hasAttribute("listItemId")||n.setAttributes(d,h);r.length>1&&r[1].getAttribute("listItemId")!=d.listItemId&&e.keepEmptyElement(r[0])}}function Lm(){return(o,t,e)=>{if(!e.consumable.test(t.viewItem,{name:!0}))return;const n=new $e(t.viewItem.document);for(const i of Array.from(t.viewItem.getChildren()))hr(i)||Bm(i)||n.remove(i)}}function Om(o,t,e,{dataPipeline:n}={}){const i=function(r){return(s,a)=>{const c=[];for(const l of r)s.hasAttribute(l)&&c.push(`attribute:${l}`);return!!c.every(l=>a.test(s,l)!==!1)&&(c.forEach(l=>a.consume(s,l)),!0)}}(o);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a,h=s.item;if(!o.includes(s.attributeKey)||!i(h,d))return;const u=function(p,k,b){const A=b.createRangeOn(p);return k.toViewRange(A).getTrimmed().end.nodeBefore}(h,l,e);(function(p,k,b){for(;p.parent.is("attributeElement")&&p.parent.getCustomProperty("listItemWrapper");)k.unwrap(k.createRangeIn(p.parent),p.parent);const A=k.createPositionBefore(p).getWalker({direction:"backward"}),x=[];for(const{item:M}of A){if(M.is("element")&&b.toModelElement(M))break;M.is("element")&&M.getCustomProperty("listItemMarker")&&x.push(M)}for(const M of x)k.remove(M)})(u,c,l),function(p,k){let b=p.parent;for(;b.is("attributeElement")&&["ul","ol","li"].includes(b.name);){const A=b.parent;k.unwrap(k.createRangeOn(p),b),b=A}}(u,c);const g=function(p,k,b,A,{dataPipeline:x}){let M=A.createRangeOn(k);if(!Nn(p))return M;for(const O of b){if(O.scope!="itemMarker")continue;const H=O.createElement(A,p,{dataPipeline:x});if(!H||(A.setCustomProperty("listItemMarker",!0,H),A.insert(M.start,H),M=A.createRange(A.createPositionBefore(H),A.createPositionAfter(k)),!O.createWrapperElement||!O.canWrapElement))continue;const Y=O.createWrapperElement(A,p,{dataPipeline:x});A.setCustomProperty("listItemWrapper",!0,Y),O.canWrapElement(p)?M=A.wrap(M,Y):(M=A.wrap(A.createRangeOn(H),Y),M=A.createRange(M.start,A.createPositionAfter(k)))}return M}(h,u,t,c,{dataPipeline:n});(function(p,k,b,A){if(!p.hasAttribute("listIndent"))return;const x=p.getAttribute("listIndent");let M=p;for(let O=x;O>=0;O--){const H=P2(A,O,M.getAttribute("listItemId")),Y=N2(A,O,M.getAttribute("listType"));for(const et of b)et.scope!="list"&&et.scope!="item"||!M.hasAttribute(et.attributeName)||et.setAttributeOnDowncast(A,M.getAttribute(et.attributeName),et.scope=="list"?Y:H);if(k=A.wrap(k,H),k=A.wrap(k,Y),O==0||(M=we.first(M,{lowerIndent:!0}),!M))break}})(h,g,t,c)}}function zm(o,{dataPipeline:t}={}){return(e,{writer:n})=>{if(!Rm(e,o))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const i=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,i),i}}function Rm(o,t,e=wa(o)){if(!Gt(o))return!1;for(const n of o.getAttributeKeys())if(!n.startsWith("selection:")&&!t.includes(n))return!1;return e.length<2}var jm=L(2483),O2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(jm.c,O2),jm.c.locals;var Fm=L(2984),z2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Fm.c,z2),Fm.c.locals;const ur=["listType","listIndent","listItemId"];class R2 extends z{constructor(t){super(t),this._downcastStrategies=[],t.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get requires(){return[Xi,Qe,B2,Be]}init(){const t=this.editor,e=t.model,n=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new _("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:ur}),n?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const i of ur)e.schema.setAttributeProperties(i,{copyOnReplace:!0});t.commands.add("numberedList",new Tm(t,"numbered")),t.commands.add("bulletedList",new Tm(t,"bulleted")),t.commands.add("indentList",new Dm(t,"forward")),t.commands.add("outdentList",new Dm(t,"backward")),t.commands.add("splitListItemBefore",new Mm(t,"before")),t.commands.add("splitListItemAfter",new Mm(t,"after")),n&&(t.commands.add("mergeListItemBackward",new Sm(t,"backward")),t.commands.add("mergeListItemForward",new Sm(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),n=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),n&&n.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...ur,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),n=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(i,r)=>{const s=t.model.document.selection;oi(t.model)||t.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&r.direction=="backward"){if(!a.isAtStart)return;const c=a.parent;if(!Gt(c))return;if(we.first(c,{sameAttributes:"listType",sameIndent:!0})||c.getAttribute("listIndent")!==0){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:Vm(t.model,"backward")})}else Em(c)||t.execute("splitListItemAfter"),t.execute("outdentList");r.preventDefault(),i.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:Vm(t.model,"forward")}),r.preventDefault(),i.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,n=t.commands,i=n.get("enter");this.listenTo(t.editing.view.document,"enter",(r,s)=>{const a=e.document,c=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&Gt(c)&&c.isEmpty&&!s.isSoft){const l=Nn(c),d=Em(c);l&&d?(t.execute("outdentList"),s.preventDefault(),r.stop()):l&&!d?(t.execute("splitListItemAfter"),s.preventDefault(),r.stop()):d&&(t.execute("splitListItemBefore"),s.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(i,"afterExecute",()=>{const r=n.get("splitListItemBefore");r.refresh(),r.isEnabled&&wa(t.model.document.selection.getLastPosition().parent).length===2&&r.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(e,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(t.execute(i),n.stopPropagation(),n.preventDefault(),e.stop())},{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,n=this.getListAttributeNames(),i=t.config.get("list.multiBlock"),r=i?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(s,{writer:a})=>a.createElement(r,{listType:""})}).elementToElement({view:"p",model:(s,{writer:a})=>s.parent&&s.parent.is("element","li")?a.createElement(r,{listType:""}):null,converterPriority:"high"}).add(s=>{s.on("element:li",L2()),s.on("element:ul",Lm(),{priority:"high"}),s.on("element:ol",Lm(),{priority:"high"})}),i||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:r,view:zm(n),converterPriority:"high"}).add(s=>{s.on("attribute",Om(n,this._downcastStrategies,e))}),t.conversion.for("dataDowncast").elementToElement({model:r,view:zm(n,{dataPipeline:!0}),converterPriority:"high"}).add(s=>{s.on("attribute",Om(n,this._downcastStrategies,e,{dataPipeline:!0}))}),this.listenTo(e.document,"change:data",function(s,a,c,l){return()=>{const g=s.document.differ.getChanges(),p=[],k=new Map,b=new Set;for(const A of g)if(A.type=="insert"&&A.name!="$text")Pe(A.position,k),A.attributes.has("listItemId")?b.add(A.position.nodeAfter):Pe(A.position.getShiftedBy(A.length),k);else if(A.type=="remove"&&A.attributes.has("listItemId"))Pe(A.position,k);else if(A.type=="attribute"){const x=A.range.start.nodeAfter;c.includes(A.attributeKey)?(Pe(A.range.start,k),A.attributeNewValue===null?(Pe(A.range.start.getShiftedBy(1),k),h(x)&&p.push(x)):b.add(x)):Gt(x)&&h(x)&&p.push(x)}for(const A of k.values())p.push(...d(A,b));for(const A of new Set(p))a.reconvertItem(A)};function d(g,p){const k=[],b=new Set,A=[];for(const{node:x,previous:M}of ti(g,"forward")){if(b.has(x))continue;const O=x.getAttribute("listIndent");M&&Oc.includes(Y)));const H=hn(x,{direction:"forward"});for(const Y of H)b.add(Y),(h(Y,H)||u(Y,A,p))&&k.push(Y)}return k}function h(g,p){const k=a.mapper.toViewElement(g);if(!k)return!1;if(l.fire("checkElement",{modelElement:g,viewElement:k}))return!0;if(!g.is("element","paragraph")&&!g.is("element","listItem"))return!1;const b=Rm(g,c,p);return!(!b||!k.is("element","p"))||!(b||!k.is("element","span"))}function u(g,p,k){if(k.has(g))return!1;const b=a.mapper.toViewElement(g);let A=p.length-1;for(let x=b.parent;!x.is("editableElement");x=x.parent){const M=hr(x),O=Bm(x);if(!O&&!M)continue;const H="checkAttributes:"+(M?"item":"list");if(l.fire(H,{viewElement:x,modelAttributes:p[A]}))break;if(O&&(A--,A<0))return!1}return!0}}(e,t.editing,n,this),{priority:"high"}),this.on("checkAttributes:item",(s,{viewElement:a,modelAttributes:c})=>{a.id!=c.listItemId&&(s.return=!0,s.stop())}),this.on("checkAttributes:list",(s,{viewElement:a,modelAttributes:c})=>{a.name==Nm(c.listType)&&a.id==Pm(c.listType,c.listIndent)||(s.return=!0,s.stop())})}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer(n=>function(i,r,s,a){const c=i.document.differ.getChanges(),l=new Map,d=a.editor.config.get("list.multiBlock");let h=!1;for(const g of c){if(g.type=="insert"&&g.name!="$text"){const p=g.position.nodeAfter;if(!i.schema.checkAttribute(p,"listItemId"))for(const k of Array.from(p.getAttributeKeys()))s.includes(k)&&(r.removeAttribute(k,p),h=!0);Pe(g.position,l),g.attributes.has("listItemId")||Pe(g.position.getShiftedBy(g.length),l);for(const{item:k,previousPosition:b}of i.createRangeIn(p))Gt(k)&&Pe(b,l)}else g.type=="remove"?Pe(g.position,l):g.type=="attribute"&&s.includes(g.attributeKey)&&(Pe(g.range.start,l),g.attributeNewValue===null&&Pe(g.range.start.getShiftedBy(1),l));if(!d&&g.type=="attribute"&&ur.includes(g.attributeKey)){const p=g.range.start.nodeAfter;g.attributeNewValue===null&&p&&p.is("element","listItem")?(r.rename(p,"paragraph"),h=!0):g.attributeOldValue===null&&p&&p.is("element")&&p.name!="listItem"&&(r.rename(p,"listItem"),h=!0)}}const u=new Set;for(const g of l.values())h=a.fire("postFixer",{listNodes:new y2(g),listHead:g,writer:r,seenIds:u})||h;return h}(t,n,e,this)),this.on("postFixer",(n,{listNodes:i,writer:r})=>{n.return=function(s,a){let c=0,l=-1,d=null,h=!1;for(const{node:u}of s){const g=u.getAttribute("listIndent");if(g>c){let p;d===null?(d=g-c,p=c):(d>g&&(d=g),p=g-d),p>l+1&&(p=l+1),a.setAttribute("listIndent",p,u),h=!0,l=p}else d=null,c=g+1,l=g}return h}(i,r)||n.return},{priority:"high"}),this.on("postFixer",(n,{listNodes:i,writer:r,seenIds:s})=>{n.return=function(a,c,l){const d=new Set;let h=!1;for(const{node:u}of a){if(d.has(u))continue;let g=u.getAttribute("listType"),p=u.getAttribute("listItemId");if(c.has(p)&&(p=lo.next()),c.add(p),u.is("element","listItem"))u.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,u),h=!0);else for(const k of hn(u,{direction:"forward"}))d.add(k),k.getAttribute("listType")!=g&&(p=lo.next(),g=k.getAttribute("listType")),k.getAttribute("listItemId")!=p&&(l.setAttribute("listItemId",p,k),h=!0)}return h}(i,s,r)||n.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(n){return(i,[r,s])=>{const a=r.is("documentFragment")?Array.from(r.getChildren()):[r];if(!a.length)return;const c=(s?n.createSelection(s):n.document.selection).getFirstPosition();let l;if(Gt(c.parent))l=c.parent;else{if(!Gt(c.nodeBefore))return;l=c.nodeBefore}n.change(d=>{const h=l.getAttribute("listType"),u=l.getAttribute("listIndent"),g=a[0].getAttribute("listIndent")||0,p=Math.max(u-g,0);for(const k of a){const b=Gt(k);l.is("element","listItem")&&k.is("element","paragraph")&&d.rename(k,"listItem"),d.setAttributes({listIndent:(b?k.getAttribute("listIndent"):0)+p,listItemId:b?k.getAttribute("listItemId"):lo.next(),listType:h},k)}})}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",(n,i)=>{t.change(r=>{const s=Array.from(i.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every(Gt)&&r.remove(a),i.method=="copy"||i.method=="cut"){const c=Array.from(i.content.getChildren());ni(c)&&dr(c,r)}})})}}function Vm(o,t){const e=o.document.selection;if(!e.isCollapsed)return!oi(o);if(t==="forward")return!0;const n=e.getFirstPosition().parent,i=n.previousSibling;return!o.schema.isObject(i)&&(!!i.isEmpty||ni([n,i]))}function Um(o,t,e,n){o.ui.componentFactory.add(t,i=>{const r=o.commands.get(t),s=new ut(i);return s.set({label:e,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{o.execute(t),o.editing.view.focus()}),s})}class j2 extends z{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;Um(this.editor,"numberedList",t("Numbered List"),J.numberedList),Um(this.editor,"bulletedList",t("Bulleted List"),J.bulletedList)}}class F2 extends z{static get requires(){return[R2,j2]}static get pluginName(){return"List"}}const V2=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:o,typeAttribute:t,listType:e}of V2);var Hm=L(4672),U2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Hm.c,U2),Hm.c.locals;var qm=L(6832),H2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(qm.c,H2),qm.c.locals,Io("Ctrl+Enter");var Gm=L(9472),q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Gm.c,q2),Gm.c.locals,Io("Ctrl+Enter");function Wm(o,t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const s=i.attributeNewValue,a=r.writer,c=r.mapper.toViewElement(i.item),l=[...c.getChildren()].find(h=>h.getCustomProperty("media-content"));a.remove(l);const d=o.getMediaViewElement(a,s,t);a.insert(a.createPositionAt(c,0),d)};return n=>{n.on("attribute:url:media",e)}}function Km(o,t,e,n){return o.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(o,e,n),o.createSlot()])}function $m(o){const t=o.getSelectedElement();return t&&t.is("element","media")?t:null}function Ym(o,t,e,n){o.change(i=>{const r=i.createElement("media",{url:t});o.insertObject(r,e,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})})}class G2 extends nt{refresh(){const t=this.editor.model,e=t.document.selection,n=$m(e);this.value=n?n.getAttribute("url"):void 0,this.isEnabled=function(i){const r=i.getSelectedElement();return!!r&&r.name==="media"}(e)||function(i,r){let a=og(i,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(e,t)}execute(t){const e=this.editor.model,n=e.document.selection,i=$m(n);i?e.change(r=>{r.setAttribute("url",t,i)}):Ym(e,t,n,!0)}}class W2{constructor(t,e){const n=e.providers,i=e.extraProviders||[],r=new Set(e.removeProviders),s=n.concat(i).filter(a=>{const c=a.name;return c?!r.has(c):(W("media-embed-no-provider-name",{provider:a}),!1)});this.locale=t,this.providerDefinitions=s}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t)return new Qm(this.locale);t=t.trim();for(const e of this.providerDefinitions){const n=e.html,i=Tt(e.url);for(const r of i){const s=this._getUrlMatches(t,r);if(s)return new Qm(this.locale,t,s,n)}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n)return n;let i=t.replace(/^https?:\/\//,"");return n=i.match(e),n||(i=i.replace(/^www\./,""),n=i.match(e),n||null)}}class Qm{constructor(t,e,n,i){this.url=this._getValidUrl(e),this._locale=t,this._match=n,this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),e.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(e);i=t.createRawElement("div",n,(s,a)=>{a.setContentOf(s,r)})}else this.url&&(n.url=this.url),i=t.createEmptyElement(e.elementName,n);return t.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new on,e=this._locale.t;return t.content='',t.viewBox="0 0 64 42",new Ee({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}var Zm=L(2792),K2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Zm.c,K2),Zm.c.locals;class gr extends z{constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const n=e[1],i=e[2];return`
`}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new W2(t.locale,t.config.get("mediaEmbed"))}static get pluginName(){return"MediaEmbedEditing"}init(){const t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,r=t.config.get("mediaEmbed.previewsInData"),s=t.config.get("mediaEmbed.elementName"),a=this.registry;t.commands.add("mediaEmbed",new G2(t)),e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),i.for("dataDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return Km(l,a,d,{elementName:s,renderMediaPreview:!!d&&r})}}),i.for("dataDowncast").add(Wm(a,{elementName:s,renderMediaPreview:r})),i.for("editingDowncast").elementToStructure({model:"media",view:(c,{writer:l})=>{const d=c.getAttribute("url");return function(h,u,g){return u.setCustomProperty("media",!0,h),Qs(h,u,{label:g})}(Km(l,a,d,{elementName:s,renderForEditingView:!0}),l,n("media widget"))}}),i.for("editingDowncast").add(Wm(a,{elementName:s,renderForEditingView:!0})),i.for("upcast").elementToElement({view:c=>["oembed",s].includes(c.name)&&c.getAttribute("url")?{name:!0}:null,model:(c,{writer:l})=>{const d=c.getAttribute("url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(c,{writer:l})=>{const d=c.getAttribute("data-oembed-url");return a.hasMedia(d)?l.createElement("media",{url:d}):null}}).add(c=>{c.on("element:figure",(l,d,h)=>{if(!h.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:u,modelCursor:g}=h.convertChildren(d.viewItem,d.modelCursor);d.modelRange=u,d.modelCursor=g,Ht(u.getItems())||h.consumable.revert(d.viewItem,{name:!0,classes:"media"})})})}}const $2=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Y2 extends z{constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}static get requires(){return[_g,Qe,Dg]}static get pluginName(){return"AutoMediaEmbed"}init(){const t=this.editor,e=t.model.document,n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",()=>{const i=e.selection.getFirstRange(),r=$t.fromPosition(i.start);r.stickiness="toPrevious";const s=$t.fromPosition(i.end);s.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(r,s),r.detach(),s.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(q.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor,i=n.plugins.get(gr).registry,r=new ce(t,e),s=r.getWalker({ignoreElementEnd:!0});let a="";for(const c of s)c.item.is("$textProxy")&&(a+=c.item.data);if(a=a.trim(),!a.match($2)||!i.hasMedia(a))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=$t.fromPosition(t),this._timeoutId=q.window.setTimeout(()=>{n.model.change(c=>{this._timeoutId=null,c.remove(r),r.detach();let l=null;this._positionToInsert.root.rootName!=="$graveyard"&&(l=this._positionToInsert),Ym(n.model,a,l,!1),this._positionToInsert.detach(),this._positionToInsert=null}),n.plugins.get(Qe).requestUndoOnBackspace()},100)):r.detach()}}var Jm=L(8776),Q2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Jm.c,Q2),Jm.c.locals;class Z2 extends ${constructor(t,e){super(e);const n=e.t;this.focusTracker=new Kt,this.keystrokes=new Jt,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),J.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),J.cancel,"ck-button-cancel","cancel"),this._focusables=new me,this._focusCycler=new fe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),m({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element);const t=e=>e.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new _i(this.locale,Hi),n=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),e}_createButton(t,e,n,i){const r=new ut(this.locale);return r.set({label:t,icon:e,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class J2 extends z{static get requires(){return[gr]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",n=>{const i=Ye(n);return this._setUpDropdown(i,e),i})}_setUpDropdown(t,e){const n=this.editor,i=n.t,r=t.buttonView,s=n.plugins.get(gr).registry;t.once("change:isOpen",()=>{const a=new(D(Z2))(function(c,l){return[d=>{if(!d.url.length)return c("The URL must not be empty.")},d=>{if(!l.hasMedia(d.url))return c("This media URL is not supported.")}]}(n.t,s),n.locale);t.panelView.children.add(a),r.on("open",()=>{a.disableCssTransitions(),a.url=e.value||"",a.urlInputView.fieldView.select(),a.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{a.isValid()&&(n.execute("mediaEmbed",a.url),n.editing.view.focus())}),t.on("change:isOpen",()=>a.resetFormStatus()),t.on("cancel",()=>{n.editing.view.focus()}),a.delegate("submit","cancel").to(t),a.urlInputView.fieldView.bind("value").to(e,"value"),a.urlInputView.bind("isEnabled").to(e,"isEnabled")}),t.bind("isEnabled").to(e),r.set({label:i("Insert media"),icon:'',tooltip:!0})}}var Xm=L(9460),X2={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};U()(Xm.c,X2),Xm.c.locals;function tx(o,t){if(!o.childCount)return;const e=new $e(o.document),n=function(s,a){const c=a.createRangeIn(s),l=new De({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),d=[];for(const h of c)if(h.type==="elementStart"&&l.match(h.item)){const u=nx(h.item);d.push({element:h.item,id:u.id,order:u.order,indent:u.indent})}return d}(o,e);if(!n.length)return;let i=null,r=1;n.forEach((s,a)=>{const c=function(p,k){if(!p)return!0;if(p.id!==k.id)return k.indent-p.indent!=1;const b=k.element.previousSibling;if(!b)return!0;return A=b,!(A.is("element","ol")||A.is("element","ul"));var A}(n[a-1],s),l=c?null:n[a-1],d=(u=s,(h=l)?u.indent-h.indent:u.indent-1);var h,u;if(c&&(i=null,r=1),!i||d!==0){const p=function(k,b){const A=new RegExp(`@list l${k.id}:level${k.indent}\\s*({[^}]*)`,"gi"),x=/mso-level-number-format:([^;]{0,100});/gi,M=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,O=A.exec(b);let H="decimal",Y="ol",et=null;if(O&&O[1]){const Bt=x.exec(O[1]);if(Bt&&Bt[1]&&(H=Bt[1].trim(),Y=H!=="bullet"&&H!=="image"?"ol":"ul"),H==="bullet"){const Nt=function(uo){const He=function(Xe){if(Xe.getChild(0).is("$text"))return null;for(const tn of Xe.getChildren()){if(!tn.is("element","span"))continue;const Rn=tn.getChild(0);if(Rn)return Rn.is("$text")?Rn:Rn.getChild(0)}return null}(uo);if(!He)return null;const Ae=He._data;return Ae==="o"?"circle":Ae==="·"?"disc":Ae==="§"?"square":null}(k.element);Nt&&(H=Nt)}else{const Nt=M.exec(O[1]);Nt&&Nt[1]&&(et=parseInt(Nt[1]))}}return{type:Y,startIndex:et,style:ex(H)}}(s,t);if(i){if(s.indent>r){const k=i.getChild(i.childCount-1),b=k.getChild(k.childCount-1);i=tf(p,b,e),r+=1}else if(s.indent1&&e.setAttribute("start",o.startIndex,i),i}function nx(o){const t={},e=o.getStyle("mso-list");if(e){const n=e.match(/(^|\s{1,100})l(\d+)/i),i=e.match(/\s{0,100}lfo(\d+)/i),r=e.match(/\s{0,100}level(\d+)/i);n&&i&&r&&(t.id=n[2],t.order=i[1],t.indent=parseInt(r[1]))}return t}function ox(o,t){if(!o.childCount)return;const e=new $e(o.document),n=function(r,s){const a=s.createRangeIn(r),c=new De({name:/v:(.+)/}),l=[];for(const d of a){if(d.type!="elementStart")continue;const h=d.item,u=h.previousSibling,g=u&&u.is("element")?u.name:null;c.match(h)&&h.getAttribute("o:gfxdata")&&g!=="v:shapetype"&&l.push(d.item.getAttribute("id"))}return l}(o,e);(function(r,s,a){const c=a.createRangeIn(s),l=new De({name:"img"}),d=[];for(const h of c)if(h.item.is("element")&&l.match(h.item)){const u=h.item,g=u.getAttribute("v:shapes")?u.getAttribute("v:shapes").split(" "):[];g.length&&g.every(p=>r.indexOf(p)>-1)?d.push(u):u.getAttribute("src")||d.push(u)}for(const h of d)a.remove(h)})(n,o,e),function(r,s,a){const c=a.createRangeIn(s),l=[];for(const u of c)if(u.type=="elementStart"&&u.item.is("element","v:shape")){const g=u.item.getAttribute("id");if(r.includes(g))continue;d(u.item.parent.getChildren(),g)||l.push(u.item)}for(const u of l){const g={src:h(u)};u.hasAttribute("alt")&&(g.alt=u.getAttribute("alt"));const p=a.createElement("img",g);a.insertChild(u.index+1,p,u.parent)}function d(u,g){for(const p of u)if(p.is("element")&&(p.name=="img"&&p.getAttribute("v:shapes")==g||d(p.getChildren(),g)))return!0;return!1}function h(u){for(const g of u.getChildren())if(g.is("element")&&g.getAttribute("src"))return g.getAttribute("src")}}(n,o,e),function(r,s){const a=s.createRangeIn(r),c=new De({name:/v:(.+)/}),l=[];for(const d of a)d.type=="elementStart"&&c.match(d.item)&&l.push(d.item);for(const d of l)s.remove(d)}(o,e);const i=function(r,s){const a=s.createRangeIn(r),c=new De({name:"img"}),l=[];for(const d of a)d.item.is("element")&&c.match(d.item)&&d.item.getAttribute("src").startsWith("file://")&&l.push(d.item);return l}(o,e);i.length&&function(r,s,a){if(r.length===s.length)for(let c=0;cString.fromCharCode(parseInt(t,16))).join(""))}const rx=//i,sx=/xmlns:o="urn:schemas-microsoft-com/i;class ax{constructor(t){this.document=t}isActive(t){return rx.test(t)||sx.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;tx(e,n),ox(e,t.dataTransfer.getData("text/rtf")),function(i){const r=[],s=new $e(i.document);for(const{item:a}of s.createRangeIn(i))if(a.is("element")){for(const c of a.getClassNames())/\bmso/gi.exec(c)&&s.removeClass(c,a);for(const c of a.getStyleNames())/\bmso/gi.exec(c)&&s.removeStyle(c,a);a.is("element","w:sdt")&&r.push(a)}for(const a of r){const c=a.parent,l=c.getChildIndex(a);s.insertChild(l,a.getChildren(),c),s.remove(a)}}(e),t.content=e}}function ef(o,t,e,{blockElements:n,inlineObjectElements:i}){let r=e.createPositionAt(o,t=="forward"?"after":"before");return r=r.getLastMatchingPosition(({item:s})=>s.is("element")&&!n.includes(s.name)&&!i.includes(s.name),{direction:t}),t=="forward"?r.nodeAfter:r.nodeBefore}function nf(o,t){return!!o&&o.is("element")&&t.includes(o.name)}const cx=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class lx{constructor(t){this.document=t}isActive(t){return cx.test(t)}execute(t){const e=new $e(this.document),{body:n}=t._parsedData;(function(i,r){for(const s of i.getChildren())if(s.is("element","b")&&s.getStyle("font-weight")==="normal"){const a=i.getChildIndex(s);r.remove(s),r.insertChild(a,s.getChildren(),i)}})(n,e),function(i,r){for(const s of r.createRangeIn(i)){const a=s.item;if(a.is("element","li")){const c=a.getChild(0);c&&c.is("element","p")&&r.unwrapElement(c)}}}(n,e),function(i,r){const s=new Ii(r.document.stylesProcessor),a=new Mi(s,{renderingMode:"data"}),c=a.blockElements,l=a.inlineObjectElements,d=[];for(const h of r.createRangeIn(i)){const u=h.item;if(u.is("element","br")){const g=ef(u,"forward",r,{blockElements:c,inlineObjectElements:l}),p=ef(u,"backward",r,{blockElements:c,inlineObjectElements:l}),k=nf(g,c);(nf(p,c)||k)&&d.push(u)}}for(const h of d)h.hasClass("Apple-interchange-newline")?r.remove(h):r.replace(h,r.createElement("p"))}(n,e),t.content=n}}const dx=/(\s+)<\/span>/g,(t,e)=>e.length===1?" ":Array(e.length+1).join("  ").substr(0,e.length))}function ux(o,t){const e=new DOMParser,n=function(c){return of(of(c)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(c){const l="",d="",h=c.indexOf(l);if(h<0)return c;const u=c.indexOf(d,h+l.length);return c.substring(0,h+l.length)+(u>=0?c.substring(u):"")}(o=(o=o.replace(/